Commit Graph

27 Commits

Author SHA1 Message Date
Albrecht Schlosser
0771bc6cee CMake: improve formatting, remove debug statements 2024-02-13 15:10:06 +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
63c54fe7c8 CMake: Remove UseFLTK.cmake generation and usage 2023-12-03 17:16:58 +01:00
Matthias Melcher
1fc269b0d4
Move global FLTK options into new app fltk-admin (#560) 2023-01-21 17:14:41 +01:00
Matthias Melcher
edf7510dda
Make building Fluid optional. (#539) 2022-11-13 20:16:54 +01:00
Albrecht Schlosser
2b8f3a757a CMake: Don't install man pages of game programs (issue #23)
I decided not to install the man pages for consistency because we
don't install the executable programs. The instructions are commented
out only so they can be activated easily if this will be changed,
i.e. if we decide to install the test/game programs in the future.

Closes #23
2022-03-26 20:04:04 +01:00
Albrecht Schlosser
59e028a3a7 CMake: Improve fltk-config generation
- set executable permissions on MinGW and more platforms
- add missing link libraries
- improve code formatting (indent)
- mark some variables as advanced
- simplify search for glib-2.0
2022-03-13 21:56:05 +01:00
Albrecht Schlosser
b91db00d91 CMake: export Cairo include directories (issue #350)
If a user project is built using a FLTK library generated by CMake
with Cairo support then the CMake variable FLTK_INCLUDE_DIRECTORIES
now includes the required Cairo include directories.
2021-12-20 19:18:38 +01:00
Albrecht Schlosser
5438954d8c Generate FL/fl_config.h rather than FL/abi-version.h
... 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-12-18 22:44:08 +01:00
Albrecht Schlosser
3611d788e3 Fix CMake install procedure (#212)
Only install header files to the FL/ include directory.
2021-04-11 21:56:28 +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
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
7d1488507d CMake: Fix fltk-config for Windows and Unix/Linux.
This update ought to work with

  fltk-config [--use-images] [--use-gl] --compile <c source file>

on both Windows and Unix/Linux when built with CMake. It was tested
under Windows and Linux using fltk-config directly from the build tree,
but it should work as well after installation.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12686 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-23 19:41:52 +00:00
Albrecht Schlosser
6721ba67eb CMake: fix generated fltk-config for Windows (partially).
This makes 'fltk-config --compile' work with simple test applications
like hello.cxx etc.

It may not yet work with other options though, particularly with
--use-gl or --use-images, but it's an improvement.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12676 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-18 12:31:16 +00:00
Albrecht Schlosser
7aef0cad39 CMake: enable building FLTK in a subdirectory of another project.
Basically replace CMAKE_XXX_DIR with CMAKE_CURRENT_XXX_DIR where
XXX = SOURCE or BINARY.

Patch proposal by cleanrock, FLTK PR #4:
https://github.com/fltk/test-only/pull/4

Patch modified to fix target dirs for test programs and doxygen docs.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12630 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-10 20:49:03 +00:00
Albrecht Schlosser
90f6c8ee26 Update copyright year(s).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12282 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-06-29 18:12:57 +00:00
Albrecht Schlosser
3eb6b7ea58 CMake: replace improperly used variables with correct ones.
CMake variables FLTK_SOURCE_DIR and FLTK_BINARY_DIR are only defined
if the project name is exactly "FLTK" (all uppercase). These variables
are generated (set) by CMake as <PROJECT_NAME>_SOURCE_DIR etc.

The correct variables are CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR,
respectively, which are always defined.

This commit enables future changes of the FLTK project name, e.g. to
"fltk" or "fltk-1.4.0" (a versioned project name), if we like...


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12281 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-06-29 17:51:27 +00:00
Albrecht Schlosser
fb172ecd3c Fix fltk-config for CMake build.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10787 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-12 22:32:30 +00:00
Albrecht Schlosser
9adb181156 Make FL_ABI_VERSION configurable (STR #3161).
This commit adds the configure option --with-abiversion and the CMake option
OPTION_ABI_VERSION. Both options can be set e.g. to 10304 to build with
FL_ABI_VERSION = 10304 (FLTK 1.3.4).

For IDE builds there are new files ide/<IDE-NAME>/FL/abi-version.h that
can be edited to change the ABI version before the FLTK lib is built.
Note that this file MUST be copied to the include/FL directory if the
IDE-built library is to be installed.

The default is FL_ABI_VERSION = FL_MAJOR*10000 + FL_MINOR*100 + 0, i.e.
10300 for all FLTK 1.3.x versions to keep binary compatibility (ABI).

Todo: more tests and more documentation.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10786 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-12 19:23:55 +00:00
Albrecht Schlosser
e23bf0b768 [CMake] Fix CMake build's fltk-config (STR #3217).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10716 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-25 13:50:27 +00:00
Albrecht Schlosser
d767ae7ff6 [CMake] Fix and install fltk-config.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10679 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-06 13:06:21 +00:00
Albrecht Schlosser
6390a0e09e [CMake] Improve installation, support DESTDIR, and more (STR #3149).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10580 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-02-16 14:30:27 +00:00
Albrecht Schlosser
f7b50362c4 [CMake] Fix CMake 3.1 warning about new policy CMP0053.
CMake Warning (dev) at CMake/export.cmake:48 (set):
  Policy CMP0053 is not set: Simplify variable reference and escape sequence
  evaluation.  Run "cmake --help-policy CMP0053" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

Changed old-style @variable@ replacement to ${variable}. 


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10467 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-24 09:35:04 +00:00
Albrecht Schlosser
fd4784a340 Set correct svn properties on CMake files.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10466 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-22 00:42:44 +00:00
Albrecht Schlosser
eb6c15bcef [CMake] Fix man page path. Patch posted by Richard Shaw in fltk.general.
Thanks for the patch.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10440 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-08 17:21:09 +00: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
f352740953 Split CMake files for better maintenance, as discussed in fltk.general.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10098 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-02-09 18:41:29 +00:00