diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-04-08 18:56:40 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-04-08 18:56:40 +0200 |
| commit | 265e5cd77b30581e7701927930d8fa887e0361df (patch) | |
| tree | 1c0d545b1a6d239054c801aaffeea13e195c7ad8 /CMakeLists.txt | |
| parent | ba7b2427b6dabbc1200207fff3b576d09f18c931 (diff) | |
Improve CMake build configuration summary
- simplify and unify build option output
- alignment can be changed in only 2 macros in CMake/fl_summary.cmake
- output system library location of image libraries if applicable
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 129 |
1 files changed, 36 insertions, 93 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 68ae7e974..8e0788127 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -227,136 +227,79 @@ if(FLTK_BUILD_SHARED_LIBS AND GENERATE_EXPORT_HEADERS) endif(FLTK_BUILD_SHARED_LIBS AND GENERATE_EXPORT_HEADERS) ####################################################################### -# Output Configuration Summary +# Output Build Configuration Summary ####################################################################### -include(FeatureSummary) +include(FeatureSummary) # CMake Feature Summary +include(CMake/fl_summary.cmake) # special FLTK summary macros + +# CMake Feature Summary message("") set(_descr "${PROJECT_NAME} ${FLTK_VERSION} generated by CMake ${CMAKE_VERSION}") feature_summary(WHAT ALL DESCRIPTION "Configuration Summary for ${_descr} --\n") -message(STATUS "Static libraries will be built in ${CMAKE_CURRENT_BINARY_DIR}/lib") - -if(FLTK_BUILD_SHARED_LIBS) - message(STATUS "Shared libraries will be built in ${CMAKE_CURRENT_BINARY_DIR}/lib") -else() - message(STATUS "Shared libraries will not be built (set FLTK_BUILD_SHARED_LIBS=ON to build)") -endif() - -if(FLTK_BUILD_FORMS) - message(STATUS "The forms library will be built in ${CMAKE_CURRENT_BINARY_DIR}/lib") -else() - message(STATUS "The forms library will not be built (set FLTK_BUILD_FORMS=ON to build)") -endif() - -if(FLTK_USE_GL) - message(STATUS "The OpenGL library will be built in ${CMAKE_CURRENT_BINARY_DIR}/lib") -else() - message(STATUS "The OpenGL library will not be built (set FLTK_BUILD_GL=ON to build)") -endif() - -if(FLTK_BUILD_FLUID) - message(STATUS "fluid will be built in ${CMAKE_CURRENT_BINARY_DIR}/bin/fluid") -else() - message(STATUS "fluid will not be built (set FLTK_BUILD_FLUID=ON to build)") -endif() +# FLTK specific build configuration and options (see macros in fl_summary.cmake) -if(FLTK_BUILD_FLTK_OPTIONS) - message(STATUS "fltk-options will be built in ${CMAKE_CURRENT_BINARY_DIR}/bin/fltk-options") -else() - message(STATUS "fltk-options will not be built (set FLTK_BUILD_FLTK_OPTIONS=ON to build)") -endif() +# "title" dir build (bool) option to set +fl_summary_build("Static libraries" lib TRUE "n/a") +fl_summary_build("Shared libraries" lib FLTK_BUILD_SHARED_LIBS FLTK_BUILD_SHARED_LIBS) +fl_summary_build("The forms library" lib FLTK_BUILD_FORMS FLTK_BUILD_FORMS) +fl_summary_build("The OpenGL library" lib FLTK_USE_GL FLTK_BUILD_GL) +fl_summary_build("fluid" bin FLTK_BUILD_FLUID FLTK_BUILD_FLUID) +fl_summary_build("fltk-options" bin FLTK_BUILD_FLTK_OPTIONS FLTK_BUILD_FLTK_OPTIONS) -if(FLTK_BUILD_TEST) - message(STATUS "Test programs will be built in ${CMAKE_CURRENT_BINARY_DIR}/bin/test") -else() - message(STATUS "Test programs will not be built (set FLTK_BUILD_TEST=ON to build)") -endif() - -if(FLTK_BUILD_EXAMPLES) - message(STATUS "Example programs will be built in ${CMAKE_CURRENT_BINARY_DIR}/bin/examples") -else() - message(STATUS "Example programs will not be built (set FLTK_BUILD_EXAMPLES=ON to build)") -endif() +fl_summary_build("Test programs" bin/test FLTK_BUILD_TEST FLTK_BUILD_TEST) +fl_summary_build("Example programs" bin/examples FLTK_BUILD_EXAMPLES FLTK_BUILD_EXAMPLES) message(STATUS "") if(CMAKE_BUILD_TYPE STREQUAL "") - message(STATUS "Build configuration : <unspecified>") + fl_summary("Build configuration" "<unspecified>") else() - message(STATUS "Build configuration : ${CMAKE_BUILD_TYPE}") + fl_summary("Build configuration" "${CMAKE_BUILD_TYPE}") endif() -message(STATUS "") - -if(FLTK_USE_BUNDLED_JPEG) - message(STATUS "Image Libraries : JPEG = Builtin") -else() - message(STATUS "Image Libraries : JPEG = System") -endif() - -if(FLTK_USE_BUNDLED_PNG) - message(STATUS " : PNG = Builtin") -else() - message(STATUS " : PNG = System") -endif() +message("") +# "title" name system library if used +fl_summary_image("Image Libraries" JPEG LIB_jpeg) +fl_summary_image("" PNG LIB_png) +fl_summary_image("" ZLIB LIB_zlib) -if(FLTK_USE_BUNDLED_ZLIB) - message(STATUS " : ZLIB = Builtin") -else() - message(STATUS " : ZLIB = System") -endif() +message("") if(UNIX AND NOT (APPLE AND NOT FLTK_BACKEND_X11)) if(FLTK_BACKEND_WAYLAND) if(FLTK_BACKEND_X11) - message(STATUS "Use Wayland : Yes (can also run as X11 client)") + fl_summary("Use Wayland" "Yes (can also run as X11 client)") else() - message(STATUS "Use Wayland : Yes (cannot run as X11 client)") + fl_summary("Use Wayland" "Yes (cannot run as X11 client)") endif(FLTK_BACKEND_X11) - if(USE_SYSTEM_LIBDECOR) - message(STATUS "Use system libdecor : Yes") - else() - message(STATUS "Use system libdecor : No") - endif(USE_SYSTEM_LIBDECOR) + fl_summary_yn("Use system libdecor" USE_SYSTEM_LIBDECOR) else() - message(STATUS "Use Wayland : No (therefore, X11 is used)") + fl_summary("Use Wayland" "No (X11 is used)") endif(FLTK_BACKEND_WAYLAND) - if(FLTK_USE_CAIRO) - message(STATUS "All drawing uses Cairo : Yes") - else() - message(STATUS "All drawing uses Cairo : No") - endif() + fl_summary_yn("All drawing uses Cairo" FLTK_USE_CAIRO) - if(USE_PANGO) - message(STATUS "Use Pango : Yes") - else() - message(STATUS "Use Pango : No") - if(USE_XFT) - message(STATUS "Use Xft : Yes") - else() - message(STATUS "Use Xft : No") - endif() + fl_summary_yn("Use Pango" USE_PANGO) + if(NOT USE_PANGO) + fl_summary_yn("Use Xft" USE_XFT) endif() endif() +set(title "Fl_Cairo_Window support") if(FLTK_HAVE_CAIROEXT) - message(STATUS "Fl_Cairo_Window support : Yes (extended)") + fl_summary("${title}" "Yes (extended)") elseif(FLTK_HAVE_CAIRO) - message(STATUS "Fl_Cairo_Window support : Yes (standard)") + fl_summary("${title}" "Yes (standard)") else() - message(STATUS "Fl_Cairo_Window support : No") + fl_summary("${title}" "No") endif() -if(FLTK_USE_STD) - message(STATUS "Use std:: : Yes") -else() - message(STATUS "Use std:: : No") -endif() +fl_summary_yn("Use std::" FLTK_USE_STD) message("") message(STATUS "End of Configuration Summary --\n") |
