Properly search for OpenCV.

This commit is contained in:
2018-04-05 17:35:46 +02:00
parent 375833bc87
commit 2bc3d5ae95
2 changed files with 6 additions and 3 deletions

View File

@@ -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

View File

@@ -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})