Allow hiredis to be retrieved automatically by FetchContent#639
Conversation
75fcea5 to
8135fa5
Compare
8135fa5 to
b961816
Compare
|
just tried this in our project and configure and build are successful. big help and very nice work!! |
|
Great job! Thanks a lot! The only problem is that this solution requires minimum version of cmake is 3.24. Is it possible to make the CMakeLists.txt also works with older version cmake for those who don't require the FetchContent feature? I mean, if they want to use FetchContent feature, the upgrade cmake to 3.24, otherwise, they can use an older version to build. Regards |
|
Hello @sewenew ! Indeed it requires CMake 3.24 because of |
|
@sjanel Sorry, but I misunderstood the solution. User with older version cmake, can still build redis-plus-plus the old way. Thanks a lot for your contribution! Regards |
|
I think the latest CMake (v4.2.1 at the latest) has moved the directory of FetchContent's dependencies to, e.g., |
Configure hiredis features file before find package of hiredis to avoid configuration error.
Fix issues encountered by this PR, and this issue.
Here's how to use FetchContent with
redis++as a dependency with modern CMake (>= v3.24):CMakeLists.txt
main.cc
(adapted from this gist)