summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-10-04 15:53:26 +0200
committerStanislaw Halik <sthalik@misaki.pl>2021-10-04 15:53:26 +0200
commitc2ab96e976ff12f1d5fdaefbb77042c024cb47dd (patch)
tree17331de17772210824e979a533836230579b1230
parenta790e295b544bceb067f3ea6c4f0fd93f225cb98 (diff)
tracker/{aruco,easy,pt,wii}, video/opencv: allow dynamic opencv
-rw-r--r--cmake/opentrack-opencv.cmake10
-rw-r--r--tracker-aruco/CMakeLists.txt3
-rw-r--r--tracker-easy/CMakeLists.txt2
-rw-r--r--tracker-pt/CMakeLists.txt3
-rw-r--r--tracker-pt/module/CMakeLists.txt3
-rw-r--r--tracker-wii/CMakeLists.txt3
-rw-r--r--video-opencv/CMakeLists.txt5
7 files changed, 17 insertions, 12 deletions
diff --git a/cmake/opentrack-opencv.cmake b/cmake/opentrack-opencv.cmake
index 40356418..3acadf4a 100644
--- a/cmake/opentrack-opencv.cmake
+++ b/cmake/opentrack-opencv.cmake
@@ -2,13 +2,3 @@ include_guard(GLOBAL)
include(opentrack-boilerplate)
find_package(OpenCV QUIET)
-
-function(otr_install_opencv_libs)
- foreach(k core features2d calib3d flann imgcodecs imgproc videoio)
- otr_install_lib("opencv_${k}" "${opentrack-libexec}")
- endforeach()
-endfunction()
-
-if(TARGET opencv_core)
- otr_install_opencv_libs()
-endif()
diff --git a/tracker-aruco/CMakeLists.txt b/tracker-aruco/CMakeLists.txt
index d3c1f28c..96605f1b 100644
--- a/tracker-aruco/CMakeLists.txt
+++ b/tracker-aruco/CMakeLists.txt
@@ -11,6 +11,9 @@ include(opentrack-opencv)
find_package(OpenCV QUIET)
if(OpenCV_FOUND)
+ foreach(k core calib3d imgproc features2d flann)
+ otr_install_lib("opencv_${k}" "${opentrack-libexec}")
+ endforeach()
set(SDK_ARUCO_LIBPATH "" CACHE FILEPATH "Aruco paper marker tracker static library path")
if(SDK_ARUCO_LIBPATH)
set(modules "${SDK_ARUCO_LIBPATH}" opencv_calib3d opencv_imgproc opencv_core)
diff --git a/tracker-easy/CMakeLists.txt b/tracker-easy/CMakeLists.txt
index 5ba49944..d4dcdca9 100644
--- a/tracker-easy/CMakeLists.txt
+++ b/tracker-easy/CMakeLists.txt
@@ -8,7 +8,7 @@ if(OpenCV_FOUND)
"-DCXX_STANDARD=17" "-DCXX_STANDARD_REQUIRED=1"
OUTPUT_VARIABLE krap)
if(tracker-easy_ocv-check)
- foreach(k video highgui)
+ foreach(k highgui videoio imgcodecs imgproc calib3d video features2d flann)
otr_install_lib("opencv_${k}" "${opentrack-libexec}")
endforeach()
diff --git a/tracker-pt/CMakeLists.txt b/tracker-pt/CMakeLists.txt
index 76506c5e..a1bf47f5 100644
--- a/tracker-pt/CMakeLists.txt
+++ b/tracker-pt/CMakeLists.txt
@@ -1,6 +1,9 @@
include(opentrack-opencv)
find_package(OpenCV QUIET)
if(OpenCV_FOUND)
+ foreach(k core)
+ otr_install_lib("opencv_${k}" "${opentrack-libexec}")
+ endforeach()
otr_module(tracker-pt-base STATIC)
target_include_directories(${self} SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
target_link_libraries(${self} opentrack-cv opencv_core opentrack-video)
diff --git a/tracker-pt/module/CMakeLists.txt b/tracker-pt/module/CMakeLists.txt
index cc16cba1..c5670404 100644
--- a/tracker-pt/module/CMakeLists.txt
+++ b/tracker-pt/module/CMakeLists.txt
@@ -1,6 +1,9 @@
include(opentrack-opencv)
find_package(OpenCV QUIET)
if(OpenCV_FOUND)
+ foreach(k core imgproc)
+ otr_install_lib("opencv_${k}" "${opentrack-libexec}")
+ endforeach()
otr_module(tracker-pt)
target_link_libraries(${self} opencv_imgproc opentrack-tracker-pt-base)
target_include_directories(${self} PUBLIC "${CMAKE_SOURCE_DIR}/tracker-pt")
diff --git a/tracker-wii/CMakeLists.txt b/tracker-wii/CMakeLists.txt
index b275fbeb..fb840385 100644
--- a/tracker-wii/CMakeLists.txt
+++ b/tracker-wii/CMakeLists.txt
@@ -2,6 +2,9 @@ if(WIN32)
include(opentrack-opencv)
find_package(OpenCV QUIET)
if(OpenCV_FOUND)
+ foreach(k core imgproc)
+ otr_install_lib("opencv_${k}" "${opentrack-libexec}")
+ endforeach()
add_subdirectory(wiiyourself)
otr_module(tracker-wii)
target_link_libraries(${self} opencv_imgproc opentrack-tracker-pt-base opentrack-wiiyourself bthprops)
diff --git a/video-opencv/CMakeLists.txt b/video-opencv/CMakeLists.txt
index c56e65d4..0b2460a4 100644
--- a/video-opencv/CMakeLists.txt
+++ b/video-opencv/CMakeLists.txt
@@ -2,8 +2,11 @@ include(opentrack-opencv)
find_package(OpenCV QUIET)
if(OpenCV_FOUND)
+ foreach(k core videoio imgcodecs imgproc)
+ otr_install_lib("opencv_${k}" "${opentrack-libexec}")
+ endforeach()
otr_module(video-opencv)
- target_link_libraries(${self} opencv_core opencv_videoio opentrack-video)
+ target_link_libraries(${self} opencv_core opencv_imgcodecs opencv_videoio opentrack-video)
if(WIN32)
target_link_libraries(${self} strmiids)
endif()