Commit Graph

68 Commits

Author SHA1 Message Date
Albrecht Schlosser
0f1492bba6 Update 'cmake_minimum_required' version to 3.12.0
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-08-26 18:07:54 +02:00
Albrecht Schlosser
5175192755 CMake: build shared libs with OPTION_CAIROEXT (issue #250)
- 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-03-09 17:34:05 +01:00
Matthias Melcher
1fc269b0d4
Move global FLTK options into new app fltk-admin (#560) 2023-01-21 17:14:41 +01:00
ManoloFLTK
82bee7fa33 CMake: fix informative messages sent under macOS 2022-11-18 10:55:14 +01:00
Matthias Melcher
edf7510dda
Make building Fluid optional. (#539) 2022-11-13 20:16:54 +01:00
ManoloFLTK
c720aae515 Make hybrid Wayland/X11 platform. 2022-08-29 12:15:32 +02:00
Albrecht Schlosser
bed6027cf0 CMake: Improve configuration summary, add fl_debug_pkg macro
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-03-13 21:56:05 +01:00
Albrecht Schlosser
ec98dc113f CMake: Fix image libraries build if fallback is used
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-02-01 00:54:42 +01:00
Albrecht Schlosser
04ccc8cc46 Remove experimental platforms Android, Pico, SDL (PR #376)
... as discussed in fltk.coredev: "FLTK 1.4.0 release schedule"
https://groups.google.com/g/fltkcoredev/c/PDbHTRpXVh0/m/JqboexZ_AwAJ
2022-01-23 18:12:47 +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
654e20ff8b CMake: Build fluid when cross-compiling 2021-11-11 23:11:06 +01:00
Albrecht Schlosser
410a01c6db Add CMake compatibility functions and macros
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-26 17:40:26 +02:00
Albrecht Schlosser
787c67afea macOS: fix fltk_cairo shared library (issue #250)
- 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-07-12 20:05:07 +02:00
Albrecht Schlosser
5c85a4ea95 Enhance CMake build configuration summary 2021-04-30 19:48:17 +02:00
Albrecht Schlosser
266b5e7cdd Fix CMake warning related to CMP0072 2021-03-01 10:02:41 +01:00
Albrecht Schlosser
bbaec9bd88 Update CMake and make files, minor edits only
There are no functional changes to be expected, mostly formatting
and comments.
2021-02-15 19:45:20 +01:00
Albrecht Schlosser
caf0bfa81d Avoid CMake developer warning related to OpenGL/CMP0072
Newer CMake versions warn if CMake policy CMP0072 is not set. We're
using "legacy mode" since we use FindOpenGL with `OPENGL_LIBRARIES`
and not (yet) the `OpenGL::GL` target.

See https://cmake.org/cmake/help/latest/policy/CMP0072.html
2020-09-18 18:07:18 +02:00
Albrecht Schlosser
9ba4cd06dc CMake: add feature and configuration summary 2020-08-21 19:00:38 +02:00
Albrecht Schlosser
3b9a04ae2e CMake: add examples folder to build (optional)
- replace misnamed option 'OPTION_BUILD_EXAMPLES' with 'FLTK_BUILD_TEST'
- add option 'FLTK_BUILD_EXAMPLES' to build apps in examples folder
- move examples/fltk-versions.cxx to test/fltk-versions.cxx
- [Travis-CI] enable option 'FLTK_BUILD_EXAMPLES' for automatic builds
2020-08-21 18:55:12 +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
Matthias Melcher
563baced13 Android CMake: fix, more autogenerated files
Fixed a bug that would cause an error is Android Build was NOT
defined. Creating list of test targets automatically.
2019-01-16 02:12:29 +01:00
Matthias Melcher
b450cea7e2 Android: starting to use CMake to build AndroidStudio files. 2019-01-15 01:22:18 +01:00
Matthias Melcher
e25511131b Android: modifying CMake to also create AndroidStudio IDE 2019-01-14 23:27:34 +01:00
Matthias Melcher
42555053a1 More Android changes.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12699 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-02 20:03:04 +00:00
Albrecht Schlosser
c7b5d61eb0 CMake: add macro fl_debug_var to debug variables.
Some debug messages are included, but currently disabled.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12658 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-09 20:51:15 +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
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
92d3e1e03a Update minimum required CMake version from 2.6 to 2.6.3.
Verified build with CMake 2.6.3 (failed with 2.6.2).

We need 2.6.3 for "unset" (unknown command in 2.6.2 and earlier).

CMake 2.6.2 also fails when parsing nested brackets in logical
expressions like the following one:

  if((NOT APPLE OR OPTION_APPLE_X11) AND NOT WIN32)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11397 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-22 00:23:25 +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
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
078df04bfd CMake: Prevent annoying warning under Cygwin.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10368 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-09 16:03:56 +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
Albrecht Schlosser
1396a79651 CMake/MinGW: Fix missing -pthread linker option for MinGW build.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10092 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-02-02 00:49:50 +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
4d4ffb4d0a Add CMake fixes for OS X build from Rob McDonald.
See thread: [fltk.general] Embedding FLTK in project.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10050 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-01-10 10:33:25 +00:00
Albrecht Schlosser
738563f973 Fixed missing libdl dependency in CMake builds (STR #2977).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10042 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-01-03 16:42:21 +00:00
Pierre Ossman
1d6cc80d59 STR 2636. Add ability to get notifications whenever the
clipboard changes.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9974 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-09-11 12:54:40 +00:00
Albrecht Schlosser
e9767cce34 Removed autoconf/configure and CMake tests and defines for
unused function strtoll() [resolves one part of STR #2965].


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9923 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-05-22 10:40:58 +00:00
Manolo Gouy
703d78c4b0 Fixed CMake use for Mac OS and the scandir() function.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9679 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-09-13 14:19:01 +00:00
yuri
3086c07eec fix STR #2764
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9171 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-11-12 19:41:13 +00:00
Greg Ercolano
4f4a8fc3c7 Modifications to all LGPL headers for STR #2685.
(to clarify static exception LGPL by changing license references)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8864 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-07-19 04:49:30 +00:00
Manolo Gouy
bc509d32eb Fix STR #2504 (first part). Replaced HAVE _CAIRO by FLTK_HAVE_CAIRO and USE_CAIRO
by FLTK_USE_CAIRO everywhere.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8198 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-06 10:24:58 +00:00
Manolo Gouy
874bca74f5 Mac OS X: removed all uses of Carbon (except for older OS versions) and re-organized
text input around the NSTextInput protocol.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8173 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-03 16:50:34 +00:00
Manolo Gouy
dbb7be0fee Mac OS X: removed dependency from AudioToolbox.framework by calling NSBeep() from Cocoa.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8135 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-12-29 11:33:42 +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
Manolo Gouy
c077050d05 Fixed cmake under Mac OS X
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7867 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-11-17 16:47:54 +00:00
Albrecht Schlosser
b24875d8cd One more CMake fix.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7461 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-04-06 20:36:34 +00:00