From 7997e7aee9c16f39a96d35e50e66beb67875bc56 Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Mon, 18 Sep 2017 17:47:49 +0200 Subject: [PATCH] cmake: map RelWithDebInfo and MinSizeRel configuration to Release --- cmake/templates/OpenCVConfig.cmake.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/templates/OpenCVConfig.cmake.in b/cmake/templates/OpenCVConfig.cmake.in index 167dfa9097..fe85571ebf 100644 --- a/cmake/templates/OpenCVConfig.cmake.in +++ b/cmake/templates/OpenCVConfig.cmake.in @@ -219,6 +219,14 @@ foreach(__cvcomponent ${OpenCV_FIND_COMPONENTS}) string(TOUPPER "${__cvcomponent}" __cvcomponent) set(${__cvcomponent}_FOUND 1) endif() + # OpenCV supports Debug and Release only. + # RelWithDebInfo and MinSizeRel are mapped to Release + if(TARGET ${__cvcomponent}) + set_target_properties(${__cvcomponent} PROPERTIES + MAP_IMPORTED_CONFIG_MINSIZEREL "Release" + MAP_IMPORTED_CONFIG_RELWITHDEBINFO "Release" + ) + endif() endforeach() set(OpenCV_FIND_COMPONENTS ${OpenCV_FIND_COMPONENTS_})