myproject/
├── CMakeLists.txt
├── main.cpp
└── include
└── hello.hpp
# OpenCV
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
# Eigen
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
add_executable(main main.cpp)
target_sources(main PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include/hello.hpp)
target_link_libraries(main
${OpenCV_LIBS}
Eigen3::Eigen)
标签:include,cmake,OpenCV,directories,hpp,单独,main,DIR
From: https://www.cnblogs.com/hezexian/p/17357253.html