Nordix / hiredis-cluster

C client library for Valkey/Redis Cluster. This project is used and sponsored by Ericsson. It is a fork of the now unmaintained hiredis-vip.
BSD 3-Clause "New" or "Revised" License
87 stars 42 forks source link

Create and install a version file for the hiredis-cluster CMake package #154

Closed bjosv closed 1 year ago

bjosv commented 1 year ago

The version file for the CMake package enables users to ask for a specific version like:

find_package(hiredis_cluster 0.10.1 REQUIRED)

which will find and accept all 0.10.x versions but not 0.11.0 (using CMakePackageConfigHelpers).

Additionally, this PR fixes a problem that CMake's find_package() don't understand which version that is used when the build downloads the hiredis package using FetchContent. This is fixed by creating a version file stub containing the package version. This fixes a problem seen in PR #150, a testcase that should be run when using hiredis 1.0.1 will not run even when the build downloads hiredis 1.0.1.