summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJustin Brewer <jzb0012@auburn.edu>2019-01-21 13:42:58 -0600
committerMark Nunberg <mnunberg@haskalah.org>2019-02-20 05:01:09 -0500
commit9ea7ddec0c8b83cb38ce41477116f31614d6623e (patch)
treecc642c568ac32606ac45c9a2356b95c95d096280 /CMakeLists.txt
parentedfab35cdcc5d5767918322b8af2dc41915f416d (diff)
Generate and install hiredis.pc
Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e58bfa7..2ef322a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,8 @@ getVersionBit(HIREDIS_MAJOR)
getVersionBit(HIREDIS_MINOR)
getVersionBit(HIREDIS_PATCH)
-MESSAGE("Detected version: ${HIREDIS_MAJOR}.${HIREDIS_MINOR}.${HIREDIS_PATCH}")
+SET(VERSION "${HIREDIS_MAJOR}.${HIREDIS_MINOR}.${HIREDIS_PATCH}")
+MESSAGE("Detected version: ${VERSION}")
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
@@ -32,7 +33,9 @@ ADD_LIBRARY(hiredis SHARED
SET_TARGET_PROPERTIES(hiredis
PROPERTIES
- VERSION "${HIREDIS_MAJOR}.${HIREDIS_MINOR}.${HIREDIS_PATCH}")
+ VERSION "${VERSION}")
+
+CONFIGURE_FILE(hiredis.pc.in hiredis.pc @ONLY)
INSTALL(TARGETS hiredis
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
@@ -40,6 +43,9 @@ INSTALL(TARGETS hiredis
INSTALL(FILES hiredis.h read.h sds.h async.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredis.pc
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+
# Add tests: Currently, I don't know how to make the tests actually run
# without hanging!
ENABLE_TESTING()