基本上我有一个文件夹/myOpenCVProject/
我所拥有的地方:
header.hpp
main.cpp
helper.cpp
和CMakeLists.txt
SET( PROJECT_NAME myOpenCVProject )
PROJECT( ${PROJECT_NAME} )
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
FIND_PACKAGE( OpenCV REQUIRED )
ADD_EXECUTABLE( ${PROJECT_NAME} main.cpp )
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${OpenCV_LIBS} )
我如何告诉CMake包含header
和helper
文件?
答案 0 :(得分:2)
您只需要将它们包含在ADD_EXECUTABLE
命令中:
ADD_EXECUTABLE( ${PROJECT_NAME} main.cpp helper.cpp header.hpp)
有关ADD_EXECUTABLE
的完整详情,请运行
cmake --help-command add_executable