summaryrefslogtreecommitdiff
path: root/CMake
AgeCommit message (Collapse)Author
3 dayswip: forkmaxim nikonov
7 daysFix typo in CMake config fileAlbrecht Schlosser
10 daysCMake: add try_compile() to figure out if Pen/Tablet is supportedAlbrecht Schlosser
This test is specifically intended to disable Pen/Tablet support on classic MinGW (32-bit) platforms that lack required symbol definitions although Pen/Tablet support might be supported by the Windows system. This test can be extended for other platforms, but for now it's performed only on Windows.
2026-01-08Add CMake option FLTK_OPTION_PEN_SUPPORT (default: ON)Albrecht Schlosser
This option can be used to disable pen/tablet support if there are build problems on a particular platform or build system (e.g. MinGW) so users can continue to build FLTK 1.5. Users can also choose to disable pen support if they don't need it.
2026-01-05Restore building with CMake option FLTK_BUILD_FLUID=0ManoloFLTK
2026-01-05Wayland: use modern approach to cursor shapes with the "Cursor shape" protocol.ManoloFLTK
This removes the need to guess names of files each theme gives to cursor shapes and makes linking with dbus superfluous when the compositor supports the new protocol. The old, surface-based approach to cursor shapes remains used for custom shapes.
2026-01-04Add an option and the first program to create screenshotsAlbrecht Schlosser
This is the first step in creating additional programs for saving screenshots for documentation purposes. These screenshots must be saved in the documentation/images directory and checked into the Git repository. These programs allow developers to create new screenshots or change existing ones. More screenshots may be created by programs in the /test/ folder. To-do: add more *new* screenshot programs, and if useful, move some existing programs from the `/test/` folder to `/screenshots/`, such as `test/resize-example*.cxx` and maybe more.
2025-12-08Wayland: add support of the "XDG dialog windows" protocolManoloFLTK
2025-11-02Fix "CMake: Fallback to libOpenGL (no-X11 OpenGL)" (#1251)ManoloFLTK
2025-06-03Add build option FLTK_USE_DBUS to allow build w/o dbus (PR #1252)ManoloFLTK
Thanks to @lanodan for most of the source code.
2025-05-28Fix usage of FLTK_BACKEND_WAYLAND and FLTK_USE_WAYLANDAlbrecht Schlosser
- Do not change or remove the cache variable FLTK_BACKEND_WAYLAND: this is an option set (and must only be changed) by the user. - CMake/options.cmake: check Wayland availability if option FLTK_BACKEND_WAYLAND is ON and set the result variable FLTK_USE_WAYLAND accordingly. - Replace FLTK_BACKEND_WAYLAND with FLTK_USE_WAYLAND everywhere else, except as noted above: in options.cmake.
2025-05-06Remove hardcoded version numbers: part 1Albrecht Schlosser
The goal is to change the version number for a new release only in CMakeLists.txt. This is the first step. Details: - CMake/gen_config.cmake: this new file is included to generate the header files config.h (private, root directory), and FL/fl_config.h (public, can be installed). This file implements also ABI version checks (removed from FL/Enumerations.H and with more checks). Warnings are issued if the chosen ABI version is invalid. - CMake/export.cmake: code to generate 'config.h' was moved to CMake/gen_config.cmake. - CMake/options.cmake: set default of FLTK_BUILD_FORMS=OFF + comments - CMakeLists.txt: move generation of FL/fl_config.h to gen_config.cmake, add API and ABI versions to CMake summary, - FL/Enumerations.H: remove most of the version number details which are now included in FL/fl_config.h. This needed also some doxygen related changes. - README.CMake.txt: improve docs of FL_ABI_VERSION and some more. Reflect the new default of CMake option FLTK_BUILD_FORMS (OFF). - documentation/Doxyfile.in: add FL/fl_config.h to file list. This file is created in the build tree (and may be "installed"). - fl_config.h.in: add version number details that have been moved here from Enumerations.H (used to generate FL/fl_config.h).
2025-05-05Rename config header input files to better namesAlbrecht Schlosser
Up to FLTK 1.4 we had two distinct input files for each header file: one for configure and one for CMake. Since 1.5 we have only one input file for each header which can now have a more appropriate name. 1) configh.cmake.in -> config.h.in 2) fl_config.cmake.in -> fl_config.h.in
2025-04-21Fix "fully support ... own shared libraries" (#1238)Albrecht Schlosser
- If shared libraries are built, then fluid, fltk-options, and the "games" are linked against the shared FLTK libraries. On some platforms the static and the shared versions of fluid and fltk-options are built. The games are only built if FLTK_BUILD_TEST is enabled. - The CMake 'install' target now installs the games (if built) and their man pages on all platforms (no matter if that is useful, for instance on Windows). - On macOS 'CMAKE_INSTALL_RPATH' is set so *installed* programs automatically find their shared FLTK libraries. The "shared" versions of fluid and fltk-options got their own '.plist' files. This works for both the executables themselves as well as those included in bundles. There may be more to do on the macOS platform.
2025-04-02CMake: check version for some properties in fl_debug_target()Albrecht Schlosser
Debug only, if fl_debug_target() is used: Prior to CMake 3.19 some properties of "INTERFACE_LIBRARY targets" can't be read with get_property(). These properties are now excluded if the CMake version is lower than 3.19.
2025-04-01options.cmake: Check Threads_FOUND, not CMAKE_HAVE_THREADS_LIBRARYAaron M. Ucko
The former's been available since CMake v2.8 and documented since v3.17; the latter was never documented and quietly went away in CMake v3.24.
2025-03-19Remove obsolete build option 'FLTK_OPTION_STD'Albrecht Schlosser
This option is no longer needed since FLTK 1.5 always requires C++11.
2025-03-18Fix "X11 library missing in fltk-config" (#1228)ManoloFLTK
2025-03-16Remove libfltk_cairo (fltk::cairo)Albrecht Schlosser
This library is no longer needed and was "empty" for backwards compatibility since FLTK 1.4.0.
2025-03-13CMake: improve setting C++ standard and configuration summaryAlbrecht Schlosser
CMake/fl_add_library.cmake: set target_compile_features(.. cxx_std_NN) which is inherited by consumers of the library. This prevents CMake user projects from failing if they would otherwise compile with an older C++ standard. CMake/fl_debug_var.cmake: add INTERFACE_COMPILE_FEATURES to fl_debug_target() CMake/fl_summary.cmake: update summary format for longer variable names CMakeLists.txt: - check CMAKE_CXX_STANDARD given by the user (commandline) and set C++ standard related CMake variables in the CMake cache. The latter is experimental: setting in the cache may be reverted. - add C++ standard related info to configure summary.
2025-03-08CMake: set FLTK_OPTION_STD effectively "always on"Albrecht Schlosser
Temporarily done by setting the internal variable FLTK_USE_STD to 1. This affects FL/fl_config.h where FLTK_USE_STD will always be 1. Source code that checks this variable should be fixed soon.
2025-03-07Fix "fltk autotools build does not link against libXft" (#1202)ManoloFLTK
libXft was erroneously present in the link command when using Pango and Cairo. This is fixed by disconnecting the GUI scaling code from use of Xft. This commit also makes sure that when Wayland is used, pkg-config is available on the build machine. This allows to remove from file CMake/options.cmake code that was labelled with "FIXME".
2025-02-21Bump version numbers to 1.4.2Albrecht Schlosser
2025-01-16MSYS2: Correctly detect ucrt64 environment (PR #1167)Albrecht Schlosser
This fix is different than the proposed PR. The PR will be closed and not merged. Closes #1167.
2024-12-09No need to link to libgtk when using package libdecor-0-devManoloFLTK
2024-11-28Improve procedure to construct best link command for macOS platformManoloFLTK
As discussed between Matthias, Albrecht and Manolo, the best procedure is - use MAC_OS_X_VERSION_MAX_ALLOWED but not __MAC_OS_X_VERSION_MAX_ALLOWED; - compile helper file CMake /macOSMaxAllowed.c to detect whether the SDK in use is in version above a given threshold version number; - based upon the result of this check, decide to weakly link or not a given framework.
2024-11-05MacOS: Fix build folder for detection of SDK version (#1103)Albrecht Schlosser
Sorry for the noise...
2024-11-05MacOS: Improve detection of SDK version (#1103)Albrecht Schlosser
CMake/macOSMaxAllowed.c: avoid C compiler warning in test code CMake/setup.cmake, technical changes: - optimization: test SDK 15.0.0 first to avoid unnecessary test if true - use a function instead of a macro - use different names for (cached) result variables - use prefix FLTK_ for cache variables Note: the cache variables are marked 'internal': you may need to grep CMakeCache.txt to view them.
2024-11-04MacOS version check using try_compile: #1103Matthias Melcher
This change will work as well when cross-compiling.
2024-11-04Using try_run to get __MAC_OS_X_VERSION_MAX_ALLOWED (#1105)Matthias Melcher
2024-10-09CMake: ignore FLTK_MSVC_RUNTIME_DLL on other platformsAlbrecht Schlosser
This commit suppresses a CMake warning if FLTK_MSVC_RUNTIME_DLL is defined on the CMake commandline on platforms that don't use it.
2024-09-03CMake/Windows: enable MSVC runtime DLL option for Clang (#1058)Albrecht Schlosser
User @supsm reported that using LLVM/clang to compile together with the MSVC linker should support the MSVC runtime DLL selection. This commit enables the option on Windows except MinGW and MSYS rather than MSVC only.
2024-08-31 CMake: replace check_function_exists() with check_symbol_exists() (#1053)ManoloFLTK
2024-08-30macOS: Fix installing partial 'FLTK.framework' (#961)Albrecht Schlosser
... which is not a real macOS "Framework". Note that users building and *installing* FLTK should either install in a fresh directory or delete the entire 'FLTK.framework' tree if they are reusing an existing install directory because it will not be deleted by subsequent installs.
2024-08-26Display Git revision in docs generated from releases (#499)Albrecht Schlosser
- makesrcdist: store Git revision in a file in the tarball - CMake/resources.cmake: get git revision either from Git or file and store it as CMake cache variable 'FLTK_GIT_REVISION' for reference - documentation/*: get git revision from git or file - fluid/documentation/*: get git revision from git or file
2024-08-25CMake: replace check_function_exists() for trunc() (#1049)Albrecht Schlosser
Part 1: replace the check for trunc() with check_symbol_exists(). Part 2 (to be done): replace all occurrences of the macro check_function_exists() with check_symbol_exists() if possible.
2024-08-23CMake: remove cache consistency check (#1046)Albrecht Schlosser
The attempted consistency check to remove FLTK's obsolete cache variable OPENGL_GLU_INCLUDE_DIR which is used by CMake 3.29+ could cause false positives, at least on macOS, as reported on issue #1046. This modified code removes OPENGL_GLU_INCLUDE_DIR if it is defined but FLTK_OPENGL_GLU_INCLUDE_DIR is not (yet) defined which indicates the first configure execution with the new code.
2024-08-08CMake: remove debug statementsAlbrecht Schlosser
2024-08-08CMake: fix usage of OPENGL_GLU_INCLUDE_DIR (#1001)Albrecht Schlosser
This commit consists of two parts: 1. CMake/resources.cmake: remove the old variable OPENGL_GLU_INCLUDE_DIR from the CMake cache if possible, otherwise enforce a clean build. 2. src/CMakeLists.txt, CMake/options.cmake: use the new variable name FLTK_OPENGL_GLU_INCLUDE_DIR. For details please see GitHub Issue #1001.
2024-08-06Add -lwinspool necessary for new class Fl_PDF_File_SurfaceManoloFLTK
2024-06-16Link frameworks used by recent macOS versions with -weak_frameworkManoloFLTK
This allows FLTK apps to use the recent frameworks when they run on recent macOS versions even if the minimum supported macOS version of these apps is more ancient than the framework.
2024-06-14macOS 15.0 Sequoia: fix capture of window titlebarsManoloFLTK
The previous procedure using CGWindowListCreateImageFromArray() is obsoleted in macOS 15.0 . The new procedure requires an additional framework: ScreenCaptureKit; FLTK uses it only for macOS ≥ 15.0
2024-05-13CMake: improve linking OpenGL3 example programs (#959)Albrecht Schlosser
- Remove find_library(LIB_GLEW ...) from 'resources.cmake' - Use the variable FLTK_GLEW_DIR to "find" a user supplied GLEW library for OpenGL3 example programs (examples/OpenGL3*.cxx). Both static and shared libs (DLLs) are supported, but the static library is preferred to avoid DLL dependencies. - Define preprocessor macro 'GLEW_STATIC' by CMake compile definitions if and only if the static glew library (glew32s) was found and linked. The previous code defined 'GLEW_STATIC' unconditionally in the source code which led to undefined references if a shared lib (DLL) was used.
2024-05-13CMake: improve finding cairo.dll on WindowsAlbrecht Schlosser
- don't use pkg-config to find Cairo if FLTK_CAIRO_DIR is set - use FLTK_CAIRO_DIR to locate Cairo headers and DLL if it is set - otherwise try to find Cairo with pkg-config anyway This prevents accidentally "finding" the system Cairo libs provided by MSYS - which would tie the FLTK library and user programs to MSYS, i.e. it would make FLTK programs depend on the MSYS installation.
2024-05-13Fix "Cannot build project with CMake ..." (#970)Albrecht Schlosser
... (add_library cannot create ALIAS target "fltk" because target "fltk::fltk" is imported but not globally visible) It turned out that this was due to a CMake feature that was changed in CMake 3.18. This commit makes imported FLTK targets globally visible for CMake versions less than 3.18.
2024-05-05CMake: improve output of fl_debug_target()Albrecht Schlosser
Todo: check "*LOCATION" properties ...
2024-05-03macOS + CMake: fix use of optional framework UniformTypeIdentifiersManoloFLTK
2024-05-03 CMake: don't put freetype stuff in include directories for macOSManoloFLTK
This removes these warnings for each source file compiled osxcross: warning: possibly dangerous include path specified: '-I /usr/include/freetype2' osxcross: info: you can silence this warning via 'OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1' (env) when cross-compiling from Linux to macOS.
2024-05-02Remove commit 4a31d49 that breaks X11 buildManoloFLTK
2024-05-02CMake: put freetype stuff in include directories for X11 onlyManoloFLTK
This would create these warnings for each source file compiled osxcross: warning: possibly dangerous include path specified: '-I /usr/include/freetype2' osxcross: info: you can silence this warning via 'OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1' (env) when cross-compiling from Linux to macOS.