Merge topic 'SelectLibraryConfiguration-multi-lib-per-var2'

5797512 SelectLibraryConfiguration: generate correct output when input vars are lists
This commit is contained in:
David Cole 2012-08-13 13:27:39 -04:00 committed by CMake Topic Stage
commit 92b11383d9
1 changed files with 10 additions and 8 deletions

View File

@ -48,17 +48,19 @@ macro( select_library_configurations basename )
# if only the debug version was found, set the release value to be the # if only the debug version was found, set the release value to be the
# debug value. # debug value.
_set_library_name( ${basename} DEBUG RELEASE ) _set_library_name( ${basename} DEBUG RELEASE )
if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE) NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE )
# if the generator supports configuration types or CMAKE_BUILD_TYPE # if the generator supports configuration types or CMAKE_BUILD_TYPE
# is set, then set optimized and debug options. # is set, then set optimized and debug options.
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
set( ${basename}_LIBRARY set( ${basename}_LIBRARY )
optimized ${${basename}_LIBRARY_RELEASE} foreach( _libname LISTS ${basename}_LIBRARY_RELEASE )
debug ${${basename}_LIBRARY_DEBUG} ) list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
set( ${basename}_LIBRARIES endforeach()
optimized ${${basename}_LIBRARY_RELEASE} foreach( _libname LISTS ${basename}_LIBRARY_DEBUG )
debug ${${basename}_LIBRARY_DEBUG} ) list( APPEND ${basename}_LIBRARY debug "${_libname}" )
endforeach()
set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
else( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) else( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
# If there are no configuration types or build type, just use # If there are no configuration types or build type, just use
# the release version # the release version