summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenSSL.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-08-03 15:12:01 (GMT)
committerBrad King <brad.king@kitware.com>2016-08-03 15:14:29 (GMT)
commitff386d1121ec52854d522d3bb9c86fab286d58ef (patch)
tree3b1d9d71f628227661992346e791ebdd9f07fa80 /Modules/FindOpenSSL.cmake
parent382c4fca6b895c2c7a68445918a8fd73a15e1f91 (diff)
downloadCMake-ff386d1121ec52854d522d3bb9c86fab286d58ef.zip
CMake-ff386d1121ec52854d522d3bb9c86fab286d58ef.tar.gz
CMake-ff386d1121ec52854d522d3bb9c86fab286d58ef.tar.bz2
Modules: Make imported targets fall back to `Release`
Find modules only detect Debug and Release configurations. All other configurations will fall back to the configuration listed as the first entry in `IMPORTED_CONFIGURATIONS`. Switch the order so that `Release` is listed first, as this is a better fallback than `Debug` for the `RelWithDebInfo` and `MinSizeRel` configurations. See issue #16091. This approach is recommended by documentation in `cmake-developer(7)` added by commit v3.2.0-rc1~286^2~1 (Help: Document IMPORTED_CONFIGURATIONS target property for Find modules, 2014-12-04).
Diffstat (limited to 'Modules/FindOpenSSL.cmake')
-rw-r--r--Modules/FindOpenSSL.cmake28
1 files changed, 14 insertions, 14 deletions
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 6393f2e..10b62ff 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -399,13 +399,6 @@ if(OPENSSL_FOUND)
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${OPENSSL_CRYPTO_LIBRARY}")
endif()
- if(EXISTS "${LIB_EAY_LIBRARY_DEBUG}")
- set_property(TARGET OpenSSL::Crypto APPEND PROPERTY
- IMPORTED_CONFIGURATIONS DEBUG)
- set_target_properties(OpenSSL::Crypto PROPERTIES
- IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
- IMPORTED_LOCATION_DEBUG "${LIB_EAY_LIBRARY_DEBUG}")
- endif()
if(EXISTS "${LIB_EAY_LIBRARY_RELEASE}")
set_property(TARGET OpenSSL::Crypto APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
@@ -413,6 +406,13 @@ if(OPENSSL_FOUND)
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
IMPORTED_LOCATION_RELEASE "${LIB_EAY_LIBRARY_RELEASE}")
endif()
+ if(EXISTS "${LIB_EAY_LIBRARY_DEBUG}")
+ set_property(TARGET OpenSSL::Crypto APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(OpenSSL::Crypto PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
+ IMPORTED_LOCATION_DEBUG "${LIB_EAY_LIBRARY_DEBUG}")
+ endif()
endif()
if(NOT TARGET OpenSSL::SSL AND
(EXISTS "${OPENSSL_SSL_LIBRARY}" OR
@@ -427,13 +427,6 @@ if(OPENSSL_FOUND)
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${OPENSSL_SSL_LIBRARY}")
endif()
- if(EXISTS "${SSL_EAY_LIBRARY_DEBUG}")
- set_property(TARGET OpenSSL::SSL APPEND PROPERTY
- IMPORTED_CONFIGURATIONS DEBUG)
- set_target_properties(OpenSSL::SSL PROPERTIES
- IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
- IMPORTED_LOCATION_DEBUG "${SSL_EAY_LIBRARY_DEBUG}")
- endif()
if(EXISTS "${SSL_EAY_LIBRARY_RELEASE}")
set_property(TARGET OpenSSL::SSL APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
@@ -441,6 +434,13 @@ if(OPENSSL_FOUND)
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
IMPORTED_LOCATION_RELEASE "${SSL_EAY_LIBRARY_RELEASE}")
endif()
+ if(EXISTS "${SSL_EAY_LIBRARY_DEBUG}")
+ set_property(TARGET OpenSSL::SSL APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(OpenSSL::SSL PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
+ IMPORTED_LOCATION_DEBUG "${SSL_EAY_LIBRARY_DEBUG}")
+ endif()
if(TARGET OpenSSL::Crypto)
set_target_properties(OpenSSL::SSL PROPERTIES
INTERFACE_LINK_LIBRARIES OpenSSL::Crypto)