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

Fix builds when using CMake < v3.15 and preinstalled hiredis #196

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ if(NOT hiredis_FOUND)
message("CMake package for 'hiredis' not found, searching for the library..")
find_library(HIREDIS_LIB hiredis REQUIRED)
find_path(HIREDIS_INCLUDES hiredis/hiredis.h)
add_library(hiredis UNKNOWN IMPORTED GLOBAL)
set_target_properties(hiredis PROPERTIES IMPORTED_LOCATION ${HIREDIS_LIB})
set_target_properties(hiredis PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${HIREDIS_INCLUDES})
add_library(hiredis::hiredis UNKNOWN IMPORTED GLOBAL)
set_target_properties(hiredis::hiredis PROPERTIES IMPORTED_LOCATION ${HIREDIS_LIB})
set_target_properties(hiredis::hiredis PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${HIREDIS_INCLUDES})
endif()

if(NOT TARGET hiredis::hiredis)
Expand All @@ -154,9 +154,9 @@ if(ENABLE_SSL)
message("CMake package for 'hiredis_ssl' not found, searching for the library..")
find_library(HIREDIS_SSL_LIB hiredis_ssl REQUIRED)
find_path(HIREDIS_SSL_INCLUDES hiredis/hiredis_ssl.h)
add_library(hiredis_ssl UNKNOWN IMPORTED GLOBAL)
set_target_properties(hiredis_ssl PROPERTIES IMPORTED_LOCATION ${HIREDIS_SSL_LIB})
set_target_properties(hiredis_ssl PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${HIREDIS_SSL_INCLUDES})
add_library(hiredis::hiredis_ssl UNKNOWN IMPORTED GLOBAL)
set_target_properties(hiredis::hiredis_ssl PROPERTIES IMPORTED_LOCATION ${HIREDIS_SSL_LIB})
set_target_properties(hiredis::hiredis_ssl PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${HIREDIS_SSL_INCLUDES})
endif()

if(NOT TARGET hiredis::hiredis_ssl)
Expand Down
Loading