Commit Graph

10 Commits

Author SHA1 Message Date
Albrecht Schlosser
9cdd457382 CMake: make compile definition "FL_DLL" public for MSVC (#960)
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-27 18:35:39 +02:00
ManoloFLTK
4742d830be CMake for macOS platform: improve handling of -framework link arguments 2024-03-24 08:48:45 +01:00
ManoloFLTK
97d2836f5e macOS: remove deprecated use of property allowedFileTypes in class NSSavePanel
The recommended replacement requires macos ≥ 11.0 and a new framework: UniformTypeIdentifiers
2024-03-23 17:16:57 +01:00
Albrecht Schlosser
0771bc6cee CMake: improve formatting, remove debug statements 2024-02-13 15:10:06 +01:00
Albrecht Schlosser
809ceea075 Fix Cairo related build issues (missing Cairo lib)
... particularly for shared libs
2024-02-09 19:41:45 +01:00
Albrecht Schlosser
a1d3bf182e Fix GitHub CI build and minor CMake issues
- GitHub CI: fix wrong CMake option name
- fl_add_library: disable debug output (MSVC), fix formatting
2024-02-07 20:03:29 +01:00
Albrecht Schlosser
fd5cd80935 Introduce "Modern CMake" in FLTK
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-02-07 18:37:34 +01:00
Albrecht Schlosser
d11c412f95 CMake: Make compile definitions 'FL_LIBRARY' and 'FL_DLL' private
... so they are not inherited by consumers of the library.

Remove 'add_definitions(-DFL_LIBRARY)' from src/CMakeLists.txt
  This is not necessary, see CMake/fl_add_library.cmake

Don't set obsolete property 'CLEAN_DIRECT_OUTPUT' which was removed
in CMake 2.8.0.
2023-08-28 15:21:58 +02:00
Albrecht Schlosser
372fe4cc99 CMake: fix formatting, add more debug output 2023-08-26 17:33:05 +02:00
Albrecht Schlosser
720b84ef9d CMake: refactor and reformat CMake files
- raise minimum CMake version from 2.6.3 to 3.2.3 (Jun 01, 2015)
- indent all CMake files according to the CMP (2 col.)
- refactor FLTK version number definitions and usage
- unify CMake and autoconf/configure variable names:
  - FL_VERSION -> FLTK_VERSION
  - FL_MAJOR_VERSION -> FLTK_VERSION_MAJOR
  - etc. for _MINOR_ and _PATCH_, respectively
  - note: this does not affect FL_VERSION etc. in source code
- generate "export headers" for all libraries (experimental: OFF)
- port some forgotten goodies from branch-1.3 to master
- merge and improve macro 'create_example' (WIP)
- remove "temporary" options and code for older CMake versions
- include and use 'GenerateExportHeader' (experimental, WIP: OFF)
  - note: created header files are not yet used
- build only *one* DLL with Visual Studio (tested, works)
  - similar to the bundled IDE projects in 1.3.x
- add some dynamically linked test/demo programs ('*-shared')
  if shared libraries are built (WIP)
- split 'macros.cmake': use one file per macro
2020-07-15 00:34:53 +02:00