diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2025-05-06 19:10:00 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2025-05-06 19:25:53 +0200 |
| commit | 53491f2ca0f197a84f15cf10949f13450ce7d021 (patch) | |
| tree | 9e6f700bbc1e568eed41b74fdea066e5f0705988 /CMakeLists.txt | |
| parent | 9ba11949ca58537c1f511e0919243ede7b86507d (diff) | |
Remove hardcoded version numbers: part 1
The goal is to change the version number for a new release only in
CMakeLists.txt. This is the first step.
Details:
- CMake/gen_config.cmake: this new file is included to generate the
header files config.h (private, root directory), and FL/fl_config.h
(public, can be installed). This file implements also ABI version
checks (removed from FL/Enumerations.H and with more checks).
Warnings are issued if the chosen ABI version is invalid.
- CMake/export.cmake: code to generate 'config.h' was moved to
CMake/gen_config.cmake.
- CMake/options.cmake: set default of FLTK_BUILD_FORMS=OFF + comments
- CMakeLists.txt: move generation of FL/fl_config.h to gen_config.cmake,
add API and ABI versions to CMake summary,
- FL/Enumerations.H: remove most of the version number details which
are now included in FL/fl_config.h. This needed also some doxygen
related changes.
- README.CMake.txt: improve docs of FL_ABI_VERSION and some more.
Reflect the new default of CMake option FLTK_BUILD_FORMS (OFF).
- documentation/Doxyfile.in: add FL/fl_config.h to file list. This
file is created in the build tree (and may be "installed").
- fl_config.h.in: add version number details that have been moved here
from Enumerations.H (used to generate FL/fl_config.h).
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index db6e0bb8e..ea0b37067 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org) +# Main CMakeLists.txt to build the FLTK project using CMake # Originally written by Michael Surette # # Copyright 1998-2025 by Bill Spitzak and others. @@ -132,6 +132,12 @@ include(CMake/resources.cmake) include(CMake/options.cmake) ####################################################################### +# generate version numbers and config headers +####################################################################### + +include(CMake/gen_config.cmake) + +####################################################################### # Disable automatic code signing on macOS when using Xcode. # This *MUST* be done after including CMake/options.cmake. # Users can still enable code signing if they have a valid certificate. @@ -266,12 +272,6 @@ include(CMake/variables.cmake) include(CMake/export.cmake) -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/fl_config.h.in - ${CMAKE_CURRENT_BINARY_DIR}/FL/fl_config.h - @ONLY -) - ####################################################################### # options to build test/demo and example programs ####################################################################### @@ -364,29 +364,31 @@ feature_summary(WHAT ALL DESCRIPTION "Configuration Summary for ${_descr} --\n") # FLTK specific build configuration and options (see macros in fl_summary.cmake) -# "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) +# "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) 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 "") +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>") + fl_summary("Build configuration" "<unspecified>") else() - fl_summary("Build configuration" "${CMAKE_BUILD_TYPE}") + fl_summary("Build configuration" "${CMAKE_BUILD_TYPE}") endif() - -fl_summary("Installation prefix" "${CMAKE_INSTALL_PREFIX}") +fl_summary("Installation prefix" "${CMAKE_INSTALL_PREFIX}") message("") -# "title" name system library if used +# "title" name system library if used fl_summary_image("Bundled Libraries" JPEG LIB_jpeg) fl_summary_image("" PNG LIB_png) fl_summary_image("" ZLIB LIB_zlib) |
