diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 22:52:54 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 22:52:54 +0100 |
| commit | dcacc00e3750300617ba6e16eb346713f91a783a (patch) | |
| tree | 38e2d4fb5ed9d119711d4295c6eda4b014af73fd /examples/redis-unstable/deps/hiredis/CMakeLists.txt | |
| parent | 58dac10aeb8f5a041c46bddbeaf4c7966a99b998 (diff) | |
| download | crep-dcacc00e3750300617ba6e16eb346713f91a783a.tar.gz | |
Remove testing data
Diffstat (limited to 'examples/redis-unstable/deps/hiredis/CMakeLists.txt')
| -rw-r--r-- | examples/redis-unstable/deps/hiredis/CMakeLists.txt | 237 |
1 files changed, 0 insertions, 237 deletions
diff --git a/examples/redis-unstable/deps/hiredis/CMakeLists.txt b/examples/redis-unstable/deps/hiredis/CMakeLists.txt deleted file mode 100644 index b7d6ee8..0000000 --- a/examples/redis-unstable/deps/hiredis/CMakeLists.txt +++ /dev/null | |||
| @@ -1,237 +0,0 @@ | |||
| 1 | CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) | ||
| 2 | |||
| 3 | OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON) | ||
| 4 | OPTION(ENABLE_SSL "Build hiredis_ssl for SSL support" OFF) | ||
| 5 | OPTION(DISABLE_TESTS "If tests should be compiled or not" OFF) | ||
| 6 | OPTION(ENABLE_SSL_TESTS "Should we test SSL connections" OFF) | ||
| 7 | OPTION(ENABLE_EXAMPLES "Enable building hiredis examples" OFF) | ||
| 8 | OPTION(ENABLE_ASYNC_TESTS "Should we run all asynchronous API tests" OFF) | ||
| 9 | |||
| 10 | MACRO(getVersionBit name) | ||
| 11 | SET(VERSION_REGEX "^#define ${name} (.+)$") | ||
| 12 | FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/hiredis.h" | ||
| 13 | VERSION_BIT REGEX ${VERSION_REGEX}) | ||
| 14 | STRING(REGEX REPLACE ${VERSION_REGEX} "\\1" ${name} "${VERSION_BIT}") | ||
| 15 | ENDMACRO(getVersionBit) | ||
| 16 | |||
| 17 | getVersionBit(HIREDIS_MAJOR) | ||
| 18 | getVersionBit(HIREDIS_MINOR) | ||
| 19 | getVersionBit(HIREDIS_PATCH) | ||
| 20 | getVersionBit(HIREDIS_SONAME) | ||
| 21 | SET(VERSION "${HIREDIS_MAJOR}.${HIREDIS_MINOR}.${HIREDIS_PATCH}") | ||
| 22 | MESSAGE("Detected version: ${VERSION}") | ||
| 23 | |||
| 24 | PROJECT(hiredis LANGUAGES "C" VERSION "${VERSION}") | ||
| 25 | INCLUDE(GNUInstallDirs) | ||
| 26 | |||
| 27 | # Hiredis requires C99 | ||
| 28 | SET(CMAKE_C_STANDARD 99) | ||
| 29 | SET(CMAKE_DEBUG_POSTFIX d) | ||
| 30 | |||
| 31 | SET(hiredis_sources | ||
| 32 | alloc.c | ||
| 33 | async.c | ||
| 34 | hiredis.c | ||
| 35 | net.c | ||
| 36 | read.c | ||
| 37 | sds.c | ||
| 38 | sockcompat.c) | ||
| 39 | |||
| 40 | SET(hiredis_sources ${hiredis_sources}) | ||
| 41 | |||
| 42 | IF(WIN32) | ||
| 43 | ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -DWIN32_LEAN_AND_MEAN) | ||
| 44 | ENDIF() | ||
| 45 | |||
| 46 | ADD_LIBRARY(hiredis ${hiredis_sources}) | ||
| 47 | ADD_LIBRARY(hiredis::hiredis ALIAS hiredis) | ||
| 48 | set(hiredis_export_name hiredis CACHE STRING "Name of the exported target") | ||
| 49 | set_target_properties(hiredis PROPERTIES EXPORT_NAME ${hiredis_export_name}) | ||
| 50 | |||
| 51 | SET_TARGET_PROPERTIES(hiredis | ||
| 52 | PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE | ||
| 53 | VERSION "${HIREDIS_SONAME}") | ||
| 54 | IF(MSVC) | ||
| 55 | SET_TARGET_PROPERTIES(hiredis | ||
| 56 | PROPERTIES COMPILE_FLAGS /Z7) | ||
| 57 | ENDIF() | ||
| 58 | IF(WIN32) | ||
| 59 | TARGET_LINK_LIBRARIES(hiredis PUBLIC ws2_32 crypt32) | ||
| 60 | ELSEIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") | ||
| 61 | TARGET_LINK_LIBRARIES(hiredis PUBLIC m) | ||
| 62 | ELSEIF(CMAKE_SYSTEM_NAME MATCHES "SunOS") | ||
| 63 | TARGET_LINK_LIBRARIES(hiredis PUBLIC socket) | ||
| 64 | ENDIF() | ||
| 65 | |||
| 66 | TARGET_INCLUDE_DIRECTORIES(hiredis PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) | ||
| 67 | |||
| 68 | CONFIGURE_FILE(hiredis.pc.in hiredis.pc @ONLY) | ||
| 69 | |||
| 70 | set(CPACK_PACKAGE_VENDOR "Redis") | ||
| 71 | set(CPACK_PACKAGE_DESCRIPTION "\ | ||
| 72 | Hiredis is a minimalistic C client library for the Redis database. | ||
| 73 | |||
| 74 | It is minimalistic because it just adds minimal support for the protocol, \ | ||
| 75 | but at the same time it uses a high level printf-alike API in order to make \ | ||
| 76 | it much higher level than otherwise suggested by its minimal code base and the \ | ||
| 77 | lack of explicit bindings for every Redis command. | ||
| 78 | |||
| 79 | Apart from supporting sending commands and receiving replies, it comes with a \ | ||
| 80 | reply parser that is decoupled from the I/O layer. It is a stream parser designed \ | ||
| 81 | for easy reusability, which can for instance be used in higher level language bindings \ | ||
| 82 | for efficient reply parsing. | ||
| 83 | |||
| 84 | Hiredis only supports the binary-safe Redis protocol, so you can use it with any Redis \ | ||
| 85 | version >= 1.2.0. | ||
| 86 | |||
| 87 | The library comes with multiple APIs. There is the synchronous API, the asynchronous API \ | ||
| 88 | and the reply parsing API.") | ||
| 89 | set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/redis/hiredis") | ||
| 90 | set(CPACK_PACKAGE_CONTACT "michael dot grunder at gmail dot com") | ||
| 91 | set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) | ||
| 92 | set(CPACK_RPM_PACKAGE_AUTOREQPROV ON) | ||
| 93 | |||
| 94 | include(CPack) | ||
| 95 | |||
| 96 | INSTALL(TARGETS hiredis | ||
| 97 | EXPORT hiredis-targets | ||
| 98 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
| 99 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| 100 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
| 101 | |||
| 102 | if (MSVC AND BUILD_SHARED_LIBS) | ||
| 103 | INSTALL(FILES $<TARGET_PDB_FILE:hiredis> | ||
| 104 | DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
| 105 | CONFIGURATIONS Debug RelWithDebInfo) | ||
| 106 | endif() | ||
| 107 | |||
| 108 | # For NuGet packages | ||
| 109 | INSTALL(FILES hiredis.targets | ||
| 110 | DESTINATION build/native) | ||
| 111 | |||
| 112 | INSTALL(FILES hiredis.h read.h sds.h async.h alloc.h sockcompat.h | ||
| 113 | DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis) | ||
| 114 | |||
| 115 | INSTALL(DIRECTORY adapters | ||
| 116 | DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis) | ||
| 117 | |||
| 118 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredis.pc | ||
| 119 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) | ||
| 120 | |||
| 121 | export(EXPORT hiredis-targets | ||
| 122 | FILE "${CMAKE_CURRENT_BINARY_DIR}/hiredis-targets.cmake" | ||
| 123 | NAMESPACE hiredis::) | ||
| 124 | |||
| 125 | if(WIN32) | ||
| 126 | SET(CMAKE_CONF_INSTALL_DIR share/hiredis) | ||
| 127 | else() | ||
| 128 | SET(CMAKE_CONF_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/hiredis) | ||
| 129 | endif() | ||
| 130 | SET(INCLUDE_INSTALL_DIR include) | ||
| 131 | include(CMakePackageConfigHelpers) | ||
| 132 | write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/hiredis-config-version.cmake" | ||
| 133 | COMPATIBILITY SameMajorVersion) | ||
| 134 | configure_package_config_file(hiredis-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/hiredis-config.cmake | ||
| 135 | INSTALL_DESTINATION ${CMAKE_CONF_INSTALL_DIR} | ||
| 136 | PATH_VARS INCLUDE_INSTALL_DIR) | ||
| 137 | |||
| 138 | INSTALL(EXPORT hiredis-targets | ||
| 139 | FILE hiredis-targets.cmake | ||
| 140 | NAMESPACE hiredis:: | ||
| 141 | DESTINATION ${CMAKE_CONF_INSTALL_DIR}) | ||
| 142 | |||
| 143 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredis-config.cmake | ||
| 144 | ${CMAKE_CURRENT_BINARY_DIR}/hiredis-config-version.cmake | ||
| 145 | DESTINATION ${CMAKE_CONF_INSTALL_DIR}) | ||
| 146 | |||
| 147 | |||
| 148 | IF(ENABLE_SSL) | ||
| 149 | IF (NOT OPENSSL_ROOT_DIR) | ||
| 150 | IF (APPLE) | ||
| 151 | SET(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") | ||
| 152 | ENDIF() | ||
| 153 | ENDIF() | ||
| 154 | FIND_PACKAGE(OpenSSL REQUIRED) | ||
| 155 | SET(hiredis_ssl_sources | ||
| 156 | ssl.c) | ||
| 157 | ADD_LIBRARY(hiredis_ssl ${hiredis_ssl_sources}) | ||
| 158 | ADD_LIBRARY(hiredis::hiredis_ssl ALIAS hiredis_ssl) | ||
| 159 | |||
| 160 | IF (APPLE AND BUILD_SHARED_LIBS) | ||
| 161 | SET_PROPERTY(TARGET hiredis_ssl PROPERTY LINK_FLAGS "-Wl,-undefined -Wl,dynamic_lookup") | ||
| 162 | ENDIF() | ||
| 163 | |||
| 164 | SET_TARGET_PROPERTIES(hiredis_ssl | ||
| 165 | PROPERTIES | ||
| 166 | WINDOWS_EXPORT_ALL_SYMBOLS TRUE | ||
| 167 | VERSION "${HIREDIS_SONAME}") | ||
| 168 | IF(MSVC) | ||
| 169 | SET_TARGET_PROPERTIES(hiredis_ssl | ||
| 170 | PROPERTIES COMPILE_FLAGS /Z7) | ||
| 171 | ENDIF() | ||
| 172 | TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE OpenSSL::SSL) | ||
| 173 | IF(WIN32) | ||
| 174 | TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE hiredis) | ||
| 175 | ENDIF() | ||
| 176 | CONFIGURE_FILE(hiredis_ssl.pc.in hiredis_ssl.pc @ONLY) | ||
| 177 | |||
| 178 | INSTALL(TARGETS hiredis_ssl | ||
| 179 | EXPORT hiredis_ssl-targets | ||
| 180 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
| 181 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| 182 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
| 183 | |||
| 184 | if (MSVC AND BUILD_SHARED_LIBS) | ||
| 185 | INSTALL(FILES $<TARGET_PDB_FILE:hiredis_ssl> | ||
| 186 | DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
| 187 | CONFIGURATIONS Debug RelWithDebInfo) | ||
| 188 | endif() | ||
| 189 | |||
| 190 | INSTALL(FILES hiredis_ssl.h | ||
| 191 | DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis) | ||
| 192 | |||
| 193 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredis_ssl.pc | ||
| 194 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) | ||
| 195 | |||
| 196 | export(EXPORT hiredis_ssl-targets | ||
| 197 | FILE "${CMAKE_CURRENT_BINARY_DIR}/hiredis_ssl-targets.cmake" | ||
| 198 | NAMESPACE hiredis::) | ||
| 199 | |||
| 200 | if(WIN32) | ||
| 201 | SET(CMAKE_CONF_INSTALL_DIR share/hiredis_ssl) | ||
| 202 | else() | ||
| 203 | SET(CMAKE_CONF_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/hiredis_ssl) | ||
| 204 | endif() | ||
| 205 | configure_package_config_file(hiredis_ssl-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/hiredis_ssl-config.cmake | ||
| 206 | INSTALL_DESTINATION ${CMAKE_CONF_INSTALL_DIR} | ||
| 207 | PATH_VARS INCLUDE_INSTALL_DIR) | ||
| 208 | |||
| 209 | INSTALL(EXPORT hiredis_ssl-targets | ||
| 210 | FILE hiredis_ssl-targets.cmake | ||
| 211 | NAMESPACE hiredis:: | ||
| 212 | DESTINATION ${CMAKE_CONF_INSTALL_DIR}) | ||
| 213 | |||
| 214 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredis_ssl-config.cmake | ||
| 215 | DESTINATION ${CMAKE_CONF_INSTALL_DIR}) | ||
| 216 | ENDIF() | ||
| 217 | |||
| 218 | IF(NOT DISABLE_TESTS) | ||
| 219 | ENABLE_TESTING() | ||
| 220 | ADD_EXECUTABLE(hiredis-test test.c) | ||
| 221 | TARGET_LINK_LIBRARIES(hiredis-test hiredis) | ||
| 222 | IF(ENABLE_SSL_TESTS) | ||
| 223 | ADD_DEFINITIONS(-DHIREDIS_TEST_SSL=1) | ||
| 224 | TARGET_LINK_LIBRARIES(hiredis-test hiredis_ssl) | ||
| 225 | ENDIF() | ||
| 226 | IF(ENABLE_ASYNC_TESTS) | ||
| 227 | ADD_DEFINITIONS(-DHIREDIS_TEST_ASYNC=1) | ||
| 228 | TARGET_LINK_LIBRARIES(hiredis-test event) | ||
| 229 | ENDIF() | ||
| 230 | ADD_TEST(NAME hiredis-test | ||
| 231 | COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test.sh) | ||
| 232 | ENDIF() | ||
| 233 | |||
| 234 | # Add examples | ||
| 235 | IF(ENABLE_EXAMPLES) | ||
| 236 | ADD_SUBDIRECTORY(examples) | ||
| 237 | ENDIF(ENABLE_EXAMPLES) | ||
