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).
This commit is contained in:
Albrecht Schlosser
2025-05-06 19:10:00 +02:00
parent 9ba11949ca
commit 53491f2ca0
8 changed files with 305 additions and 206 deletions

View File

@@ -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})

109
CMake/gen_config.cmake Normal file
View File

@@ -0,0 +1,109 @@
#
# Generate version numbers and configure header files
#
# 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
# file is missing or damaged, see the license at:
#
# https://www.fltk.org/COPYING.php
#
# Please see the following page on how to report bugs and issues:
#
# https://www.fltk.org/bugs.php
#
#######################################################################
# Calculate limits and check FL_ABI_VERSION syntax
#######################################################################
# Initialize FL_ABI_VERSION
set(FL_ABI_VERSION "${FLTK_ABI_VERSION}")
# These are the limits (min/max) FL_ABI_VERSION is allowed to have
math(EXPR abi_version_min "${FLTK_VERSION_MAJOR} * 10000 + ${FLTK_VERSION_MINOR} * 100")
math(EXPR abi_version_max "${abi_version_min} + ${FLTK_VERSION_PATCH} + 1")
if(FL_ABI_VERSION STREQUAL "")
# no version set, silently use default
set(FL_ABI_VERSION "${abi_version_min}")
else()
# check syntax of reuested ABI version (five digits)
string(REGEX MATCH "[1-9][0-9][0-9][0-9][0-9]" reg_match "${FL_ABI_VERSION}")
if(NOT reg_match STREQUAL "${FL_ABI_VERSION}")
message(STATUS "FLTK_ABI_VERSION \"${FLTK_ABI_VERSION}\" is invalid. Using default = ${abi_version_min}")
set(FL_ABI_VERSION "${abi_version_min}")
endif()
# check minor version (first three numbers must match)
string(SUBSTRING "${abi_version_min}" 0 3 abi_version_minor)
string(SUBSTRING "${FL_ABI_VERSION}" 0 3 abi_version_temp)
if(NOT abi_version_temp STREQUAL ${abi_version_minor})
set(FL_ABI_VERSION "${abi_version_min}")
message(STATUS "FLTK_ABI_VERSION \"${FLTK_ABI_VERSION}\" doesn't match minor version. Using default = ${abi_version_min}")
set(FL_ABI_VERSION "${abi_version_min}")
endif()
endif()
if(FL_ABI_VERSION STRLESS ${abi_version_min})
# should never happen
set(FL_ABI_VERSION "${abi_version_min}")
elseif(FL_ABI_VERSION STRGREATER ${abi_version_max})
# accept w/o warning
set(FL_ABI_VERSION "${abi_version_max}")
endif()
# reset all temporary variables
unset(abi_version_min)
unset(abi_version_max)
unset(abi_version_minor)
unset(abi_version_temp)
unset(reg_match)
#######################################################################
# configure the header file "FL/fl_config.h" in the build tree
#######################################################################
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/fl_config.h.in
${CMAKE_CURRENT_BINARY_DIR}/FL/fl_config.h
@ONLY
)
#######################################################################
# generate the header file "config.h" in the build tree
#######################################################################
# 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 the header file
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/${CONFIG_H_IN}"
"${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_H}"
@ONLY
)

View File

