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.
This commit is contained in:
Albrecht Schlosser
2023-03-09 13:21:49 +02:00
parent e32d4bcab9
commit 5175192755
23 changed files with 444 additions and 170 deletions
+75
View File
@@ -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