CMake: Improve summary output for multi-config builds

This commit is contained in:
Sebastian Pipping 2021-06-23 21:21:26 +02:00
parent 40bf9fe84a
commit f9eb8a1286

View File

@ -746,19 +746,32 @@ elseif(EXPAT_CHAR_TYPE STREQUAL "wchar_t")
else() else()
set(_EXPAT_CHAR_TYPE_SUMMARY "ERROR") set(_EXPAT_CHAR_TYPE_SUMMARY "ERROR")
endif() endif()
# NOTE: We're not accessing global property GENERATOR_IS_MULTI_CONFIG
# because that would require CMake >=3.9
if(CMAKE_CONFIGURATION_TYPES)
set(_EXPAT_GENERATOR_IS_MULTI_CONFIG TRUE)
else()
set(_EXPAT_GENERATOR_IS_MULTI_CONFIG FALSE)
endif()
message(STATUS "===========================================================================") message(STATUS "===========================================================================")
message(STATUS "") message(STATUS "")
message(STATUS "Configuration") message(STATUS "Configuration")
message(STATUS " Generator .................. ${CMAKE_GENERATOR}") message(STATUS " Generator .................. ${CMAKE_GENERATOR}")
if(_EXPAT_GENERATOR_IS_MULTI_CONFIG)
message(STATUS " Build types ................ ${CMAKE_CONFIGURATION_TYPES}")
else()
message(STATUS " Build type ................. ${CMAKE_BUILD_TYPE}")
endif()
message(STATUS " Prefix ..................... ${CMAKE_INSTALL_PREFIX}") message(STATUS " Prefix ..................... ${CMAKE_INSTALL_PREFIX}")
message(STATUS " Build type ................. ${CMAKE_BUILD_TYPE}")
message(STATUS " Shared libraries ........... ${EXPAT_SHARED_LIBS}") message(STATUS " Shared libraries ........... ${EXPAT_SHARED_LIBS}")
if(MSVC) if(MSVC)
message(STATUS " Static CRT ................. ${EXPAT_MSVC_STATIC_CRT}") message(STATUS " Static CRT ................. ${EXPAT_MSVC_STATIC_CRT}")
endif() endif()
message(STATUS " Character type ............. ${_EXPAT_CHAR_TYPE_SUMMARY}") message(STATUS " Character type ............. ${_EXPAT_CHAR_TYPE_SUMMARY}")
message(STATUS " Library name postfix ....... ${CMAKE_${_EXPAT_BUILD_TYPE_UPPER}_POSTFIX}") if(NOT _EXPAT_GENERATOR_IS_MULTI_CONFIG)
message(STATUS " Library name postfix ....... ${CMAKE_${_EXPAT_BUILD_TYPE_UPPER}_POSTFIX}")
endif()
message(STATUS "") message(STATUS "")
message(STATUS " Build documentation ........ ${EXPAT_BUILD_DOCS}") message(STATUS " Build documentation ........ ${EXPAT_BUILD_DOCS}")
message(STATUS " Build examples ............. ${EXPAT_BUILD_EXAMPLES}") message(STATUS " Build examples ............. ${EXPAT_BUILD_EXAMPLES}")