diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-02-12 16:33:40 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-02-12 16:53:20 +0100 |
| commit | bddcecd28ad2046ab9b13617a04cb4831510da88 (patch) | |
| tree | b3463e1b99f2f59540e407fa3d56c3349260df75 /CMakeLists.txt | |
| parent | cf551ddf5a1fb72f56ca31187acb0bbf1951cdb6 (diff) | |
CMake: set FLTK_VERSION and FLTK_FLUID_EXECUTABLE in the cache
This is useful if FLTK is built as a subproject, for instance by
using FetchContent.
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ac5adb44e..7ac4e112d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,11 @@ if(0) fl_debug_var(CMAKE_VERSION) endif() +# Set FLTK_VERSION in the cache so user projects can access it, +# for instance if FLTK is built as a subproject (FetchContent) + +set(FLTK_VERSION ${FLTK_VERSION} CACHE STRING "FLTK version" FORCE) + ####################################################################### # basic setup ####################################################################### @@ -115,13 +120,22 @@ endif() add_subdirectory(src) ####################################################################### -# build fluid +# build fluid (optional) ####################################################################### +set(FLTK_FLUID_EXECUTABLE "") + if(FLTK_BUILD_FLUID) add_subdirectory(fluid) endif(FLTK_BUILD_FLUID) +# Set FLTK_FLUID_EXECUTABLE in the cache for user projects. +# This can be used if FLTK has been built as a subproject. + +set(FLTK_FLUID_EXECUTABLE + "${FLTK_FLUID_EXECUTABLE}" CACHE STRING + "FLTK's 'fluid' executable") + ####################################################################### # build fltk-options ####################################################################### |
