Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
0bc2356e
Commit
0bc2356e
authored
Feb 06, 2019
by
Mark Nunberg
Browse files
CMake: update for SSL
parent
847a2012
Changes
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
0bc2356e
CMAKE_MINIMUM_REQUIRED
(
VERSION 3.0.0
)
INCLUDE
(
GNUInstallDirs
)
PROJECT
(
hiredis
)
OPTION
(
HIREDIS_SSL
"Link against OpenSSL"
ON
)
MACRO
(
getVersionBit name
)
SET
(
VERSION_REGEX
"^#define
${
name
}
(.+)$"
)
...
...
@@ -27,7 +30,8 @@ ADD_LIBRARY(hiredis SHARED
hiredis.c
net.c
read.c
sds.c
)
sds.c
sslio.c
)
SET_TARGET_PROPERTIES
(
hiredis
PROPERTIES
...
...
@@ -44,9 +48,22 @@ INSTALL(FILES hiredis.h read.h sds.h async.h
INSTALL
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/hiredis.pc
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig
)
IF
(
HIREDIS_SSL
)
IF
(
NOT OPENSSL_ROOT_DIR
)
IF
(
APPLE
)
SET
(
OPENSSL_ROOT_DIR
"/usr/local/opt/openssl"
)
ENDIF
()
ENDIF
()
FIND_PACKAGE
(
OpenSSL REQUIRED
)
ADD_DEFINITIONS
(
-DHIREDIS_SSL
)
INCLUDE_DIRECTORIES
(
"
${
OPENSSL_INCLUDE_DIR
}
"
)
TARGET_LINK_LIBRARIES
(
hiredis
${
OPENSSL_LIBRARIES
}
)
ENDIF
()
ENABLE_TESTING
()
ADD_EXECUTABLE
(
hiredis-test
test.c
)
ADD_EXECUTABLE
(
hiredis-test test.c
)
TARGET_LINK_LIBRARIES
(
hiredis-test hiredis
)
ADD_TEST
(
NAME hiredis-test
COMMAND
${
CMAKE_CURRENT_SOURCE_DIR
}
/test.sh
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment