diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2012-10-21 13:24:25 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2012-10-21 13:24:25 (GMT) |
commit | a22f4fabb7eb6a978c5f0ddf7988d1c57793f7e6 (patch) | |
tree | 2eac06166737fd6dd053dea6275b4a0d7dc67ef1 | |
parent | 5052fbc93d8158e44d1a44f167ba00f39813b82f (diff) | |
download | CMake-a22f4fabb7eb6a978c5f0ddf7988d1c57793f7e6.zip CMake-a22f4fabb7eb6a978c5f0ddf7988d1c57793f7e6.tar.gz CMake-a22f4fabb7eb6a978c5f0ddf7988d1c57793f7e6.tar.bz2 |
SelectLibraryConfigurations: fix for release and debug libs being the same
-rw-r--r-- | Modules/SelectLibraryConfigurations.cmake | 14 | ||||
-rw-r--r-- | Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt | 4 |
2 files changed, 13 insertions, 5 deletions
diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake index 82bb173..709f345 100644 --- a/Modules/SelectLibraryConfigurations.cmake +++ b/Modules/SelectLibraryConfigurations.cmake @@ -48,6 +48,15 @@ macro( select_library_configurations basename ) # if only the debug version was found, set the release value to be the # debug value. _set_library_name( ${basename} DEBUG RELEASE ) + + # Set a default case, which will come into effect if + # -no build type is set and the generator only supports one build type + # at a time (i.e. CMAKE_CONFIGURATION_TYPES is false) + # -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are the same + # -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are both empty + set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) + set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} ) + if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE ) # if the generator supports configuration types or CMAKE_BUILD_TYPE @@ -61,11 +70,6 @@ macro( select_library_configurations basename ) list( APPEND ${basename}_LIBRARY debug "${_libname}" ) endforeach() set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" ) - else() - # If there are no configuration types or build type, just use - # the release version - set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) - set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} ) endif() endif() diff --git a/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt index b3b05c3..5bf0f8a 100644 --- a/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt +++ b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt @@ -37,6 +37,10 @@ check_slc(OPTONLY "opt") set(DBGONLY_LIBRARY_RELEASE "dbg") check_slc(DBGONLY "dbg") +set(SAME_LIBRARY_RELEASE "same") +set(SAME_LIBRARY_DEBUG "same") +check_slc(SAME "same") + set(OPTONLYLIST_LIBRARY_RELEASE "opt1;opt2") check_slc(OPTONLYLIST "opt1;opt2") |