From 5175192755e57d1d7016253d48f34f9d0c2c0832 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 9 Mar 2023 13:21:49 +0200 Subject: 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. --- fltk-options/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'fltk-options') diff --git a/fltk-options/CMakeLists.txt b/fltk-options/CMakeLists.txt index 7f289ab92..96c61773c 100644 --- a/fltk-options/CMakeLists.txt +++ b/fltk-options/CMakeLists.txt @@ -51,11 +51,7 @@ else () endif () -# we must link all programs with fltk_cairo if option CAIROEXT is enabled -if (FLTK_HAVE_CAIROEXT) - list (APPEND FLTK_OPTIONS_LIBS fltk_cairo cairo) -endif (FLTK_HAVE_CAIROEXT) - +# we must link fltk-optons with cairo if option CAIRO is enabled if (FLTK_HAVE_CAIRO) fl_target_link_directories (fltk-options PRIVATE "${PKG_CAIRO_LIBRARY_DIRS}") endif (FLTK_HAVE_CAIRO) -- cgit v1.2.3