From 5438954d8c6213f1b0cc9d23b70ffaae388e1d60 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 18 Dec 2021 22:42:30 +0100 Subject: Generate FL/fl_config.h rather than FL/abi-version.h ... as discussed in fltk.coredev in thread "RFC: introduce public config header ", see: https://groups.google.com/g/fltkcoredev/c/xLCs1AIXMVo/m/MHZpQggzAQAJ - Rename abi-version.h to fl_config.h, rename input files, update dependencies, .gitignore, CMake, configure and Makefiles. - Include Cairo options in FL/fl_config.h - Rename FLTK_USE_CAIRO to FLTK_HAVE_CAIROEXT for consistency. - Include in config.h and wherever necessary, fix include order (move FL/Fl.H to the top) and more. - Move USE_X11 to fl_config.h and rename to FLTK_USE_X11 - Do not include in Cairo demo program which is no longer required in Cairo programs since FLTK 1.4.0 --- CMake/Android/abi-version.cmake.in | 25 ------------------------- CMake/Android/fl_config.cmake.in | 25 +++++++++++++++++++++++++ CMake/android.cmake | 4 ++-- CMake/fl_create_example.cmake | 5 +++++ CMake/install.cmake | 2 +- CMake/options.cmake | 6 +++--- 6 files changed, 36 insertions(+), 31 deletions(-) delete mode 100644 CMake/Android/abi-version.cmake.in create mode 100644 CMake/Android/fl_config.cmake.in (limited to 'CMake') diff --git a/CMake/Android/abi-version.cmake.in b/CMake/Android/abi-version.cmake.in deleted file mode 100644 index 5200197a9..000000000 --- a/CMake/Android/abi-version.cmake.in +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Configuration file for the Fast Light Tool Kit (FLTK). - * - * Copyright 1998-2020 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 - * file is missing or damaged, see the license at: - * - * https://www.fltk.org/COPYING.php - * - * Please see the following page on how to report bugs and issues: - * - * https://www.fltk.org/bugs.php - */ - -/* - ============================================================================ - DO NOT EDIT - This file is generated by CMake ! - ============================================================================ -*/ - -/* define FL_ABI_VERSION as 10x0y for FLTK ABI version 1.x.y */ - -/* #undef FL_ABI_VERSION */ diff --git a/CMake/Android/fl_config.cmake.in b/CMake/Android/fl_config.cmake.in new file mode 100644 index 000000000..5200197a9 --- /dev/null +++ b/CMake/Android/fl_config.cmake.in @@ -0,0 +1,25 @@ +/* + * Configuration file for the Fast Light Tool Kit (FLTK). + * + * Copyright 1998-2020 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 + * file is missing or damaged, see the license at: + * + * https://www.fltk.org/COPYING.php + * + * Please see the following page on how to report bugs and issues: + * + * https://www.fltk.org/bugs.php + */ + +/* + ============================================================================ + DO NOT EDIT - This file is generated by CMake ! + ============================================================================ +*/ + +/* define FL_ABI_VERSION as 10x0y for FLTK ABI version 1.x.y */ + +/* #undef FL_ABI_VERSION */ diff --git a/CMake/android.cmake b/CMake/android.cmake index b5db954cf..9fc78d828 100644 --- a/CMake/android.cmake +++ b/CMake/android.cmake @@ -31,8 +31,8 @@ configure_file( # create a custom abi file for this setup configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/abi-version.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/FL/abi-version.h" + "${CMAKE_CURRENT_SOURCE_DIR}/fl_config.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/FL/fl_config.h" @ONLY ) diff --git a/CMake/fl_create_example.cmake b/CMake/fl_create_example.cmake index 66c8efc58..c2db54e30 100644 --- a/CMake/fl_create_example.cmake +++ b/CMake/fl_create_example.cmake @@ -116,6 +116,11 @@ macro (CREATE_EXAMPLE NAME SOURCES LIBRARIES) set_target_properties (${TARGET_NAME} PROPERTIES OUTPUT_NAME ${NAME}) target_link_libraries (${TARGET_NAME} ${LIBRARIES}) + # we must link all programs with fltk_cairo if option CAIROEXT is enabled + if (FLTK_HAVE_CAIROEXT) + target_link_libraries (${TARGET_NAME} fltk_cairo cairo) + endif () + if (FLTK_HAVE_CAIRO) fl_target_link_directories (${TARGET_NAME} PRIVATE "${PKG_CAIRO_LIBRARY_DIRS}") endif () diff --git a/CMake/install.cmake b/CMake/install.cmake index bbba1255d..b6b18c374 100644 --- a/CMake/install.cmake +++ b/CMake/install.cmake @@ -34,7 +34,7 @@ install (DIRECTORY DESTINATION ${FLTK_INCLUDEDIR} USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN "*.[hH]" - PATTERN "abi-version.h" EXCLUDE + PATTERN "fl_config.h" EXCLUDE ) install (DIRECTORY diff --git a/CMake/options.cmake b/CMake/options.cmake index cad4b86e2..f1e347fbc 100644 --- a/CMake/options.cmake +++ b/CMake/options.cmake @@ -76,7 +76,7 @@ set (PATH_TO_XLIBS) if ((NOT APPLE OR OPTION_APPLE_X11) AND NOT WIN32) include (FindX11) if (X11_FOUND) - set (USE_X11 1) + set (FLTK_USE_X11 1) list (APPEND FLTK_LDLIBS -lX11) if (X11_Xext_FOUND) list (APPEND FLTK_LDLIBS -lXext) @@ -164,7 +164,7 @@ option (OPTION_CAIROEXT ) set (FLTK_HAVE_CAIRO 0) -set (FLTK_USE_CAIRO 0) +set (FLTK_HAVE_CAIROEXT 0) if (OPTION_CAIRO OR OPTION_CAIROEXT) pkg_search_module (PKG_CAIRO cairo) @@ -174,7 +174,7 @@ if (OPTION_CAIRO OR OPTION_CAIROEXT) if (PKG_CAIRO_FOUND) set (FLTK_HAVE_CAIRO 1) if (OPTION_CAIROEXT) - set (FLTK_USE_CAIRO 1) + set (FLTK_HAVE_CAIROEXT 1) endif (OPTION_CAIROEXT) add_subdirectory (cairo) -- cgit v1.2.3