Raise CMake minimum required version to 3.15 and more

- ensure that all required CMake policies are set to 3.15
- enhance CMake status report (add bundled library types)
- add erco's CMake instructions for building with NMake
- improve HTML docs (remove "custom" HTML footer)
- update ANNOUNCEMENT
This commit is contained in:
Albrecht Schlosser 2023-12-09 14:58:40 +01:00
parent 3c25c0a483
commit a66273e726
8 changed files with 102 additions and 72 deletions

View File

@ -13,6 +13,9 @@ FLTK 1.3.9 and previous versions contain many improvements and bug fixes.
macOS is now supported up to macOS 14 (Sonoma).
CMake support has been enhanced and requires CMake 3.15 or higher,
autotools/configure/make and bundled IDE projects are still supported.
Open bugs and feature requests can be viewed (offline) in KNOWN_BUGS.html
with your browser. Links in this file direct you to the current state
(online) of all listed bugs and feature requests.

19
CHANGES
View File

@ -5,11 +5,21 @@ FLTK 1.3.9 is a maintenance release with some fixes and enhancements.
Highlights in this release:
- Support macOS up to macOS 14 "Sonoma".
- Update bundled libraries to current versions.
- Update bundled libraries to current versions (see below).
- Introduce bundled image library "prefixing" to avoid conflicts
with system libraries.
- New CMake option FLTK_MSVC_RUNTIME_DLL selects Visual Studio
Runtime (DLL or static) if built with CMake 3.15 or later
- New CMake option FLTK_MSVC_RUNTIME_DLL to select Visual Studio
Runtime version: DLL (/MDx) or static (/MTx), see README.CMake.txt
Bundled library versions (see also README.bundled-libs.txt):
Library Version Release date
---------------------------------------------
jpeg jpeg-9e 2022-01-16
png libpng-1.6.40 2023-06-21
zlib zlib-1.3 2023-08-18
Details:
@ -31,6 +41,9 @@ Details:
Update bundled image libraries and zlib to current versions
Update README, README.CMake.txt, and some support files
Fix compiler warnings: backported from 1.4 (git 'master')
CMake/MSVC: remove confusing recommendation to rerun CMake
Documentation: remove dark color on title page
Raise CMake minimum required version to 3.15 and more
ManoloFLTK:
macOS platform: Issue #325 "Disabling IM disables Greek and Cyrillic layouts"

View File

@ -1,8 +1,8 @@
#
# A macro used by the CMake build system for the Fast Light Tool Kit (FLTK).
# Written by Michael Surette
# Originally written by Michael Surette
#
# Copyright 1998-2020 by Bill Spitzak and others.
# Copyright 1998-2023 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
@ -39,15 +39,14 @@
# all other file types are added to the target's source files.
#
# macOS specific .icns and .plist files are ignored on other platforms.
# These files must resided in the subdirectory 'mac-resources'.
# These files must reside in the subdirectory 'mac-resources'.
#
# - LIBRARIES:
# List of libraries (CMake target names), separated by ';'. Needs
# quotes if more than one library is needed, e.g. "fltk_gl;fltk"
# quotes if more than one library is required, e.g. "fltk_gl;fltk"
#
# CREATE_EXAMPLE can have an optional fourth argument with a list of options
# - the option ANDROID_OK is set if CREATE_EXAMPLE creates code for Android
# builds in addition to the native build
# - these options are currently not used
#
################################################################################
@ -156,15 +155,17 @@ macro (CREATE_EXAMPLE NAME SOURCES LIBRARIES)
endif (MAC_BUNDLE)
######################################################################
# Parse optional fourth argument "ANDROID_OK", see description above.
# Parse optional fourth argument, see description above.
######################################################################
if (${ARGC} GREATER 3)
foreach (OPTION ${ARGV3})
if (${OPTION} STREQUAL "ANDROID_OK" AND OPTION_CREATE_ANDROID_STUDIO_IDE)
CREATE_ANDROID_IDE_FOR_TEST (${NAME} ${SOURCES} ${LIBRARIES})
endif ()
endforeach ()
endif ()
# code left commented out as an example
endmacro (CREATE_EXAMPLE NAME SOURCES LIBRARIES)
# *unused* # if (${ARGC} GREATER 3)
# *unused* # foreach (OPTION ${ARGV3})
# *unused* # if (${OPTION} STREQUAL "xxx")
# *unused* # # do something ...
# *unused* # endif ()
# *unused* # endforeach ()
# *unused* # endif ()
endmacro ()

