diff --git a/CMakeLists.txt b/CMakeLists.txt index 28fc943..cd38b62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ find_package(OpenGL REQUIRED) find_package(GLUT REQUIRED) find_package(png++ REQUIRED) find_package(Boost REQUIRED COMPONENTS filesystem program_options) +find_package(OpenCV REQUIRED COMPONENTS core imgproc imgcodecs) target_link_libraries(fmri PUBLIC Caffe::Caffe @@ -31,6 +32,9 @@ target_link_libraries(fmri PUBLIC OpenGL::GLU png++::png++ Boost::program_options + opencv_core + opencv_imgproc + opencv_imgcodecs ) target_include_directories(fmri PUBLIC diff --git a/cmake/modules/FindCaffe.cmake b/cmake/modules/FindCaffe.cmake index 734d774..614b9b2 100644 --- a/cmake/modules/FindCaffe.cmake +++ b/cmake/modules/FindCaffe.cmake @@ -23,7 +23,6 @@ find_library(Caffe_LIBRARY PATHS ${Caffe_DIR} DOC "The Caffe library") -find_package(OpenCV REQUIRED) find_package(Glog REQUIRED) find_package(Boost 1.55 REQUIRED COMPONENTS system) @@ -48,9 +47,9 @@ if (CAFFE_FOUND) add_library(Caffe::Caffe UNKNOWN IMPORTED) set_target_properties(Caffe::Caffe PROPERTIES INTERFACE_COMPILE_DEFINITIONS "${Caffe_DEFINITIONS}" - INTERFACE_INCLUDE_DIRECTORIES "${Caffe_INCLUDE_DIR};${OpenCV_INCLUDE_DIRS}" + INTERFACE_INCLUDE_DIRECTORIES "${Caffe_INCLUDE_DIR}" IMPORTED_LOCATION "${Caffe_LIBRARY}" - INTERFACE_LINK_LIBRARIES "Glog::Glog;Boost::system;${OpenCV_LIBRARIES};${Caffe_ADDITIONAL_LIBS}" + INTERFACE_LINK_LIBRARIES "Glog::Glog;Boost::system;${Caffe_ADDITIONAL_LIBS}" ) set(Caffe_LIBRARIES ${Caffe_LIBRARY})