From 5df5daf78e135e0c8371012ffe56df5cae357755 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Wed, 20 Dec 2023 16:56:29 +0100 Subject: Make the 'Forms' compatibility library 'fltk_forms' optional This library is no longer needed in FLTK itself. There is only one demo program (test/forms.cxx) that uses it if it is built. The demo program displays a message if fltk_forms is not available. The default is 'enabled' for backwards compatibility but this may be changed to 'disabled' in a future version. --- src/CMakeLists.txt | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index be2634d62..47d576ac3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -406,14 +406,18 @@ set (CPPFILES ${DRIVER_FILES} ) -set (FORMS_FILES - forms_compatibility.cxx - forms_bitmap.cxx - forms_free.cxx - forms_fselect.cxx - forms_pixmap.cxx - forms_timer.cxx -) +if (FLTK_BUILD_FORMS) + set (FORMS_FILES + forms_compatibility.cxx + forms_bitmap.cxx + forms_free.cxx + forms_fselect.cxx + forms_pixmap.cxx + forms_timer.cxx + ) +else () + set (FORMS_FILES "") +endif () set (GLCPPFILES Fl_Gl_Choice.cxx @@ -759,8 +763,10 @@ endif() ####################################################################### -FL_ADD_LIBRARY (fltk_forms STATIC "${FORMS_FILES}") -target_link_libraries (fltk_forms fltk) +if (FLTK_BUILD_FORMS) + FL_ADD_LIBRARY (fltk_forms STATIC "${FORMS_FILES}") + target_link_libraries (fltk_forms fltk) +endif () ####################################################################### @@ -806,8 +812,10 @@ if (OPTION_BUILD_SHARED_LIBS AND NOT MSVC) ################################################################### - FL_ADD_LIBRARY (fltk_forms SHARED "${FORMS_FILES}") - target_link_libraries (fltk_forms_SHARED fltk_SHARED) + if (FLTK_BUILD_FORMS) + FL_ADD_LIBRARY (fltk_forms SHARED "${FORMS_FILES}") + target_link_libraries (fltk_forms_SHARED fltk_SHARED) + endif () ################################################################### -- cgit v1.2.3