From 53491f2ca0f197a84f15cf10949f13450ce7d021 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Tue, 6 May 2025 19:10:00 +0200 Subject: 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). --- CMake/export.cmake | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'CMake/export.cmake') diff --git a/CMake/export.cmake b/CMake/export.cmake index 642be6762..407b24933 100644 --- a/CMake/export.cmake +++ b/CMake/export.cmake @@ -1,9 +1,9 @@ # -# Export CMake file to build the FLTK project using CMake (www.cmake.org) +# Export CMake file to build the FLTK project using CMake # # Originally written by Michael Surette # -# Copyright 1998-2024 by Bill Spitzak and others. +# Copyright 1998-2025 by Bill Spitzak and others. # # This library is free software. Distribution and use rights are outlined in # the file "COPYING" which should have been included with this file. If this @@ -136,31 +136,6 @@ else(CMAKE_VERSION VERSION_LESS 3.19) WORLD_READ WORLD_EXECUTE) endif(CMAKE_VERSION VERSION_LESS 3.19) -# prepare some variables for config.h - -if(IS_ABSOLUTE "${FLTK_DATADIR}") - set(PREFIX_DATA "${FLTK_DATADIR}/fltk") -else(IS_ABSOLUTE "${FLTK_DATADIR}") - set(PREFIX_DATA "${CMAKE_INSTALL_PREFIX}/${FLTK_DATADIR}/fltk") -endif(IS_ABSOLUTE "${FLTK_DATADIR}") - -if(IS_ABSOLUTE "${FLTK_DOCDIR}") - set(PREFIX_DOC "${FLTK_DOCDIR}/fltk") -else(IS_ABSOLUTE "${FLTK_DOCDIR}") - set(PREFIX_DOC "${CMAKE_INSTALL_PREFIX}/${FLTK_DOCDIR}/fltk") -endif(IS_ABSOLUTE "${FLTK_DOCDIR}") - -set(CONFIG_H_IN config.h.in) -set(CONFIG_H config.h) - -# generate config.h - -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/${CONFIG_H_IN}" - "${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_H}" - @ONLY -) - if(FLTK_INSTALL_LINKS) # Set PREFIX_INCLUDE to the proper value. if(IS_ABSOLUTE ${FLTK_INCLUDEDIR}) -- cgit v1.2.3