2
我開始在C++的opencv項目,我認爲這將是一個學習cmake的好機會。這是我的項目hirerachy:錯誤與opencv項目中的CMakeLists.txt
project/
|__include/
|__sample1.h
|__sample2.h
|__build/
|__doc/
|__src/
|__sample1.cpp
|__sample2.cpp
|__test/
|__main.cpp
|__CMakeLists.txt
的的CMakeLists.txt是:產生
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(PROJ_NAME "Project")
SET(PROJ_PATH ${CMAKE_SOURCE_DIR})
SET(PROJ_OUT_PATH ${CMAKE_BINARY_DIR})
SET(PROJ_LIBRARIES ${OpenCV_LIBS})
SET(PROJ_INCLUDES "include")
FILE(GLOB_RECURSE PROJ_SOURCES src/*cpp test/*cpp)
FILE(GLOB_RECURSE PROJ_HEADERS include/${PROJ_NAME}/*.h)
PROJECT(${PROJ_NAME})
FIND_PACKAGE(OpenCV REQUIRED)
INCLUDE_DIRECTORIES(${PROJ_INCLUDES})
ADD_EXECUTABLE(${PROJ_NAME} ${PROJ_SOURCES})
TARGET_LINK_LIBRARIES(${PROJ_NAME} ${PROJ_LIBRARIES})
生成文件,但是當我執行「讓」我有一些「未定義的引用」到OpenCV的功能。
任何幫助,將不勝感激,如果你想了解更多信息,當然只是問:)
感謝
非常感謝,它完美的作品:) – Kruncho 2014-11-06 11:00:02