Unverified Commit 1cbd5bc7 authored by Dominik Charousset's avatar Dominik Charousset Committed by GitHub
Browse files

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.
parent 6f5bae8c
...@@ -154,6 +154,8 @@ else() ...@@ -154,6 +154,8 @@ else()
endif() endif()
SET(INCLUDE_INSTALL_DIR include) SET(INCLUDE_INSTALL_DIR include)
include(CMakePackageConfigHelpers) 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 configure_package_config_file(hiredis-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/hiredis-config.cmake
INSTALL_DESTINATION ${CMAKE_CONF_INSTALL_DIR} INSTALL_DESTINATION ${CMAKE_CONF_INSTALL_DIR}
PATH_VARS INCLUDE_INSTALL_DIR) PATH_VARS INCLUDE_INSTALL_DIR)
...@@ -164,6 +166,7 @@ INSTALL(EXPORT hiredis-targets ...@@ -164,6 +166,7 @@ INSTALL(EXPORT hiredis-targets
DESTINATION ${CMAKE_CONF_INSTALL_DIR}) DESTINATION ${CMAKE_CONF_INSTALL_DIR})
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredis-config.cmake INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredis-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/hiredis-config-version.cmake
DESTINATION ${CMAKE_CONF_INSTALL_DIR}) DESTINATION ${CMAKE_CONF_INSTALL_DIR})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment