diff options
author | Guillaume Dollé <dolle.guillaume@gmail.com> | 2021-08-01 16:02:00 +0200 |
---|---|---|
committer | Guillaume Dollé <dolle.guillaume@gmail.com> | 2021-08-01 16:02:00 +0200 |
commit | 489b49e98f013ca495ee8314718df24b67b0e825 (patch) | |
tree | d184e1301d6f57ab2ae464e5e75fd7bc76855ee9 /tracker-neuralnet | |
parent | 1a22815d82ddfbd4f5c1f3240fb13155f517d79c (diff) |
Fix link library
- Address review comment https://github.com/opentrack/opentrack/pull/1306#discussion_r680484878
- Update ONNXRuntime module to use a specific `onnxruntime` target.
- Use OpenCV components instead.
NOTE:
ONNXRuntinme may provide their own ONNXRuntimeConfig.cmake and
ONNXRuntimeVersion.cmake in the future.
See https://github.com/microsoft/onnxruntime/issues/3124 for reference
Diffstat (limited to 'tracker-neuralnet')
-rw-r--r-- | tracker-neuralnet/CMakeLists.txt | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/tracker-neuralnet/CMakeLists.txt b/tracker-neuralnet/CMakeLists.txt index c38ba3d8..36395684 100644 --- a/tracker-neuralnet/CMakeLists.txt +++ b/tracker-neuralnet/CMakeLists.txt @@ -1,19 +1,25 @@ include(opentrack-opencv) -find_package(OpenCV QUIET) +find_package(OpenCV QUIET COMPONENTS imgproc core imgcodecs calib3d) find_package(OpenMP QUIET) # Used to control number of onnx threads. find_package(ONNXRuntime QUIET) if(OpenCV_FOUND AND ONNXRuntime_FOUND AND OpenMP_FOUND) otr_module(tracker-neuralnet) - target_include_directories(${self} SYSTEM PUBLIC - ${OpenCV_INCLUDE_DIRS} "${ONNXRuntime_INCLUDE_DIRS}") - target_link_libraries(${self} "${ONNXRuntime_LIBRARIES}" - opentrack-cv opencv_imgproc opencv_core - opencv_imgcodecs opencv_calib3d - OpenMP::OpenMP_C) - + target_include_directories(${self} + SYSTEM PRIVATE + ${OpenCV_INCLUDE_DIRS} + ${ONNXRuntime_INCLUDE_DIRS} + ) + target_link_libraries(${self} + opentrack-cv + ${ONNXRuntime_LIBRARIES} + ${OpenCV_LIBS} + OpenMP::OpenMP_C + ) install( - FILES "models/head-localizer.onnx" "models/head-pose.onnx" + FILES "models/head-localizer.onnx" + "models/head-pose.onnx" DESTINATION "${opentrack-libexec}/models" - PERMISSIONS ${opentrack-perms-file}) + PERMISSIONS ${opentrack-perms-file} + ) endif() |