summaryrefslogtreecommitdiffhomepage
path: root/tracker-aruco/CMakeLists.txt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-07-10 06:42:15 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-07-10 06:42:15 +0200
commite85d85265adb9f3d1eba93811440a83b6b74500d (patch)
tree651fa9c984d644ed168761fcbb980a4fac9d9bc9 /tracker-aruco/CMakeLists.txt
parent8c1dec7a5f16bd1eed656810a7009f4ce87adc80 (diff)
tracker/aruco: simplify abi test
The issue was that with LTO enabled, the `try_compile' call took way too long for a simple compile test. Rather, add a #define to Aruco to avoid the slow link. Bump aruco ABI version. Please update your opentrack/aruco and/or opentrack/opentrack-depends repos.
Diffstat (limited to 'tracker-aruco/CMakeLists.txt')
-rw-r--r--tracker-aruco/CMakeLists.txt18
1 files changed, 9 insertions, 9 deletions
diff --git a/tracker-aruco/CMakeLists.txt b/tracker-aruco/CMakeLists.txt
index 9c228831..253cdd5f 100644
--- a/tracker-aruco/CMakeLists.txt
+++ b/tracker-aruco/CMakeLists.txt
@@ -17,14 +17,18 @@ if(OpenCV_FOUND)
set(modules "${SDK_ARUCO_LIBPATH}" opencv_core opencv_calib3d opencv_imgproc opencv_videoio)
+ get_filename_component(dir "${SDK_ARUCO_LIBPATH}" DIRECTORY)
+ get_filename_component(dir "${dir}" ABSOLUTE)
+ set(dir "${dir}/include")
+
file(TIMESTAMP "${SDK_ARUCO_LIBPATH}" tm "%s" UTC)
- set(cache-str "${tm}|${SDK_ARUCO_LIBPATH}")
+ set(cache-str "${tm}^|^${SDK_ARUCO_LIBPATH}")
if(NOT aruco_has-working-abi STREQUAL "${cache-str}")
try_compile(result "${CMAKE_CURRENT_BINARY_DIR}"
SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/compile-test/abi.cpp"
- OUTPUT_VARIABLE krap
- LINK_LIBRARIES ${modules})
+ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${dir}"
+ OUTPUT_VARIABLE krap)
if(NOT result)
message(FATAL_ERROR "${krap}\n" "Must use Aruco fork from <https://github.com/opentrack/aruco>")
endif()
@@ -34,11 +38,7 @@ if(OpenCV_FOUND)
otr_module(tracker-aruco)
- 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")
+ target_include_directories(${self} SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS} "${dir}")
+ target_link_libraries(${self} opentrack-cv ${modules})
endif()
endif()