summaryrefslogtreecommitdiffhomepage
path: root/tracker-easy/CMakeLists.txt
blob: ff537877a9121d6eaa7c327861056745f1e6d043 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
include(opentrack-opencv)
find_package(OpenCV QUIET)

if(OpenCV_FOUND)
    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=20" "-DCXX_STANDARD_REQUIRED=1"
                OUTPUT_VARIABLE krap)
    if(tracker-easy_ocv-check)
        foreach(k highgui videoio imgcodecs imgproc calib3d video features2d flann)
            otr_install_lib("opencv_${k}" "${opentrack-libexec}")
        endforeach()

        if(CMAKE_COMPILER_IS_GNUCXX)
            add_compile_options(-Wno-sign-compare)
        elseif(MSVC)
            add_compile_options(-wd4018)
        endif()

        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 opencv_highgui opentrack-cv opentrack-video)
    endif()
endif()