Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Apr 26, 2023

Conversation

bjosv
Copy link
Collaborator

@bjosv bjosv commented Apr 25, 2023

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.

bjosv added 2 commits April 25, 2023 18:58
Enables users to ask for a specific version like:

  find_package(hiredis_cluster 0.10.1 REQUIRED)

which will accept all 0.10.x versions but not 0.11.0
Since CMake find_package() can't find required information from a
fetched dependency without jumping through hoops a version stub file
is also created. This is needed when hiredis-cluster is downloading
hiredis to make CMake understand which hiredis version it is using.
@bjosv bjosv requested a review from zuiderkwast April 25, 2023 17:29
Copy link
Collaborator

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting

@bjosv bjosv merged commit 7247532 into Nordix:master Apr 26, 2023
@bjosv bjosv deleted the add-cmake-version-file branch April 26, 2023 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants