diff options
author | David Cole <david.cole@kitware.com> | 2012-10-23 20:37:37 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-10-23 20:37:37 (GMT) |
commit | 23a257628bb70f0e182c9b537ddab2b452fbddb0 (patch) | |
tree | 877912194213200aea07cdd629cea3a88efcfc2e /Modules/SelectLibraryConfigurations.cmake | |
parent | c26373f6ca9762c0bd9950eb3aa5f1183f370842 (diff) | |
parent | a22f4fabb7eb6a978c5f0ddf7988d1c57793f7e6 (diff) | |
download | CMake-23a257628bb70f0e182c9b537ddab2b452fbddb0.zip CMake-23a257628bb70f0e182c9b537ddab2b452fbddb0.tar.gz CMake-23a257628bb70f0e182c9b537ddab2b452fbddb0.tar.bz2 |
Merge topic 'test-SelectLibraryConfigurations'
a22f4fa SelectLibraryConfigurations: fix for release and debug libs being the same
5052fbc SelectLibraryConfigurations: add testcase
Diffstat (limited to 'Modules/SelectLibraryConfigurations.cmake')
-rw-r--r-- | Modules/SelectLibraryConfigurations.cmake | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake index eb4d885..62137bb 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() |