summaryrefslogtreecommitdiffhomepage
path: root/tracker-aruco/CMakeLists.txt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-04-28 20:26:04 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-04-28 21:27:35 +0200
commitc263d3af4c0079d81cbf4dad6d266b72d3c44449 (patch)
treefcc097f9db24282a4f905305b8e004a452158bba /tracker-aruco/CMakeLists.txt
parent9bac55a0ac7365b241df8a3dacbdacf59698c862 (diff)
tracker/aruco: don't include headers in the module
Diffstat (limited to 'tracker-aruco/CMakeLists.txt')
-rw-r--r--tracker-aruco/CMakeLists.txt20
1 files changed, 19 insertions, 1 deletions
diff --git a/tracker-aruco/CMakeLists.txt b/tracker-aruco/CMakeLists.txt
index 84dc7fba..9c228831 100644
--- a/tracker-aruco/CMakeLists.txt
+++ b/tracker-aruco/CMakeLists.txt
@@ -1,7 +1,20 @@
+function(maybe_add_static_define)
+ get_filename_component(aruco-ext "${SDK_ARUCO_LIBPATH}" EXT)
+ string(TOLOWER "${aruco-ext}" aruco-ext)
+ if(aruco-ext STREQUAL ".lib" OR aruco-ext STREQUAL ".a")
+ add_definitions(-DARUCO_STATIC)
+ endif()
+endfunction()
+
+
find_package(OpenCV QUIET)
+
if(OpenCV_FOUND)
set(SDK_ARUCO_LIBPATH "" CACHE FILEPATH "Aruco paper marker tracker static library path")
if(SDK_ARUCO_LIBPATH)
+
+ maybe_add_static_define()
+
set(modules "${SDK_ARUCO_LIBPATH}" opencv_core opencv_calib3d opencv_imgproc opencv_videoio)
file(TIMESTAMP "${SDK_ARUCO_LIBPATH}" tm "%s" UTC)
@@ -20,7 +33,12 @@ if(OpenCV_FOUND)
endif()
otr_module(tracker-aruco)
- target_link_libraries(opentrack-tracker-aruco opentrack-cv ${modules})
+
target_include_directories(opentrack-tracker-aruco SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
+ target_link_libraries(opentrack-tracker-aruco opentrack-cv ${modules})
+
+ get_filename_component(dir "${SDK_ARUCO_LIBPATH}" DIRECTORY)
+ get_filename_component(dir "${dir}" ABSOLUTE)
+ include_directories(opentrack-tracker-aruco SYSTEM PUBLIC "${dir}/include")
endif()
endif()