summaryrefslogtreecommitdiffhomepage
path: root/tracker-neuralnet
diff options
context:
space:
mode:
authorMichael Welter <michael@welter-4d.de>2021-08-03 23:29:00 +0200
committerMichael Welter <michael@welter-4d.de>2021-08-05 23:21:28 +0200
commit07e64c37487b6c99b0425b8e4014af63529459cf (patch)
treea39ee16bfd37eb2c6801f7c0c991f7ece5ef1a85 /tracker-neuralnet
parent6a5954197ef5671b5cc9159377e83ef15bf43373 (diff)
cmake: improve the FindONNXRuntime script and install the ONNX dll
* Add ONNXRuntime_DIR variable * Change target name to onnxruntime::onnxruntime following naming conventions for imported libs * Look for the DLL on windows and store it in a variable for later * Correctly define the properties of the import library * Change names and logic for global variables to follow standard conventions * Change import library type from UNKNOWN to SHARED in order to make msvc link against the .lib file, not the dll.
Diffstat (limited to 'tracker-neuralnet')
-rw-r--r--tracker-neuralnet/CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/tracker-neuralnet/CMakeLists.txt b/tracker-neuralnet/CMakeLists.txt
index bcdbbc81..70850925 100644
--- a/tracker-neuralnet/CMakeLists.txt
+++ b/tracker-neuralnet/CMakeLists.txt
@@ -5,16 +5,20 @@ find_package(ONNXRuntime QUIET)
if(OpenCV_FOUND AND ONNXRuntime_FOUND AND OpenMP_FOUND)
otr_module(tracker-neuralnet)
+
target_link_libraries(${self}
opentrack-cv
- onnxruntime
+ onnxruntime::onnxruntime
${OpenCV_LIBS}
OpenMP::OpenMP_C
)
+
install(
FILES "models/head-localizer.onnx"
"models/head-pose.onnx"
DESTINATION "${opentrack-libexec}/models"
PERMISSIONS ${opentrack-perms-file}
)
+
+ otr_install_lib("${ONNXRuntime_RUNTIME}" ".")
endif()