@@ -40,6 +40,7 @@ IF(WIN32)
40
40
ENDIF ()
41
41
42
42
ADD_LIBRARY (hiredis SHARED ${hiredis_sources} )
43
+ ADD_LIBRARY (hiredis_static STATIC ${hiredis_sources} )
43
44
44
45
SET_TARGET_PROPERTIES (hiredis
45
46
PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE
@@ -48,16 +49,47 @@ IF(WIN32 OR MINGW)
48
49
TARGET_LINK_LIBRARIES (hiredis PRIVATE ws2_32)
49
50
ENDIF ()
50
51
51
- TARGET_INCLUDE_DIRECTORIES (hiredis PUBLIC $<INSTALL_INTERFACE:.> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} >)
52
+ TARGET_INCLUDE_DIRECTORIES (hiredis PUBLIC $<INSTALL_INTERFACE:include > $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} >)
53
+ TARGET_INCLUDE_DIRECTORIES (hiredis_static PUBLIC $<INSTALL_INTERFACE:include > $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} >)
52
54
53
55
CONFIGURE_FILE (hiredis.pc.in hiredis.pc @ONLY)
54
56
55
- INSTALL (TARGETS hiredis
57
+ set (CPACK_PACKAGE_VENDOR "Redis" )
58
+ set (CPACK_PACKAGE_DESCRIPTION "\
59
+ Hiredis is a minimalistic C client library for the Redis database.
60
+
61
+ It is minimalistic because it just adds minimal support for the protocol, \
62
+ but at the same time it uses a high level printf-alike API in order to make \
63
+ it much higher level than otherwise suggested by its minimal code base and the \
64
+ lack of explicit bindings for every Redis command.
65
+
66
+ Apart from supporting sending commands and receiving replies, it comes with a \
67
+ reply parser that is decoupled from the I/O layer. It is a stream parser designed \
68
+ for easy reusability, which can for instance be used in higher level language bindings \
69
+ for efficient reply parsing.
70
+
71
+ Hiredis only supports the binary-safe Redis protocol, so you can use it with any Redis \
72
+ version >= 1.2.0.
73
+
74
+ The library comes with multiple APIs. There is the synchronous API, the asynchronous API \
75
+ and the reply parsing API." )
76
+ set (CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/redis/hiredis" )
77
+ set (CPACK_PACKAGE_CONTACT "michael dot grunder at gmail dot com" )
78
+ set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON )
79
+ set (CPACK_RPM_PACKAGE_AUTOREQPROV ON )
80
+
81
+ include (CPack)
82
+
83
+ INSTALL (TARGETS hiredis hiredis_static
56
84
EXPORT hiredis-targets
57
85
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
58
86
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
59
87
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
60
88
89
+ # For NuGet packages
90
+ INSTALL (FILES hiredis.targets
91
+ DESTINATION build /native)
92
+
61
93
INSTALL (FILES hiredis.h read.h sds.h async.h alloc.h
62
94
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} /hiredis)
63
95
@@ -98,6 +130,8 @@ IF(ENABLE_SSL)
98
130
ssl.c)
99
131
ADD_LIBRARY (hiredis_ssl SHARED
100
132
${hiredis_ssl_sources} )
133
+ ADD_LIBRARY (hiredis_ssl_static STATIC
134
+ ${hiredis_ssl_sources} )
101
135
102
136
IF (APPLE )
103
137
SET_PROPERTY (TARGET hiredis_ssl PROPERTY LINK_FLAGS "-Wl,-undefined -Wl,dynamic_lookup" )
@@ -109,13 +143,15 @@ IF(ENABLE_SSL)
109
143
VERSION "${HIREDIS_SONAME} " )
110
144
111
145
TARGET_INCLUDE_DIRECTORIES (hiredis_ssl PRIVATE "${OPENSSL_INCLUDE_DIR} " )
146
+ TARGET_INCLUDE_DIRECTORIES (hiredis_ssl_static PRIVATE "${OPENSSL_INCLUDE_DIR} " )
147
+
112
148
TARGET_LINK_LIBRARIES (hiredis_ssl PRIVATE ${OPENSSL_LIBRARIES} )
113
149
IF (WIN32 OR MINGW)
114
150
TARGET_LINK_LIBRARIES (hiredis_ssl PRIVATE hiredis)
115
151
ENDIF ()
116
152
CONFIGURE_FILE (hiredis_ssl.pc.in hiredis_ssl.pc @ONLY)
117
153
118
- INSTALL (TARGETS hiredis_ssl
154
+ INSTALL (TARGETS hiredis_ssl hiredis_ssl_static
119
155
EXPORT hiredis_ssl-targets
120
156
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
121
157
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
0 commit comments