summaryrefslogtreecommitdiffhomepage
path: root/tracker-aruco
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-aruco')
-rw-r--r--tracker-aruco/CMakeLists.txt18
-rw-r--r--tracker-aruco/compile-test/abi.cpp14
2 files changed, 14 insertions, 18 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()
diff --git a/tracker-aruco/compile-test/abi.cpp b/tracker-aruco/compile-test/abi.cpp
index 633188de..9c72fe2a 100644
--- a/tracker-aruco/compile-test/abi.cpp
+++ b/tracker-aruco/compile-test/abi.cpp
@@ -1,11 +1,7 @@
-#include "../../compat/linkage-macros.hpp"
+#include <aruco/abi.h>
-#define ARUCO_ABI aruco_opentrack_fork_abi_1
+#if ARUCO_OPENTRACK_FORK_ABI != 2
+# error "wrong ABI"
+#endif
-extern "C" void ARUCO_ABI(void);
-
-int main(void)
-{
- ARUCO_ABI();
- return 0;
-}
+int main(void) { return 0; }