37 lines
1.3 KiB
CMake
37 lines
1.3 KiB
CMake
# This CMake file tries to find the the Hiredis library
|
|
# The following variables are set:
|
|
# HIREDIS_FOUND - System has Hiredis
|
|
# HIREDIS_STATIC_FOUND - System has statically linked Hiredis
|
|
# HIREDIS_LIBRARIES - The Hiredis library
|
|
# HIREDIS_STATIC_LIBRARIES - The static Hiredis library
|
|
# HIREDIS_HEADERS - The Hiredis headers
|
|
|
|
find_library(HIREDIS_LIBRARIES NAMES hiredis PATH_SUFFIXES hiredis)
|
|
if(${HIREDIS_LIBRARIES} MATCHES "NOTFOUND")
|
|
set(HIREDIS_FOUND FALSE CACHE INTERNAL "")
|
|
message(STATUS "Dynamic Hiredis library not found.")
|
|
unset(HIREDIS_LIBRARIES)
|
|
else()
|
|
set(HIREDIS_FOUND TRUE CACHE INTERNAL "")
|
|
message(STATUS "Found dynamic Hiredis library: ${HIREDIS_LIBRARIES}")
|
|
endif()
|
|
|
|
set(OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
|
find_library(HIREDIS_STATIC_LIBRARIES NAMES hiredis PATH_SUFFIXES hiredis)
|
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_SUFFIXES})
|
|
|
|
if(${HIREDIS_STATIC_LIBRARIES} MATCHES "NOTFOUND")
|
|
set(HIREDIS_STATIC_FOUND FALSE CACHE INTERNAL "")
|
|
message(STATUS "Static Hiredis library not found")
|
|
unset(HIREDIS_STATIC_LIBRARIES)
|
|
else()
|
|
set(HIREDIS_STATIC_FOUND TRUE CACHE INTERNAL "")
|
|
message(STATUS "Found static Hiredis library: ${HIREDIS_STATIC_LIBRARIES}")
|
|
endif()
|
|
|
|
find_path(HIREDIS_HEADERS hiredis.h PATH_SUFFIXES hiredis)
|
|
|
|
|
|
|