Commit Graph

16 Commits

Author SHA1 Message Date
Albrecht Schlosser 6c06e953e1 Fix "Cannot build project with CMake ..." (#970)
... (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-13 12:05:27 +02: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 63c54fe7c8 CMake: Remove UseFLTK.cmake generation and usage 2023-12-03 17:16:58 +01:00
Matthias Melcher edf7510dda
Make building Fluid optional. (#539) 2022-11-13 20:16:54 +01:00
Albrecht Schlosser 556e895dc1 CMake: Document FLTKConfig.cmake and set FLTK_INCLUDE_DIR
Some of the output variables had not been documented, and the "new"
variable for FLTK include directories is 'FLTK_INCLUDE_DIRS' (plural)
rather than 'FLTK_INCLUDE_DIR'.

FLTK_INCLUDE_DIR is now also set for compatibility with FindFLTK.cmake
supplied by CMake.
2021-04-26 15:03:00 +02:00
Albrecht Schlosser a6f9388f33 Fix version number in exported file FLTKConfig.cmake 2020-09-01 13:32:05 +02:00
Albrecht Schlosser f09e17c3c5 Remove $Id$ tags, update URL's, and more
- remove obsolete svn '$Id$' tags from all source files
- update .fl files and generated files accordingly
- replace 'http://www.fltk.org' URL's with 'https://...'
- replace bug report URL 'str.php' with 'bugs.php'
- remove trailing whitespace
- fix other whitespace errors flagged by Git
- add and/or fix missing or wrong standard headers
- convert tabs to spaces in all source files

The only relevant code changes are in the fluid/ folder where
some .fl files and other source files were used to generate
the '$Id' headers and footers.
2020-07-06 20:28:20 +02:00
Albrecht Schlosser 6279ab0586 CMake: Deprecate FLTK_USE_FILE (UseFLTK.cmake)
Cherry-pick the essential changes from FLTK 1.3 since this change
had not been ported to 1.4 yet.

To do: my current plan is to consolidate 1.3 and 1.4 CMake files
as far as possible (with the exceptions of source files, obviously)
and to redesign / refactor CMake files later in this process or
maybe only for 1.4 if it turns out to be too much to backport.
2020-06-13 13:51:35 +02:00
Albrecht Schlosser 318c3619dc CMake enhancements, as discussed in STR #3055.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10342 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-27 00:41:06 +00:00
Albrecht Schlosser c92e58fdac CMake: Fix linker issues on OS X and Arch Linux (STR #3045).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10091 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-02-02 00:41:01 +00:00
Albrecht Schlosser 8c56fc7e22 Updated CMake files with patches from Michael Surette (STR #2317).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7919 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-11-30 10:34:43 +00:00
Albrecht Schlosser a0d26b634a Mostly rewritten CMake files by Michael Surette. They are more complete
than what we had previously, but may need some more testing. The latest
changes (removing old APPLE_QD definitions and code) might need another
update.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7451 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-04-05 22:33:58 +00:00
Dejan Lekic 1cd06f3ad0 This commit contains patch submitted by "fltk.x0" (thanks fltk.x0!) in the middle of May this year - STR #863. Also small change in fluid.cxx - time.h was needed for successful build on MinGW.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4468 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2005-08-06 05:02:56 +00:00
Michael R Sweet 1f2456132e Cmake updates (STR #645)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4026 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2005-02-06 00:17:50 +00:00
Michael R Sweet ca005c4067 Documentation updates (STR #568)
More CMake updates (STR #499)

The Watcom C++ compiler needed a small change (STR #567)


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3869 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2004-10-18 20:29:58 +00:00
Michael R Sweet 1ca225e19d Added (unsupported) CMake files (STR #499)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3829 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2004-09-13 02:12:41 +00:00