From a72fedb5508a1c86bca3eee8cc484dcf46364437 Mon Sep 17 00:00:00 2001 From: "d.kilic" <d.kilic@fz-juelich.de> Date: Tue, 4 Jul 2023 09:34:00 +0200 Subject: [PATCH] Don't apply mapping of OpenCV debug to release on MSVC Since OpenCV is quite slow in debug, we always link against the release version. This does not work with MSVC due to incompatible crt's. Therefore, we don't do it on MSVC and have to live with the slowness... --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5956703bb..a70786456 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,9 +241,13 @@ target_include_directories(petrack_core PRIVATE "${CMAKE_SOURCE_DIR}/ui") # Linking OpenCV * #***************************************************************** # Debug Version of slows our debug down to a unusable degree -set_target_properties(${OpenCV_LIBS} PROPERTIES - MAP_IMPORTED_CONFIG_DEBUG RELEASE - MAP_IMPORTED_CONFIG_RELWITHDEBINFO RELEASE) +# so link to release always (not possible on MSVC due to +# debug crt and release crt not being compatible) +if(NOT ${MSVC}) + set_target_properties(${OpenCV_LIBS} PROPERTIES + MAP_IMPORTED_CONFIG_DEBUG RELEASE + MAP_IMPORTED_CONFIG_RELWITHDEBINFO RELEASE) +endif() target_link_libraries(petrack_core PUBLIC ${OpenCV_LIBS}) #***************************************************************** # Linking QWT * -- GitLab