summaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
authormaxim nikonov <maxim.nikonov@hqo.co>2026-02-05 15:21:34 +0500
committermaxim nikonov <maxim.nikonov@hqo.co>2026-02-05 15:21:34 +0500
commitdb214d1145e46d527a46d1fc2519548d2c4d23f1 (patch)
treecf0fd9922e4d54f6beb63888f9b28c8e2a787bdf /CMake
parent75fc94d6c71fe686f6dde5b41ad91cba2f6bdd6f (diff)
wip: fork
Diffstat (limited to 'CMake')
-rw-r--r--CMake/FLTK-Functions.cmake85
-rw-r--r--CMake/FLTKConfig.cmake.in144
-rw-r--r--CMake/MacOSXBundleInfo.plist.in36
-rw-r--r--CMake/cmake_uninstall.cmake.in57
-rw-r--r--CMake/compatibility.cmake70
-rw-r--r--CMake/export.cmake150
-rw-r--r--CMake/fl_add_library.cmake257
-rw-r--r--CMake/fl_create_example.cmake173
-rw-r--r--CMake/fl_debug_pkg.cmake69
-rw-r--r--CMake/fl_debug_var.cmake144
-rw-r--r--CMake/fl_summary.cmake89
-rw-r--r--CMake/gen_config.cmake109
-rw-r--r--CMake/install-symlinks.cmake.in33
-rw-r--r--CMake/install.cmake156
-rw-r--r--CMake/macOS-bundle-wrapper.in25
-rw-r--r--CMake/macOSMaxAllowed.c6
-rw-r--r--CMake/options.cmake1098
-rw-r--r--CMake/pen-support.c41
-rw-r--r--CMake/posixScandir.cxx11
-rw-r--r--CMake/pthread_mutex_recursive.c7
-rw-r--r--CMake/resources.cmake344
-rw-r--r--CMake/setup.cmake209
-rw-r--r--CMake/variables.cmake177
23 files changed, 0 insertions, 3490 deletions
diff --git a/CMake/FLTK-Functions.cmake b/CMake/FLTK-Functions.cmake
deleted file mode 100644
index a8d339fac..000000000
--- a/CMake/FLTK-Functions.cmake
+++ /dev/null
@@ -1,85 +0,0 @@
-#
-# FLTK-Functions.cmake
-# Originally written by Michael Surette
-#
-# Copyright 1998-2024 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
-#
-
-################################################################################
-# functions used by the build system and exported for the end-user
-################################################################################
-
-################################################################################
-#
-# fltk_run_fluid: Run fluid to compile fluid (.fl) files
-#
-# Usage: fltk_run_fluid(SOURCES "FLUID_SOURCE [.. FLUID_SOURCE]")
-#
-# Input: The CMake variable "FL_FILES" must contain a list of input
-# file names. Only names ending in ".fl" are considered and
-# compiled to their ".cxx" and ".h" files which are stored
-# in the current build directory.
-#
-# Output: "SOURCES" is used as a CMake variable name that is assigned the
-# names of the compiled ".cxx" files as a ";" separated list in the
-# parent scope (the caller's scope).
-#
-################################################################################
-
-function(fltk_run_fluid SOURCES FL_FILES)
-
- if(NOT FLTK_FLUID_EXECUTABLE)
- message(WARNING "Not building ${FL_FILES}. FLUID executable not found.")
- return()
- endif()
-
- set(CXX_FILES)
- foreach(src ${FL_FILES})
- if("${src}" MATCHES "\\.fl$")
- string(REGEX REPLACE "(.*).fl" \\1 basename ${src})
- add_custom_command(
- OUTPUT "${basename}.cxx" "${basename}.h"
- COMMAND ${FLTK_FLUID_EXECUTABLE} -c ${CMAKE_CURRENT_SOURCE_DIR}/${src}
- DEPENDS ${src}
- MAIN_DEPENDENCY ${src}
- )
- list(APPEND CXX_FILES "${basename}.cxx")
- endif()
- endforeach()
- set(${SOURCES} ${CXX_FILES} PARENT_SCOPE)
-
-endfunction(fltk_run_fluid SOURCES FL_FILES)
-
-
-################################################################################
-#
-# fltk_set_bundle_icon: Set the bundle icon for macOS bundles
-#
-# This function sets macOS specific target properties. These properties are
-# ignored on other platforms.
-#
-# Usage: fltk_set_bundle_icon(TARGET ICON_PATH)
-#
-# TARGET must be a valid CMake target that has been created before this
-# function is called. It must not be an alias name.
-#
-################################################################################
-
-function(fltk_set_bundle_icon TARGET ICON_PATH)
- get_filename_component(ICON_NAME "${ICON_PATH}" NAME)
- set_target_properties(${TARGET}
- PROPERTIES
- MACOSX_BUNDLE_ICON_FILE "${ICON_NAME}"
- RESOURCE "${ICON_PATH}"
- )
-endfunction(fltk_set_bundle_icon TARGET ICON_PATH)
diff --git a/CMake/FLTKConfig.cmake.in b/CMake/FLTKConfig.cmake.in
deleted file mode 100644
index b183bc80f..000000000
--- a/CMake/FLTKConfig.cmake.in
+++ /dev/null
@@ -1,144 +0,0 @@
-#
-# FLTKConfig.cmake - FLTK CMake configuration file for external projects.
-#
-# This file is generated by CMake and used to load FLTK's settings for
-# an external project, i.e. a project using FLTK.
-#
-# It defines the following variables:
-#
-# FLTK_VERSION - FLTK version string ("x.y.z")
-# FLTK_INCLUDE_DIRS - FLTK include directories
-# FLTK_LIBRARIES - list of built FLTK libraries
-# FLTK_FLUID_EXECUTABLE - needed by the function FLTK_RUN_FLUID
-# (or the deprecated fltk_wrap_ui() CMake command)
-#
-# It defines the following deprecated variables for backwards
-# compatibility (do not use for new projects):
-#
-# FLTK_INCLUDE_DIR - FLTK include directories (same as FLTK_INCLUDE_DIRS)
-#
-# Important note: FLTK's CMake build files are not yet complete and may be
-# changed in future versions. This includes the list of defined variables
-# above that may be changed if necessary.
-#
-# Note: FLTK 1.4.0 introduced "Modern CMake", therefore usage of most if not
-# all of the variables mentioned above is no longer needed in user projects.
-# Please use the CMake target names fltk::fltk, fltk::images, etc. instead.
-# Please see README.CMake.txt for more info on how to do this.
-#
-
-# Optional: Create backwards compatible aliases for libraries and fluid.
-# This is enabled in FLTK 1.4.0 to simplify migration of user projects
-# from "classic" (1.3.x) to "modern" CMake and will likely be removed
-# in a later FLTK version (maybe 1.4.x, x>2, or 1.5.0).
-
-set(FLTK_CREATE_COMPATIBILITY_ALIASES TRUE)
-
-set(FLTK_VERSION @FLTK_VERSION@)
-
-include(${CMAKE_CURRENT_LIST_DIR}/FLTK-Targets.cmake)
-
-set(FLTK_INCLUDE_DIRS "@INCLUDE_DIRS@")
-set(FLTK_LIBRARIES "@FLTK_LIBRARIES@")
-
-# For compatibility with CMake's FindFLTK.cmake:
-
-set(FLTK_INCLUDE_DIR "${FLTK_INCLUDE_DIRS}")
-
-if(CMAKE_CROSSCOMPILING)
-
- # Find a fluid executable on the build host to be able to build fluid programs
-
- find_program(FLTK_FLUID_HOST
- NAMES fluid fluid.exe
- PATHS ENV PATH
- NO_DEFAULT_PATH
- NO_CMAKE_FIND_ROOT_PATH
- )
-
- if(FLTK_FLUID_HOST)
-
- if(0) # Experimental: currently not used
- # Import a special 'fluid' target called 'fluid-host' (fltk::fluid-host)
- # Note: this is "the same as" the CMake variable FLTK_FLUID_EXECUTABLE
- add_executable(fluid-host IMPORTED)
- set_target_properties(fluid-host
- PROPERTIES IMPORTED_LOCATION ${FLTK_FLUID_HOST}
- )
- add_executable(fltk::fluid-host ALIAS fluid-host)
- set(FLTK_FLUID_EXECUTABLE fltk::fluid-host)
-
- else()
-
- set(FLTK_FLUID_EXECUTABLE "${FLTK_FLUID_HOST}")
-
- endif()
-
- else() # fluid not found on build host
-
- message(STATUS "FLTKConfig.cmake (cross-compiling): fluid not found on the build host")
- # note: this assigns "FLTK_FLUID_HOST-NOTFOUND" and running fluid will fail
- set(FLTK_FLUID_EXECUTABLE "${FLTK_FLUID_HOST}")
-
- endif()
-
-else(CMAKE_CROSSCOMPILING)
-
- if(FLTK_CREATE_COMPATIBILITY_ALIASES)
-
- function(_fltk_make_alias target from)
- if(TARGET ${from} AND NOT TARGET ${target})
- # message(STATUS "FLTKConfig.cmake - create alias: ${target} from ${from}")
-
- # promote imported target to global visibility (CMake < 3.18 only)
- if(CMAKE_VERSION VERSION_LESS "3.18")
- set_target_properties(${from} PROPERTIES IMPORTED_GLOBAL TRUE)
- endif()
-
- get_target_property(ttype ${from} TYPE)
- if(ttype STREQUAL "EXECUTABLE")
- add_executable(${target} ALIAS ${from})
- else()
- add_library(${target} ALIAS ${from})
- endif()
- endif()
- endfunction(_fltk_make_alias target)
-
- if(NOT TARGET fltk::fltk)
- message(FATAL "FLTKConfig.cmake: target fltk::fltk does not exist!")
- endif()
-
- _fltk_make_alias(fltk fltk::fltk)
- _fltk_make_alias(fltk-shared fltk::fltk-shared)
-
- _fltk_make_alias(fluid fltk::fluid)
- _fltk_make_alias(fluid-cmd fltk::fluid-cmd)
-
- _fltk_make_alias(fltk-options fltk::options)
- _fltk_make_alias(fltk-options-cmd fltk::options-cmd)
-
- foreach(target forms gl images jpeg png z)
- _fltk_make_alias(fltk_${target} fltk::${target})
- _fltk_make_alias(fltk_${target}-shared fltk::${target}-shared)
- endforeach()
-
- endif() # Create aliases ...
-
- # set FLTK_FLUID_EXECUTABLE: try to use the fltk::target name if it
- # exists and fall back to 'fluid-cmd' or 'fluid' if not. This will
- # eventually call the build host's fluid if found in the users's PATH
-
- if(TARGET fltk::fluid-cmd) # Windows only
- set(FLTK_FLUID_EXECUTABLE fltk::fluid-cmd)
- elseif(TARGET fltk::fluid)
- set(FLTK_FLUID_EXECUTABLE fltk::fluid)
- elseif(WIN32)
- set(FLTK_FLUID_EXECUTABLE fluid-cmd)
- else()
- set(FLTK_FLUID_EXECUTABLE fluid)
- endif()
-
-endif(CMAKE_CROSSCOMPILING)
-
-# Debug: should be commented out
-# message(STATUS "FLTKConfig.cmake: FLTK_FLUID_EXECUTABLE = '${FLTK_FLUID_EXECUTABLE}'")
diff --git a/CMake/MacOSXBundleInfo.plist.in b/CMake/MacOSXBundleInfo.plist.in
deleted file mode 100644
index c5b643d6e..000000000
--- a/CMake/MacOSXBundleInfo.plist.in
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>${MACOSX_BUNDLE_INFO_STRING}</string>
- <key>CFBundleIconFile</key>
- <string>${MACOSX_BUNDLE_ICON_FILE}</string>
- <key>CFBundleIdentifier</key>
- <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleLongVersionString</key>
- <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
- <key>CFBundleName</key>
- <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
- <key>CSResourcesFileMapped</key>
- <true/>
- <key>NSHumanReadableCopyright</key>
- <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
- <key>NSHighResolutionCapable</key>
- <true/>
-</dict>
-</plist>
diff --git a/CMake/cmake_uninstall.cmake.in b/CMake/cmake_uninstall.cmake.in
deleted file mode 100644
index efd90e47f..000000000
--- a/CMake/cmake_uninstall.cmake.in
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# Support file to uninstall the FLTK project using CMake
-#
-# Originally written by Michael Surette
-#
-# Copyright 1998-2024 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
-#
-
-if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
- message(FATAL_ERROR
- "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
-endif()
-
-file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
-string(REGEX REPLACE "\n" ";" files "${files}")
-
-# Note 1: 'cmake -E remove [-f]' is deprecated since CMake 3.17 and the docs
-# state: "The implementation was buggy and always returned 0. It cannot be
-# fixed without breaking backwards compatibility. Use rm instead."
-# Note 2: 'cmake -E rm [-f]' has been added in CMake 3.17
-# Note 3:
-# Remove this distinction if: cmake_minimum_required(VERSION 3.17) or higher.
-
-if(CMAKE_VERSION VERSION_LESS 3.17)
- set(rm_cmd remove)
-else()
- set(rm_cmd rm)
-endif()
-
-foreach(file ${files})
- message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
- execute_process(
- COMMAND "${CMAKE_COMMAND}" -E ${rm_cmd} -f "$ENV{DESTDIR}${file}"
- OUTPUT_VARIABLE rm_out
- ERROR_VARIABLE rm_err
- RESULT_VARIABLE rm_retval
- )
-
- if(NOT "${rm_retval}" STREQUAL 0)
- message(STATUS "Error removing \"$ENV{DESTDIR}${file}\"")
- message(STATUS " Status = '${rm_retval}'")
- message(STATUS " Output = '${rm_out}'")
- message(STATUS " Error = '${rm_err}'")
- message(FATAL_ERROR "Exiting - uninstall may be incomplete.")
- endif()
-
-endforeach(file)
diff --git a/CMake/compatibility.cmake b/CMake/compatibility.cmake
deleted file mode 100644
index ba48d80e9..000000000
--- a/CMake/compatibility.cmake
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# CMake compatibility functions and macros for the Fast Light Tool Kit (FLTK)
-#
-# 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
-# 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
-#
-
-################################################################################
-#
-# The functions and maybe macros in this file are defined to simplify CMake
-# code that uses features not available in all supported CMake versions.
-# Functions should be preferred (rather than macros) because functions
-# have their own variable scope.
-#
-# The function must apply a workaround for older versions or not add code
-# at all if there is no suitable workaround.
-#
-# The functions included here may be removed (with according changes of the
-# calling code) or the workaround code may be removed from the implementation
-# after cmake_minimum_required() has been raised to a version number greater
-# than or equal to the required version.
-#
-# Current cmake_minimum_required() version: see <fltk-root>/CMakeLists.txt
-#
-################################################################################
-
-
-# Right now we don't need compatibility functions
-# This file is currently "empty" but left for documentation purposes
-# An example function documentation follows...
-
-
-################################################################################
-#
-# function fl_target_link_directories - add link directories to target
-#
-# Requires CMake version: 3.13
-# https://cmake.org/cmake/help/latest/command/target_link_directories.html
-#
-# Input:
-#
-# - TARGET: target to add link directories to, e.g. fluid
-#
-# - SCOPE: one of <INTERFACE|PUBLIC|PRIVATE> (see CMake docs)
-#
-# - DIRS: quoted list of link directories (separated by ';')
-#
-# The 'DIRS' argument takes a standard CMake list of directories, i.e. the
-# individual members must be separated by ';'. The list may be empty ("").
-# If more than one directory is to be added or if the list of directories
-# can be empty it *must* be quoted. This function may be called more than
-# once. Each invocation adds zero, one, or more directories.
-#
-# Example:
-#
-# fl_target_link_directories(fluid PRIVATE "${PKG_CAIRO_LIBRARY_DIRS}")
-#
-# In this example 'PKG_CAIRO_LIBRARY_DIRS' is platform dependent and
-# can be an empty list.
-#
-################################################################################
diff --git a/CMake/export.cmake b/CMake/export.cmake
deleted file mode 100644
index 407b24933..000000000
--- a/CMake/export.cmake
+++ /dev/null
@@ -1,150 +0,0 @@
-#
-# Export CMake file to build the FLTK project using CMake
-#
-# Originally written by Michael Surette
-#
-# 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
-#
-
-#######################################################################
-# final config and export
-#######################################################################
-
-# Set the fluid executable path used to create .cxx/.h from .fl files
-
-if(FLTK_BUILD_FLUID AND NOT CMAKE_CROSSCOMPILING)
- # Use the fluid executable we build using its namespaced target name
- if(WIN32)
- set(FLTK_FLUID_EXECUTABLE fltk::fluid-cmd)
- set(FLUID_EXPORT fluid fluid-cmd) # export fluid and fluid-cmd
- else()
- set(FLTK_FLUID_EXECUTABLE fltk::fluid)
- set(FLUID_EXPORT fluid) # export fluid
- endif()
-else()
- # We don't build fluid /or/ we are cross-compiling (or both):
- # we need to find a fluid executable on the build host.
- # The search is restricted to the user's PATH (environment).
- find_program(FLTK_FLUID_HOST
- NAMES fluid fluid.exe
- PATHS ENV PATH
- NO_DEFAULT_PATH
- NO_CMAKE_FIND_ROOT_PATH
- )
- if(NOT FLTK_FLUID_HOST)
- message(STATUS "Warning: fluid not found on the build system!")
- endif()
- # Note: this *may* assign "FLTK_FLUID_HOST-NOTFOUND"
- set(FLTK_FLUID_EXECUTABLE "${FLTK_FLUID_HOST}")
- set(FLUID_EXPORT "") # don't export fluid
-endif(FLTK_BUILD_FLUID AND NOT CMAKE_CROSSCOMPILING)
-
-if(0) # Debug
- message(STATUS "##############################################################")
- message(STATUS "[export.cmake] INFO: Did we find fluid?")
- fl_debug_var(FLTK_FLUID_HOST)
- fl_debug_var(FLTK_FLUID_EXECUTABLE)
- fl_debug_var(FLTK_BUILD_FLUID)
- fl_debug_var(CMAKE_CROSSCOMPILING)
- message(STATUS "##############################################################")
-endif()
-
-# set fltk-options export names (built or not, Windows)
-if(FLTK_BUILD_FLTK_OPTIONS)
- set(FLTK_OPTIONS_EXPORT fltk-options)
- if(WIN32)
- list(APPEND FLTK_OPTIONS_EXPORT fltk-options-cmd)
- endif()
-else()
- set(FLTK_OPTIONS_EXPORT)
-endif()
-
-# generate FLTK-Targets.cmake for build directory use
-set(export_targets
- ${FLTK_LIBRARIES}
- ${FLTK_LIBRARIES_SHARED}
- ${FLUID_EXPORT}
- ${FLTK_OPTIONS_EXPORT}
-)
-export(TARGETS
- ${export_targets}
- FILE
- ${CMAKE_CURRENT_BINARY_DIR}/FLTK-Targets.cmake
- NAMESPACE
- fltk::)
-
-# generate FLTK-Functions.cmake for build directory use
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/CMake/FLTK-Functions.cmake
- ${CMAKE_CURRENT_BINARY_DIR}/FLTK-Functions.cmake
- COPYONLY
-)
-
-# generate FLTKConfig.cmake for build directory use
-set(INCLUDE_DIRS "${FLTK_INCLUDE_DIRS}")
-if(FLTK_HAVE_CAIRO OR FLTK_USE_CAIRO)
- list(APPEND INCLUDE_DIRS ${PKG_CAIRO_INCLUDE_DIRS})
-endif()
-list(REMOVE_DUPLICATES INCLUDE_DIRS)
-set(CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR})
-
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/CMake/FLTKConfig.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/FLTKConfig.cmake
- @ONLY
-)
-
-# generate fltk-config for build directory use
-set(prefix ${CMAKE_CURRENT_BINARY_DIR})
-set(exec_prefix "\${prefix}")
-set(includedir "${CMAKE_CURRENT_SOURCE_DIR}")
-set(BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
-set(libdir "\${exec_prefix}/lib")
-set(srcdir ".")
-
-set(LIBNAME "${libdir}/libfltk.a")
-
-configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/fltk-config.in"
- "${CMAKE_CURRENT_BINARY_DIR}/fltk-config"
- @ONLY
-)
-
-# Set execute permissions on fltk-config in the build directory.
-# Note: file(CHMOD) is available since CMake 3.19,
-# use fallback before CMake 3.19
-
-if(CMAKE_VERSION VERSION_LESS 3.19)
- if(UNIX OR MSYS OR MINGW)
- execute_process(COMMAND chmod 755 fltk-config
- WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
- endif()
-else(CMAKE_VERSION VERSION_LESS 3.19)
- file(CHMOD "${CMAKE_CURRENT_BINARY_DIR}/fltk-config"
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE)
-endif(CMAKE_VERSION VERSION_LESS 3.19)
-
-if(FLTK_INSTALL_LINKS)
- # Set PREFIX_INCLUDE to the proper value.
- if(IS_ABSOLUTE ${FLTK_INCLUDEDIR})
- set(PREFIX_INCLUDE ${FLTK_INCLUDEDIR})
- else()
- set(PREFIX_INCLUDE "${CMAKE_INSTALL_PREFIX}/${FLTK_INCLUDEDIR}")
- endif(IS_ABSOLUTE ${FLTK_INCLUDEDIR})
- configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/CMake/install-symlinks.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/install-symlinks.cmake"
- @ONLY)
-endif(FLTK_INSTALL_LINKS)
diff --git a/CMake/fl_add_library.cmake b/CMake/fl_add_library.cmake
deleted file mode 100644
index 8806de191..000000000
--- a/CMake/fl_add_library.cmake
+++ /dev/null
@@ -1,257 +0,0 @@
-#
-# Macro used by the CMake build system for the Fast Light Tool Kit (FLTK).
-# Originally written by Michael Surette
-#
-# 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
-#
-
-#######################################################################
-# fl_add_library - add a static or shared library to the build
-#======================================================================
-#
-# Input:
-#
-# LIBNAME: name of the library, including 'fltk_' prefix if applicable.
-#
-# LIBTYPE: either "STATIC" or "SHARED"
-#
-# SOURCES: Files needed to build the library
-#
-# Output:
-#
-# FLTK_LIBRARIES or FLTK_LIBRARIES_SHARED (in parent scope)
-#
-# This function adds the given library to the build, adds it to
-# either FLTK_LIBRARIES or FLTK_LIBRARIES_SHARED, respectively,
-# and "exports" the modified variable to the parent scope.
-#
-# For each library an alias is defined (see comment below).
-#
-#######################################################################
-
-function(fl_add_library LIBNAME LIBTYPE SOURCES)
-
- # message(STATUS "Building library **************** ${LIBNAME} ${LIBTYPE}")
-
- set(suffix "")
- if(LIBTYPE STREQUAL "SHARED")
- set(suffix "-shared")
- endif()
-
- set(TARGET_NAME ${LIBNAME}${suffix})
-
- ## Strip 'fltk_' from target name (if it exists in the name)
- ## and use the result as EXPORT_NAME property. This makes it
- ## easy to export library targets fltk::fltk and fltk::images
- ## rather than fltk::fltk_images.
-
- string(REPLACE "fltk_" "" EXPORT_NAME ${TARGET_NAME})
-
- if(MSVC)
- set(OUTPUT_NAME_DEBUG "${LIBNAME}d")
- else()
- set(OUTPUT_NAME_DEBUG "${LIBNAME}")
- endif(MSVC)
-
- set(OUTPUT_NAME_RELEASE "${LIBNAME}")
-
- add_library(${TARGET_NAME} ${LIBTYPE} ${SOURCES})
-
- # Create an alias 'fltk::alias_name' for the library
- # where 'alias_name' is the library name without the prefix 'fltk_'
- #
- # e.g. 'fltk' -> 'fltk::fltk'
- # and 'fltk-shared' -> 'fltk::fltk-shared'
- # but 'fltk_images' -> 'fltk::images'
- # and 'fltk_images-shared' -> 'fltk::images-shared'
-
- if(NOT (LIBNAME STREQUAL "fltk"))
- string(REPLACE "fltk_" "" alias_name ${LIBNAME})
- else()
- set(alias_name ${LIBNAME})
- endif()
- set(alias_name "fltk::${alias_name}${suffix}")
-
- add_library(${alias_name} ALIAS ${TARGET_NAME})
-
- if(0)
- fl_debug_var(TARGET_NAME)
- fl_debug_var(LIBTYPE)
- fl_debug_var(alias_name)
- # fl_debug_var(SOURCES)
- endif()
-
- # Target properties for all libraries
-
- # Set 'PRIVATE' target compile definitions for the library
- # so they are not inherited by consumers
-
- target_compile_definitions(${TARGET_NAME} PRIVATE "FL_LIBRARY")
-
- # Set PUBLIC properties, e.g. C++ standard and include and linker directories.
- # These properties are inherited by consumers of the libraries
-
- target_compile_features(${TARGET_NAME} PUBLIC "cxx_std_${CMAKE_CXX_STANDARD}")
-
- if(0) # DEBUG
- message(STATUS "fl_add_library and alias : fltk::${alias_name} ALIAS ${TARGET_NAME}")
- fl_debug_var(TARGET_NAME)
- fl_debug_var(FLTK_INCLUDE_DIRS)
- fl_debug_var(CMAKE_CURRENT_BINARY_DIR)
- fl_debug_var(CMAKE_CURRENT_SOURCE_DIR)
- fl_debug_var(FLTK_BUILD_INCLUDE_DIRECTORIES)
- endif()
-
- # Special handling for the core 'fltk' library,
- # no matter if it's SHARED or STATIC
- # FIXME: maybe this should be in src/CMakeLists.txt (?)
-
- if(LIBNAME STREQUAL "fltk")
-
- target_include_directories(${TARGET_NAME} PUBLIC
- $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
- $<INSTALL_INTERFACE:include>
- )
-
- ### FIXME: why does the simplified else() block not work?
- ### Needs investigation, using 'if(1)' for now...
-
- if(1)
-
- foreach(dir ${FLTK_BUILD_INCLUDE_DIRECTORIES})
- target_include_directories(${TARGET_NAME} PRIVATE
- $<BUILD_INTERFACE:${dir}>
- )
- endforeach()
-
- else()
-
- ### This generates a wrong string in property INTERFACE_INCLUDE_DIRECTORIES:
- ### ... $<INSTALL_INTERFACE:include>;/git/fltk/modern-cmake/src/$<BUILD_INTERFACE:/usr/include/freetype2; ...
- ### ... --- OK ---------------------^^^^^^^ WRONG ^^^^^^^^^^^^^^-------- would be OK -------------------- ...
- ### End of string: ';/usr/include/libpng16' (WRONG: missing '>')
- ### I don't see anything wrong with this statement though but
- ### maybe I'm missing something. Albrecht, Jan 22 2024
-
- target_include_directories(${TARGET_NAME} PRIVATE
- $<BUILD_INTERFACE:${FLTK_BUILD_INCLUDE_DIRECTORIES}>
- )
-
- endif()
-
- target_link_directories(${TARGET_NAME} PUBLIC
- $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../lib>
- $<INSTALL_INTERFACE:lib>
- )
-
- if(APPLE AND NOT FLTK_BACKEND_X11)
- foreach(item ${FLTK_COCOA_FRAMEWORKS})
- target_link_libraries(${TARGET_NAME} PUBLIC "${item}")
- endforeach()
- endif()
-
- # we must link fltk with cairo if Cairo or Wayland is enabled (or both)
- if(FLTK_HAVE_CAIRO OR FLTK_USE_CAIRO)
- target_include_directories(${TARGET_NAME} PUBLIC ${PKG_CAIRO_INCLUDE_DIRS})
- target_link_directories (${TARGET_NAME} PUBLIC ${PKG_CAIRO_LIBRARY_DIRS})
- target_link_libraries (${TARGET_NAME} PUBLIC ${PKG_CAIRO_LIBRARIES})
- endif()
-
- endif(LIBNAME STREQUAL "fltk")
-
- # Set additional target properties for static libraries
-
- if(LIBTYPE STREQUAL "STATIC")
- set_target_properties(${TARGET_NAME}
- PROPERTIES
- OUTPUT_NAME ${LIBNAME}
- OUTPUT_NAME_DEBUG ${OUTPUT_NAME_DEBUG}
- OUTPUT_NAME_RELEASE ${OUTPUT_NAME_RELEASE}
- EXPORT_NAME ${EXPORT_NAME}
- )
- endif(LIBTYPE STREQUAL "STATIC")
-
- # Set additional target properties for shared (dynamic) libraries (DLL's)
-
- if(LIBTYPE STREQUAL "SHARED")
- set_target_properties(${TARGET_NAME} PROPERTIES
- VERSION ${FLTK_VERSION}
- SOVERSION ${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR}
- OUTPUT_NAME ${LIBNAME}
- OUTPUT_NAME_DEBUG ${OUTPUT_NAME_DEBUG}
- OUTPUT_NAME_RELEASE ${OUTPUT_NAME_RELEASE}
- EXPORT_NAME ${EXPORT_NAME}
- )
- # Visual Studio only:
- if(MSVC)
- set_target_properties(${TARGET_NAME} PROPERTIES
- OUTPUT_NAME ${LIBNAME}_dll
- OUTPUT_NAME_DEBUG ${LIBNAME}_dlld
- OUTPUT_NAME_RELEASE ${LIBNAME}_dll
- )
- target_compile_definitions(${TARGET_NAME} PUBLIC FL_DLL)
- endif(MSVC)
- endif(LIBTYPE STREQUAL "SHARED")
-
- # Debug library output names (optional)
- set(DEBUG_ONAME 0)
-
- if(DEBUG_ONAME)
- get_target_property(XX_NAME ${TARGET_NAME} NAME)
- get_target_property(XX_ONAME ${TARGET_NAME} OUTPUT_NAME)
- get_target_property(XX_ONAME_DEBUG ${TARGET_NAME} OUTPUT_NAME_DEBUG)
- get_target_property(XX_ONAME_RELEASE ${TARGET_NAME} OUTPUT_NAME_RELEASE)
- get_target_property(XX_EXPORT_NAME ${TARGET_NAME} EXPORT_NAME)
-
- message(STATUS "--- DEBUG_ONAME ---")
- fl_debug_var(TARGET_NAME)
- fl_debug_var(XX_NAME)
- fl_debug_var(XX_ONAME)
- fl_debug_var(XX_ONAME_DEBUG)
- fl_debug_var(XX_ONAME_RELEASE)
- fl_debug_var(XX_EXPORT_NAME)
- message(STATUS "--- /DEBUG_ONAME ---")
- endif(DEBUG_ONAME)
-
- if(MSVC)
- if(FLTK_OPTION_LARGE_FILE)
- set_target_properties(${TARGET_NAME} PROPERTIES
- LINK_FLAGS /LARGEADDRESSAWARE
- )
- endif(FLTK_OPTION_LARGE_FILE)
- endif(MSVC)
-
- install(TARGETS ${TARGET_NAME} EXPORT FLTK-Targets
- RUNTIME DESTINATION ${FLTK_BINDIR}
- LIBRARY DESTINATION ${FLTK_LIBDIR}
- ARCHIVE DESTINATION ${FLTK_LIBDIR}
- )
-
- if(LIBTYPE STREQUAL "SHARED")
- list(APPEND FLTK_LIBRARIES_SHARED "${TARGET_NAME}")
- set(FLTK_LIBRARIES_SHARED "${FLTK_LIBRARIES_SHARED}" PARENT_SCOPE)
- else()
- list(APPEND FLTK_LIBRARIES "${TARGET_NAME}")
- set(FLTK_LIBRARIES "${FLTK_LIBRARIES}" PARENT_SCOPE)
- endif()
-
- if(0)
- fl_debug_var(fl_add_library_DEBUG)
- fl_debug_var(FLTK_LIBRARIES)
- fl_debug_var(FLTK_LIBRARIES_SHARED)
- fl_debug_var(fl_add_library_END)
- message("")
- endif()
-
-endfunction(fl_add_library LIBNAME LIBTYPE SOURCES)
diff --git a/CMake/fl_create_example.cmake b/CMake/fl_create_example.cmake
deleted file mode 100644
index 571e33b43..000000000
--- a/CMake/fl_create_example.cmake
+++ /dev/null
@@ -1,173 +0,0 @@
-#
-# A function used by the CMake build system for the Fast Light Tool Kit (FLTK).
-# Originally written by Michael Surette
-#
-# 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
-#
-
-################################################################################
-#
-# function fl_create_example - Create a test/demo (example) program
-#
-# Input:
-#
-# - NAME: program name, e.g. 'hello'
-#
-# - SOURCES: list of source files, separated by ';' (needs quotes)
-# Sources can be:
-# - .c/.cxx files, e.g. 'hello.cxx'
-# - .fl (fluid) files, e.g. 'radio.fl'
-# - .plist file(macOS), e.g. 'editor.plist'
-# - .icns file(macOS Icon), e.g. 'checkers.icns'
-# - .rc file(Windows resource file, e.g. icon definition)
-#
-# Order of sources doesn't matter, multiple .cxx and .fl files are
-# supported, but only one .plist and one .icns file.
-#
-# File name (type), e.g. '.icns' matters, it is parsed internally:
-# File types .fl, .plist, and .icns are treated specifically,
-# 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 reside in the subdirectory 'mac-resources'.
-#
-# - LIBRARIES:
-# List of libraries (CMake target names), separated by ';'. Must be
-# quoted if more than one library is required, e.g. "fltk::gl;fltk::images"
-#
-################################################################################
-
-function(fl_create_example NAME SOURCES LIBRARIES)
-
- set(srcs) # source files
- set(flsrcs) # fluid source (.fl) files
- set(TARGET_NAME ${NAME}) # CMake target name
- set(ICON_NAME) # macOS icon (max. one)
- set(PLIST) # macOS .plist file(max. one)
- set(ICON_PATH) # macOS icon resource path
-
- # create macOS bundle? 0 = no, 1 = yes
-
- if(APPLE AND NOT FLTK_BACKEND_X11)
- set(MAC_BUNDLE 1)
- else()
- set(MAC_BUNDLE 0)
- endif()
-
- # filter input files for different handling (fluid, icon, plist, source)
-
- foreach(src ${SOURCES})
- if("${src}" MATCHES "\\.fl$")
- list(APPEND flsrcs ${src})
- elseif("${src}" MATCHES "\\.icns$")
- set(ICON_NAME "${src}")
- elseif("${src}" MATCHES "\\.plist$")
- set(PLIST "${src}")
- else()
- list(APPEND srcs ${src})
- endif("${src}" MATCHES "\\.fl$")
- endforeach(src)
-
- # generate source files from .fl files, add output to sources
-
- if(flsrcs)
- if(NOT FLTK_FLUID_EXECUTABLE)
- message(STATUS "Example app \"${NAME}\" will not be built. FLUID executable not found.")
- return ()
- endif()
- FLTK_RUN_FLUID (FLUID_SOURCES "${flsrcs}")
- list(APPEND srcs ${FLUID_SOURCES})
- unset(FLUID_SOURCES)
- endif(flsrcs)
-
- # set macOS (icon) resource path if applicable
-
- if(MAC_BUNDLE AND ICON_NAME)
- set(ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/mac-resources/${ICON_NAME}")
- endif(MAC_BUNDLE AND ICON_NAME)
-
- ##############################################################################
- # add executable target and set properties (all platforms)
- ##############################################################################
-
- if(MAC_BUNDLE)
- add_executable (${TARGET_NAME} MACOSX_BUNDLE ${srcs} ${ICON_PATH})
- else()
- add_executable (${TARGET_NAME} WIN32 ${srcs})
- endif(MAC_BUNDLE)
-
- set_target_properties (${TARGET_NAME} PROPERTIES OUTPUT_NAME ${NAME})
- target_link_libraries (${TARGET_NAME} PRIVATE ${LIBRARIES})
-
- # make sure we're "exporting" global symbols like 'fl_disable_wayland',
- # see also README.Wayland.txt and CMake policy CMP0065.
-
- set_target_properties (${TARGET_NAME} PROPERTIES ENABLE_EXPORTS TRUE)
-
-
- # Search the current binary directory for header files created by CMake
- # or fluid and the source folder for other headers included by test programs
-
- target_include_directories(${TARGET_NAME} PRIVATE
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}
- )
-
- if(MAC_BUNDLE)
- if(PLIST)
- set_target_properties(${TARGET_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST
- "${CMAKE_CURRENT_SOURCE_DIR}/mac-resources/${PLIST}")
- endif()
-
- string(REPLACE "_" "-" FLTK_BUNDLE_ID "org.fltk.${TARGET_NAME}")
- set_target_properties(${TARGET_NAME} PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "${TARGET_NAME}")
- set_target_properties(${TARGET_NAME} PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "${FLTK_BUNDLE_ID}")
- set_target_properties(${TARGET_NAME} PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${FLTK_BUNDLE_ID}")
-
- if(ICON_NAME)
- set_target_properties(${TARGET_NAME} PROPERTIES MACOSX_BUNDLE_ICON_FILE ${ICON_NAME})
- set_target_properties(${TARGET_NAME} PROPERTIES RESOURCE ${ICON_PATH})
- endif()
- endif()
-
- ##############################################################################
- # Copy macOS "bundle wrapper" (shell script) to target directory.
- # The "custom command" will be executed "POST_BUILD".
- ##############################################################################
-
- if(MAC_BUNDLE)
- set(WRAPPER "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/${TARGET_NAME}")
-
- add_custom_command(
- TARGET ${TARGET_NAME} POST_BUILD
- COMMAND cp ${FLTK_SOURCE_DIR}/CMake/macOS-bundle-wrapper.in ${WRAPPER}
- COMMAND chmod u+x,g+x,o+x ${WRAPPER}
- BYPRODUCTS ${WRAPPER}
- # COMMENT "Creating macOS bundle wrapper script ${WRAPPER}"
- VERBATIM
- )
- unset(WRAPPER)
- endif(MAC_BUNDLE)
-
- ##############################################################################
- # MSVC: Add fltk-shared (DLL) path to Environment 'PATH' for debugging
- ##############################################################################
-
- if(MSVC AND TARGET fltk-shared)
- set(DllDir "$<SHELL_PATH:$<TARGET_FILE_DIR:fltk-shared>>")
- set_target_properties(${TARGET_NAME} PROPERTIES
- VS_DEBUGGER_ENVIRONMENT "PATH=${DllDir};$ENV{PATH}"
- )
- endif()
-
-endfunction()
diff --git a/CMake/fl_debug_pkg.cmake b/CMake/fl_debug_pkg.cmake
deleted file mode 100644
index 4e4030102..000000000
--- a/CMake/fl_debug_pkg.cmake
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# Macro used by the CMake build system for the Fast Light Tool Kit (FLTK).
-#
-# Copyright 2022 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
-#
-
-#######################################################################
-# fl_debug_pkg - a macro to output pkgconfig debugging info
-#######################################################################
-#
-# This macro displays the name and value of some CMake variables
-# defined by pkg_check_modules().
-#
-# Syntax:
-#
-# fl_debug_pkg(PREFIX NAME)
-#
-# Example for package "cairo":
-#
-# pkg_check_modules (CAIRO cairo)
-# fl_debug_pkg(CAIRO cairo)
-#
-# The first command searches for pkg 'cairo' and stores the results
-# in CMake variables with prefix 'CAIRO_'.
-#
-# The second command displays all relevant variables if the package has
-# been found, otherwise only 'CAIRO_FOUND' (empty or false).
-#
-#######################################################################
-
-macro(fl_debug_pkg PREFIX NAME)
- message("")
- message(STATUS "Results of pkg_check_modules(${PREFIX}, ${NAME}):")
- fl_debug_var(${PREFIX}_FOUND)
- if(${PREFIX}_FOUND)
-
- fl_debug_var(${PREFIX}_INCLUDE_DIRS)
- fl_debug_var(${PREFIX}_CFLAGS)
- fl_debug_var(${PREFIX}_LIBRARIES)
- fl_debug_var(${PREFIX}_LINK_LIBRARIES)
- fl_debug_var(${PREFIX}_LIBRARY_DIRS)
- fl_debug_var(${PREFIX}_LDFLAGS)
- fl_debug_var(${PREFIX}_LDFLAGS_OTHER)
- fl_debug_var(${PREFIX}_CFLAGS_OTHER)
-
- fl_debug_var(${PREFIX}_STATIC_INCLUDE_DIRS)
- fl_debug_var(${PREFIX}_STATIC_CFLAGS)
- fl_debug_var(${PREFIX}_STATIC_LIBRARIES)
- fl_debug_var(${PREFIX}_STATIC_LINK_LIBRARIES)
- fl_debug_var(${PREFIX}_STATIC_LIBRARY_DIRS)
-
- fl_debug_var(${PREFIX}_VERSION)
- fl_debug_var(${PREFIX}_PREFIX)
- fl_debug_var(${PREFIX}_INCLUDEDIR)
- fl_debug_var(${PREFIX}_LIBDIR)
-
- endif()
- message("")
-endmacro(fl_debug_pkg)
diff --git a/CMake/fl_debug_var.cmake b/CMake/fl_debug_var.cmake
deleted file mode 100644
index d583d7d0c..000000000
--- a/CMake/fl_debug_var.cmake
+++ /dev/null
@@ -1,144 +0,0 @@
-#
-# Function used by the CMake build system for the Fast Light Tool Kit (FLTK).
-#
-# Copyright 1998-2024 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
-#
-
-#######################################################################
-# fl_expand_name - a function to expand a variable name with spaces
-#######################################################################
-#
-# This function returns a string comprising of the given name and
-# enough spaces to have at least the given minimal length (min_len).
-# Currently min_len must not be greater than 50.
-#
-# If the string is already at least min_len it is not changed,
-# otherwise the string is returned to the given variable (out)
-# in the parent scope.
-#
-# Syntax:
-# fl_expand_name (out in min_len)
-#
-# Example:
-# fl_expand_name (var WIN32 30)
-# fl_expand_name (var UNIX 40)
-#
-#######################################################################
-
-function(fl_expand_name out in min_len)
- string(LENGTH "${in}" len)
- if(len LESS min_len)
- set(spaces " ")
- set(temp "${in}")
- set(temp "${in}${spaces}${spaces}")
- string(SUBSTRING "${temp}" 0 ${min_len} temp)
- set(${out} "${temp}" PARENT_SCOPE)
- else()
- set(${out} "${in}" PARENT_SCOPE)
- endif()
-endfunction(fl_expand_name)
-
-#######################################################################
-# fl_debug_var - a function to output debugging info
-#######################################################################
-#
-# This function displays the name and value of a CMake variable.
-# The variable name is expanded with spaces to be (at least)
-# <min_len> (currently 30) characters wide for better readability.
-# VARNAME must be a string literal, e.g. WIN32 or "WIN32".
-#
-# Syntax:
-# fl_debug_var(VARNAME)
-#
-# Example:
-# fl_debug_var(WIN32)
-# fl_debug_var("UNIX")
-#
-#######################################################################
-
-function(fl_debug_var name)
- set(var "${name}")
- fl_expand_name(var "${name}" 40)
- message(STATUS "${var} = '${${name}}'")
-endfunction(fl_debug_var)
-
-
-#######################################################################
-# fl_debug_target - a function to output info about a target
-#######################################################################
-#
-# This function displays properties of a CMake target.
-#
-# Currently there's a fixed number of properties.
-#
-# Syntax:
-# fl_debug_target(target)
-#
-# Example:
-# fl_debug_target(fltk)
-# fl_debug_target(fluid)
-# fl_debug_target(fltk_image)
-# fl_debug_target(fltk::forms)
-#
-#######################################################################
-
-function(fl_debug_target name)
- message(STATUS "+++ fl_debug_target(${name})")
- set(var "${name}")
- fl_expand_name(var "${name}" 40)
-
- if(NOT TARGET ${name})
- message(STATUS "${var} = <not a target>")
- message(STATUS "")
- return()
- endif()
-
- get_target_property(_type ${name} TYPE)
- # message(STATUS "${var} = target, type = ${_type}")
-
- # these properties are always supported:
- set(_props NAME TYPE ALIASED_TARGET)
-
- # these properties can't be read from executable target types
- ### if(NOT _type STREQUAL "EXECUTABLE")
- ### list(APPEND _props
- ### LOCATION
- ### IMPORTED_LOCATION
- ### INTERFACE_LOCATION)
- ### endif()
-
- if(NOT _type STREQUAL "INTERFACE_LIBRARY" OR CMAKE_VERSION VERSION_GREATER_EQUAL "3.19")
- # Before 3.19: "INTERFACE_LIBRARY targets may only have whitelisted properties"
- list(APPEND _props
- INCLUDE_DIRECTORIES
- LINK_DIRECTORIES
- LINK_LIBRARIES
- COMPILE_DEFINITIONS)
- endif()
-
- list(APPEND _props
- INTERFACE_COMPILE_DEFINITIONS
- INTERFACE_INCLUDE_DIRECTORIES
- INTERFACE_LINK_DIRECTORIES
- INTERFACE_LINK_LIBRARIES)
-
- foreach(prop ${_props})
- get_target_property(${prop} ${name} ${prop})
- if(NOT ${prop})
- set(${prop} "")
- endif()
- fl_debug_var(${prop})
- endforeach()
- message(STATUS "")
-
-endfunction(fl_debug_target)
diff --git a/CMake/fl_summary.cmake b/CMake/fl_summary.cmake
deleted file mode 100644
index 2026e096e..000000000
--- a/CMake/fl_summary.cmake
+++ /dev/null
@@ -1,89 +0,0 @@
-#
-# Macros used by the CMake build system for the Fast Light Tool Kit (FLTK).
-#
-# Copyright 2024 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
-#
-
-########################################################################
-# The macros in this file are used to generate the CMake build summary.
-# Fixed widths of title fields are intentionally hard coded in two of
-# these macros so we can easily change the alignment.
-########################################################################
-
-include(${CMAKE_CURRENT_LIST_DIR}/fl_debug_var.cmake)
-
-########################################################################
-# Output a summary line like "<title> <value>"
-########################################################################
-# <title> will be expanded to a fixed width (can be empty)
-# <value> text to be displayed
-########################################################################
-
-macro(fl_summary title value)
- fl_expand_name(label "${title}" 30)
- message(STATUS "${label} ${value}")
-endmacro(fl_summary title value)
-
-########################################################################
-# Output a summary line like "<title> will be built ..."
-# or "<title> will not be built ..."
-########################################################################
-# title will be expanded to a fixed width (must not be empty)
-# subdir = relative build directory (e.g. lib or bin/test)
-# build = CMake variable name (bool): whether <title> is built
-# option = option name the user can set to build <title>
-########################################################################
-
-macro(fl_summary_build title subdir build option)
- if(${build})
- set(value "will be built in: ${CMAKE_CURRENT_BINARY_DIR}/${subdir}")
- else()
- set(value "will not be built (set ${option}=ON to build)")
- endif()
- fl_expand_name(label "${title}" 19)
- message(STATUS "${label} ${value}")
-endmacro(fl_summary_build title var subdir)
-
-########################################################################
-# Output a simple summary line like "<title> {Yes|No}"
-########################################################################
-# title will be expanded to a fixed width (must not be empty)
-# var = CMake variable name, must evaluate to true or false
-########################################################################
-
-macro(fl_summary_yn title var)
- if(${var})
- set(value "Yes")
- else()
- set(value "No")
- endif()
- fl_summary("${title}" ${value})
-endmacro(fl_summary_yn title var)
-
-########################################################################
-# Output summary line for image libs (bundled or system libs)
-########################################################################
-# title = "Image Libraries" or empty
-# name = displayed name = { JPEG | PNG | ZLIB }
-# lib = CMake library name (system library, if it was found)
-########################################################################
-
-macro(fl_summary_image title name lib)
- fl_expand_name(name4 "${name}" 8)
- if(FLTK_USE_BUNDLED_${name})
- set(value "${name4} = Bundled")
- else()
- set(value "${name4} = System: ${${lib}}")
- endif()
- fl_summary("${title}" "${value}")
-endmacro(fl_summary_image title name lib)
diff --git a/CMake/gen_config.cmake b/CMake/gen_config.cmake
deleted file mode 100644
index 719b804d2..000000000
--- a/CMake/gen_config.cmake
+++ /dev/null
@@ -1,109 +0,0 @@
-#
-# 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
-)
diff --git a/CMake/install-symlinks.cmake.in b/CMake/install-symlinks.cmake.in
deleted file mode 100644
index e1c7a9e86..000000000
--- a/CMake/install-symlinks.cmake.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Installation script to create symlinks for the FLTK project using CMake
-#
-# Copyright 1998-2021 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
-
-# On UNIX create backward compatibility symlinks
-if(NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/Fl)
- EXECUTE_PROCESS(
- COMMAND ln -s FL Fl
- WORKING_DIRECTORY $ENV{DESTDIR}@PREFIX_INCLUDE@
- )
-endif(NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/Fl)
-
-file(GLOB FLTK_HEADER_FILES $ENV{DESTDIR}@PREFIX_INCLUDE@/FL/*.H)
-foreach(file ${FLTK_HEADER_FILES})
- GET_FILENAME_COMPONENT(nameWE ${file} NAME_WE)
- if(NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/FL/${nameWE}.h)
- EXECUTE_PROCESS(
- COMMAND ln -s ${nameWE}.H ${nameWE}.h
- WORKING_DIRECTORY $ENV{DESTDIR}@PREFIX_INCLUDE@/FL
- )
- endif(NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/FL/${nameWE}.h)
-endforeach(file)
diff --git a/CMake/install.cmake b/CMake/install.cmake
deleted file mode 100644
index abd80c5c6..000000000
--- a/CMake/install.cmake
+++ /dev/null
@@ -1,156 +0,0 @@
-#
-# Installation support for building the FLTK project using CMake (www.cmake.org)
-# Originally written by Michael Surette
-#
-# 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
-#
-
-#######################################################################
-# installation
-#######################################################################
-
-# generate uninstall target
-configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmake_uninstall.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
- @ONLY
-)
-add_custom_target(uninstall
- "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
-)
-
-install(DIRECTORY
- ${CMAKE_CURRENT_SOURCE_DIR}/FL
- DESTINATION ${FLTK_INCLUDEDIR} USE_SOURCE_PERMISSIONS
- FILES_MATCHING
- PATTERN "*.[hH]"
- PATTERN "fl_config.h" EXCLUDE
-)
-
-install(DIRECTORY
- ${CMAKE_CURRENT_BINARY_DIR}/FL
- DESTINATION ${FLTK_INCLUDEDIR} USE_SOURCE_PERMISSIONS
- FILES_MATCHING
- PATTERN "*.[hH]"
-)
-
-if(FLTK_INSTALL_LINKS)
- install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/install-symlinks.cmake)
-endif(FLTK_INSTALL_LINKS)
-
-# generate FLTKConfig.cmake for installed directory use
-set(INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include)
-if(FLTK_HAVE_CAIRO)
- list(APPEND INCLUDE_DIRS ${PKG_CAIRO_INCLUDE_DIRS})
-endif()
-
-set(CONFIG_PATH ${CMAKE_INSTALL_PREFIX}/${FLTK_CONFIG_PATH})
-
-install(EXPORT FLTK-Targets
- DESTINATION ${FLTK_CONFIG_PATH}
- FILE FLTK-Targets.cmake
- NAMESPACE fltk::
-)
-
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/CMake/FLTKConfig.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/etc/FLTKConfig.cmake
- @ONLY
-)
-
-install(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/etc/FLTKConfig.cmake
- DESTINATION ${FLTK_CONFIG_PATH}
-)
-
-install(FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/CMake/FLTK-Functions.cmake
- DESTINATION ${FLTK_CONFIG_PATH}
-)
-
-# Generate fltk-config
-
-set(prefix ${CMAKE_INSTALL_PREFIX})
-set(exec_prefix "\${prefix}")
-set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
-set(BINARY_DIR)
-set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
-set(srcdir ".")
-
-set(LIBNAME "${libdir}/libfltk.a")
-
-configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/fltk-config.in"
- "${CMAKE_CURRENT_BINARY_DIR}/bin/fltk-config"
- @ONLY
-)
-
-# Install fltk-config
-# Note: no need to set execute perms, install(PROGRAMS) does this
-
-install(PROGRAMS
- ${CMAKE_CURRENT_BINARY_DIR}/bin/fltk-config
- DESTINATION ${FLTK_BINDIR}
-)
-
-# Install man pages of fluid and fltk-options
-
-macro(INSTALL_MAN FILE LEVEL)
- install(FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/documentation/src/${FILE}.man
- DESTINATION ${FLTK_MANDIR}/man${LEVEL}
- RENAME ${FILE}.${LEVEL}
- )
-endmacro(INSTALL_MAN FILE LEVEL)
-
-if(FLTK_BUILD_FLUID)
- INSTALL_MAN (fluid 1)
-endif(FLTK_BUILD_FLUID)
-if(FLTK_BUILD_FLTK_OPTIONS)
- INSTALL_MAN (fltk-options 1)
-endif(FLTK_BUILD_FLTK_OPTIONS)
-INSTALL_MAN (fltk-config 1)
-INSTALL_MAN (fltk 3)
-
-# Install the games
-
-if(FLTK_BUILD_TEST) # "OR FLTK_BUILD_GAMES" (not yet implemented)
-
- set(games_ blocks sudoku)
- if(FLTK_BUILD_FLUID)
- list(APPEND games_ checkers)
- endif(FLTK_BUILD_FLUID)
- if(FLTK_USE_GL)
- list(APPEND games_ glpuzzle)
- endif()
-
- foreach(game_ ${games_})
- if(FLTK_BUILD_SHARED_LIBS)
- set(tgt_ "${game_}-shared")
- set_target_properties(${tgt_} PROPERTIES RUNTIME_OUTPUT_NAME ${game_})
- else()
- set(tgt_ ${game_})
- endif()
- install(TARGETS ${tgt_}
- EXPORT FLTK-Targets
- RUNTIME DESTINATION ${FLTK_BINDIR}
- LIBRARY DESTINATION ${FLTK_LIBDIR}
- ARCHIVE DESTINATION ${FLTK_LIBDIR}
- BUNDLE DESTINATION ${FLTK_BINDIR} # macOS: bundles
- )
- # install man page
- INSTALL_MAN (${game_} 6)
- endforeach()
- unset(game_)
- unset(games_)
-endif()
diff --git a/CMake/macOS-bundle-wrapper.in b/CMake/macOS-bundle-wrapper.in
deleted file mode 100644
index 2f31e4886..000000000
--- a/CMake/macOS-bundle-wrapper.in
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-#
-# Run the executable of a macOS bundle for the Fast Light Tool Kit (FLTK).
-#
-# Copyright 1998-2020 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
-#
-#
-# Install this script side by side with the macOS bundle with the same name:
-#
-# - dir/prog.app macOS bundle (directory)
-# - dir/prog this script: runs the executable 'prog' inside the bundle
-#
-prog="`basename \"$0\"`"
-dir="`dirname \"$0\"`"
-exec "$dir/$prog.app/Contents/MacOS/$prog" "$@"
diff --git a/CMake/macOSMaxAllowed.c b/CMake/macOSMaxAllowed.c
deleted file mode 100644
index 4628348d3..000000000
--- a/CMake/macOSMaxAllowed.c
+++ /dev/null
@@ -1,6 +0,0 @@
-
-#include <AvailabilityMacros.h>
-#if MAC_OS_X_VERSION_MAX_ALLOWED < SDK_VERSION_CHECK
-#error MAC_OS_X_VERSION_MAX_ALLOWED < SDK_VERSION_CHECK
-#endif
-int main(int argc, char** argv) { return 0; }
diff --git a/CMake/options.cmake b/CMake/options.cmake
deleted file mode 100644
index f005f8b0e..000000000
--- a/CMake/options.cmake
+++ /dev/null
@@ -1,1098 +0,0 @@
-#
-# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
-# Originally written by Michael Surette
-#
-# Copyright 1998-2026 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
-#
-
-#######################################################################
-# Important implementation note for FLTK developers
-#######################################################################
-#
-# *FIXME* In the current version of FLTK's CMake build files we're
-# using 'include_directories()' to define directories that must be
-# used in compile commands (typically "-Idirectories").
-#
-# include_directories() is a global command that affects *all* source
-# files in the current directory and all subdirectories. This can lead
-# to conflicts and should be replaced with target_include_directories()
-# which can be applied to particular targets and source files only.
-#
-# This could remove some of these potential build conflicts, for
-# instance if the bundled image libs and Cairo or Pango are used
-# together (Pango depends on Cairo and Cairo depends on libpng).
-# However, this is not a proper solution!
-#
-# That said, order of "-I..." switches matters, and therefore the
-# bundled libraries (png, jpeg, zlib) *must* appear before any other
-# include_directories() statements that might introduce conflicts.
-# Currently 'resources.cmake' is included before this file and thus
-# 'include_directories(${FREETYPE_PATH})' is executed before this
-# file but this doesn't matter.
-#
-# This *MUST* be fixed using target_include_directories() as
-# appropriate but this would need a major rework.
-#
-# Albrecht-S April 6, 2022
-#
-#######################################################################
-
-set(DEBUG_OPTIONS_CMAKE 0)
-if(DEBUG_OPTIONS_CMAKE)
- message(STATUS "[** options.cmake **]")
- fl_debug_var(WIN32)
- fl_debug_var(FLTK_LDLIBS)
-endif(DEBUG_OPTIONS_CMAKE)
-
-#######################################################################
-# options
-#######################################################################
-set(FLTK_OPTION_OPTIM ""
- CACHE STRING
- "custom optimization flags"
-)
-# *FIXME* add_definitions()
-add_definitions(${FLTK_OPTION_OPTIM})
-
-#######################################################################
-set(FLTK_ARCHFLAGS ""
- CACHE STRING
- "custom architecture flags"
-)
-# *FIXME* add_definitions()
-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 zeroes)"
-)
-# see also CMake/gen_config.cmake
-
-#######################################################################
-# Select MSVC (Visual Studio) Runtime: DLL (/MDx) or static (/MTx)
-# where x = 'd' for Debug builds, empty ('') for non-Debug builds.
-# 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.
-# This also applies when using LLVM/clang on Windows (#1058).
-#######################################################################
-
-if(WIN32 AND NOT MINGW AND NOT MSYS)
- 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()
-else(WIN32 AND NOT MINGW AND NOT MSYS)
- # suppress CMake warning if the user sets FLTK_MSVC_RUNTIME_DLL on other platforms
- if(DEFINED FLTK_MSVC_RUNTIME_DLL)
- unset(FLTK_MSVC_RUNTIME_DLL)
- unset(FLTK_MSVC_RUNTIME_DLL CACHE)
- endif()
-endif(WIN32 AND NOT MINGW AND NOT MSYS)
-
-#######################################################################
-
-if(APPLE)
- option(FLTK_BACKEND_X11 "use X11" OFF)
- if(CMAKE_OSX_SYSROOT)
- list(APPEND FLTK_CFLAGS "-isysroot ${CMAKE_OSX_SYSROOT}")
- endif(CMAKE_OSX_SYSROOT)
-elseif(UNIX)
- option(FLTK_BACKEND_X11 "use X11" ON)
-endif(APPLE)
-
-#######################################################################
-# Bundled Library Options
-#######################################################################
-
-if(WIN32 OR (APPLE AND NOT FLTK_BACKEND_X11))
- option(FLTK_USE_SYSTEM_LIBJPEG "use system libjpeg" OFF)
- option(FLTK_USE_SYSTEM_LIBPNG "use system libpng" OFF)
- option(FLTK_USE_SYSTEM_ZLIB "use system zlib" OFF)
-else()
- option(FLTK_USE_SYSTEM_LIBJPEG "use system libjpeg" ON)
- option(FLTK_USE_SYSTEM_LIBPNG "use system libpng" ON)
- option(FLTK_USE_SYSTEM_ZLIB "use system zlib" ON)
-endif()
-
-# Set default values of internal build options
-
-set(FLTK_USE_BUNDLED_JPEG FALSE)
-set(FLTK_USE_BUNDLED_PNG FALSE)
-set(FLTK_USE_BUNDLED_ZLIB FALSE)
-
-# Collect libraries to build fltk_images (starting empty)
-
-set(FLTK_IMAGE_LIBRARIES "")
-
-#######################################################################
-# Ensure that png and zlib are both system or both local for compatibility
-#######################################################################
-
-if(FLTK_USE_SYSTEM_ZLIB)
- find_package(ZLIB)
- if(NOT ZLIB_FOUND)
- set(FLTK_USE_BUNDLED_ZLIB TRUE)
- endif()
-else()
- set(FLTK_USE_BUNDLED_ZLIB TRUE)
-endif()
-
-if(FLTK_USE_SYSTEM_LIBPNG AND NOT FLTK_USE_BUNDLED_ZLIB)
- find_package(PNG)
- if(NOT PNG_FOUND)
- set(FLTK_USE_BUNDLED_PNG TRUE)
- set(FLTK_USE_BUNDLED_ZLIB TRUE)
- endif()
-else()
- set(FLTK_USE_BUNDLED_PNG TRUE)
- set(FLTK_USE_BUNDLED_ZLIB TRUE)
-endif()
-
-# Issue warnings if we deviate from the user's choice
-
-if(FLTK_USE_SYSTEM_LIBPNG AND FLTK_USE_BUNDLED_PNG)
- message(STATUS "System PNG or ZLIB not usable, falling back to local PNG for compatibility.")
-endif()
-
-if(FLTK_USE_SYSTEM_ZLIB AND FLTK_USE_BUNDLED_ZLIB)
- message(STATUS "System PNG or ZLIB not usable, falling back to local ZLIB for compatibility.")
-endif()
-
-#######################################################################
-# Bundled Compression Library : zlib
-#######################################################################
-
-if(FLTK_USE_BUNDLED_ZLIB)
-
- add_subdirectory(zlib)
-
- set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zlib)
-
- # FIXME - include_directories()
- include_directories(${ZLIB_INCLUDE_DIR})
-
-endif()
-
-set(HAVE_LIBZ 1)
-
-#######################################################################
-# Bundled Image Library : libpng
-#######################################################################
-
-if(FLTK_USE_BUNDLED_PNG)
-
- add_subdirectory(png)
- set(FLTK_PNG_LIBRARIES fltk::png)
- list(APPEND FLTK_IMAGE_LIBRARIES fltk::png)
-
- # Definitions for 'config.h' - do we still need this?
- # See also png/CMakeLists.txt (target_compile_definitions).
- # 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)
- set(HAVE_PNG_SET_TRNS_TO_ALPHA 1)
-
- # *FIXME* include_directories()
- include_directories(${FLTK_SOURCE_DIR}/png)
-
-else() # use system libpng and zlib
-
- set(FLTK_PNG_LIBRARIES ${PNG_LIBRARIES})
- list(APPEND FLTK_IMAGE_LIBRARIES ${PNG_LIBRARIES})
-
- # *FIXME* include_directories()
- include_directories(${PNG_INCLUDE_DIRS})
-
- set(_INCLUDE_SAVED ${CMAKE_REQUIRED_INCLUDES})
- list(APPEND CMAKE_REQUIRED_INCLUDES ${PNG_INCLUDE_DIRS})
-
- # Note: we do not check for <libpng/png.h> explicitly.
- # This is assumed to exist if we have PNG_FOUND and don't find <png.h>
-
- # FIXME - Force search by unsetting the chache variable. Maybe use
- # FIXME - another cache variable to check for option changes?
- # unset(HAVE_PNG_H CACHE) # force search
-
- check_include_file(png.h HAVE_PNG_H)
- mark_as_advanced(HAVE_PNG_H)
-
- set(CMAKE_REQUIRED_INCLUDES ${_INCLUDE_SAVED})
- unset(_INCLUDE_SAVED)
-
-endif()
-
-set(HAVE_LIBPNG 1)
-
-#######################################################################
-# Bundled Image Library : libjpeg
-#######################################################################
-
-if(FLTK_USE_SYSTEM_LIBJPEG)
- find_package(JPEG)
- if(NOT JPEG_FOUND)
- set(FLTK_USE_BUNDLED_JPEG TRUE)
- message(STATUS "cannot find system jpeg library - using built-in")
- endif()
-else()
- set(FLTK_USE_BUNDLED_JPEG TRUE)
-endif()
-
-if(FLTK_USE_BUNDLED_JPEG)
-
- add_subdirectory(jpeg)
- set(FLTK_JPEG_LIBRARIES fltk::jpeg)
- # list(APPEND FLTK_IMAGE_LIBRARIES fltk::jpeg)
-
- # *FIXME* include_directories
- include_directories(${FLTK_SOURCE_DIR}/jpeg)
-
-else()
-
- set(FLTK_JPEG_LIBRARIES ${JPEG_LIBRARIES})
- list(APPEND FLTK_IMAGE_LIBRARIES ${JPEG_LIBRARIES})
-
-endif()
-
-set(HAVE_LIBJPEG 1)
-
-#######################################################################
-
-if(UNIX)
- option(FLTK_INSTALL_LINKS "create backwards compatibility links" OFF)
- list(APPEND FLTK_LDLIBS -lm)
-
- if(NOT APPLE)
- option(FLTK_BACKEND_WAYLAND "support the Wayland backend" ON)
- endif(NOT APPLE)
-
- # Check Wayland requirements and set the result variable FLTK_USE_WAYLAND.
- # FLTK_USE_WAYLAND *must* be used *everywhere* else after these checks.
-
- if(FLTK_BACKEND_WAYLAND)
- message(STATUS "Checking Wayland requirements ...")
- set(FLTK_USE_WAYLAND FALSE) # assume Wayland not OK ...
-
- if(NOT PKG_CONFIG_FOUND)
- message(FATAL_ERROR "Option FLTK_BACKEND_WAYLAND requires pkg-config on the build host.")
- endif()
-
- pkg_check_modules(WLDCLIENT IMPORTED_TARGET wayland-client>=1.18)
- pkg_check_modules(WLDCURSOR IMPORTED_TARGET wayland-cursor)
- pkg_check_modules(WLDPROTO IMPORTED_TARGET wayland-protocols>=1.15)
- pkg_check_modules(XKBCOMMON IMPORTED_TARGET xkbcommon)
-
- if(WLDCLIENT_FOUND AND WLDCURSOR_FOUND AND WLDPROTO_FOUND AND XKBCOMMON_FOUND)
- set(FLTK_USE_WAYLAND TRUE) # OK, Wayland can be used
- message(STATUS "Checking Wayland requirements: OK")
- else()
- message(NOTICE "Checking Wayland requirements FAILED!")
- message(NOTICE " Not all required software modules for Wayland are present.")
- message(NOTICE " The Wayland backend was requested but can't be built.")
- message(NOTICE " Please check Wayland requirements (see above) or")
- message(NOTICE " set FLTK_BACKEND_WAYLAND=OFF to silence this warning.")
- endif()
- endif(FLTK_BACKEND_WAYLAND)
-
- if(FLTK_USE_WAYLAND)
- pkg_get_variable(PROTOCOLS wayland-protocols pkgdatadir)
- string(REPLACE "//" "/" PROTOCOLS ${PROTOCOLS})
- if(EXISTS ${PROTOCOLS}/staging/xdg-dialog/xdg-dialog-v1.xml)
- set(HAVE_XDG_DIALOG 1)
- message(STATUS "Found dev files for Wayland protocol 'XDG dialog windows'")
- else()
- set(HAVE_XDG_DIALOG 0)
- endif()
- if(EXISTS ${PROTOCOLS}/staging/cursor-shape/cursor-shape-v1.xml AND
- EXISTS ${PROTOCOLS}/stable/tablet/tablet-v2.xml)
- set(HAVE_CURSOR_SHAPE 1)
- message(STATUS "Found dev files for Wayland protocols 'Cursor shape' and 'Tablet'")
- message(STATUS " ==> option FLTK_USE_DBUS can be turned OFF if 'Cursor shape'-enabled wayland compositor is used.")
- else()
- set(HAVE_CURSOR_SHAPE 0)
- endif()
- if(FLTK_BACKEND_X11)
- include(FindX11)
- endif()
- if(FLTK_BACKEND_X11 AND X11_FOUND)
- set(FLTK_USE_X11 1) # build a hybrid Wayland/X11 library
- else()
- set(FLTK_USE_X11 0) # build a Wayland-only library
- endif()
- unset(FLTK_GRAPHICS_CAIRO CACHE)
- set(FLTK_GRAPHICS_CAIRO TRUE CACHE BOOL "all drawing to X11 windows uses Cairo")
- option(FLTK_USE_DBUS "use D-Bus - required to detect the cursor theme" ON)
- option(FLTK_USE_SYSTEM_LIBDECOR "use libdecor from the system" ON)
- set(USE_SYSTEM_LIBDECOR 1)
- unset(FLTK_USE_XRENDER CACHE)
- unset(FLTK_USE_XINERAMA CACHE)
- unset(FLTK_USE_XFT CACHE)
- unset(FLTK_USE_XCURSOR CACHE)
- unset(FLTK_USE_XFIXES CACHE)
- if(X11_FOUND)
- if(NOT X11_Xfixes_FOUND)
- message(WARNING "Install development headers for libXfixes (e.g., libxfixes-dev)")
- endif()
- set(HAVE_XFIXES 1)
- if(NOT X11_Xrender_FOUND)
- message(WARNING "Install development headers for libXrender (e.g., libxrender-dev)")
- endif()
- set(HAVE_XRENDER 1)
- if(NOT X11_Xft_FOUND)
- message(WARNING "Install development headers for libXft (e.g., libxft-dev)")
- endif()
- if(NOT X11_Xcursor_FOUND)
- message(WARNING "Install development headers for libXcursor (e.g., libxcursor-dev)")
- endif()
- set(HAVE_XCURSOR 1)
- if(NOT X11_Xinerama_FOUND)
- message(WARNING "Install development headers for libXinerama (e.g., libxinerama-dev)")
- endif()
- set(HAVE_XINERAMA 1)
- if(NOT (X11_Xfixes_FOUND AND X11_Xrender_FOUND AND X11_Xft_FOUND AND X11_Xcursor_FOUND
- AND X11_Xinerama_FOUND))
- message(FATAL_ERROR "*** Terminating: one or more required software package(s) missing.")
- endif()
- endif(X11_FOUND)
- unset(FLTK_USE_PANGO CACHE)
- set(FLTK_USE_PANGO TRUE CACHE BOOL "use lib Pango")
- if(FLTK_USE_SYSTEM_LIBDECOR)
- pkg_check_modules(SYSTEM_LIBDECOR IMPORTED_TARGET libdecor-0>=0.2.0 QUIET)
- if(NOT SYSTEM_LIBDECOR_FOUND)
- message(STATUS "Warning: system libdecor doesn't satisfy version ≥ 0.2.0,")
- message(STATUS " using bundled libdecor library instead.")
- set(USE_SYSTEM_LIBDECOR 0)
- else()
- pkg_get_variable(LIBDECOR_LIBDIR libdecor-0 libdir)
- set(LIBDECOR_PLUGIN_DIR ${LIBDECOR_LIBDIR}/libdecor/plugins-1)
- if(EXISTS ${LIBDECOR_PLUGIN_DIR} AND IS_DIRECTORY ${LIBDECOR_PLUGIN_DIR})
- set(LIBDECOR_PLUGIN_DIR "\"${LIBDECOR_PLUGIN_DIR}\"" )
- else()
- set(USE_SYSTEM_LIBDECOR 0)
- endif()
- endif(NOT SYSTEM_LIBDECOR_FOUND)
- else()
- set(USE_SYSTEM_LIBDECOR 0)
- endif(FLTK_USE_SYSTEM_LIBDECOR)
-
- if(USE_SYSTEM_LIBDECOR)
- set(FLTK_USE_LIBDECOR_GTK ON)
- else()
- option(FLTK_USE_LIBDECOR_GTK "Allow to use libdecor's GTK plugin" ON)
- endif(USE_SYSTEM_LIBDECOR)
-
- if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "FreeBSD")
- check_include_file(linux/input.h LINUX_INPUT_H)
- if(NOT LINUX_INPUT_H)
- message(FATAL_ERROR "Required include file 'linux/input.h' is missing. Please install package 'evdev-proto'")
- endif(NOT LINUX_INPUT_H)
- endif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "FreeBSD")
-
- endif(FLTK_USE_WAYLAND)
-endif(UNIX)
-
-if(WIN32)
- option(FLTK_GRAPHICS_GDIPLUS "use GDI+ when possible for antialiased graphics" ON)
- if(FLTK_GRAPHICS_GDIPLUS)
- set(USE_GDIPLUS TRUE)
- if(NOT MSVC)
- list(APPEND FLTK_LDLIBS "-lgdiplus")
- endif(NOT MSVC)
- endif(FLTK_GRAPHICS_GDIPLUS)
-endif(WIN32)
-
-#######################################################################
-
-# find X11 libraries and headers
-set(PATH_TO_XLIBS)
-if(FLTK_BACKEND_X11)
- include(FindX11)
- if(X11_FOUND)
- set(FLTK_USE_X11 1)
- list(APPEND FLTK_LDLIBS -lX11)
- if(X11_Xext_FOUND)
- list(APPEND FLTK_LDLIBS -lXext)
- endif(X11_Xext_FOUND)
- get_filename_component(PATH_TO_XLIBS ${X11_X11_LIB} PATH)
- endif(X11_FOUND)
-endif()
-
-if(APPLE AND FLTK_BACKEND_X11)
- if(NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0)) # a.k.a. macOS version ≥ 10.13
- list(APPEND FLTK_CFLAGS "-D_LIBCPP_HAS_THREAD_API_PTHREAD")
- endif(NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0))
- # FIXME: include_directories(!)
- # FIXME: how can we implement "AFTER SYSTEM" ?
- include_directories(AFTER SYSTEM /opt/X11/include/freetype2)
- include_directories(AFTER SYSTEM /opt/X11/include) # for Xft.h
- if(PATH_TO_XLIBS)
- set(LDFLAGS "-L${PATH_TO_XLIBS} ${LDFLAGS}")
- endif(PATH_TO_XLIBS)
- if(X11_INCLUDE_DIR)
- set(TEMP_INCLUDE_DIR ${X11_INCLUDE_DIR})
- list(TRANSFORM TEMP_INCLUDE_DIR PREPEND "-I")
- list(APPEND FLTK_CFLAGS "${TEMP_INCLUDE_DIR}")
- endif(X11_INCLUDE_DIR)
-endif(APPLE AND FLTK_BACKEND_X11)
-
-#######################################################################
-option(FLTK_USE_POLL "use poll if available" OFF)
-mark_as_advanced(FLTK_USE_POLL)
-
-if(FLTK_USE_POLL)
- check_symbol_exists(poll "poll.h" USE_POLL)
-endif(FLTK_USE_POLL)
-
-#######################################################################
-option(FLTK_BUILD_SHARED_LIBS
- "Build shared libraries in addition to static libraries"
- OFF
-)
-
-#######################################################################
-
-option(FLTK_OPTION_PRINT_SUPPORT "allow print support" ON)
-option(FLTK_OPTION_FILESYSTEM_SUPPORT "allow file system support" ON)
-option(FLTK_OPTION_PEN_SUPPORT "include Pen/Tablet support" 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)
-option(FLTK_BUILD_SCREENSHOTS "Build screenshot programs for docs" OFF)
-
-if(FLTK_IS_TOPLEVEL)
- option(FLTK_BUILD_TEST "Build test/demo programs" ON)
-else()
- option(FLTK_BUILD_TEST "Build test/demo programs" OFF)
-endif()
-
-
-# set variables to generate config.h or fl_config.h
-
-if(FLTK_BUILD_FORMS)
- set(FLTK_HAVE_FORMS 1)
-else()
- set(FLTK_HAVE_FORMS 0)
-endif()
-
-# Note: on some Windows build systems (notably "classic" MinGW 32-bit)
-# Pen/Tablet support is not available, hence we use try_compile() to
-# figure this out.
-#
-# CMake variables:
-# - FLTK_OPTION_PEN_SUPPORT: user option (cache; default ON/TRUE)
-# - PEN_DRIVER_SUPPORTED : Windows only; result of try_compile()
-# - FLTK_HAVE_PEN_SUPPORT : final result for building Pen/Tablet support,
-# also used to set config variable in config.h
-
-if(FLTK_OPTION_PEN_SUPPORT)
- if(WIN32)
- try_compile(PEN_DRIVER_SUPPORTED
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/CMake/pen-support.c
- )
- # fl_debug_var(PEN_DRIVER_SUPPORTED)
- if(PEN_DRIVER_SUPPORTED)
- set(FLTK_HAVE_PEN_SUPPORT 1)
- else()
- set(FLTK_HAVE_PEN_SUPPORT 0)
- endif()
- else(WIN32) # all other platforms
- set(FLTK_HAVE_PEN_SUPPORT 1)
- endif(WIN32)
-
- # generate a warning if Pen/Tablet support was requested but can't be compiled
-
- if(NOT FLTK_HAVE_PEN_SUPPORT)
- message(STATUS "WARNING: Pen/Tablet support requested (FLTK_OPTION_PEN_SUPPORT) but not available")
- message(STATUS " ... Pen/Tablet support has been disabled!")
- endif()
-
-else(FLTK_OPTION_PEN_SUPPORT) # option disabled by user
- set(FLTK_HAVE_PEN_SUPPORT 0)
-endif(FLTK_OPTION_PEN_SUPPORT)
-
-#######################################################################
-if(DOXYGEN_FOUND)
- option(FLTK_BUILD_HTML_DOCS "build html docs" ON)
- option(FLTK_INSTALL_HTML_DOCS "install html docs" OFF)
- option(FLTK_BUILD_FLUID_DOCS "build FLUID docs" OFF)
- option(FLTK_INSTALL_FLUID_DOCS "install FLUID docs" OFF)
-
- option(FLTK_INCLUDE_DRIVER_DOCS "include driver (developer) docs" OFF)
- mark_as_advanced(FLTK_INCLUDE_DRIVER_DOCS)
-
- if(LATEX_FOUND)
- option(FLTK_BUILD_PDF_DOCS "build pdf docs" ON)
- option(FLTK_INSTALL_PDF_DOCS "install pdf docs" OFF)
- endif(LATEX_FOUND)
-endif(DOXYGEN_FOUND)
-
-if(FLTK_BUILD_HTML_DOCS OR FLTK_BUILD_PDF_DOCS)
- add_subdirectory(documentation)
-endif(FLTK_BUILD_HTML_DOCS OR FLTK_BUILD_PDF_DOCS)
-
-if(FLTK_BUILD_FLUID_DOCS)
- add_subdirectory(fluid/documentation)
-endif(FLTK_BUILD_FLUID_DOCS)
-
-#######################################################################
-# Include optional Cairo support
-#######################################################################
-
-option(FLTK_OPTION_CAIRO_WINDOW "add support for Fl_Cairo_Window" OFF)
-option(FLTK_OPTION_CAIRO_EXT
- "use FLTK code instrumentation for Cairo extended use" OFF
-)
-
-set(FLTK_HAVE_CAIRO 0)
-set(FLTK_HAVE_CAIROEXT 0)
-
-if(FLTK_OPTION_CAIRO_WINDOW OR FLTK_OPTION_CAIRO_EXT)
-
- # On Windows we don't use pkg-config *if* FLTK_CAIRO_DIR is set
- # to prevent that CMake finds the system lib(s).
-
- if(WIN32 AND FLTK_CAIRO_DIR)
- set(PKG_CAIRO_FOUND FALSE)
- else()
- pkg_search_module(PKG_CAIRO cairo)
- endif()
-
- if(PKG_CAIRO_FOUND)
- set(FLTK_HAVE_CAIRO 1)
- if(FLTK_OPTION_CAIRO_EXT)
- set(FLTK_HAVE_CAIROEXT 1)
- endif(FLTK_OPTION_CAIRO_EXT)
-
- list(APPEND FLTK_BUILD_INCLUDE_DIRECTORIES ${PKG_CAIRO_INCLUDE_DIRS})
-
- # Cairo libs and flags for fltk-config
-
- # Hint: use either PKG_CAIRO_* or PKG_CAIRO_STATIC_* variables to
- # create the list of libraries used to link programs with Cairo
- # by running fltk-config --use-cairo --compile ...
- # Currently we're using the non-STATIC variables to link Cairo shared.
-
- set(CAIROLIBS)
- foreach(lib ${PKG_CAIRO_LIBRARIES})
- list(APPEND CAIROLIBS "-l${lib}")
- endforeach()
-
- string(REPLACE ";" " " CAIROLIBS "${CAIROLIBS}")
- string(REPLACE ";" " " CAIROFLAGS "${PKG_CAIRO_CFLAGS}")
-
- else(PKG_CAIRO_FOUND)
-
- if(NOT WIN32)
- message(STATUS "*** Cairo was requested but not found - please check your Cairo installation")
- message(STATUS "*** or disable options FLTK_OPTION_CAIRO_WINDOW and FLTK_OPTION_CAIRO_EXT.")
- message(FATAL_ERROR "*** Terminating: missing Cairo libs or headers.")
- endif()
-
- # Tweak Cairo includes / libs / paths for Windows (TEMPORARY solution).
- # Todo: find a better way to set the required variables and flags!
- # The current version was tested with 32-bit (MinGW) and 64-bit (Visual
- # Studio and MSYS2). The latter can also be used with the Cairo library
- # provided by MSYS2, but then the build depends on the MSYS2 installation.
- # AlbrechtS (05/2024)
-
- message(STATUS "--- Cairo not found: trying to find Cairo for Windows ...")
-
- if(CMAKE_SIZEOF_VOID_P STREQUAL "8")
- set(_cairo_suffix x64)
- else()
- set(_cairo_suffix x86)
- endif()
-
- find_library(FLTK_CAIRO_LIB cairo
- PATHS ${FLTK_CAIRO_DIR}
- PATH_SUFFIXES lib lib/${_cairo_suffix}
- NO_DEFAULT_PATH
- )
-
- if(NOT FLTK_CAIRO_DIR AND NOT FLTK_CAIRO_LIB)
- message(STATUS "--- Please set FLTK_CAIRO_DIR to point to the Cairo installation folder ...")
- message(STATUS " ... with files 'include/cairo.h' and 'lib/${_cairo_suffix}/cairo.lib'")
- message(STATUS "--- Example: cmake -DFLTK_CAIRO_DIR=\"C:/cairo-windows\" ...")
- message(STATUS "--- Note: this may be changed in the future.")
- message(FATAL_ERROR "*** Terminating: missing Cairo libs or headers.")
- endif()
-
- set(CAIROLIBS "-lcairo") # should be correct: needs cairo.lib
-
- # Simulate results of 'pkg_search_module (PKG_CAIRO cairo)' and more (above).
- # These variables will be used later
-
- set(PKG_CAIRO_LIBRARIES "cairo")
- set(PKG_CAIRO_INCLUDE_DIRS "${FLTK_CAIRO_DIR}/include")
- set(PKG_CAIRO_LIBRARY_DIRS "${FLTK_CAIRO_DIR}/lib/${_cairo_suffix}/")
-
- # FIXME - include_directories()
- include_directories(${PKG_CAIRO_INCLUDE_DIRS})
-
- set(FLTK_HAVE_CAIRO 1)
- if(FLTK_OPTION_CAIRO_EXT)
- set(FLTK_HAVE_CAIROEXT 1)
- endif(FLTK_OPTION_CAIRO_EXT)
-
- endif(PKG_CAIRO_FOUND)
-
- if(0) # 1 = DEBUG, 0 = no output
- message(STATUS "--- options.cmake: Cairo related variables ---")
- if(WIN32)
- fl_debug_var(FLTK_CAIRO_DIR)
- fl_debug_var(_cairo_suffix)
- endif()
- fl_debug_pkg(PKG_CAIRO cairo)
- message(STATUS "--- fltk-config/Cairo variables ---")
- fl_debug_var(FLTK_LDLIBS)
- fl_debug_var(CAIROFLAGS)
- fl_debug_var(CAIROLIBS)
- message(STATUS "--- End of Cairo related variables ---")
- endif() # 1 = DEBUG, ...
-
- unset(_cairo_suffix)
-
-endif(FLTK_OPTION_CAIRO_WINDOW OR FLTK_OPTION_CAIRO_EXT)
-
-#######################################################################
-
-option(FLTK_OPTION_SVG "read/write SVG image files" ON)
-
-if(FLTK_OPTION_SVG)
- set(FLTK_USE_SVG 1)
-else()
- set(FLTK_USE_SVG 0)
-endif(FLTK_OPTION_SVG)
-
-#######################################################################
-
-# FIXME: GLU libs have already been searched in resources.cmake
-
-set(HAVE_GL LIB_GL OR LIB_MesaGL)
-set(FLTK_USE_GL FALSE)
-
-if(HAVE_GL)
- option(FLTK_BUILD_GL "use OpenGL and build fltk_gl library" ON)
- if(FLTK_BUILD_GL)
- set(FLTK_USE_GL TRUE)
- endif()
-endif()
-
-if(FLTK_BUILD_GL)
- if(FLTK_USE_WAYLAND)
- pkg_check_modules(WLD_EGL IMPORTED_TARGET wayland-egl)
- pkg_check_modules(PKG_EGL IMPORTED_TARGET egl)
- if(FLTK_BACKEND_X11)
- pkg_check_modules(PKG_GL IMPORTED_TARGET gl)
- else()
- pkg_check_modules(PKG_GL IMPORTED_TARGET opengl)
- endif()
- pkg_check_modules(PKG_GLU IMPORTED_TARGET glu)
-
- if(NOT (WLD_EGL_FOUND AND PKG_EGL_FOUND AND PKG_GL_FOUND AND PKG_GLU_FOUND))
- message(STATUS "Modules 'wayland-egl, egl, gl (or opengl), and glu' are required to build for the Wayland backend.")
- message(FATAL_ERROR "*** Aborting ***")
- endif()
-
- endif(FLTK_USE_WAYLAND)
-
- if(FLTK_BACKEND_X11 OR FLTK_USE_WAYLAND)
- set(OPENGL_FOUND TRUE)
- if(FLTK_BACKEND_X11)
- find_library(OPENGL_LIB GL)
- else()
- find_library(OPENGL_LIB OpenGL)
- endif(FLTK_BACKEND_X11)
- get_filename_component(PATH_TO_GLLIB ${OPENGL_LIB} DIRECTORY)
- find_library(GLU_LIB GLU)
- get_filename_component(PATH_TO_GLULIB ${GLU_LIB} DIRECTORY)
- set(OPENGL_LIBRARIES -L${PATH_TO_GLULIB} -L${PATH_TO_GLLIB})
- if(APPLE)
- # FIXME: we should find a better way to resolve this issue:
- # with GL, must use XQuartz libX11 else "Insufficient GL support"
- set(OPENGL_LIBRARIES ${OPENGL_LIBRARIES} -lX11)
- endif(APPLE)
- set(OPENGL_LIBRARIES ${OPENGL_LIBRARIES} -lGLU)
- if(FLTK_BACKEND_X11)
- set(OPENGL_LIBRARIES ${OPENGL_LIBRARIES} -lGL)
- else()
- set(OPENGL_LIBRARIES ${OPENGL_LIBRARIES} -lOpenGL)
- endif(FLTK_BACKEND_X11)
- find_path(OPENGL_INCLUDE_DIR NAMES GL/gl.h OpenGL/gl.h HINTS ${X11_INCLUDE_DIR})
- unset(HAVE_GL_GLU_H CACHE)
- find_file(HAVE_GL_GLU_H GL/glu.h PATHS ${X11_INCLUDE_DIR})
- else()
- find_package(OpenGL)
- if(APPLE)
- set(HAVE_GL_GLU_H ${HAVE_OPENGL_GLU_H})
- endif(APPLE)
- endif(FLTK_BACKEND_X11 OR FLTK_USE_WAYLAND)
-else(FLTK_BUILD_GL)
- set(OPENGL_FOUND FALSE)
- set(HAVE_GL FALSE)
- set(HAVE_GL_GLU_H FALSE)
- set(HAVE_GLXGETPROCADDRESSARB FALSE)
-endif(FLTK_BUILD_GL)
-
-mark_as_advanced(OPENGL_LIB) # internal cache variable, not relevant for users
-
-# FIXME: the following is necessary because this variable may have been removed
-# from the cache above. It has been marked "advanced" before in resources.cmake.
-mark_as_advanced(HAVE_GL_GLU_H)
-
-# Note: GLLIBS is a CMake 'list' and is used exclusively to generate fltk-config !
-
-# FIXME, this should be improved!
-# We should probably deduct this from OPENGL_LIBRARIES but it turned
-# out to be difficult since FindOpenGL seems to return different
-# syntax depending on the platform (and maybe also CMake version).
-# Hence we use the following code...
-
-set(GLLIBS)
-set(FLTK_GL_FOUND FALSE)
-
-if(OPENGL_FOUND)
- set(FLTK_GL_FOUND TRUE)
- find_path(FLTK_OPENGL_GLU_INCLUDE_DIR NAMES GL/glu.h OpenGL/glu.h HINTS ${OPENGL_INCLUDE_DIR} ${X11_INCLUDE_DIR})
- set(CMAKE_REQUIRED_INCLUDES ${OPENGL_INCLUDE_DIR}/GL ${FLTK_OPENGL_GLU_INCLUDE_DIR})
-
- if(WIN32)
- list(APPEND GLLIBS -lglu32 -lopengl32)
- elseif(APPLE AND NOT FLTK_BACKEND_X11)
- list(APPEND GLLIBS "-framework OpenGL")
- elseif(FLTK_USE_WAYLAND)
- foreach(_lib WLD_EGL PKG_EGL PKG_GLU PKG_GL)
- list(APPEND GLLIBS ${${_lib}_LDFLAGS})
- endforeach(_lib )
- else()
- list(APPEND GLLIBS -lGLU -lGL)
- endif(WIN32)
-
- if (FLTK_BACKEND_X11)
- # check if function glXGetProcAddressARB exists
- set(TEMP_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
- set(CMAKE_REQUIRED_LIBRARIES ${OPENGL_LIBRARIES})
- check_symbol_exists(glXGetProcAddressARB "glx.h" HAVE_GLXGETPROCADDRESSARB)
- set(CMAKE_REQUIRED_LIBRARIES ${TEMP_REQUIRED_LIBRARIES})
- unset(TEMP_REQUIRED_LIBRARIES)
- else()
- unset(HAVE_GLXGETPROCADDRESSARB CACHE)
- endif(FLTK_BACKEND_X11)
-endif(OPENGL_FOUND)
-
-#######################################################################
-option(FLTK_OPTION_LARGE_FILE "enable large file support" ON)
-
-if(FLTK_OPTION_LARGE_FILE)
- if(NOT MSVC)
- add_definitions(-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64)
- list(APPEND FLTK_CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64)
- endif(NOT MSVC)
-endif(FLTK_OPTION_LARGE_FILE)
-
-#######################################################################
-# Create an option whether we want to check for pthreads.
-# We must not do it on Windows unless we run under Cygwin, since we
-# always use native threads on Windows (even if libpthread is available).
-
-# Note: HAVE_PTHREAD_H has already been determined in resources.cmake
-# before this file is included (or set to 0 for WIN32).
-
-if(WIN32 AND NOT CYGWIN)
- # set(HAVE_PTHREAD_H 0) # (see resources.cmake)
- set(FLTK_USE_PTHREADS FALSE)
-else()
- option(FLTK_USE_PTHREADS "use multi-threading with pthreads" ON)
-endif(WIN32 AND NOT CYGWIN)
-
-# initialize more variables
-set(USE_THREADS 0)
-set(HAVE_PTHREAD 0)
-set(FLTK_PTHREADS_FOUND FALSE)
-
-if(FLTK_USE_PTHREADS)
-
- include(FindThreads)
-
- if(Threads_FOUND)
- add_definitions("-D_THREAD_SAFE -D_REENTRANT")
- set(USE_THREADS 1)
- set(FLTK_THREADS_FOUND TRUE)
- endif(Threads_FOUND)
-
- if(CMAKE_USE_PTHREADS_INIT AND NOT WIN32)
- set(HAVE_PTHREAD 1)
- if(NOT APPLE)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
- endif(NOT APPLE)
- list(APPEND FLTK_LDLIBS -lpthread)
- list(APPEND FLTK_CFLAGS -D_THREAD_SAFE -D_REENTRANT)
- set(FLTK_PTHREADS_FOUND TRUE)
- else()
- set(HAVE_PTHREAD 0)
- set(HAVE_PTHREAD_H 0)
- set(FLTK_PTHREADS_FOUND FALSE)
- endif(CMAKE_USE_PTHREADS_INIT AND NOT WIN32)
-
-else(FLTK_USE_PTHREADS)
-
- set(HAVE_PTHREAD_H 0)
-
-endif(FLTK_USE_PTHREADS)
-
-set(debug_threads 0) # set to 1 to show debug info
-if(debug_threads)
- message("")
- message(STATUS "options.cmake: set debug_threads to 0 to disable the following info:")
- fl_debug_var(FLTK_USE_PTHREADS)
- fl_debug_var(HAVE_PTHREAD)
- fl_debug_var(HAVE_PTHREAD_H)
- fl_debug_var(FLTK_THREADS_FOUND)
- fl_debug_var(CMAKE_EXE_LINKER_FLAGS)
- message(STATUS "options.cmake: end of debug_threads info.")
-endif(debug_threads)
-unset(debug_threads)
-
-
-#######################################################################
-if(X11_Xinerama_FOUND)
- option(FLTK_USE_XINERAMA "use lib Xinerama" ON)
-endif(X11_Xinerama_FOUND)
-
-if(FLTK_USE_XINERAMA)
- set(HAVE_XINERAMA ${X11_Xinerama_FOUND})
- list(APPEND FLTK_BUILD_INCLUDE_DIRECTORIES ${X11_Xinerama_INCLUDE_PATH})
- list(APPEND FLTK_LDLIBS -lXinerama)
- set(FLTK_XINERAMA_FOUND TRUE)
-else()
- set(FLTK_XINERAMA_FOUND FALSE)
-endif(FLTK_USE_XINERAMA)
-
-#######################################################################
-if(X11_Xfixes_FOUND)
- option(FLTK_USE_XFIXES "use lib Xfixes" ON)
-endif(X11_Xfixes_FOUND)
-
-if(FLTK_USE_XFIXES)
- set(HAVE_XFIXES ${X11_Xfixes_FOUND})
- list(APPEND FLTK_BUILD_INCLUDE_DIRECTORIES ${X11_Xfixes_INCLUDE_PATH})
- list(APPEND FLTK_LDLIBS -lXfixes)
- set(FLTK_XFIXES_FOUND TRUE)
-else()
- set(FLTK_XFIXES_FOUND FALSE)
-endif(FLTK_USE_XFIXES)
-
-#######################################################################
-if(X11_Xcursor_FOUND)
- option(FLTK_USE_XCURSOR "use lib Xcursor" ON)
-endif(X11_Xcursor_FOUND)
-
-if(FLTK_USE_XCURSOR)
- set(HAVE_XCURSOR ${X11_Xcursor_FOUND})
- list(APPEND FLTK_BUILD_INCLUDE_DIRECTORIES ${X11_Xcursor_INCLUDE_PATH})
- list(APPEND FLTK_LDLIBS -lXcursor)
- set(FLTK_XCURSOR_FOUND TRUE)
-else()
- set(FLTK_XCURSOR_FOUND FALSE)
-endif(FLTK_USE_XCURSOR)
-
-#######################################################################
-if(X11_Xft_FOUND)
- option(FLTK_USE_PANGO "use lib Pango" OFF)
- if(NOT FLTK_USE_WAYLAND)
- option(FLTK_GRAPHICS_CAIRO "all drawing to X11 windows uses Cairo" OFF)
- endif(NOT FLTK_USE_WAYLAND)
- if(NOT FLTK_GRAPHICS_CAIRO)
- option(FLTK_USE_XFT "use lib Xft" ON)
- endif()
-endif(X11_Xft_FOUND)
-
-# test option compatibility: Cairo for Xlib requires Pango
-if(FLTK_GRAPHICS_CAIRO)
- unset(FLTK_USE_PANGO CACHE)
- set(FLTK_USE_PANGO TRUE CACHE BOOL "use lib Pango")
-endif(FLTK_GRAPHICS_CAIRO)
-
-if(FLTK_USE_X11 AND FLTK_USE_PANGO AND NOT FLTK_GRAPHICS_CAIRO)
- set(USE_PANGOXFT true)
-endif()
-
-# test option compatibility: PangoXft requires Xft
-if(USE_PANGOXFT)
- if(NOT X11_Xft_FOUND)
- message(STATUS "PangoXft requires Xft but Xft library or headers could not be found.")
- message(STATUS "Please install Xft development files and try again or disable FLTK_USE_PANGO.")
- message(FATAL_ERROR "*** Aborting ***")
- else()
- if(NOT FLTK_USE_XFT)
- message(STATUS "PangoXft requires Xft but usage of Xft was disabled.")
- message(STATUS "Please enable FLTK_USE_XFT and try again or disable FLTK_USE_PANGO.")
- message(FATAL_ERROR "*** Aborting ***")
- endif(NOT FLTK_USE_XFT)
- endif(NOT X11_Xft_FOUND)
-endif(USE_PANGOXFT)
-
-#######################################################################
-if((X11_Xft_FOUND OR NOT USE_PANGOXFT) AND FLTK_USE_PANGO)
- if(NOT PKG_CONFIG_FOUND)
- message(FATAL_ERROR "Option FLTK_USE_PANGO requires availability of pkg-config on the build machine.")
- endif(NOT PKG_CONFIG_FOUND)
- pkg_check_modules(CAIRO IMPORTED_TARGET cairo)
- if(USE_PANGOXFT)
- pkg_check_modules(PANGOXFT IMPORTED_TARGET pangoxft)
- endif(USE_PANGOXFT)
- pkg_check_modules(PANGOCAIRO IMPORTED_TARGET pangocairo)
-
- if((PANGOXFT_FOUND OR NOT USE_PANGOXFT) AND PANGOCAIRO_FOUND AND CAIRO_FOUND)
- if(USE_PANGOXFT)
- list(APPEND FLTK_BUILD_INCLUDE_DIRECTORIES ${PANGOXFT_INCLUDE_DIRS})
- else()
- list(APPEND FLTK_BUILD_INCLUDE_DIRECTORIES ${PANGOCAIRO_INCLUDE_DIRS})
- endif(USE_PANGOXFT)
- list(APPEND FLTK_BUILD_INCLUDE_DIRECTORIES ${CAIRO_INCLUDE_DIRS})
-
- set(USE_PANGO TRUE)
-
- # add required libraries to fltk-config ...
- if(USE_PANGOXFT)
- list(APPEND FLTK_LDLIBS ${PANGOXFT_LDFLAGS})
- endif(USE_PANGOXFT)
- list(APPEND FLTK_LDLIBS ${PANGOCAIRO_LDFLAGS})
-
- endif((PANGOXFT_FOUND OR NOT USE_PANGOXFT) AND PANGOCAIRO_FOUND AND CAIRO_FOUND)
-
- if(USE_PANGO AND (FLTK_GRAPHICS_CAIRO OR FLTK_USE_WAYLAND))
- set(FLTK_USE_CAIRO 1)
- # fl_debug_var(FLTK_USE_CAIRO)
- endif()
-
-endif((X11_Xft_FOUND OR NOT USE_PANGOXFT) AND FLTK_USE_PANGO)
-
-if(FLTK_USE_WAYLAND)
-
- # Note: Disable FLTK_USE_LIBDECOR_GTK to get cairo titlebars rather than GTK
- if(FLTK_USE_LIBDECOR_GTK AND NOT USE_SYSTEM_LIBDECOR)
- pkg_check_modules(GTK IMPORTED_TARGET gtk+-3.0)
- if(GTK_FOUND)
- list(APPEND FLTK_BUILD_INCLUDE_DIRECTORIES ${GTK_INCLUDE_DIRS})
- list(APPEND FLTK_LDLIBS ${GTK_LDFLAGS})
- else()
- message(WARNING "Installation of the development files for the GTK library "
- "(e.g., libgtk-3-dev) is recommended when using the gnome desktop.")
- endif(GTK_FOUND)
- endif(FLTK_USE_LIBDECOR_GTK AND NOT USE_SYSTEM_LIBDECOR)
-
-endif()
-
-if(FLTK_USE_XFT)
- set(USE_XFT X11_Xft_FOUND)
- list(APPEND FLTK_LDLIBS -lXft)
- set(FLTK_XFT_FOUND TRUE)
- if(APPLE AND FLTK_BACKEND_X11)
- find_library(LIB_fontconfig fontconfig "/opt/X11/lib")
- endif()
-else()
- set(FLTK_XFT_FOUND FALSE)
-endif(FLTK_USE_XFT)
-
-#######################################################################
-if(X11_Xrender_FOUND)
- option(FLTK_USE_XRENDER "use lib Xrender" ON)
-endif(X11_Xrender_FOUND)
-
-if(FLTK_USE_XRENDER)
- set(HAVE_XRENDER ${X11_Xrender_FOUND})
- if(HAVE_XRENDER)
- list(APPEND FLTK_BUILD_INCLUDE_DIRECTORIES ${X11_Xrender_INCLUDE_PATH})
- list(APPEND FLTK_LDLIBS -lXrender)
- set(FLTK_XRENDER_FOUND TRUE)
- else(HAVE_XRENDER)
- set(FLTK_XRENDER_FOUND FALSE)
- endif(HAVE_XRENDER)
-else(FLTK_USE_XRENDER)
- set(FLTK_XRENDER_FOUND FALSE)
-endif(FLTK_USE_XRENDER)
-
-#######################################################################
-set(FL_NO_PRINT_SUPPORT FALSE)
-if(X11_FOUND AND NOT FLTK_OPTION_PRINT_SUPPORT)
- set(FL_NO_PRINT_SUPPORT TRUE)
-endif(X11_FOUND AND NOT FLTK_OPTION_PRINT_SUPPORT)
-#######################################################################
-
-#######################################################################
-set(FL_CFG_NO_FILESYSTEM_SUPPORT TRUE)
-if(FLTK_OPTION_FILESYSTEM_SUPPORT)
- set(FL_CFG_NO_FILESYSTEM_SUPPORT FALSE)
-endif(FLTK_OPTION_FILESYSTEM_SUPPORT)
-#######################################################################
-
-#######################################################################
-option(CMAKE_SUPPRESS_REGENERATION "suppress rules to re-run CMake on rebuild" OFF)
-mark_as_advanced(CMAKE_SUPPRESS_REGENERATION)
-
-#######################################################################
-# Clean up ...
-
-# *** FIXME *** Do we need all these variables ?
-
-list(REMOVE_DUPLICATES FLTK_BUILD_INCLUDE_DIRECTORIES)
-list(REMOVE_DUPLICATES FLTK_IMAGE_INCLUDE_DIRECTORIES)
-list(REMOVE_DUPLICATES FLTK_IMAGE_LIBRARIES)
-
-#######################################################################
-# Debugging ...
-
-if(DEBUG_OPTIONS_CMAKE)
- message(STATUS "") # empty line
- fl_debug_var(WIN32)
- fl_debug_var(LIBS)
- fl_debug_var(GLLIBS)
- fl_debug_var(FLTK_LDLIBS)
- fl_debug_var(OPENGL_FOUND)
- fl_debug_var(OPENGL_INCLUDE_DIR)
- fl_debug_var(OPENGL_LIBRARIES)
- fl_debug_var(CMAKE_MSVC_RUNTIME_LIBRARY)
- message("--- bundled libraries ---")
- fl_debug_var(FLTK_USE_SYSTEM_LIBJPEG)
- fl_debug_var(FLTK_USE_SYSTEM_LIBPNG)
- fl_debug_var(FLTK_USE_SYSTEM_ZLIB)
- fl_debug_var(FLTK_USE_BUNDLED_JPEG)
- fl_debug_var(FLTK_USE_BUNDLED_PNG)
- fl_debug_var(FLTK_USE_BUNDLED_ZLIB)
-
- message(STATUS "--- *FIXME* include directories ---")
- fl_debug_var(FLTK_BUILD_INCLUDE_DIRECTORIES)
- fl_debug_var(FLTK_IMAGE_INCLUDE_DIRECTORIES)
-
- message("--- X11 ---")
- fl_debug_var(X11_FOUND)
- fl_debug_var(X11_INCLUDE_DIR)
- fl_debug_var(X11_LIBRARIES)
- fl_debug_var(X11_X11_LIB)
- fl_debug_var(X11_X11_INCLUDE_PATH)
- fl_debug_var(X11_Xft_INCLUDE_PATH)
- fl_debug_var(X11_Xft_LIB)
- fl_debug_var(X11_Xft_FOUND)
- fl_debug_var(PATH_TO_XLIBS)
- message(STATUS "[** end of options.cmake **]")
-endif(DEBUG_OPTIONS_CMAKE)
-unset(DEBUG_OPTIONS_CMAKE)
diff --git a/CMake/pen-support.c b/CMake/pen-support.c
deleted file mode 100644
index 3c3bed0be..000000000
--- a/CMake/pen-support.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- Test Pen/Tablet support availability (Windows).
-
- Copyright 2026 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
-*/
-
-/*
- CMake test function: test if this can be compiled.
- If compilation fails, then Pen/Tablet support can't be built and is disabled.
-*/
-
-/* We require Windows 8 or later features for Pen/Tablet support */
-
-# if !defined(WINVER) || (WINVER < 0x0602)
-# ifdef WINVER
-# undef WINVER
-# endif
-# define WINVER 0x0602
-# endif
-# if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0602)
-# ifdef _WIN32_WINNT
-# undef _WIN32_WINNT
-# endif
-# define _WIN32_WINNT 0x0602
-# endif
-
-#include <windows.h>
-
-int main() {
- return POINTER_CHANGE_FIRSTBUTTON_DOWN; /* required symbol */
-}
diff --git a/CMake/posixScandir.cxx b/CMake/posixScandir.cxx
deleted file mode 100644
index 8b91428b5..000000000
--- a/CMake/posixScandir.cxx
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#include <dirent.h>
-
-int func (const char *d, dirent ***list, void *sort) {
- int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort);
- return n;
-}
-
-int main() {
- return 0;
-}
diff --git a/CMake/pthread_mutex_recursive.c b/CMake/pthread_mutex_recursive.c
deleted file mode 100644
index 2a058822f..000000000
--- a/CMake/pthread_mutex_recursive.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- FLTK feature test: do we have PTHREAD_MUTEX_RECURSIVE ?
-*/
-#include <pthread.h>
-int main() {
- return PTHREAD_MUTEX_RECURSIVE;
-}
diff --git a/CMake/resources.cmake b/CMake/resources.cmake
deleted file mode 100644
index bad4279be..000000000
--- a/CMake/resources.cmake
+++ /dev/null
@@ -1,344 +0,0 @@
-#
-# Resource definitions to build the FLTK project using CMake (www.cmake.org)
-# Originally written by Michael Surette
-#
-# Copyright 1998-2024 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
-#
-
-#######################################################################
-# check for headers, libraries and functions
-#######################################################################
-
-# If CMAKE_REQUIRED_QUIET is 1 (default) the search is mostly quiet,
-# if it is 0 (or not defined) check_include_files() is more verbose
-# and the result of the search is logged with fl_debug_var().
-# This is useful for debugging.
-
-set(CMAKE_REQUIRED_QUIET 1)
-
-include(CheckIncludeFiles)
-include(CheckSymbolExists)
-
-
-macro(fl_find_header VAR HEADER)
- check_include_files("${HEADER}" ${VAR})
- if(NOT CMAKE_REQUIRED_QUIET)
- fl_debug_var(${VAR})
- endif(NOT CMAKE_REQUIRED_QUIET)
-endmacro(fl_find_header)
-
-
-#######################################################################
-# find git revision and store it in the CMake cache for reference
-#######################################################################
-
-# (1) Get current Git revision from `git rev-parse ...`
-# (2) Read Git revision from file `fltk_git_rev.dat`
-#
-# (1) This can fail if the FLTK source directory is not a Git checkout,
-# i.e. FLTK was downloaded as a distro (tarball).
-# (2) If (1) fails the file `fltk_git_rev.dat` is read. This file is
-# generated by the process to generate the distribution (makesrcdist).
-#
-
-set(git_rev_file ${FLTK_SOURCE_DIR}/fltk_git_rev.dat)
-
-set(git_revision "") # temporary variable
-
-execute_process(COMMAND
- git rev-parse HEAD # --short=${git_rev_size} HEAD
- OUTPUT_VARIABLE git_revision
- OUTPUT_STRIP_TRAILING_WHITESPACE
- WORKING_DIRECTORY ${FLTK_SOURCE_DIR}
- ERROR_QUIET
-)
-
-if(git_revision STREQUAL "")
-
- # Read git revision from a file generated by makesrcdist.
- # This file is located in the FLTK source directory
-
- if(EXISTS ${git_rev_file})
- file(READ ${git_rev_file} git_revision)
- string(STRIP "${git_revision}" git_revision)
- else()
- set(git_revision "unknown")
- endif()
-endif()
-
-set(FLTK_GIT_REVISION "${git_revision}"
- CACHE STRING
- "FLTK Git revision (do not change)"
- FORCE)
-
-# debug and unset temporary variables
-# fl_debug_var(git_revision)
-unset(git_rev_file)
-unset(git_revision)
-
-#######################################################################
-# Include FindPkgConfig for later use of pkg-config
-#######################################################################
-
-include(FindPkgConfig)
-
-# fl_debug_var(PKG_CONFIG_FOUND)
-# fl_debug_var(PKG_CONFIG_EXECUTABLE)
-# fl_debug_var(PKG_CONFIG_VERSION_STRING)
-
-#######################################################################
-# GitHub Issue #1001: try to "repair" the CMake Cache
-# GitHub Issue #1046: don't try "too hard" (see GitHub Issue)
-#######################################################################
-#
-# Note: we renamed "our" CMake cache variable OPENGL_GLU_INCLUDE_DIR
-# to FLTK_OPENGL_GLU_INCLUDE_DIR because the former is now defined
-# in find_package(OpenGL) (FindOpenGL.cmake) since CMake 3.29.0.
-#
-# We remove "our" cache variable if OPENGL_GLU_INCLUDE_DIR is defined
-# but FLTK_OPENGL_GLU_INCLUDE_DIR is not yet defined which indicates
-# the first execution after the rename.
-#
-# FIXME: we can remove this code some time after the release of FLTK 1.4.0.
-
-if(DEFINED OPENGL_GLU_INCLUDE_DIR AND NOT DEFINED FLTK_OPENGL_GLU_INCLUDE_DIR)
- unset(OPENGL_GLU_INCLUDE_DIR)
- unset(OPENGL_GLU_INCLUDE_DIR CACHE)
-endif() # (DEFINED OPENGL_GLU_INCLUDE_DIR AND NOT ...)
-
-#######################################################################
-# Find header files...
-#######################################################################
-
-if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "FreeBSD")
- list(APPEND CMAKE_REQUIRED_INCLUDES /usr/local/include)
-endif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "FreeBSD")
-
-fl_find_header(HAVE_ALSA_ASOUNDLIB_H alsa/asoundlib.h)
-fl_find_header(HAVE_DLFCN_H dlfcn.h)
-fl_find_header(HAVE_GL_GLU_H GL/glu.h)
-fl_find_header(HAVE_LOCALE_H locale.h)
-fl_find_header(HAVE_OPENGL_GLU_H OpenGL/glu.h)
-fl_find_header(HAVE_STDIO_H stdio.h)
-fl_find_header(HAVE_STRINGS_H strings.h)
-fl_find_header(HAVE_SYS_SELECT_H sys/select.h)
-fl_find_header(HAVE_SYS_STDTYPES_H sys/stdtypes.h)
-
-fl_find_header(HAVE_X11_XREGION_H "X11/Xlib.h;X11/Xregion.h")
-
-if(WIN32 AND NOT CYGWIN)
- # we don't use pthreads on Windows (except for Cygwin, see options.cmake)
- set(HAVE_PTHREAD_H 0)
-else()
- fl_find_header(HAVE_PTHREAD_H pthread.h)
-endif(WIN32 AND NOT CYGWIN)
-
-# Do we have PTHREAD_MUTEX_RECURSIVE ?
-
-if(HAVE_PTHREAD_H)
- try_compile(HAVE_PTHREAD_MUTEX_RECURSIVE
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/CMake/pthread_mutex_recursive.c
- )
-else()
- set(HAVE_PTHREAD_MUTEX_RECURSIVE 0)
-endif()
-
-# Special case for Microsoft Visual Studio generator (MSVC):
-#
-# The header files <GL/glu.h> and <locale.h> are located in the SDK's
-# for Visual Studio. If CMake is invoked from a desktop icon or the Windows
-# menu it doesn't have the correct paths to find these header files.
-# The CMake folks recommend not to search for these files at all, because
-# they must always be there, but we do anyway.
-# If we don't find them we issue a warning and continue anyway.
-#
-# Note: these cache variables can only be seen in "advanced" mode.
-
-if(MSVC)
-
- if(NOT HAVE_GL_GLU_H)
- message(STATUS "Info: Header file GL/glu.h was not found. Continuing...")
- set(HAVE_GL_GLU_H 1)
- endif(NOT HAVE_GL_GLU_H)
-
- if(NOT HAVE_LOCALE_H)
- message(STATUS "Info: Header file locale.h was not found. Continuing...")
- set(HAVE_LOCALE_H 1)
- endif(NOT HAVE_LOCALE_H)
-
-endif(MSVC)
-
-# Simulate the behavior of autoconf macro AC_HEADER_DIRENT, see:
-# https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Particular-Headers.html
-# "Check for the following header files. For the first one that is found
-# and defines 'DIR', define the listed C preprocessor macro ..."
-#
-# Note: we don't check if it really defines 'DIR', but we stop processing
-# once we found the first suitable header file.
-
-fl_find_header(HAVE_DIRENT_H dirent.h)
-
-if(NOT HAVE_DIRENT_H)
- fl_find_header(HAVE_SYS_NDIR_H sys/ndir.h)
- if(NOT HAVE_SYS_NDIR_H)
- fl_find_header(HAVE_SYS_DIR_H sys/dir.h)
- if(NOT HAVE_SYS_DIR_H)
- fl_find_header(HAVE_NDIR_H ndir.h)
- endif(NOT HAVE_SYS_DIR_H)
- endif(NOT HAVE_SYS_NDIR_H)
-endif(NOT HAVE_DIRENT_H)
-
-#----------------------------------------------------------------------
-# The following code is used to find the include path for freetype
-# headers to be able to #include <ft2build.h> in Xft.h.
-
-# where to find freetype headers
-
-find_path(FREETYPE_PATH freetype.h PATH_SUFFIXES freetype2)
-find_path(FREETYPE_PATH freetype/freetype.h PATH_SUFFIXES freetype2)
-
-if(FREETYPE_PATH AND ((NOT APPLE) OR FLTK_BACKEND_X11))
- list(APPEND FLTK_BUILD_INCLUDE_DIRECTORIES ${FREETYPE_PATH})
-endif(FREETYPE_PATH AND ((NOT APPLE) OR FLTK_BACKEND_X11))
-
-mark_as_advanced(FREETYPE_PATH)
-
-#######################################################################
-# libraries
-find_library(LIB_dl dl)
-if((NOT APPLE) OR FLTK_BACKEND_X11)
- find_library(LIB_fontconfig fontconfig)
-endif((NOT APPLE) OR FLTK_BACKEND_X11)
-find_library(LIB_freetype freetype)
-find_library(LIB_GL GL)
-find_library(LIB_MesaGL MesaGL)
-find_library(LIB_jpeg jpeg)
-find_library(LIB_png png)
-find_library(LIB_zlib z)
-find_library(LIB_m m)
-
-mark_as_advanced(LIB_dl LIB_fontconfig LIB_freetype)
-mark_as_advanced(LIB_GL LIB_MesaGL)
-mark_as_advanced(LIB_jpeg LIB_png LIB_zlib)
-mark_as_advanced(LIB_m)
-
-#######################################################################
-# functions
-include(CheckFunctionExists)
-
-# Save CMAKE_REQUIRED_LIBRARIES
-# Note: CMAKE_REQUIRED_LIBRARIES must be set for each search and
-# reset after the search to avoid to influence subsequent searches.
-# The original value is restored after all searches.
-
-if(DEFINED CMAKE_REQUIRED_LIBRARIES)
- set(SAVED_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
-else()
- unset(SAVED_REQUIRED_LIBRARIES)
-endif()
-set(CMAKE_REQUIRED_LIBRARIES)
-
-if(HAVE_DLFCN_H)
- set(HAVE_DLFCN_H 1)
-endif(HAVE_DLFCN_H)
-
-set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS})
-check_symbol_exists(dlsym "dlfcn.h" HAVE_DLSYM)
-set(CMAKE_REQUIRED_LIBRARIES)
-
-check_symbol_exists(localeconv "locale.h" HAVE_LOCALECONV)
-
-if(LIB_png)
- set(CMAKE_REQUIRED_LIBRARIES ${LIB_png})
- check_symbol_exists(png_get_valid "png.h" HAVE_PNG_GET_VALID)
- check_symbol_exists(png_set_tRNS_to_alpha "png.h" HAVE_PNG_SET_TRNS_TO_ALPHA)
- set(CMAKE_REQUIRED_LIBRARIES)
-endif(LIB_png)
-
-check_symbol_exists(scandir "dirent.h" HAVE_SCANDIR)
-check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
-
-# not really true but we convert strcasecmp calls to _stricmp calls in flstring.h
-if(MSVC)
- set(HAVE_STRCASECMP 1)
-endif(MSVC)
-
-check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP)
-
-check_symbol_exists(strlcat "string.h" HAVE_STRLCAT)
-check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY)
-check_symbol_exists(vsnprintf "stdio.h" HAVE_VSNPRINTF)
-
-check_symbol_exists(setenv "stdlib.h" HAVE_SETENV)
-
-# Windows doesn't require '-lm' for trunc(), other platforms do
-if(LIB_m AND NOT WIN32)
- set(CMAKE_REQUIRED_LIBRARIES ${LIB_m})
-endif()
-
-check_symbol_exists(trunc "math.h" HAVE_TRUNC)
-
-set(CMAKE_REQUIRED_LIBRARIES)
-
-if(HAVE_SCANDIR AND NOT HAVE_SCANDIR_POSIX)
- set(MSG "POSIX compatible scandir")
- message(STATUS "Looking for ${MSG}")
- try_compile(V
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/CMake/posixScandir.cxx
- )
- if(V)
- message(STATUS "${MSG} - found")
- set(HAVE_SCANDIR_POSIX 1 CACHE INTERNAL "")
- else()
- message(STATUS "${MSG} - not found")
- set(HAVE_SCANDIR_POSIX HAVE_SCANDIR_POSIX-NOTFOUND)
- endif(V)
-endif(HAVE_SCANDIR AND NOT HAVE_SCANDIR_POSIX)
-mark_as_advanced(HAVE_SCANDIR_POSIX)
-
-# restore CMAKE_REQUIRED_LIBRARIES
-if(DEFINED SAVED_REQUIRED_LIBRARIES)
- set(CMAKE_REQUIRED_LIBRARIES ${SAVED_REQUIRED_LIBRARIES})
- unset(SAVED_REQUIRED_LIBRARIES)
-else()
- unset(CMAKE_REQUIRED_LIBRARIES)
-endif()
-
-#######################################################################
-# packages
-
-# Doxygen: necessary for HTML and PDF docs
-find_package(Doxygen)
-
-# LaTex: necessary for PDF docs (note: FindLATEX doesn't return LATEX_FOUND)
-
-# Note: we only check existence of `latex' (LATEX_COMPILER), hence
-# building the pdf docs may still fail because of other missing tools.
-
-set(LATEX_FOUND)
-if(DOXYGEN_FOUND)
- find_package(LATEX)
- if(LATEX_COMPILER AND NOT LATEX_FOUND)
- set(LATEX_FOUND YES)
- endif(LATEX_COMPILER AND NOT LATEX_FOUND)
-endif(DOXYGEN_FOUND)
-
-# message("Doxygen found : ${DOXYGEN_FOUND}")
-# message("LaTex found : ${LATEX_FOUND}")
-# message("LaTex Compiler : ${LATEX_COMPILER}")
-
-# Cleanup: unset local variables
-
-unset(CMAKE_REQUIRED_QUIET)
diff --git a/CMake/setup.cmake b/CMake/setup.cmake
deleted file mode 100644
index 266e1299a..000000000
--- a/CMake/setup.cmake
+++ /dev/null
@@ -1,209 +0,0 @@
-#
-# CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
-# Originally written by Michael Surette
-#
-# 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
-#
-
-#######################################################################
-# basic setup
-#######################################################################
-
-set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin)
-set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib)
-set(ARCHIVE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib)
-
-# Search for modules in the FLTK source dir first
-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
-
-# Setup install locations (requires CMake 2.8.4)
-
-include(GNUInstallDirs)
-
-set(FLTK_BINDIR ${CMAKE_INSTALL_BINDIR} CACHE PATH
- "Binary install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
-set(FLTK_LIBDIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH
- "Library install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
-set(FLTK_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH
- "Public header install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
-set(FLTK_DATADIR ${CMAKE_INSTALL_DATADIR} CACHE PATH
- "Non-arch data install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
-set(FLTK_MANDIR ${CMAKE_INSTALL_MANDIR} CACHE PATH
- "Manual install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
-set(FLTK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc CACHE PATH
- "Non-arch doc install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
-
-
-#######################################################################
-# Initialize variables needed to collect include directories etc..
-# Some of these variables are used to *append* other values later
-#######################################################################
-
-set(FLTK_BUILD_INCLUDE_DIRECTORIES "")
-set(FLTK_IMAGE_INCLUDE_DIRECTORIES "")
-set(FLTK_IMAGE_LIBRARIES "")
-set(FLTK_IMAGE_LIBRARIES_SHARED "")
-
-set(FLTK_CFLAGS "")
-set(FLTK_LIBRARIES "")
-set(FLTK_LIBRARIES_SHARED "")
-
-# Remember root of FLTK source directory in case we're later in a subdirectory.
-# Used for instance to find the source directory for doxygen docs
-
-set(FLTK_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-
-if(FLTK_SOURCE_DIR STREQUAL ${CMAKE_SOURCE_DIR})
- set(FLTK_IS_TOPLEVEL TRUE)
-else()
- set(FLTK_IS_TOPLEVEL FALSE)
-endif()
-
-# Note: FLTK_INCLUDE_DIRS is used to export the required include directories
-# in FLTKConfig.cmake etc.
-# ### FIXME ### check if we really need this ...
-
-set(FLTK_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
-
-# FLTK_BUILD_INCLUDE_DIRECTORIES is used to build the main FLTK lib
-
-set(FLTK_BUILD_INCLUDE_DIRECTORIES)
-
-# Some of these variables are used to *append* other values later
-
-set(FLTK_LDLIBS "")
-set(FLTK_LIBRARIES "")
-set(IMAGELIBS "")
-set(LDFLAGS "")
-set(LINK_LIBS "")
-set(STATICIMAGELIBS "")
-
-#######################################################################
-# platform dependent information
-#######################################################################
-
-# set where config files go
-if(WIN32 AND NOT CYGWIN)
- set(FLTK_CONFIG_PATH CMake)
-elseif(APPLE AND NOT FLTK_BACKEND_X11)
- set(FLTK_CONFIG_PATH ${FLTK_DATADIR}/fltk)
-else()
- set(FLTK_CONFIG_PATH ${FLTK_DATADIR}/fltk)
-endif(WIN32 AND NOT CYGWIN)
-
-include(TestBigEndian)
-TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
-
-if(CMAKE_GENERATOR MATCHES "Xcode")
- # Tell Xcode to regenerate scheme information automatically whenever the
- # CMake configuration changes without asking the user
- set(CMAKE_XCODE_GENERATE_SCHEME 1)
-endif()
-
-if(APPLE)
- # Check if the __MAC_OS_X_VERSION_MAX_ALLOWED compile time macro is at least
- # the version encoded in SDK_VERSION and return TRUE or FALSE in RESULT.
- # Note 1: try_compile() always creates an *internal* CMake cache variable for
- # the result which we set to 'FLTK_CHECK_OSX_MAX_ALLOWED_${SDK_VERSION}'.
- # Note 2: 'FLTK_' to avoid polluting the cache if FLTK is built as a subproject.
- # Note 3: We don't care about the cache, i.e. we run try_compile() unconditionally
- # so users can switch SDK's, particularly if they *upgrade* Xcode.
-
- function(CHECK_OSX_MAX_ALLOWED SDK_VERSION RESULT)
- set(_result FLTK_CHECK_OSX_MAX_ALLOWED_${SDK_VERSION})
- try_compile(${_result}
- ${CMAKE_CURRENT_BINARY_DIR}/CHECK_OSX_MAX_ALLOWED_${SDK_VERSION}
- SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/CMake/macOSMaxAllowed.c
- COMPILE_DEFINITIONS -DSDK_VERSION_CHECK=${SDK_VERSION}
- )
- set(${RESULT} ${${_result}} PARENT_SCOPE)
- endfunction()
-
- # APPLE macOS setup
- set(HAVE_STRCASECMP 1)
- set(HAVE_DIRENT_H 1)
- set(HAVE_SNPRINTF 1)
- set(HAVE_VSNPRINTF 1)
- set(HAVE_SCANDIR 1)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
- if(FLTK_BACKEND_X11)
- if(NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0)) # a.k.a. macOS version ≥ 10.13
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_HAS_THREAD_API_PTHREAD")
- endif(NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0))
- else()
- set(FLTK_COCOA_FRAMEWORKS "-framework Cocoa")
- if (NOT (CMAKE_OSX_ARCHITECTURES STREQUAL "ppc" OR CMAKE_OSX_ARCHITECTURES STREQUAL "i386"))
- CHECK_OSX_MAX_ALLOWED(150000 SDK_15_AVAILABLE) # at least SDK 15.0.0 ?
- if (SDK_15_AVAILABLE)
- list(APPEND FLTK_COCOA_FRAMEWORKS "-weak_framework ScreenCaptureKit") # 15.0
- list(APPEND FLTK_COCOA_FRAMEWORKS "-weak_framework UniformTypeIdentifiers") # 11.0
- else(SDK_15_AVAILABLE)
- CHECK_OSX_MAX_ALLOWED(110000 SDK_11_AVAILABLE) # at least SDK 11.0.0 ?
- if (SDK_11_AVAILABLE)
- list(APPEND FLTK_COCOA_FRAMEWORKS "-weak_framework UniformTypeIdentifiers")
- endif(SDK_11_AVAILABLE)
- endif(SDK_15_AVAILABLE)
- endif()
- endif(FLTK_BACKEND_X11)
-endif(APPLE)
-
-if(WIN32)
- # we do no longer define WIN32 or _WIN32 (since FLTK 1.4.0)
- # ... but if we did, we'd define _WIN32 (since FLTK 1.4.0)
- # add_definitions (-D_WIN32)
- if(MSVC)
- add_definitions (-DWIN32_LEAN_AND_MEAN)
- add_definitions (-D_CRT_SECURE_NO_WARNINGS)
- if(NOT MSVC_VERSION VERSION_LESS 1900) # Visual Studio 2015
- add_compile_options (/utf-8) # equivalent to `/source-charset:utf-8 /execution-charset:utf-8`
- endif()
- set(BORDER_WIDTH 2)
- endif(MSVC)
-
- # Don't use the following code, it breaks building with MSYS2/UCRT64
- # See GitHub PR #1167. Solution is to remove the entire block!
-
- ### if(MINGW AND EXISTS /mingw)
- ### list(APPEND CMAKE_PREFIX_PATH /mingw)
- ### endif(MINGW AND EXISTS /mingw)
-
-endif(WIN32)
-
-#######################################################################
-# size of ints
-include(CheckTypeSize)
-
-CHECK_TYPE_SIZE(short SIZEOF_SHORT)
-CHECK_TYPE_SIZE(int SIZEOF_INT)
-CHECK_TYPE_SIZE(long SIZEOF_LONG)
-CHECK_TYPE_SIZE("long long" HAVE_LONG_LONG)
-
-if(${SIZEOF_SHORT} MATCHES "^2$")
- set(U16 "unsigned short")
-endif(${SIZEOF_SHORT} MATCHES "^2$")
-
-if(${SIZEOF_INT} MATCHES "^4$")
- set(U32 "unsigned")
-else()
- if(${SIZEOF_LONG} MATCHES "^4$")
- set(U32 "unsigned long")
- endif(${SIZEOF_LONG} MATCHES "^4$")
-endif(${SIZEOF_INT} MATCHES "^4$")
-
-if(${SIZEOF_INT} MATCHES "^8$")
- set(U64 "unsigned")
-else()
- if(${SIZEOF_LONG} MATCHES "^8$")
- set(U64 "unsigned long")
- endif(${SIZEOF_LONG} MATCHES "^8$")
-endif(${SIZEOF_INT} MATCHES "^8$")
diff --git a/CMake/variables.cmake b/CMake/variables.cmake
deleted file mode 100644
index 6fcaed395..000000000
--- a/CMake/variables.cmake
+++ /dev/null
@@ -1,177 +0,0 @@
-#
-# This file sets variables for common use in export.cmake and install.cmake
-# Originally written by Michael Surette
-#
-# Copyright 1998-2024 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
-#
-
-#######################################################################
-
-set(DEBUG_VARIABLES_CMAKE 0)
-if(DEBUG_VARIABLES_CMAKE)
- message(STATUS "[** variables.cmake **]")
- fl_debug_var(HAVE_DLSYM)
- fl_debug_var(CMAKE_DL_LIBS)
- fl_debug_var(CMAKE_EXE_LINKER_FLAGS)
- fl_debug_var(LDFLAGS)
- fl_debug_var(GLLIBS)
- fl_debug_var(IMAGELIBS)
- fl_debug_var(STATICIMAGELIBS)
- fl_debug_var(FLTK_LDLIBS)
- fl_debug_var(LIB_jpeg)
- fl_debug_var(LIB_png)
- fl_debug_var(LIB_zlib)
- fl_debug_var(FLTK_LIBRARIES)
-endif(DEBUG_VARIABLES_CMAKE)
-
-#######################################################################
-# add several libraries
-# FIXME: libraries may need reordering.
-# FIXME: check fontconfig conditions (only if Xft is used or ...)
-
-if(WIN32)
- list(APPEND FLTK_LDLIBS -lole32 -luuid -lcomctl32 -lws2_32 -lwinspool)
-elseif(APPLE AND NOT FLTK_BACKEND_X11)
- list(APPEND FLTK_LDLIBS ${FLTK_COCOA_FRAMEWORKS})
-elseif(FLTK_USE_WAYLAND)
- foreach(_lib WLDCURSOR WLDCLIENT XKBCOMMON)
- list(APPEND FLTK_LDLIBS "${${_lib}_LDFLAGS}")
- endforeach()
- if(FLTK_USE_DBUS AND DBUS_FOUND)
- list(APPEND FLTK_LDLIBS "${DBUS_LDFLAGS}")
- endif()
- if(USE_SYSTEM_LIBDECOR)
- list(APPEND FLTK_LDLIBS ${SYSTEM_LIBDECOR_LDFLAGS})
- endif(USE_SYSTEM_LIBDECOR)
-else()
- list(APPEND FLTK_LDLIBS -lm)
-endif(WIN32)
-
-if(LIB_fontconfig)
- list(APPEND FLTK_LDLIBS -lfontconfig)
-endif(LIB_fontconfig)
-
-# add "-ldl" or whatever is necessary according to CMake (CMAKE_DL_LIBS)
-if(HAVE_DLSYM)
- foreach(LIB ${CMAKE_DL_LIBS})
- list(APPEND FLTK_LDLIBS "-l${LIB}")
- endforeach()
-endif(HAVE_DLSYM)
-
-#######################################################################
-# Set variables for fltk-config (generated from fltk-config.in)
-#######################################################################
-
-# Variables in fltk-config.in (@VAR@) are used in configure(.ac)
-# and in CMake so their names and usage must be synchronized.
-# CMake generates two instances of fltk-config, one that can be used
-# directly in the build tree (see export.cmake) and one that is copied
-# to the installation directory (see install.cmake). Common variables
-# should be set here, whereas variables with different values should
-# be set in install.cmake or export.cmake, respectively.
-
-if(WIN32)
- set(LDFLAGS "${CMAKE_EXE_LINKER_FLAGS} -mwindows")
-endif()
-
-set(IMAGELIBS)
-set(STATICIMAGELIBS)
-
-if(FLTK_USE_BUNDLED_JPEG)
- list(APPEND IMAGELIBS -lfltk_jpeg)
- list(APPEND STATICIMAGELIBS \$libdir/libfltk_jpeg.a)
-else()
- if(LIB_jpeg)
- # fl_debug_var(LIB_jpeg)
- list(APPEND IMAGELIBS ${LIB_jpeg})
- list(APPEND STATICIMAGELIBS ${LIB_jpeg})
- endif(LIB_jpeg)
-endif(FLTK_USE_BUNDLED_JPEG)
-
-if(FLTK_USE_BUNDLED_PNG)
- list(APPEND IMAGELIBS -lfltk_png)
- list(APPEND STATICIMAGELIBS \$libdir/libfltk_png.a)
-else()
- if(LIB_png)
- # fl_debug_var(LIB_png)
- list(APPEND IMAGELIBS ${LIB_png})
- list(APPEND STATICIMAGELIBS ${LIB_png})
- endif(LIB_png)
-endif(FLTK_USE_BUNDLED_PNG)
-
-if(FLTK_USE_BUNDLED_ZLIB)
- list(APPEND IMAGELIBS -lfltk_z)
- list(APPEND STATICIMAGELIBS \$libdir/libfltk_z.a)
-else()
- if(LIB_zlib)
- list(APPEND IMAGELIBS ${LIB_zlib})
- list(APPEND STATICIMAGELIBS ${LIB_zlib})
- endif(LIB_zlib)
-endif(FLTK_USE_BUNDLED_ZLIB)
-
-# remove duplicates from CMake "list" variables for fltk-config
-
-list(REMOVE_DUPLICATES GLLIBS)
-list(REMOVE_DUPLICATES FLTK_LDLIBS)
-list(REMOVE_DUPLICATES IMAGELIBS)
-list(REMOVE_DUPLICATES STATICIMAGELIBS)
-
-# convert CMake lists to strings with spaces for fltk-config
-
-string(REPLACE ";" " " GLLIBS "${GLLIBS}")
-string(REPLACE ";" " " LIBS "${FLTK_LDLIBS}")
-string(REPLACE ";" " " IMAGELIBS "${IMAGELIBS}")
-string(REPLACE ";" " " STATICIMAGELIBS "${STATICIMAGELIBS}")
-
-#######################################################################
-set(CC ${CMAKE_C_COMPILER})
-set(CXX ${CMAKE_CXX_COMPILER})
-
-set(ARCHFLAGS ${FLTK_ARCHFLAGS})
-
-string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_UPPER)
-if(${BUILD_UPPER})
- set(CFLAGS "${CMAKE_C_FLAGS_${BUILD_UPPER}} ${CFLAGS}")
-endif(${BUILD_UPPER})
-
-set(CFLAGS "${FLTK_OPTION_OPTIM} ${CMAKE_C_FLAGS} ${CFLAGS}")
-foreach(arg ${FLTK_CFLAGS})
- set(CFLAGS "${CFLAGS} ${arg}")
-endforeach(arg ${FLTK_CFLAGS})
-
-set(CXXFLAGS "${CFLAGS}")
-
-if(${CMAKE_SYSTEM_NAME} STREQUAL "AIX")
- set(SHAREDSUFFIX "_s")
-else()
- set(SHAREDSUFFIX "")
-endif(${CMAKE_SYSTEM_NAME} STREQUAL "AIX")
-
-if(DEBUG_VARIABLES_CMAKE)
- message(STATUS "") # empty line
- fl_debug_var(HAVE_DLSYM)
- fl_debug_var(CMAKE_DL_LIBS)
- fl_debug_var(CMAKE_EXE_LINKER_FLAGS)
- fl_debug_var(LDFLAGS)
- fl_debug_var(FLTK_LDLIBS)
- fl_debug_var(LIBS)
- fl_debug_var(GLLIBS)
- fl_debug_var(IMAGELIBS)
- fl_debug_var(STATICIMAGELIBS)
- fl_debug_var(LIB_jpeg)
- fl_debug_var(LIB_png)
- fl_debug_var(LIB_zlib)
- fl_debug_var(FLTK_LIBRARIES)
- message(STATUS "[** end of variables.cmake **]")
-endif(DEBUG_VARIABLES_CMAKE)
-unset(DEBUG_VARIABLES_CMAKE)