From 07e64c37487b6c99b0425b8e4014af63529459cf Mon Sep 17 00:00:00 2001 From: Michael Welter Date: Tue, 3 Aug 2021 23:29:00 +0200 Subject: 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. --- tracker-neuralnet/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tracker-neuralnet') 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() -- cgit v1.2.3