View File

@ -71,17 +71,16 @@ set (FL_ABI_VERSION ${OPTION_ABI_VERSION})
# Note: this might be handled better by the 'MSVC_RUNTIME_LIBRARY'
# target property for each target rather than setting a global
# CMake variable - but this version does the latter.
# *Note* Supported since CMake version 3.15
#######################################################################
if (MSVC AND NOT (CMAKE_VERSION VERSION_LESS 3.15))
if (MSVC)
option (FLTK_MSVC_RUNTIME_DLL "use MSVC Runtime-DLL (/MDx)" ON)
if (FLTK_MSVC_RUNTIME_DLL)
set (CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
else ()
set (CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif ()
endif (MSVC AND NOT (CMAKE_VERSION VERSION_LESS 3.15))
endif (MSVC)
#######################################################################
# Bundled Library Options
@ -289,7 +288,7 @@ endif (OPTION_BUILD_HTML_DOCUMENTATION OR OPTION_BUILD_PDF_DOCUMENTATION)
# Include optional Cairo support
#######################################################################
option (OPTION_CAIRO "use lib Cairo" OFF)
option (OPTION_CAIRO "add support for Fl_Cairo_Window" OFF)
option (OPTION_CAIROEXT
"use FLTK code instrumentation for Cairo extended use" OFF
)

View File

@ -1,6 +1,6 @@
#
# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
# Written by Michael Surette
# Originally written by Michael Surette
#
# Copyright 1998-2023 by Bill Spitzak and others.
#
@ -16,7 +16,7 @@
#
#######################################################################
# set CMake minimum version (must be before `project()`
# Set CMake minimum version first: must be before `project()`
#######################################################################
# Note: previous (1.3.5) minimum version
@ -25,23 +25,11 @@
# Note: minimum CMake version required by GNUInstallDirs
# cmake_minimum_required (VERSION 2.8.4)
# Minimum CMake version required by FLTK 1.4 (06/2020, work in progress)
cmake_minimum_required (VERSION 3.2.3 FATAL_ERROR)
# Minimum CMake version required by FLTK 1.3.7 (since 07/2021)
# cmake_minimum_required (VERSION 3.2.3 FATAL_ERROR)
#######################################################################
# Use "legacy mode" of FindOpenGL (avoid CMake developer warning).
# Note: we're using FindOpenGL with `OPENGL_LIBRARIES` and not (yet)
# the `OpenGL::GL` target. This may be changed in the future.
# See https://cmake.org/cmake/help/latest/policy/CMP0072.html
# Update Feb 28, 2021: To avoid a warning about "OLD" policies we set
# OpenGL_GL_PREFERENCE directly to "LEGACY" (other option: "GLVND").
# if (POLICY CMP0072)
# cmake_policy (SET CMP0072 OLD)
# endif ()
set (OpenGL_GL_PREFERENCE LEGACY)
# Minimum CMake version required by FLTK 1.3.9 (since 12/2023)
cmake_minimum_required (VERSION 3.15.0 FATAL_ERROR)
#######################################################################
# define the FLTK project and version
@ -50,18 +38,19 @@ set (OpenGL_GL_PREFERENCE LEGACY)
project (FLTK VERSION 1.3.9)
#######################################################################
# include macro definitions of generally used macros
# include macro and function definitions for general usage
#######################################################################
include (CMake/fl_debug_var.cmake)
include (CMake/fl_add_library.cmake)
if (false)
if (0)
fl_debug_var (FLTK_VERSION_MAJOR)
fl_debug_var (FLTK_VERSION_MINOR)
fl_debug_var (FLTK_VERSION_PATCH)
fl_debug_var (FLTK_VERSION)
endif (false)
fl_debug_var (CMAKE_VERSION)
endif ()
#######################################################################
# basic setup
@ -86,14 +75,13 @@ set (debug_build 0) # set to 1 to show debug info
if (debug_build)
message ("")
message (STATUS "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt: set debug_build to 0 to disable the following info:")
message (STATUS "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt: set 'debug_build' to 0 to disable the following info:")
fl_debug_var (WIN32)
fl_debug_var (MINGW)
fl_debug_var (CYGWIN)
fl_debug_var (MSVC)
fl_debug_var (UNIX)
fl_debug_var (APPLE)
fl_debug_var (ANDROID)
fl_debug_var (CMAKE_BUILD_TYPE)
fl_debug_var (CMAKE_SIZEOF_VOID_P)
fl_debug_var (OPTION_OPTIM)
@ -154,7 +142,7 @@ feature_summary (WHAT ALL DESCRIPTION "Configuration Summary for ${_descr} --\n"
message (STATUS "Static libraries will be built in ${CMAKE_CURRENT_BINARY_DIR}/lib")
if (OPTION_BUILD_SHARED_LIBS)
message (STATUS "Shared libraries will be built in ${CMAKE_CURRENT_BINARY_DIR}/lib")
message (STATUS "Shared libraries will be built in ${CMAKE_CURRENT_BINARY_DIR}/lib")
else ()
message (STATUS "Shared libraries will not be built (set OPTION_BUILD_SHARED_LIBS=ON to build)")
endif ()
@ -169,5 +157,41 @@ else ()
message (STATUS "Example programs will not be built (set FLTK_BUILD_EXAMPLES=ON to build)")
endif ()
message (STATUS "")
if (CMAKE_BUILD_TYPE STREQUAL "")
message (STATUS "Build configuration : <unspecified>")
else ()
message (STATUS "Build configuration : ${CMAKE_BUILD_TYPE}")
endif ()
message (STATUS "")
if (FLTK_USE_BUILTIN_JPEG)
message (STATUS "Image Libraries : JPEG = Builtin")
else ()
message (STATUS "Image Libraries : JPEG = System")
endif ()
if (FLTK_USE_BUILTIN_PNG)
message (STATUS " : PNG = Builtin")
else ()
message (STATUS " : PNG = System")
endif ()
if (FLTK_USE_BUILTIN_ZLIB)
message (STATUS " : ZLIB = Builtin")
else ()
message (STATUS " : ZLIB = System")
endif ()
if (FLTK_HAVE_CAIROEXT)
message (STATUS "Fl_Cairo_Window support : Yes (extended)")
elseif (FLTK_HAVE_CAIRO)
message (STATUS "Fl_Cairo_Window support : Yes (standard)")
else ()
message (STATUS "Fl_Cairo_Window support : No")
endif ()
message ("")
message (STATUS "End of Configuration Summary --\n")

View File

@ -172,7 +172,6 @@ OPTION_ABI_VERSION - default EMPTY
Please see README.abi-version.txt for more information about which
ABI version to select.
Documentation options: these options are only available if `doxygen' is
installed and found by CMake. PDF related options require also `latex'.
@ -296,6 +295,21 @@ in the GUI (cmake-gui).
to include both the build tree (first) and then the FLTK source
tree in the compiler's header search list.
2.4.2 Visual Studio 2019 / NMake
--------------------------------------
This uses cmake to generate + build FLTK in Release mode using nmake,
using purely the command line (never need to open the Visual Studio IDE)
using Multithreaded (/MT):
mkdir build-nmake
cd build-nmake
cmake -G "NMake Makefiles" -D CMAKE_BUILD_TYPE=Release -D FLTK_MSVC_RUNTIME_DLL=off ..
nmake
..which results in a colorful percentage output crawl similar to what
we see with unix 'make'.
-erco@seriss.com
Updated: Dec 8 2023
2.5 Building under Windows with MinGW using Makefiles
--------------------------------------------------------

View File

@ -791,7 +791,7 @@ HTML_HEADER =
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER = @CMAKE_CURRENT_SOURCE_DIR@/src/html_footer
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to

View File

@ -1,24 +0,0 @@
<!--BEGIN GENERATE_TREEVIEW-->
<li class="footer">
<!-- Generated for $projectname by Doxygen -->
Copyright &copy; 1998-2023 by Bill Spitzak and others. &nbsp;&nbsp;&nbsp;
<a href="https://www.fltk.org"><img src="tiny.png" align="bottom" alt="FLTK"></a>
</li>
</ul>
</div>
<!--END GENERATE_TREEVIEW-->
<!--BEGIN !GENERATE_TREEVIEW-->
<hr class="footer"/><address class="footer"><small>
<!-- Generated for $projectname by Doxygen -->
Copyright &copy; 1998-2023 by Bill Spitzak and others. &nbsp;&nbsp;&nbsp;
<a href="https://www.fltk.org"><img src="tiny.png" align="bottom" alt="FLTK"></a>
</small></address>
<hr class="footer"/><address class="footer"><small>
<div align="center">
Permission is granted to reproduce this manual or any portion for any purpose,
provided this copyright and permission notice are preserved.
</div>
</small></address>
<!--END !GENERATE_TREEVIEW-->
</body>
</html>