From e9a8853aa45f5762265cc91aa62fd917a116b38e Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Fri, 16 Aug 2024 15:56:03 +0200 Subject: [PATCH] CMake: add FLTKConfigVersion.cmake This file enables consumers to search for a particular FLTK version. Note: backported from 'master' to support parallel installation of 1.3.10 (1.3.x) and 1.4.0 (1.4.x) or any higher version on one system. --- CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d0523d64..de50a435c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,6 +124,22 @@ if (FLTK_BUILD_EXAMPLES) add_subdirectory (examples) endif (FLTK_BUILD_EXAMPLES) +####################################################################### +# create and install version config file 'FLTKConfigVersion.cmake' +####################################################################### + +include(CMakePackageConfigHelpers) + +write_basic_package_version_file(FLTKConfigVersion.cmake + # [VERSION requiredVersion] # defaults to project version + COMPATIBILITY SameMinorVersion +) + +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/FLTKConfigVersion.cmake + DESTINATION ${FLTK_CONFIG_PATH} +) + ####################################################################### # installation #######################################################################