From f9eb8a1286e23ebbea852dfc4067562936a7b885 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Wed, 23 Jun 2021 21:21:26 +0200 Subject: [PATCH] CMake: Improve summary output for multi-config builds --- expat/CMakeLists.txt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index fda3f626..dcd9e91f 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -746,19 +746,32 @@ elseif(EXPAT_CHAR_TYPE STREQUAL "wchar_t") else() set(_EXPAT_CHAR_TYPE_SUMMARY "ERROR") 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 "Configuration") 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 " Build type ................. ${CMAKE_BUILD_TYPE}") message(STATUS " Shared libraries ........... ${EXPAT_SHARED_LIBS}") if(MSVC) message(STATUS " Static CRT ................. ${EXPAT_MSVC_STATIC_CRT}") endif() 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 " Build documentation ........ ${EXPAT_BUILD_DOCS}") message(STATUS " Build examples ............. ${EXPAT_BUILD_EXAMPLES}")