@@ -75,9 +75,9 @@ add_definitions(${FLTK_ARCHFLAGS})
#######################################################################
set(FLTK_ABI_VERSION ""
CACHE STRING
"FLTK ABI Version FL_ABI_VERSION: 1xxyy for 1.x.y (xx,yy with leading zero)"
"FLTK ABI Version FL_ABI_VERSION: 1xxyy for 1.x.y (xx,yy with leading zeroes)"
)
set(FL_ABI_VERSION ${FLTK_ABI_VERSION})
# see also CMake/gen_config.cmake
#######################################################################
# Select MSVC (Visual Studio) Runtime: DLL (/MDx) or static (/MTx)
@@ -201,8 +201,8 @@ if(FLTK_USE_BUNDLED_PNG)
# Definitions for 'config.h' - do we still need this?
# See also png/CMakeLists.txt (target_compile_definitions).
# Note: config.h is generated by either configure or CMake,
# hence we should support it in 1.4.x (may be changed in 1.5.0)
# Note: config.h is generated by CMake (or configure in 1.4), hence
# we support it in 1.4.x, but this may be changed in 1.5.0. (?)
set(HAVE_PNG_H 1)
set(HAVE_PNG_GET_VALID 1)
@@ -439,7 +439,7 @@ option(FLTK_BUILD_SHARED_LIBS
option(FLTK_OPTION_PRINT_SUPPORT "allow print support" ON)
option(FLTK_OPTION_FILESYSTEM_SUPPORT "allow file system support" ON)
option(FLTK_BUILD_FORMS "Build forms compatibility library" ON)
option(FLTK_BUILD_FORMS "Build forms compatibility library" OFF)
option(FLTK_BUILD_FLUID "Build FLUID" ON)
option(FLTK_BUILD_FLTK_OPTIONS "Build fltk-options" ON)
option(FLTK_BUILD_EXAMPLES "Build example programs" OFF)

View File

@@ -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.
@@ -131,6 +131,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.
@@ -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 "")
if(CMAKE_BUILD_TYPE STREQUAL "")
fl_summary("Build configuration" "<unspecified>")
else()
fl_summary("Build configuration" "${CMAKE_BUILD_TYPE}")
endif()
fl_summary("FLTK Library (API) version" "${FLTK_VERSION}")
fl_summary("ABI version (FL_ABI_VERSION)" "${FL_ABI_VERSION}")
fl_summary("Installation prefix" "${CMAKE_INSTALL_PREFIX}")
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
# "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)

View File

