summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2023-03-09 13:21:49 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2023-03-09 17:34:05 +0100
commit5175192755e57d1d7016253d48f34f9d0c2c0832 (patch)
tree6262a13668d6ea56067910b024516c60305e374e /fluid
parente32d4bcab990c2648bbcf550d115a5393c3f50e2 (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 'fluid')
-rw-r--r--fluid/CMakeLists.txt37
-rw-r--r--fluid/makedepend75
2 files changed, 101 insertions, 11 deletions
diff --git a/fluid/CMakeLists.txt b/fluid/CMakeLists.txt
index a9aac0019..ab891a67c 100644
--- a/fluid/CMakeLists.txt
+++ b/fluid/CMakeLists.txt
@@ -1,7 +1,7 @@
#
# CMakeLists.txt to build fluid for the FLTK project using CMake (www.cmake.org)
#
-# Copyright 1998-2022 by Bill Spitzak and others.
+# Copyright 1998-2023 by Bill Spitzak and others.
#
# This library is free software. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file. If this
@@ -114,13 +114,12 @@ else ()
endif ()
-# we must link all programs with fltk_cairo if option CAIROEXT is enabled
-if (FLTK_HAVE_CAIROEXT)
- list (APPEND FLUID_LIBS fltk_cairo cairo)
-endif (FLTK_HAVE_CAIROEXT)
-
+# we must link fluid with Cairo if OPTION_CAIRO is enabled
if (FLTK_HAVE_CAIRO)
- fl_target_link_directories (fluid PRIVATE "${PKG_CAIRO_LIBRARY_DIRS}")
+ target_include_directories (fluid PRIVATE ${PKG_CAIRO_INCLUDE_DIRS})
+ if (PKG_CAIRO_LIBRARY_DIRS)
+ fl_target_link_directories (fluid PRIVATE ${PKG_CAIRO_LIBRARY_DIRS})
+ endif ()
endif (FLTK_HAVE_CAIRO)
if (USE_GDIPLUS) # can only be true on Windows
@@ -137,11 +136,27 @@ if (WIN32)
list (APPEND FLUID_TARGETS fluid-cmd)
add_executable (fluid-cmd ${CPPFILES} ${HEADERFILES})
target_link_libraries (fluid-cmd ${FLUID_LIBS})
+
+ # we must link fluid-cmd with Cairo if OPTION_CAIRO is enabled (same as above)
if (FLTK_HAVE_CAIRO)
- fl_target_link_directories (fluid-cmd PRIVATE "${PKG_CAIRO_LIBRARY_DIRS}")
+ target_include_directories (fluid-cmd PRIVATE ${PKG_CAIRO_INCLUDE_DIRS})
+ if (PKG_CAIRO_LIBRARY_DIRS)
+ fl_target_link_directories (fluid-cmd PRIVATE ${PKG_CAIRO_LIBRARY_DIRS})
+ endif ()
endif (FLTK_HAVE_CAIRO)
-endif ()
+endif (WIN32)
+
+# Build fluid-shared (experimental)
+if (OPTION_BUILD_SHARED_LIBS)
+ list (APPEND FLUID_TARGETS fluid-shared)
+ add_executable (fluid-shared ${CPPFILES} ${HEADERFILES})
+ if (MSVC)
+ target_link_libraries (fluid-shared fltk_SHARED)
+ else ()
+ target_link_libraries (fluid-shared fltk_images_SHARED)
+ endif (MSVC)
+endif ()
# install fluid GUI and commandline tool
@@ -164,7 +179,7 @@ if (APPLE AND (NOT OPTION_APPLE_X11))
# ## set_target_properties (fluid PROPERTIES RESOURCE ${ICON_PATH})
# install fluid GUI and commandline tools
- #install (TARGETS fluid DESTINATION "/Applications")
+ # install (TARGETS fluid DESTINATION "/Applications")
# install command line tool
install (PROGRAMS $<TARGET_FILE:fluid> DESTINATION ${FLTK_BINDIR})
@@ -180,7 +195,7 @@ else()
ARCHIVE DESTINATION ${FLTK_LIBDIR}
)
- endif (APPLE AND (NOT OPTION_APPLE_X11))
+endif (APPLE AND (NOT OPTION_APPLE_X11))
# install desktop files
diff --git a/fluid/makedepend b/fluid/makedepend
index 5c5583a14..8e2b8361f 100644
--- a/fluid/makedepend
+++ b/fluid/makedepend
@@ -220,6 +220,72 @@ CodeEditor.o: ../FL/Fl_Widget.H
CodeEditor.o: ../FL/platform_types.h
CodeEditor.o: CodeEditor.h
CodeEditor.o: StyleParse.h
+custom_widgets.o: ../config.h
+custom_widgets.o: ../FL/Enumerations.H
+custom_widgets.o: ../FL/filename.H
+custom_widgets.o: ../FL/Fl.H
+custom_widgets.o: ../FL/fl_attr.h
+custom_widgets.o: ../FL/Fl_Bitmap.H
+custom_widgets.o: ../FL/Fl_Box.H
+custom_widgets.o: ../FL/Fl_Browser_.H
+custom_widgets.o: ../FL/Fl_Button.H
+custom_widgets.o: ../FL/Fl_Cairo.H
+custom_widgets.o: ../FL/fl_casts.H
+custom_widgets.o: ../FL/Fl_Check_Button.H
+custom_widgets.o: ../FL/Fl_Choice.H
+custom_widgets.o: ../FL/fl_config.h
+custom_widgets.o: ../FL/Fl_Device.H
+custom_widgets.o: ../FL/Fl_Double_Window.H
+custom_widgets.o: ../FL/fl_draw.H
+custom_widgets.o: ../FL/Fl_Export.H
+custom_widgets.o: ../FL/Fl_Graphics_Driver.H
+custom_widgets.o: ../FL/Fl_Group.H
+custom_widgets.o: ../FL/Fl_Image.H
+custom_widgets.o: ../FL/Fl_Input.H
+custom_widgets.o: ../FL/Fl_Input_.H
+custom_widgets.o: ../FL/Fl_Input_Choice.H
+custom_widgets.o: ../FL/Fl_Light_Button.H
+custom_widgets.o: ../FL/Fl_Menu_.H
+custom_widgets.o: ../FL/Fl_Menu_Button.H
+custom_widgets.o: ../FL/Fl_Menu_Item.H
+custom_widgets.o: ../FL/Fl_Pixmap.H
+custom_widgets.o: ../FL/Fl_Plugin.H
+custom_widgets.o: ../FL/Fl_Preferences.H
+custom_widgets.o: ../FL/Fl_Rect.H
+custom_widgets.o: ../FL/Fl_Return_Button.H
+custom_widgets.o: ../FL/Fl_RGB_Image.H
+custom_widgets.o: ../FL/Fl_Scrollbar.H
+custom_widgets.o: ../FL/Fl_Shortcut_Button.H
+custom_widgets.o: ../FL/Fl_Slider.H
+custom_widgets.o: ../FL/Fl_String.H
+custom_widgets.o: ../FL/fl_string_functions.h
+custom_widgets.o: ../FL/Fl_Tabs.H
+custom_widgets.o: ../FL/Fl_Text_Buffer.H
+custom_widgets.o: ../FL/Fl_Text_Display.H
+custom_widgets.o: ../FL/Fl_Text_Editor.H
+custom_widgets.o: ../FL/Fl_Tile.H
+custom_widgets.o: ../FL/fl_types.h
+custom_widgets.o: ../FL/fl_utf8.h
+custom_widgets.o: ../FL/Fl_Valuator.H
+custom_widgets.o: ../FL/Fl_Value_Input.H
+custom_widgets.o: ../FL/Fl_Widget.H
+custom_widgets.o: ../FL/Fl_Window.H
+custom_widgets.o: ../FL/platform.H
+custom_widgets.o: ../FL/platform_types.h
+custom_widgets.o: ../FL/x11.H
+custom_widgets.o: ../src/flstring.h
+custom_widgets.o: code.h
+custom_widgets.o: CodeEditor.h
+custom_widgets.o: custom_widgets.h
+custom_widgets.o: factory.h
+custom_widgets.o: fluid.h
+custom_widgets.o: Fl_Type.h
+custom_widgets.o: Fl_Widget_Type.h
+custom_widgets.o: Fl_Window_Type.h
+custom_widgets.o: pixmaps.h
+custom_widgets.o: StyleParse.h
+custom_widgets.o: widget_browser.h
+custom_widgets.o: widget_panel.h
ExternalCodeEditor_UNIX.o: ../FL/Enumerations.H
ExternalCodeEditor_UNIX.o: ../FL/filename.H
ExternalCodeEditor_UNIX.o: ../FL/Fl.H
@@ -722,6 +788,7 @@ Fl_Menu_Type.o: ../FL/Fl_Scheme.H
Fl_Menu_Type.o: ../FL/Fl_Scheme_Choice.H
Fl_Menu_Type.o: ../FL/Fl_Scrollbar.H
Fl_Menu_Type.o: ../FL/Fl_Shared_Image.H
+Fl_Menu_Type.o: ../FL/Fl_Shortcut_Button.H
Fl_Menu_Type.o: ../FL/Fl_Simple_Terminal.H
Fl_Menu_Type.o: ../FL/Fl_Slider.H
Fl_Menu_Type.o: ../FL/Fl_Spinner.H
@@ -740,6 +807,7 @@ Fl_Menu_Type.o: ../FL/platform_types.h
Fl_Menu_Type.o: ../src/flstring.h
Fl_Menu_Type.o: alignment_panel.h
Fl_Menu_Type.o: code.h
+Fl_Menu_Type.o: custom_widgets.h
Fl_Menu_Type.o: file.h
Fl_Menu_Type.o: fluid.h
Fl_Menu_Type.o: Fluid_Image.h
@@ -849,6 +917,7 @@ Fl_Widget_Type.o: ../FL/Fl_Scheme_Choice.H
Fl_Widget_Type.o: ../FL/Fl_Scroll.H
Fl_Widget_Type.o: ../FL/Fl_Scrollbar.H
Fl_Widget_Type.o: ../FL/Fl_Shared_Image.H
+Fl_Widget_Type.o: ../FL/Fl_Shortcut_Button.H
Fl_Widget_Type.o: ../FL/fl_show_colormap.H
Fl_Widget_Type.o: ../FL/Fl_Simple_Terminal.H
Fl_Widget_Type.o: ../FL/Fl_Slider.H
@@ -873,6 +942,7 @@ Fl_Widget_Type.o: ../src/flstring.h
Fl_Widget_Type.o: alignment_panel.h
Fl_Widget_Type.o: code.h
Fl_Widget_Type.o: CodeEditor.h
+Fl_Widget_Type.o: custom_widgets.h
Fl_Widget_Type.o: ExternalCodeEditor_UNIX.h
Fl_Widget_Type.o: file.h
Fl_Widget_Type.o: fluid.h
@@ -935,6 +1005,7 @@ Fl_Window_Type.o: ../FL/Fl_Scheme.H
Fl_Window_Type.o: ../FL/Fl_Scheme_Choice.H
Fl_Window_Type.o: ../FL/Fl_Scrollbar.H
Fl_Window_Type.o: ../FL/Fl_Shared_Image.H
+Fl_Window_Type.o: ../FL/Fl_Shortcut_Button.H
Fl_Window_Type.o: ../FL/Fl_Simple_Terminal.H
Fl_Window_Type.o: ../FL/Fl_Slider.H
Fl_Window_Type.o: ../FL/Fl_Spinner.H
@@ -959,6 +1030,7 @@ Fl_Window_Type.o: ../src/flstring.h
Fl_Window_Type.o: alignment_panel.h
Fl_Window_Type.o: code.h
Fl_Window_Type.o: CodeEditor.h
+Fl_Window_Type.o: custom_widgets.h
Fl_Window_Type.o: factory.h
Fl_Window_Type.o: file.h
Fl_Window_Type.o: fluid.h
@@ -1019,6 +1091,7 @@ function_panel.o: ../FL/Fl_Window.H
function_panel.o: ../FL/platform_types.h
function_panel.o: code.h
function_panel.o: CodeEditor.h
+function_panel.o: custom_widgets.h
function_panel.o: factory.h
function_panel.o: fluid.h
function_panel.o: Fl_Type.h
@@ -1290,6 +1363,7 @@ widget_panel.o: ../FL/Fl_Rect.H
widget_panel.o: ../FL/Fl_Return_Button.H
widget_panel.o: ../FL/Fl_RGB_Image.H
widget_panel.o: ../FL/Fl_Scrollbar.H
+widget_panel.o: ../FL/Fl_Shortcut_Button.H
widget_panel.o: ../FL/Fl_Slider.H
widget_panel.o: ../FL/Fl_Tabs.H
widget_panel.o: ../FL/Fl_Text_Buffer.H
@@ -1305,6 +1379,7 @@ widget_panel.o: ../FL/Fl_Window.H
widget_panel.o: ../FL/platform_types.h
widget_panel.o: code.h
widget_panel.o: CodeEditor.h
+widget_panel.o: custom_widgets.h
widget_panel.o: Fl_Type.h
widget_panel.o: Fl_Widget_Type.h
widget_panel.o: pixmaps.h