summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Charousset <dominik@charousset.de>2023-02-24 20:42:18 +0100
committerGitHub <noreply@github.com>2023-02-24 11:42:18 -0800
commit1cbd5bc762a466e196f78aae7ea6d5c8c5c51fe5 (patch)
treeb960870b91c9681181020451137b4c25253a8985
parent6f5bae8c6900e051da6e677756508707565ce56e (diff)
Write a version file for the CMake package (#1165)
* Write a version file for the CMake package > If no VERSION is given, the PROJECT_VERSION variable is used. Since we set the project version to `${VERSION}`, we can safely skip passing it to `write_basic_package_version_file` as well.
-rw-r--r--CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f05caf2..37804a8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -154,6 +154,8 @@ else()
endif()
SET(INCLUDE_INSTALL_DIR include)
include(CMakePackageConfigHelpers)
+write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/hiredis-config-version.cmake"
+ COMPATIBILITY SameMajorVersion)
configure_package_config_file(hiredis-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/hiredis-config.cmake
INSTALL_DESTINATION ${CMAKE_CONF_INSTALL_DIR}
PATH_VARS INCLUDE_INSTALL_DIR)
@@ -164,6 +166,7 @@ INSTALL(EXPORT hiredis-targets
DESTINATION ${CMAKE_CONF_INSTALL_DIR})
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredis-config.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/hiredis-config-version.cmake
DESTINATION ${CMAKE_CONF_INSTALL_DIR})