summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
AgeCommit message (Collapse)Author
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-04Add FLTK_BUILD_SCREENSHOTS option info to CMake build summaryAlbrecht Schlosser
+ build screenshot programs if option FLTK_BUILD_SCREENSHOTS=ON: don't `EXCLUDE_FROM_ALL` because the option must be set anyway.
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-28Generate code block documentation using FLTK (#1353)Matthias Melcher
The Doxygen-to-pdf toolchain can not easily generate pdf's with Japanese and Chinese characters. This patch generates code blocks by rendering them in FLTK.
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-24Enable CPack support to build binary packages and installersAlbrecht Schlosser
This minimal implementation works and enables basic (mostly default) CPack support to build binary packages of FLTK (RPM, TGZ, NSIS, ...). Users need the required tools like `rpmbuild` to build a particular type of package or installer. Using EPM or rpmbuild directly with a provided "list" file has been discontinued: fltk.list.in (EPM) and fltk.spec.in (RPM) have consequently been deleted. README.CPack.txt: basic documentation
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-28macOS: disable automatic code signing when using XcodeAlbrecht Schlosser
This is the default. Users can still override this if they have a valid certificate.
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-03-25Disallow in-source buildsAlbrecht Schlosser
Rationale: 1. Building in-source creates a lot of untracked files in the source tree. We need to take care not to commit any of them, hence we have to maintain .gitignore files in several directories. 2. Tests reveal that there are even files in git that are modified in the source tree when building docs etc. which means e.g. that builds can't be "repeated" after upgrading the sources, and that those files could be committed by accident. To avoid this we'd have to reorganize the build procedure and make it even more complex rather than simplifying it. 3. With autoconf/configure/make we didn't have a choice, i.e. we had to allow in-source builds with configure/Makefiles anyway. This is no longer true since we removed configure/make support. Note, todo: if this commit doesn't introduce unexpected issues, then we can remove a lot of stuff from the .gitignore files, but this is left for a later commit.
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-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-07Improve setting minimal compiler standard (C++11)Albrecht Schlosser
... so the user can override all settings. This may need more tweaks in the future.
2025-03-07Fl_String is now just an alias for std::string.Matthias Melcher
All mentions of Fl_String will be replaced with std::string and the Fl_String implementation will be removed.
2025-03-06Update version numbers to 1.5.0Albrecht Schlosser
2025-02-21Bump version numbers to 1.4.2Albrecht Schlosser
2024-12-09Bump version numbers for release 1.4.1Albrecht Schlosser
To do: update CHANGES.txt with real info.
2024-08-09CMake: add FLTKConfigVersion.cmakeAlbrecht Schlosser
This file enables consumers to search for a particular FLTK version.
2024-04-20CMake build summary: output libdecor location if foundAlbrecht Schlosser
Wayland only: output either the libdecor location or "Bundled".
2024-04-19CMake: add installation prefix to Configuration SummaryAlbrecht Schlosser
2024-04-08Improve CMake build configuration summaryAlbrecht Schlosser
- simplify and unify build option output - alignment can be changed in only 2 macros in CMake/fl_summary.cmake - output system library location of image libraries if applicable
2024-03-13CMake-based build under Linux shows whether X11 is usedManoloFLTK
2024-02-12CMake: set FLTK_VERSION and FLTK_FLUID_EXECUTABLE in the cacheAlbrecht Schlosser
This is useful if FLTK is built as a subproject, for instance by using FetchContent.
2024-02-07Introduce "Modern CMake" in FLTKAlbrecht Schlosser
This is a big commit and there are too many changes to list them all. The main changes are: - rename all CMake build options to 'FLTK_*' - export library targets with namespace (prefix) 'fltk::' - standardize shared library target names with suffix '-shared' - set public build properties on libraries for consumers - document library names and aliases in README.CMake.txt - document changes in "Migrating Code from FLTK 1.3 to 1.4" - partial backwards compatibility for old user projects Included but not directly related changes: - fix Windows (Visual Studio) DLL build - add CMake function fl_debug_target() to show target properties - don't build test programs if FLTK is a subproject - internal: reformat CMake code: remove space before '(' Thanks to Matthias and Manolo for their help, testing, and feeback.
2024-01-01CMake: add missing configuration output statementAlbrecht Schlosser
2023-12-20Make the 'Forms' compatibility library 'fltk_forms' optionalAlbrecht Schlosser
This library is no longer needed in FLTK itself. There is only one demo program (test/forms.cxx) that uses it if it is built. The demo program displays a message if fltk_forms is not available. The default is 'enabled' for backwards compatibility but this may be changed to 'disabled' in a future version.
2023-12-02Wayland: make OPTION_USE_SYSTEM_LIBDECOR ON by defaultManoloFLTK
This commit makes the default FLTK build setting use libdecor as packaged in Linux when the build system contains packages libdecor-0-dev and libdecor-0-plugin-1-gtk in version ≥ 0.2.0. Otherwise, FLTK uses the bundled version of libdecor. This includes situations where package libdecor-0-dev is present in an earlier version.
2023-11-17Output build configuration in CMake report (#838)Albrecht Schlosser
2023-11-15CMake: Raise cmake_minimum_required from 3.12 to 3.15Albrecht Schlosser
Remove code that checks CMake versions lower than 3.15
2023-10-22Make Fl_String and Fl_Int_Vector private (#789)Albrecht Schlosser
- add CMake option 'OPTION_USE_STD' - add configure option '--enable-use_std' - move FL/Fl_String.H to src/Fl_String.H - move FL/Fl_Int_Vector.H to src/Fl_Int_Vector.H - remove Fl_String from demo program examples/callbacks.cxx - remove Fl_Int_Vector from public header FL/Fl_Table.H - some methods of Fl_Table are no longer inline - add CMake option OPTION_USE_STD to allow std::string in some selected functions and methods Experimental, may be removed before release: - use either Fl_Int_Vector or std::vector in Fl_Table depending on CMake OPTION_USE_STD or configure --enable-use_std Move all fl_filename* functions that use Fl_String to fluid Main changes in fluid: - add fluid_filename.h and .cxx - include "fluid_filename.h" rather than <FL/filename.H> Update fl_input(), fl_password() and test/ask - add maxchar parameter to fl_input() and fl_password() - fl_input_str() and fl_password_str() are optional and return std::string if enabled (FLTK_USE_STD)
2023-08-26Update 'cmake_minimum_required' version to 3.12.0Albrecht Schlosser
Linking against OBJECT libraries as done in fluid since May 2023 and in shared library builds using MSVC even much earlier requires at least CMake 3.12. This commit adds the requirement explicitly to abort the build early.
2023-03-09CMake: build shared libs with OPTION_CAIROEXT (issue #250)Albrecht Schlosser
- remove separate libfltk_cairo to avoid cyclic dependencies, but - keep a dummy libfltk_cairo in 1.4.0 for backwards compatibility - move cairo/Fl_Cairo.cxx to src/Fl_Cairo.cxx - add preliminary Cairo support for Visual Studio (MSVC) Static linking is not affected by this change, but users building with hand-made Makefiles will have to remove libfltk_cairo starting with FLTK 1.4.0. The dummy library can be linked for backwards compatibility but it will be removed later (in 1.4.x or 1.5.0). The shared FLTK library libfltk.{so|dylib|dll|..} depends on libcairo if and only if FLTK is built with one of the Cairo options. This has always been the case for OPTION_CAIROEXT but is now also true if only OPTION_CAIRO is selected, i.e. FLTK programs linked with a Cairo enabled shared FLTK library will also be linked with libcairo. The same is true for configure options --enable-cairo and --enable-cairoext, respectively. Preliminary Cairo support for MSVC now detects a Cairo installation using the CMake variable FLTK_CAIRO_DIR which must be set by the user. Note that this feature is temporary and may be changed in the future for a better and more comfortable version.
2023-01-21Move global FLTK options into new app fltk-admin (#560)Matthias Melcher
2022-11-18CMake: fix informative messages sent under macOSManoloFLTK
2022-11-13Make building Fluid optional. (#539)Matthias Melcher
2022-08-29Make hybrid Wayland/X11 platform.ManoloFLTK
2022-03-13CMake: Improve configuration summary, add fl_debug_pkg macroAlbrecht Schlosser
fl_debug_pkg(...) can be used to display CMake variables set by executing pkg_check_modules(). This is for CMake debugging only. The CMake configuration summary displays configuration options of Wayland, Pango, Xft, and Cairo configuration.
2022-02-01CMake: Fix image libraries build if fallback is usedAlbrecht Schlosser
The CMake instructions would use the wrong image libs (png, jpeg, zlib) if the fallback was active (OPTION_USE_SYSTEM_XXX) was true but the header files were not present. This had already been fixed for jpeg but not for the other two libs. This commit rearranges the logic for all three libs. Add information about builtin or system libraries to config summary.
2022-01-23Remove experimental platforms Android, Pico, SDL (PR #376)Albrecht Schlosser
... as discussed in fltk.coredev: "FLTK 1.4.0 release schedule" https://groups.google.com/g/fltkcoredev/c/PDbHTRpXVh0/m/JqboexZ_AwAJ
2021-12-18Generate FL/fl_config.h rather than FL/abi-version.hAlbrecht Schlosser
... as discussed in fltk.coredev in thread "RFC: introduce public config header <FL/fl_config.h>", see: https://groups.google.com/g/fltkcoredev/c/xLCs1AIXMVo/m/MHZpQggzAQAJ - Rename abi-version.h to fl_config.h, rename input files, update dependencies, .gitignore, CMake, configure and Makefiles. - Include Cairo options in FL/fl_config.h - Rename FLTK_USE_CAIRO to FLTK_HAVE_CAIROEXT for consistency. - Include <FL/fl_config.h> in config.h and wherever necessary, fix include order (move FL/Fl.H to the top) and more. - Move USE_X11 to fl_config.h and rename to FLTK_USE_X11 - Do not include <config.h> in Cairo demo program which is no longer required in Cairo programs since FLTK 1.4.0
2021-11-11CMake: Build fluid when cross-compilingAlbrecht Schlosser
2021-07-26Add CMake compatibility functions and macrosAlbrecht Schlosser
CMake/compatibility.cmake: define functions and macros to be used if a particular CMake functionality requires a higher CMake version than FLTK's minimum CMake version, see 'cmake_minimum_required(...)' in the root CMakeLists.txt. Note: target_link_directories() is available since CMake 3.13
2021-07-12macOS: fix fltk_cairo shared library (issue #250)Albrecht Schlosser
- add missing dependencies to build the shared libfltk_cairo(.dylib) - remove incorrect dependency on cairo from libfltk - add cairo_test-shared demo (linked with shared libs)
2021-04-30Enhance CMake build configuration summaryAlbrecht Schlosser
2021-03-01Fix CMake warning related to CMP0072Albrecht Schlosser
2021-02-15Update CMake and make files, minor edits onlyAlbrecht Schlosser
There are no functional changes to be expected, mostly formatting and comments.