use "NOT" for "if" condition.
fix indent if <=> { space.
@@ -23,8 +23,7 @@ endif()
option(USE_OPENCV "use OpenCV library" OFF)
if(USE_OPENCV)
find_package(OpenCV REQUIRED)
- if (OpenCV_FOUND)
- else()
+ if(NOT OpenCV_FOUND)
message(SEND_ERROR "OpenCV library not found.")
endif()
endif()
@@ -48,8 +47,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)
-else()
+if(NOT USE_OPENCV)
list(FILTER SRCS EXCLUDE REGEX ".*opencv.cpp$")
list(FILTER PRIVATE_HEADERS EXCLUDE REGEX ".*opencv.hpp$")
endif()
