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.
This commit is contained in:
Albrecht Schlosser 2024-08-16 15:56:03 +02:00
parent 63d7c71e1a
commit e9a8853aa4
1 changed files with 16 additions and 0 deletions

View File

@ -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
#######################################################################