@@ -23,8 +23,10 @@
/*
******************************************************************************
* FL_ABI_VERSION is defined by configure or CMake since FLTK 1.3.4.
* FL_ABI_VERSION is defined by CMake since FLTK 1.3.4.
* It is written to FL/fl_config.h and #included here.
* Since FLTK 1.5.0 all version checks of FL_ABI_VERSION are done by CMake
* in CMake/gen_config.cmake.
******************************************************************************
* For more informations on FL_ABI_VERSION see README.abi-version.txt.
******************************************************************************
@@ -32,41 +34,16 @@
#include <FL/fl_config.h>
# include "Fl_Export.H"
# include "fl_types.h"
# include <FL/platform_types.h> // for FL_COMMAND and FL_CONTROL
#include "Fl_Export.H"
#include "fl_types.h"
#include <FL/platform_types.h> // for FL_COMMAND and FL_CONTROL
// Keep the following comment in sync with the values below for searching
// Current FLTK version: 1.5.0
// Doxygen group 'version_numbers' is defined in file FL/fl_config.h
// which is generated by CMake from fl_config.h.in and included above.
/** \name Version Numbers
FLTK defines some constants to help the programmer to
find out, for which FLTK version a program is compiled.
The following constants are defined:
*/
/**@{*/
/**
The major release version of this FLTK library.
\see FL_VERSION
*/
#define FL_MAJOR_VERSION 1
/**
The minor release version for this library.
FLTK remains mostly source-code compatible between minor version changes.
*/
#define FL_MINOR_VERSION 5
/**
The patch version for this library.
FLTK remains binary compatible between patches.
*/
#define FL_PATCH_VERSION 0
/** \addtogroup version_numbers
@{
*/
/**
The FLTK version number as a \em double.
@@ -113,73 +90,8 @@
*/
#define FL_API_VERSION (FL_MAJOR_VERSION*10000 + FL_MINOR_VERSION*100 + FL_PATCH_VERSION)
/**
The FLTK ABI (Application Binary Interface) version number as an \em int.
FL_ABI_VERSION is an \em int that describes the major, minor, and patch
ABI version numbers in the same format as FL_API_VERSION.
The ABI version number \p FL_ABI_VERSION is usually the same as the
API version \p FL_API_VERSION with the last two digits set to '00'.
FLTK retains the ABI (Application Binary Interface) during patch
releases of the same major and minor versions. Examples:
\verbatim
FLTK Version FL_API_VERSION FL_ABI_VERSION FL_VERSION (deprecated)
1.3.0 10300 10300 1.0300
1.3.4 10304 10300 1.0304
\endverbatim
Version 1.2.3 is actually stored as 10203 to allow for more than 9
minor and patch releases.
The FL_MAJOR_VERSION, FL_MINOR_VERSION, and FL_PATCH_VERSION constants
give the integral values for the major, minor, and patch releases
respectively.
To enable new ABI-breaking features in patch releases you can configure
FLTK to use a higher FL_ABI_VERSION.
\see README.abi-version.txt
*/
#ifndef FL_ABI_VERSION
#define FL_ABI_VERSION (FL_MAJOR_VERSION*10000 + FL_MINOR_VERSION*100)
#endif
/*
Check if FL_ABI_VERSION is out of allowed range; redefine if necessary.
This is done to prevent users from defining an illegal ABI version.
Rule: FL_MAJOR_VERSION * 10000 + FL_MINOR_VERSION * 100
<= FL_ABI_VERSION <= FL_API_VERSION + 1.
Since FLTK 1.4.2+ (Git commits after release 1.4.2) FL_ABI_VERSION is
allowed to be one higher than FL_API_VERSION so ABI changes in Git
targeted at the *next* release (e.g. 1.4.3) can be used.
Example: Commits after release FLTK 1.4.2 (before release 1.4.3):
10400 <= FL_ABI_VERSION <= 10403
Note: configure + CMake can be used to define FL_ABI_VERSION, but they
do not check validity. This is done here.
*/
#if FL_ABI_VERSION < FL_MAJOR_VERSION*10000 + FL_MINOR_VERSION*100
# undef FL_ABI_VERSION
# define FL_ABI_VERSION (FL_MAJOR_VERSION*10000 + FL_MINOR_VERSION*100)
#elif FL_ABI_VERSION > FL_API_VERSION + 1
# undef FL_ABI_VERSION
# define FL_ABI_VERSION FL_API_VERSION + 1
#endif
/**@}*/ // group: Version Numbers
/** @} */ // end of group 'version_numbers'
/**
Every time a user moves the mouse pointer, clicks a button,

View File

@@ -1,4 +1,4 @@
README.CMake.txt - Building and using FLTK with CMake
README.CMake.txt - Building and Using FLTK with CMake
------------------------------------------------------
@@ -67,6 +67,8 @@ VC++ and MinGW on Windows, or do some cross-compiling you must use out-of-tree
builds exclusively. In-tree builds will gum up the works by putting a
CMakeCache.txt file in the source root.
FLTK does not allow in-tree builds since version 1.5.0 for safety reasons.
More information on CMake can be found on its web site https://www.cmake.org.
@@ -112,18 +114,34 @@ them explicitly.
2.2.1 CMake Specific Configuration Options
---------------------------------------------
There are only three CMake options that you may want to specify:
There are only four CMake options that you typically want to specify.
Each option has a specific ":type" setting which is kind of optional
but should usually be specified in scripts.
CMAKE_BUILD_TYPE
-G "Generator"
This specifies the build system you want to use. In most cases the
platform specific default can be used, but you may want to use
another generator, e.g. "Ninja" on Unix-like platforms (Linux) where
"Unix Makefiles" is the default. On Windows the default is
"Visual Studio xxxx ..." if it is installed, on macOS it is
"Unix Makefiles" like on other Unix-like platforms but you can use
"Xcode" if you like. Other build systems (generators) may be available
on your platform, but these are out of the scope of this document.
The command `cmake --help` outputs a list of available generators.
-D CMAKE_BUILD_TYPE:STRING=...
This specifies what kind of build this is i.e. Release, Debug...
Platform specific compile/link flags/options are automatically selected
by CMake depending on this value.
by CMake depending on this value. Some generators, notably IDE systems
(e.g. Visual Studio on Windows, Xcode on macOS) ignore this option. You
can specify the build type at build time with these generators.
CMAKE_INSTALL_PREFIX
-D CMAKE_INSTALL_PREFIX:PATH=...
Where everything will go on install. Defaults are /usr/local for Unix
and C:\Program Files\FLTK for Windows.
CMAKE_OSX_ARCHITECTURES (macOS only, ignored on other platforms)
-D CMAKE_OSX_ARCHITECTURES:STRING=...
This is macOS specific and ignored on other platforms.
Set this to either "arm64", "x86_64", or a list of both "arm64;x86_64".
The latter will build "universal apps" on macOS, whereas the former
will either build Intel (x86_64) or Apple Silicon aka M1 (arm64) apps.
@@ -148,22 +166,30 @@ FLTK_ABI_VERSION - default EMPTY
build in the form 1xxyy for FLTK 1.x.y (xx and yy with leading zeroes).
The default ABI version is 1xx00 (the stable ABI throughout all patch
releases of one minor FLTK version). The highest ABI version you may
choose is 1xxyy for FLTK 1.x.y (again with leading zeroes).
Please see README.abi-version.txt for more information about which
ABI version to select.
choose is 1xxyy + 1 for FLTK 1.x.y (again with leading zeroes), i.e.
1xx00 <= FL_ABI_VERSION <= FL_API_VERSION + 1
since FLTK 1.4.2. In prior versions the highest ABI version that
could be set was the same as FL_API_VERSION. The option to set the ABI
version one greater than the current API version allows to build FLTK
from Git or from a snapshot with the latest ABI features designated
for the next higher version as long as the API version is the old
version of the latest release.
Please see README.abi-version.txt for more details.
FLTK_ARCHFLAGS - default EMPTY
Extra "architecture" flags used as C and C++ compiler flags.
These flags are also "exported" to fltk-config.
FLTK_BACKEND_WAYLAND - default ON (only Unix/Linux)
FLTK_BACKEND_WAYLAND - default ON (only Unix/Linux, not on macOS)
Enable the Wayland backend for all window operations, Cairo for all
graphics and Pango for text drawing (Linux+FreeBSD only). Resulting FLTK
apps use Wayland when a Wayland compositor is available at runtime,
and use X11 for their window operations otherwise (unless FLTK_BACKEND_X11
graphics, and Pango for text drawing (Linux+FreeBSD only). Resulting FLTK
apps use Wayland when a Wayland compositor is available at runtime, and
use X11 for their window operations otherwise (unless FLTK_BACKEND_X11
is OFF), but keep using Cairo and Pango - see README.Wayland.txt.
If FLTK_BACKEND_X11 has been turned OFF and there is no Wayland compositor
at runtime, then FLTK programs fail to start.
If FLTK_BACKEND_X11 has been turned OFF and there is no Wayland
compositor at runtime, then FLTK programs fail to start.
FLTK_BACKEND_X11 - default ON on Unix/Linux, OFF elsewhere (Windows, macOS).
Enable or disable the X11 backend on platforms that support it.
@@ -189,10 +215,10 @@ FLTK_BUILD_FLTK_OPTIONS - default ON
FLTK_BUILD_FLUID - default ON
Build the Fast Light User-Interface Designer ("fluid").
FLTK_BUILD_FORMS - default ON
Build the (X)Forms compatibility library. This option is ON by default
for backwards compatibility but can safely be turned OFF if you don't
need (X)Forms compatibility.
FLTK_BUILD_FORMS - default OFF since 1.5.0, ON in prior versions
Build the (X)Forms compatibility library. This option is OFF by default
because most FLTK software doesn't need it. You can turn this option
on for backwards compatibility if you need (X)Forms compatibility.
FLTK_BUILD_GL - default ON
Build the OpenGL support library fltk_gl (fltk::gl) and enable OpenGL
@@ -200,20 +226,22 @@ FLTK_BUILD_GL - default ON
FLTK_BUILD_SHARED_LIBS - default OFF
Normally FLTK is built as static libraries which makes more portable
binaries. If you want to use shared libraries, this will build them too.
You can use shared FLTK libs in your own CMake projects by appending
"-shared" to FLTK target names as described in section 3.1 and 3.2.
binaries. If you want to use shared libraries, setting this option ON
will build them too. You can use shared FLTK libs in your own CMake
projects by appending "-shared" to FLTK target names as described in
sections 3.1 and 3.2.
FLTK_BUILD_TEST - default ON in top-level build, OFF in sub-build
Build the test and demo programs in the 'test' directory. The default
is ON if the FLTK build is in a top-level project so all test and demo
programs are built. If FLTK is built as a subproject only the Library
is ON if FLTK is built in a top-level project so all test and demo
programs are built. If FLTK is built as a subproject only the library
and the tools (fluid and fltk-config) are built by default.
FLTK_GRAPHICS_CAIRO - default OFF (Unix/Linux: X11 + Wayland only).
Make all drawing operations use the Cairo library (rather than Xlib),
producing antialiased graphics (X11 platform: implies FLTK_USE_PANGO).
When using Wayland this option is ignored (Wayland uses Cairo).
When using Wayland this option is always ON (Wayland uses Cairo for
drawing).
FLTK_GRAPHICS_GDIPLUS - default ON (Windows only).
Make FLTK use GDI+ to draw oblique lines and curves resulting in
@@ -226,7 +254,8 @@ FLTK_MSVC_RUNTIME_DLL - default ON (Windows: Visual Studio, NMake, clang).
If this variable is defined on other platforms it is silently ignored.
FLTK_OPTION_CAIRO_EXT - default OFF
Enable extended libcairo support - see README.Cairo.txt.
Enable extended libcairo support. Setting this to ON is not recommended,
see README.Cairo.txt.
FLTK_OPTION_CAIRO_WINDOW - default OFF
Enable support of class Fl_Cairo_Window (all platforms, requires the
@@ -271,7 +300,7 @@ FLTK_USE_PANGO - default OFF (see note below)
unicode-defined scripts and gives FLTK limited support of right-to-left
scripts. This option makes sense only under X11 or Wayland, and also
requires Xft.
This option is ignored (always enabled) if Wayland or FLTK_GRAPHICS_CAIRO
This option is ignored (always ON) if Wayland or FLTK_GRAPHICS_CAIRO
is ON.
FLTK_USE_POLL - default OFF
@@ -290,9 +319,9 @@ FLTK_USE_SYSTEM_LIBDECOR - default ON (Wayland only)
FLTK_USE_SYSTEM_LIBJPEG - default ON (macOS and Windows: OFF)
FLTK_USE_SYSTEM_LIBPNG - default ON (macOS and Windows: OFF)
FLTK_USE_SYSTEM_ZLIB - default ON (macOS and Windows: OFF)
FLTK has built in jpeg, zlib, and png libraries. These options let you
FLTK has built-in jpeg, zlib, and png libraries. These options let you
use system libraries instead, unless CMake can't find them. If you set
any of these options to OFF, then the built in library will be used.
any of these options to OFF, then the built-in library will be used.
The default is ON on Linux/Unix platforms but OFF on Windows and macOS
because of potential incompatibilities on Windows and macOS whereas
the system libraries can typically be used on Linux/Unix.
@@ -318,29 +347,36 @@ FLTK_BUILD_HTML_DOCS - default ON
FLTK_BUILD_PDF_DOCS - default ON
These options can be used to enable HTML documentation generation with
doxygen. If these are ON the build targets 'html', 'pdf', and 'docs'
are generated but must be built explicitly. Technically the build targets
are generated but must be built explicitly. The target 'docs' is a
shortcut for 'html' and 'docs'. Technically the CMake build targets
are generated but excluded from 'ALL'.
You can safely leave these two options ON if you want to save build time
because the docs are not built automatically.
You can safely leave these two options ON if you want to save build
time because the docs are not built automatically. This may change
in a future release.
FLTK_BUILD_FLUID_DOCS - default OFF
If this option is ON, the FLUID user documentation will be built. If
FLTK_BUILD_PDF_DOCS is ON, the FLUID documentation will be generated
in PDF form. To generate the screen shots used in the handbook,
the CMake build mode must be set to "Debug".
If this option is ON, the FLUID user documentation can be built (target
'fluid_docs'). If FLTK_BUILD_PDF_DOCS (see above) is ON, the FLUID
documentation can also be created in PDF form (target 'fluid_pdf').
To generate the screen shots used in the handbook, the CMake build
type must be set to "Debug".
You can safely set these two options ON if you want to save build
time because the docs are not built automatically. This may change
in a future release.
FLTK_INCLUDE_DRIVER_DOCS - default OFF
This option adds driver documentation to HTML and PDF docs (if ON). This
option is marked as "advanced" since it is only useful for FLTK developers
and advanced users. It is only used if at least one of the documentation
options above is ON as well.
This option adds driver documentation to HTML and PDF docs (if ON).
This option is marked as "advanced" since it is only useful for FLTK
developers and advanced users. It is only used if at least one of the
documentation options above is ON as well.
FLTK_INSTALL_HTML_DOCS - default OFF
FLTK_INSTALL_HTML_DOCS - default OFF
FLTK_INSTALL_FLUID_DOCS - default OFF
FLTK_INSTALL_PDF_DOCS - default OFF
If these options are ON then the HTML, FLUID, and/or PDF docs are installed
when the 'install' target is executed, e.g. with `make install'. You
need to select above options FLTK_BUILD_*_DOCS as well.
FLTK_INSTALL_PDF_DOCS - default OFF
If these options are ON then the HTML, FLUID, and/or PDF docs are
installed when the 'install' target is executed, e.g. `make install'.
You need to select above options FLTK_BUILD_*_DOCS as well and build
the documentation manually (this may be improved in a later version).
2.2.4 Special Options
@@ -477,9 +513,10 @@ Some flags can be changed during the 'make' command, such as:
which builds in verbose mode, so you can see all the compile/link commands.
Hint: if you intend to build several different versions of FLTK, e.g. a Debug
and a Release version, or multiple libraries with different ABI versions or
options, then use subdirectories in the build directory, like this:
Hint: if you intend to build several different versions of FLTK, e.g.
a Debug and a Release version, or multiple libraries with different ABI
versions or options, or cross-compile for another platform we recommend
to use subdirectories in the build folder, like this:
mkdir build
cd build

View File

@@ -797,6 +797,7 @@ INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src/index.dox \
@CMAKE_CURRENT_SOURCE_DIR@/src/fltk-options.dox \
@CMAKE_CURRENT_SOURCE_DIR@/src/advanced.dox \
@CMAKE_CURRENT_SOURCE_DIR@/src/unicode.dox \
@CMAKE_CURRENT_BINARY_DIR@/../FL/fl_config.h \
@FLTK_SOURCE_DIR@/FL \
@FLTK_SOURCE_DIR@/src \
@CMAKE_CURRENT_SOURCE_DIR@/src/enumerations.dox \

View File

@@ -19,14 +19,77 @@
#ifndef _FL_fl_config_h_
#define _FL_fl_config_h_
/*
* FL_ABI_VERSION (ABI version)
*
* define FL_ABI_VERSION: 1xxyy for 1.x.y (xx,yy with leading zero)
/** \defgroup version_numbers Version Numbers
FLTK defines some constants to help the programmer to
find out, for which FLTK version a program is compiled.
The following constants are defined:
@{
*/
#cmakedefine FL_ABI_VERSION @FL_ABI_VERSION@
/**
The major release version of this FLTK library.
\see FL_VERSION
*/
#define FL_MAJOR_VERSION @FLTK_VERSION_MAJOR@
/**
The minor release version for this library.
FLTK remains mostly source-code compatible between minor version changes.
*/
#define FL_MINOR_VERSION @FLTK_VERSION_MINOR@
/**
The patch version for this library.
FLTK remains binary compatible between patch versions.
*/
#define FL_PATCH_VERSION @FLTK_VERSION_PATCH@
/**
The FLTK ABI (Application Binary Interface) version number as an \em int.
FL_ABI_VERSION is an \em int that describes the major, minor, and patch
ABI version numbers in the same format as FL_API_VERSION.
The ABI version number \p FL_ABI_VERSION is usually the same as the
API version \p FL_API_VERSION with the last two digits set to '00'.
FLTK retains the ABI (Application Binary Interface) during patch
releases of the same major and minor versions. Examples:
\verbatim
FLTK Version FL_API_VERSION FL_ABI_VERSION FL_VERSION (deprecated)
1.3.0 10300 10300 1.0300
1.3.4 10304 10300 1.0304
\endverbatim
Version 1.2.3 is actually stored as 10203 to allow for more than 9 minor
and patch releases.
The FL_MAJOR_VERSION, FL_MINOR_VERSION, and FL_PATCH_VERSION constants
give the integral values for the major, minor, and patch releases
respectively.
To enable new ABI-breaking features in patch releases you can configure
FLTK to use a higher FL_ABI_VERSION. The highest allowed version is
FL_ABI_VERSION = FL_API_VERSION + 1
to allow for "next version" ABI features when FLTK is built from git or
from a snapshot (pre-release version).
\see README.abi-version.txt
*/
#define FL_ABI_VERSION @FL_ABI_VERSION@
/** @} */
// End of doxygen group 'version_numbers'. More is added to the group in
// in file FL/Enumerations.H
/*
* FLTK_HAVE_CAIRO