diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-04-24 20:03:06 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-04-24 20:03:06 +0200 |
commit | f35409972b97f3e236817b29359d18c1461247f6 (patch) | |
tree | 41cc5895bf455ebc4c7fe403c87c2d8a29c87a7b | |
parent | 5bda6b0a8ed20f8296a2de3fd6637b59cd614036 (diff) |
tracker/easy: add compile test for newer opencv
-rw-r--r-- | tracker-easy/CMakeLists.txt | 15 | ||||
-rw-r--r-- | tracker-easy/ocv-check.cxx | 7 |
2 files changed, 19 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() diff --git a/tracker-easy/ocv-check.cxx b/tracker-easy/ocv-check.cxx new file mode 100644 index 00000000..62126775 --- /dev/null +++ b/tracker-easy/ocv-check.cxx @@ -0,0 +1,7 @@ +#include <opencv2/calib3d.hpp> + +static void check_solvep3p() +{ + cv::Mat x; + cv::solveP3P(x, x, x, x, x, x, 0); +} |