From fd5cd809356dc73d2ede5bb2f0db25098771cb8e Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Wed, 7 Feb 2024 18:30:11 +0100 Subject: Introduce "Modern CMake" in FLTK This is a big commit and there are too many changes to list them all. The main changes are: - rename all CMake build options to 'FLTK_*' - export library targets with namespace (prefix) 'fltk::' - standardize shared library target names with suffix '-shared' - set public build properties on libraries for consumers - document library names and aliases in README.CMake.txt - document changes in "Migrating Code from FLTK 1.3 to 1.4" - partial backwards compatibility for old user projects Included but not directly related changes: - fix Windows (Visual Studio) DLL build - add CMake function fl_debug_target() to show target properties - don't build test programs if FLTK is a subproject - internal: reformat CMake code: remove space before '(' Thanks to Matthias and Manolo for their help, testing, and feeback. --- src/Fl_Cairo.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/Fl_Cairo.cxx') diff --git a/src/Fl_Cairo.cxx b/src/Fl_Cairo.cxx index 598c8747e..4116bb1ac 100644 --- a/src/Fl_Cairo.cxx +++ b/src/Fl_Cairo.cxx @@ -1,7 +1,7 @@ // // Special Cairo support for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2023 by Bill Spitzak and others. +// Copyright 1998-2024 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 @@ -14,13 +14,14 @@ // https://www.fltk.org/bugs.php // -// This file implements the FLTK Cairo support (since 1.3.x): +// This file implements the FLTK Cairo Window support (since 1.3.x): // // - ./configure --enable-cairo and/or --enable-cairoext -// - cmake -DOPTION_CAIRO and/or -DOPTION_CAIROEXT +// - cmake -D FLTK_OPTION_CAIRO_WINDOW and/or -D FLTK_OPTION_CAIRO_EXT // // Preprocessor macro FLTK_HAVE_CAIRO is defined for both options. -// Preprocessor macro FLTK_HAVE_CAIRO_EXT is defined only for "cairoext" +// Preprocessor macro FLTK_HAVE_CAIRO_EXT is defined only for "cairoext". +// Both macros are defined in 'FL/fl_config.h'. #include // includes @@ -69,7 +70,7 @@ void Fl_Cairo_State::autolink(bool b) { autolink_ = b; #else Fl::fatal("In Fl::autolink(bool): Cairo autolink() feature is only " - "available with CMake OPTION_CAIROEXT " + "available with CMake FLTK_OPTION_CAIRO_EXT " "or the enable-cairoext configure option.\n" "Quitting now."); #endif @@ -167,7 +168,7 @@ static cairo_surface_t *cairo_create_surface(void *gc, int W, int H) { Creates a Cairo context from a \a gc only, gets its window size or offscreen size if fl_window is null. - \note Only available if CMake OPTION_CAIRO is enabled + \note Only available if CMake FLTK_OPTION_CAIRO_WINDOW is enabled or configure has the --enable-cairo option. */ cairo_t *Fl::cairo_make_current(void *gc) { @@ -210,7 +211,7 @@ cairo_t *Fl::cairo_make_current(void *gc) { /** Creates a Cairo context from a \p gc and the given size. - \note Only available if CMake OPTION_CAIRO is enabled + \note Only available if CMake FLTK_OPTION_CAIRO_WINDOW is enabled or configure has the --enable-cairo option. */ cairo_t *Fl::cairo_make_current(void *gc, int W, int H) { -- cgit v1.2.3