# # Downloads and builds Hiredis: https://github.com/redis/hiredis # # The following relevant variables are set: # HIREDIS_FOUND - Always true # HIREDIS_INCLUDE_DIR - The include directories # HIREDIS_STATIC_LIBRARIES - The static libraries # HIREDIS_LIBRARIES - The libraries to link, same as HIREDIS_STATIC_LIBRARIES # set(HIREDIS_REPO "https://github.com/redis/hiredis.git" CACHE STRING "Hiredis Git repository") set(HIREDIS_TAG "v1.0.2" CACHE STRING "Hiredis Git tag") message(STATUS "Building hiredis version ${HIREDIS_TAG}") ExternalProject_add(hiredis GIT_REPOSITORY ${HIREDIS_REPO} GIT_TAG ${HIREDIS_TAG} GIT_SHALLOW TRUE SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/hiredis CONFIGURE_COMMAND "" BUILD_IN_SOURCE 1 BUILD_COMMAND make USE_SSL=1 # The install command is intentionally left out: for some strange and # unknown reason it causes the library to be installed as a part of the # MaxScale package in the location where it would be installed. This is # definitely not wanted and in addition to that it can break the generated # package by changing the ownership of home directories to root. INSTALL_COMMAND "" UPDATE_COMMAND "" LOG_OUTPUT_ON_FAILURE 1 LOG_DOWNLOAD 1 LOG_UPDATE 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 ) set(HIREDIS_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/hiredis CACHE INTERNAL "") set(HIREDIS_STATIC_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/hiredis/libhiredis.a ${CMAKE_CURRENT_BINARY_DIR}/hiredis/libhiredis_ssl.a) set(HIREDIS_LIBRARIES ${HIREDIS_STATIC_LIBRARIES}) set(HIREDIS_FOUND TRUE)