diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2023-03-09 13:21:49 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2023-03-09 17:34:05 +0100 |
| commit | 5175192755e57d1d7016253d48f34f9d0c2c0832 (patch) | |
| tree | 6262a13668d6ea56067910b024516c60305e374e /CMakeLists.txt | |
| parent | e32d4bcab990c2648bbcf550d115a5393c3f50e2 (diff) | |
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.
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 19d7b09c3..f00237a35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,7 +102,17 @@ endif (debug_build) unset (debug_build) ####################################################################### -# build the FLTK libraries +# Build a dummy ("empty") Cairo library for backwards compatibility. +# This should be removed some time after 1.4.0 was released, maybe +# in FLTK 1.4.1, 1.4.2, 1.5.0, or whatever the next minor release is. +####################################################################### + +if (FLTK_HAVE_CAIRO) + add_subdirectory (cairo) +endif () + +####################################################################### +# build the standard FLTK libraries ####################################################################### add_subdirectory(src) @@ -129,11 +139,13 @@ endif (FLTK_BUILD_FLTK_OPTIONS) # install.cmake creates these files for an installed FLTK # these two would only differ in paths, so common variables are set here ####################################################################### + include (CMake/variables.cmake) ####################################################################### # final config and export ####################################################################### + include (CMake/export.cmake) configure_file ( @@ -157,6 +169,7 @@ endif (FLTK_BUILD_EXAMPLES) ####################################################################### # installation ####################################################################### + include (CMake/install.cmake) ####################################################################### @@ -221,15 +234,15 @@ else () endif () if (FLTK_BUILD_FLUID) - message (STATUS "FLUID will be built in ${CMAKE_CURRENT_BINARY_DIR}/bin/fluid") + message (STATUS "FLUID will be built in ${CMAKE_CURRENT_BINARY_DIR}/bin/fluid") else () - message (STATUS "FLUID will not be built (set FLTK_BUILD_FLUID=ON to build)") + message (STATUS "FLUID will not be built (set FLTK_BUILD_FLUID=ON to build)") endif () if (FLTK_BUILD_FLTK_OPTIONS) - message (STATUS "fltk-options will be built in ${CMAKE_CURRENT_BINARY_DIR}/bin/fltk-options") + message (STATUS "fltk-options will be built in ${CMAKE_CURRENT_BINARY_DIR}/bin/fltk-options") else () - message (STATUS "fltk-options will not be built (set FLTK_BUILD_FLTK_OPTIONS=ON to build)") + message (STATUS "fltk-options will not be built (set FLTK_BUILD_FLTK_OPTIONS=ON to build)") endif () if (FLTK_BUILD_TEST) @@ -243,21 +256,21 @@ else () endif () if (FLTK_USE_BUILTIN_JPEG) - message (STATUS "Image Libraries: JPEG = Builtin") + message (STATUS "Image Libraries: JPEG = Builtin") else () - message (STATUS "Image Libraries: JPEG = System") + message (STATUS "Image Libraries: JPEG = System") endif () if (FLTK_USE_BUILTIN_PNG) - message (STATUS " PNG = Builtin") + message (STATUS " PNG = Builtin") else () - message (STATUS " PNG = System") + message (STATUS " PNG = System") endif () if (FLTK_USE_BUILTIN_ZLIB) - message (STATUS " ZLIB = Builtin") + message (STATUS " ZLIB = Builtin") else () - message (STATUS " ZLIB = System") + message (STATUS " ZLIB = System") endif () if (UNIX AND NOT (APPLE AND NOT OPTION_APPLE_X11)) |
