replace USE_OPENCV_MODULE => USE_OPENCV
fix OpenCV library found / not found
@@ -20,10 +20,10 @@ else()
set(DCORE_BUILD_SHARED_LIBS OFF)
endif()
-option(USE_OPENCV_MODULE "build OpenCV module support" OFF)
-if (USE_OPENCV_MODULE)
- find_package(OpenCV REQUIRED)
+option(USE_OPENCV "use OpenCV library" OFF)
if (USE_OPENCV)
+ find_package(OpenCV REQUIRED)
+ if (OpenCV_FOUND)
else()
message(SEND_ERROR "OpenCV library not found.")
endif()
@@ -48,7 +48,7 @@ set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/output) # dir for output
file(GLOB SRCS "src/[a-zA-Z]*.cpp")
file(GLOB PUBLIC_HEADERS "include/blueoil.hpp")
file(GLOB PRIVATE_HEADERS "include/[a-zA-Z]*.hpp")
-if (USE_OPENCV_MODULE)
+if (USE_OPENCV)
else()
list(FILTER SRCS EXCLUDE REGEX ".*opencv.cpp$")
list(FILTER PRIVATE_HEADERS EXCLUDE REGEX ".*opencv.hpp$")
@@ -56,7 +56,7 @@ endif()
if(VERBOSE)
- message(STATUS "use_opencv_module: ${USE_OPENCV_MODULE}")
+ message(STATUS "use_opencv: ${USE_OPENCV}")
message(STATUS "sources: ${SRCS}")
message(STATUS "public_headers: ${PUBLIC_HEADERS}")
message(STATUS "private_headers: ${PRIVATE_HEADERS}")
@@ -65,7 +65,7 @@ endif()
# add library headers
include_directories(include yaml-cpp/include)
-if (USE_OPENCV_MODULE)
+if (USE_OPENCV)
include_directories(${OpenCV_INCLUDE_DIRS})
endif()
