diff options
author | Brad King <brad.king@kitware.com> | 2016-08-03 11:12:01 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-03 11:14:29 -0400 |
commit | ff386d1121ec52854d522d3bb9c86fab286d58ef (patch) | |
tree | 3b1d9d71f628227661992346e791ebdd9f07fa80 | |
parent | 382c4fca6b895c2c7a68445918a8fd73a15e1f91 (diff) | |
download | cmake-ff386d1121ec52854d522d3bb9c86fab286d58ef.tar.gz |
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).
-rw-r--r-- | Modules/FindGTest.cmake | 28 | ||||
-rw-r--r-- | Modules/FindIce.cmake | 14 | ||||
-rw-r--r-- | Modules/FindOpenSSL.cmake | 28 | ||||
-rw-r--r-- | Modules/FindPNG.cmake | 14 | ||||
-rw-r--r-- | Modules/FindTIFF.cmake | 14 | ||||
-rw-r--r-- | Modules/FindXalanC.cmake | 14 | ||||
-rw-r--r-- | Modules/FindXercesC.cmake | 14 |
7 files changed, 63 insertions, 63 deletions
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake index a7ffcfefed..72032c7a65 100644 --- a/Modules/FindGTest.cmake +++ b/Modules/FindGTest.cmake @@ -226,13 +226,6 @@ if(GTEST_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" IMPORTED_LOCATION "${GTEST_LIBRARY}") endif() - if(EXISTS "${GTEST_LIBRARY_DEBUG}") - set_property(TARGET GTest::GTest APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(GTest::GTest PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" - IMPORTED_LOCATION_DEBUG "${GTEST_LIBRARY_DEBUG}") - endif() if(EXISTS "${GTEST_LIBRARY_RELEASE}") set_property(TARGET GTest::GTest APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) @@ -240,6 +233,13 @@ if(GTEST_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" IMPORTED_LOCATION_RELEASE "${GTEST_LIBRARY_RELEASE}") endif() + if(EXISTS "${GTEST_LIBRARY_DEBUG}") + set_property(TARGET GTest::GTest APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(GTest::GTest PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "${GTEST_LIBRARY_DEBUG}") + endif() endif() if(NOT TARGET GTest::Main) add_library(GTest::Main UNKNOWN IMPORTED) @@ -250,13 +250,6 @@ if(GTEST_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" IMPORTED_LOCATION "${GTEST_MAIN_LIBRARY}") endif() - if(EXISTS "${GTEST_MAIN_LIBRARY_DEBUG}") - set_property(TARGET GTest::Main APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(GTest::Main PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" - IMPORTED_LOCATION_DEBUG "${GTEST_MAIN_LIBRARY_DEBUG}") - endif() if(EXISTS "${GTEST_MAIN_LIBRARY_RELEASE}") set_property(TARGET GTest::Main APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) @@ -264,5 +257,12 @@ if(GTEST_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" IMPORTED_LOCATION_RELEASE "${GTEST_MAIN_LIBRARY_RELEASE}") endif() + if(EXISTS "${GTEST_MAIN_LIBRARY_DEBUG}") + set_property(TARGET GTest::Main APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(GTest::Main PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "${GTEST_MAIN_LIBRARY_DEBUG}") + endif() endif() endif() diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake index 8f548cd38a..2bd39e8638 100644 --- a/Modules/FindIce.cmake +++ b/Modules/FindIce.cmake @@ -466,13 +466,6 @@ if(Ice_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" IMPORTED_LOCATION "${${_Ice_component_cache}}") endif() - if(EXISTS "${${_Ice_component_cache_debug}}") - set_property(TARGET ${_Ice_imported_target} APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(${_Ice_imported_target} PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" - IMPORTED_LOCATION_DEBUG "${${_Ice_component_cache_debug}}") - endif() if(EXISTS "${${_Ice_component_cache_release}}") set_property(TARGET ${_Ice_imported_target} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) @@ -480,6 +473,13 @@ if(Ice_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" IMPORTED_LOCATION_RELEASE "${${_Ice_component_cache_release}}") endif() + if(EXISTS "${${_Ice_component_cache_debug}}") + set_property(TARGET ${_Ice_imported_target} APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(${_Ice_imported_target} PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "${${_Ice_component_cache_debug}}") + endif() endif() endif() unset(_Ice_component_upcase) diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 6393f2edcf..10b62ffe05 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) diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake index 5050d9168d..d0dd870727 100644 --- a/Modules/FindPNG.cmake +++ b/Modules/FindPNG.cmake @@ -126,13 +126,6 @@ if(ZLIB_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION "${PNG_LIBRARY}") endif() - if(EXISTS "${PNG_LIBRARY_DEBUG}") - set_property(TARGET PNG::PNG APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(PNG::PNG PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" - IMPORTED_LOCATION_DEBUG "${PNG_LIBRARY_DEBUG}") - endif() if(EXISTS "${PNG_LIBRARY_RELEASE}") set_property(TARGET PNG::PNG APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) @@ -140,6 +133,13 @@ if(ZLIB_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" IMPORTED_LOCATION_RELEASE "${PNG_LIBRARY_RELEASE}") endif() + if(EXISTS "${PNG_LIBRARY_DEBUG}") + set_property(TARGET PNG::PNG APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(PNG::PNG PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" + IMPORTED_LOCATION_DEBUG "${PNG_LIBRARY_DEBUG}") + endif() endif() endif () diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake index e600498480..6c760dbcd0 100644 --- a/Modules/FindTIFF.cmake +++ b/Modules/FindTIFF.cmake @@ -98,13 +98,6 @@ if(TIFF_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION "${TIFF_LIBRARY}") endif() - if(EXISTS "${TIFF_LIBRARY_DEBUG}") - set_property(TARGET TIFF::TIFF APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(TIFF::TIFF PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" - IMPORTED_LOCATION_DEBUG "${TIFF_LIBRARY_DEBUG}") - endif() if(EXISTS "${TIFF_LIBRARY_RELEASE}") set_property(TARGET TIFF::TIFF APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) @@ -112,6 +105,13 @@ if(TIFF_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" IMPORTED_LOCATION_RELEASE "${TIFF_LIBRARY_RELEASE}") endif() + if(EXISTS "${TIFF_LIBRARY_DEBUG}") + set_property(TARGET TIFF::TIFF APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(TIFF::TIFF PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" + IMPORTED_LOCATION_DEBUG "${TIFF_LIBRARY_DEBUG}") + endif() endif() endif() diff --git a/Modules/FindXalanC.cmake b/Modules/FindXalanC.cmake index 016b7aabd2..f5061d3078 100644 --- a/Modules/FindXalanC.cmake +++ b/Modules/FindXalanC.cmake @@ -143,13 +143,6 @@ if(XalanC_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" IMPORTED_LOCATION "${XalanC_LIBRARY}") endif() - if(EXISTS "${XalanC_LIBRARY_DEBUG}") - set_property(TARGET XalanC::XalanC APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(XalanC::XalanC PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" - IMPORTED_LOCATION_DEBUG "${XalanC_LIBRARY_DEBUG}") - endif() if(EXISTS "${XalanC_LIBRARY_RELEASE}") set_property(TARGET XalanC::XalanC APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) @@ -157,6 +150,13 @@ if(XalanC_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" IMPORTED_LOCATION_RELEASE "${XalanC_LIBRARY_RELEASE}") endif() + if(EXISTS "${XalanC_LIBRARY_DEBUG}") + set_property(TARGET XalanC::XalanC APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(XalanC::XalanC PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "${XalanC_LIBRARY_DEBUG}") + endif() set_target_properties(XalanC::XalanC PROPERTIES INTERFACE_LINK_LIBRARIES XercesC::XercesC) endif() endif() diff --git a/Modules/FindXercesC.cmake b/Modules/FindXercesC.cmake index a4b80e5124..25e79d189a 100644 --- a/Modules/FindXercesC.cmake +++ b/Modules/FindXercesC.cmake @@ -122,13 +122,6 @@ if(XercesC_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" IMPORTED_LOCATION "${XercesC_LIBRARY}") endif() - if(EXISTS "${XercesC_LIBRARY_DEBUG}") - set_property(TARGET XercesC::XercesC APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(XercesC::XercesC PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" - IMPORTED_LOCATION_DEBUG "${XercesC_LIBRARY_DEBUG}") - endif() if(EXISTS "${XercesC_LIBRARY_RELEASE}") set_property(TARGET XercesC::XercesC APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) @@ -136,5 +129,12 @@ if(XercesC_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" IMPORTED_LOCATION_RELEASE "${XercesC_LIBRARY_RELEASE}") endif() + if(EXISTS "${XercesC_LIBRARY_DEBUG}") + set_property(TARGET XercesC::XercesC APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(XercesC::XercesC PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "${XercesC_LIBRARY_DEBUG}") + endif() endif() endif() |