summaryrefslogtreecommitdiff
path: root/CMake
AgeCommit message (Collapse)Author
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.
2024-05-01CMake/debug: add more properties to fl_debug_target()Albrecht Schlosser
This commit is only for CMake debugging.
2024-04-27CMake: make compile definition "FL_DLL" public for MSVC (#960)Albrecht Schlosser
Visual Studio projects that link to the FLTK DLL (fltk::fltk-shared) inherit the compile definition set by the DLL target and will be compiled with "-D FL_DLL" as required w/o the user project having to set this preprocessor macro explicitly. Todo: documentation will follow...
2024-04-22 Fix: Fl_Native_File_Chooser::filter_value() [Kdialog] always returns 0 (#899)ManoloFLTK
- remove build option FLTK_USE_KDIALOG replaced by an Fl::option() option - new run-time option OPTION_FNFC_USES_KDIALOG - make options OPTION_FNFC_USES_KDIALOG and OPTION_FNFC_USES_ZENITY false by default - add mention of new program fltk-options in the doc of Fl::option() - change logic of choice of the native file chooser under X11/Wayland: the zenity and kdialog choosers are opt-in; otherwise the GTK file chooser is used, unless opted out with OPTION_FNFC_USES_GTK - document that zenity may be interesting for sandboxed apps - document that both zenity and kdialog make member functions Fl_Native_File_Chooser::filter_value() inoperable
2024-04-20CMake build summary: output libdecor location if foundAlbrecht Schlosser
Wayland only: output either the libdecor location or "Bundled".
2024-04-18Restore IMPORTED_TARGET in pkg_check_modules command for libdecorManoloFLTK
2024-04-18Allow libdecor package version ≥ 0.2.0 with FLTK_USE_SYSTEM_LIBDECORManoloFLTK
2024-04-17Separate FLUID user documentation, screen shot automation (#936)Matthias Melcher
* CMake integration, no autotiools * alignment panel is now correctly renamed to setting panel * source view is now correctly renamed to code view * Merge FLTK FLUID docs into FLUID user manual. * Add two simple entry tutorials * Remove FLUID chapter form FLTK docs. * GitHub action to generate HTML and PDF docs and make the available as artefacts
2024-04-14Fix and improve generation of fltk-config (#954 and more)Albrecht Schlosser
Parts of this commit fix the usage of CMake targets in the generation process of fltk-config modified by PR #954. The rest improves handling of variables used to generate fltk-config, removes obsolete comments, documents variables like GLLIBS etc. which had to be done anyway.
2024-04-14CMake: Use imported targets for PkgConfig packages (#954)Jordan Williams
This carries include directories and the required link flags. Several libraries brought in through pkg_check_modules aren't linked correctly using the _LDFLAGS variables. Instead, they link the libraries directly with `-l`. This is problematic because it doesn't properly pull in the actual directory of the library being linked when it is not in a system library directory. Likewise, the necessary include directories for several of these targets aren't properly set either. Linking against the imported targets automatically pulls in the necessary include directories.
2024-04-12CMake: Improve detection of the GLU library and GL/glu.h header file (#953)Jordan Williams
* CMake: Improve detection of the GLU library and GL/glu.h header file Locate the GLU library and header independent of the GL library and header locations. Add the GLU header location to necessary target_include_directory calls. * CMake: Locate and use the GL include directory Find the GL include directory and use it in target_include_directories calls.
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-04-05CMake: Fix detection of trunc() for WindowsAlbrecht Schlosser
2024-04-02Add replacement for potentially missing trunc() (#944)Albrecht Schlosser
- add configure + CMake checks to define HAVE_TRUNC in config.h - src/Fl_Timeout.cxx: add local replacement function
2024-03-24CMake for macOS platform: improve handling of -framework link argumentsManoloFLTK
2024-03-23macOS: remove deprecated use of property allowedFileTypes in class NSSavePanelManoloFLTK
The recommended replacement requires macos ≥ 11.0 and a new framework: UniformTypeIdentifiers
2024-03-18CMake: formatting onlyAlbrecht Schlosser
2024-03-18Replace setenv() with putenv() on old systems (+937)Albrecht Schlosser
Add system check for setenv() function in configure and CMake.
2024-03-15Have FLTK use libdecor at version > 0.2.2ManoloFLTK
- it's no longer necessary to take care of the change in the layout of "struct libdecor" between versions ≤ 0.2.2 and > 0.2.2 of libdecor - version > 0.2.2 contains MR131, that is, it defines LIBDECOR_WINDOW_STATE_RESIZING so the hack to emulate it is no longer necessary - CMake option FLTK_USE_SYSTEM_LIBDECOR now requires libdecor version > 0.2.2 to be activated, otherwise the bundled libdecor is used - what will be the libdecor version after 0.2.2 (0.2.3? 0.3.0?) is not known as of today
2024-03-13To support difference in struct libdecor between built-in and systemManoloFLTK
That should disappear when next version of libdecor will be released.
2024-03-13Remove useless X11 libraries when building with -DFLTK_BACKEND_X11=0ManoloFLTK
2024-03-13Allow CMake-based build with -DFLTK_BACKEND_X11=0 under Linux/UnixManoloFLTK
2024-02-24CMake/macOS/X11: fix "FINK" search directoriesAlbrecht Schlosser
note: use only if found. Todo: check if we can get rid of explicit directory names like /opt/sw, /sw, /opt/X11, ...
2024-02-22Fix CMake code that should only be evaluated on macOSAlbrecht Schlosser
Too much simplified code when introducing modern CMake and renaming some build options caused this issue. It's hopefully fixed nor, or at least improved. Todo: the code in question needs to be revised anyway.
2024-02-14CMake: fix "LIBDECOR_PLUGIN_DIR" undefined errorAlbrecht Schlosser
This could happen on Linux if built with CMake option "-DFLTK_USE_SYSTEM_LIBDECOR=OFF"
2024-02-14CMake: remove unintended debug outputAlbrecht Schlosser
2024-02-14CMake: fix installation on macOSAlbrecht Schlosser
fluid and fltk-options are now installed correctly as bundles and as stand-alone executables side by side in the 'bin' folder relative to CMAKE_INSTALL_PREFIX. This works but the installation folders may be changed in the future. Targets fltk::fluid is now exported correctly so find_package(FLTK CONFIG ...) works with both the build folder and an installed version.
2024-02-13CMake: simplify resources.cmakeAlbrecht Schlosser
Note: CheckIncludeFiles caches the result in an 'internal' variable. Hence mark_as_advanced() is not necessary for these variables.
2024-02-13CMake: improve formatting, remove debug statementsAlbrecht Schlosser
2024-02-10CMake: fix some weird internal dependencies (Wayland/X11)Albrecht Schlosser
Improve recognition of Wayland and X11 specific build options and remove duplicates from required dependencies (FLTK_LDLIBS) used in fltk-config. This should also fix the GitLab CI build process. To do: the logic to find the dependencies of Wayland and X11 is currently suboptimal. This will be improved in a later commit.
2024-02-10Modern CMake: export shared libraries and fltk-optionsAlbrecht Schlosser
2024-02-09Fix Cairo related build issues (missing Cairo lib)Albrecht Schlosser
... particularly for shared libs
2024-02-08CMake cleanup: fix alignmentAlbrecht Schlosser
2024-02-08CMake cleanup: mark two more cache variables "advanced"Albrecht Schlosser
2024-02-07Fix GitHub CI build and minor CMake issuesAlbrecht Schlosser
- GitHub CI: fix wrong CMake option name - fl_add_library: disable debug output (MSVC), fix formatting
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.
2023-12-21Ensure that exporting 'fl_disable_wayland' worksAlbrecht Schlosser
... with cmake_minimum_required(VERSION 3.4) or higher. This version sets CMP0065 to 'NEW' which by default inhibits exporting global symbols from executable programs. For details see CMake policy CMP0065 and README.Wayland.txt.
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-12CMake: remove deprecated 'exec_program' from target 'uninstall'Albrecht Schlosser
1. 'exec_program()' should be replaced with 'execute_process()'. Done. 2. 'cmake -E remove' is broken and deprecated since 3.17, hence we use 'cmake -E rm' (!) for CMake since 3.17 and 'cmake -E remove' only for older CMake versions.
2023-12-05Wayland+CMake: use set_source_files_properties() for libdecorManoloFLTK
2023-12-04Minor updates of bundled libraries and README.CMake.txtAlbrecht Schlosser
Update Makefiles, CMakeLists.txt, improve formatting.