From 9c864c2a9785a4ebbb0acd81eb8879eeb793ce27 Mon Sep 17 00:00:00 2001 From: SunBlack Date: Tue, 3 Dec 2024 22:03:19 +0100 Subject: [PATCH] {cmake} Generating a package version file (#316) See https://cmake.org/cmake/help/v3.31/module/CMakePackageConfigHelpers.html#generating-a-package-version-file --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11675aa..6a9f64b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -254,9 +254,17 @@ install( "${E57_INSTALL_CMAKEDIR}" ) +include(CMakePackageConfigHelpers) +write_basic_package_version_file ( + e57format-config-version.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY SameMajorVersion +) + install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/e57format-config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/e57format-config-version.cmake DESTINATION "${E57_INSTALL_CMAKEDIR}" )