summaryrefslogtreecommitdiffhomepage
path: root/tracker-easy/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-easy/CMakeLists.txt')
-rw-r--r--tracker-easy/CMakeLists.txt15
1 files changed, 12 insertions, 3 deletions
diff --git a/tracker-easy/CMakeLists.txt b/tracker-easy/CMakeLists.txt
index 7b776c9b..ed95a560 100644
--- a/tracker-easy/CMakeLists.txt
+++ b/tracker-easy/CMakeLists.txt
@@ -1,6 +1,15 @@
+include(opentrack-opencv)
find_package(OpenCV QUIET)
+
if(OpenCV_FOUND)
- otr_module(tracker-easy)
- target_include_directories(${self} SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
- target_link_libraries(${self} opencv_core opencv_imgproc opencv_calib3d opencv_video opentrack-cv opentrack-video)
+ try_compile(tracker-easy-ocv-check "${CMAKE_CURRENT_BINARY_DIR}"
+ SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ocv-check.cxx"
+ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${OpenCV_INCLUDE_DIRS}"
+ "-DCXX_STANDARD=17" "-DCXX_STANDARD_REQUIRED=1"
+ OUTPUT_VARIABLE krap)
+ if(tracker-easy-ocv-check)
+ otr_module(tracker-easy)
+ target_include_directories(${self} SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
+ target_link_libraries(${self} opencv_core opencv_imgproc opencv_calib3d opencv_video opentrack-cv opentrack-video)
+ endif()
endif()