Skip to content

Commit

Permalink
Write a version file for the CMake package (#1165)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Neverlord authored Feb 24, 2023
1 parent 6f5bae8 commit 1cbd5bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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})


Expand Down

0 comments on commit 1cbd5bc

Please sign in to comment.