summaryrefslogtreecommitdiffhomepage
path: root/anim-crop-tool/CMakeLists.txt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-19 08:24:58 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-19 08:24:58 +0200
commita8793cd30a80ca98cb3acbf78e703cede6083113 (patch)
treef11c6323f5d5ada8ddead59e1b5cbe3642015ee7 /anim-crop-tool/CMakeLists.txt
parentd70ff70b7d5a259572f7f641ea754f799bda3ea1 (diff)
make opencv optional
Diffstat (limited to 'anim-crop-tool/CMakeLists.txt')
-rw-r--r--anim-crop-tool/CMakeLists.txt20
1 files changed, 11 insertions, 9 deletions
diff --git a/anim-crop-tool/CMakeLists.txt b/anim-crop-tool/CMakeLists.txt
index 6e7863e6..48e41b8f 100644
--- a/anim-crop-tool/CMakeLists.txt
+++ b/anim-crop-tool/CMakeLists.txt
@@ -1,11 +1,13 @@
-find_package(OpenCV QUIET REQUIRED COMPONENTS core imgcodecs imgproc)
-set(self "${PROJECT_NAME}-anim-crop-tool")
+find_package(OpenCV QUIET COMPONENTS core imgcodecs imgproc)
+if(Opencv_FOUND)
+ set(self "${PROJECT_NAME}-anim-crop-tool")
-include_directories(SYSTEM PRIVATE ${OpenCV_INCLUDE_DIRS})
-link_libraries(Corrade::Utility Magnum::Magnum)
-link_libraries(opencv_imgproc opencv_imgcodecs opencv_core)
-link_libraries(${PROJECT_NAME})
+ include_directories(SYSTEM PRIVATE ${OpenCV_INCLUDE_DIRS})
+ link_libraries(Corrade::Utility Magnum::Magnum)
+ link_libraries(opencv_imgproc opencv_imgcodecs opencv_core)
+ link_libraries(${PROJECT_NAME})
-file(GLOB sources "*.cpp" CONFIGURE_ARGS)
-add_executable(${self} ${sources})
-install(TARGETS ${self} RUNTIME DESTINATION "bin")
+ file(GLOB sources "*.cpp" CONFIGURE_ARGS)
+ add_executable(${self} ${sources})
+ install(TARGETS ${self} RUNTIME DESTINATION "bin")
+endif()