CMake: improve CMake configuration summary

- reorder parts of the output for clarity
- add C and C++ compilers
- add MinGW environment (env. variable MSYSTEM)
- list all non-empty linker flags (e.g. '-static-libgcc')
This commit is contained in:
Albrecht Schlosser
2026-06-27 17:37:10 +02:00
parent 6535ec90e8
commit fb7bbf64a2
+36 -10
View File
@@ -412,13 +412,6 @@ message(STATUS "")
fl_summary("FLTK Library (API) version" "${FLTK_VERSION}")
fl_summary("ABI version (FL_ABI_VERSION)" "${FL_ABI_VERSION}")
if(CMAKE_BUILD_TYPE STREQUAL "")
fl_summary("Build configuration" "<unspecified>")
else()
fl_summary("Build configuration" "${CMAKE_BUILD_TYPE}")
endif()
fl_summary("Installation prefix" "${CMAKE_INSTALL_PREFIX}")
message("")
# "title" name system library if used
fl_summary_image("Bundled Libraries" JPEG LIB_jpeg)
@@ -466,11 +459,44 @@ else()
fl_summary("${title}" "No")
endif()
message("")
message(STATUS "Build Environment:")
message("")
fl_summary( "CMAKE_CXX_STANDARD" "${CMAKE_CXX_STANDARD}")
fl_summary_yn("CMAKE_CXX_STANDARD_REQUIRED" CMAKE_CXX_STANDARD_REQUIRED)
fl_summary_yn("CMAKE_CXX_EXTENSIONS" CMAKE_CXX_EXTENSIONS)
if(CMAKE_BUILD_TYPE STREQUAL "")
fl_summary("Build configuration" "<unspecified>")
else()
fl_summary("Build configuration" "${CMAKE_BUILD_TYPE}")
endif()
fl_summary("Installation prefix" "${CMAKE_INSTALL_PREFIX}")
if(MINGW)
fl_summary("MinGW Environment (MSYSTEM)" "$ENV{MSYSTEM}")
endif()
fl_summary("C Compiler" "${CMAKE_C_COMPILER}")
fl_summary("C++ Compiler" "${CMAKE_CXX_COMPILER}")
fl_summary( "CMAKE_CXX_STANDARD" "${CMAKE_CXX_STANDARD}")
fl_summary_yn("CMAKE_CXX_STANDARD_REQUIRED" CMAKE_CXX_STANDARD_REQUIRED)
fl_summary_yn("CMAKE_CXX_EXTENSIONS" CMAKE_CXX_EXTENSIONS)
# Optional linker flags: only non-empty flags are listed
message("")
foreach(_build_type "" "_DEBUG" "_RELEASE")
foreach(_link_type "EXE" "MODULE" "SHARED" "STATIC")
set(_var "CMAKE_${_link_type}_LINKER_FLAGS${_build_type}")
set(_flags ${${_var}})
if(NOT "${_flags}" STREQUAL "")
# The *1st* line outputs the information in table format.
# The *2nd* line outputs it properly formatted for cut'n'paste to the commandline for testing.
set(_table FALSE)
if(_table)
fl_summary("${_var}" "'${_flags}'")
else()
message(STATUS "${_var}='${_flags}'")
endif()
endif()
endforeach()
endforeach()
message("")
message(STATUS "End of Configuration Summary --\n")