summaryrefslogtreecommitdiff
path: root/patches/redox-generate-pkg-config-file.patch
blob: efd488b359b30c0d4fccfd204dcbfb218d00579d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From e7904da79d5360ba22fbab64b96be167b6dda5f6 Mon Sep 17 00:00:00 2001
From: Millian Poquet <millian.poquet@inria.fr>
Date: Fri, 7 Dec 2018 00:33:43 +0100
Subject: [PATCH] fix generated pkg-config file

---
 CMakeLists.txt    | 4 +++-
 cmake/redox.pc.in | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 54dfa35..3f0fa52 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.0.2)
 project(redox)
 
 set(REDOX_VERSION_MAJOR 0)
@@ -194,6 +194,8 @@ if (lib)
   # Install the dynamic library to /usr/lib[64]
   install(TARGETS redox DESTINATION lib${LIB_SUFFIX})
   # Generate the redox.pc pkg-config file in /usr/lib[64]/pkgconfig
+  get_filename_component(HIREDIS_LIBRARY_DIRECTORY ${HIREDIS_LIBRARIES} DIRECTORY)
+  get_filename_component(LIBEV_LIBRARY_DIRECTORY ${LIBEV_LIBRARIES} DIRECTORY)
   configure_file("${CMAKE_HOME_DIRECTORY}/cmake/redox.pc.in" "${PROJECT_BINARY_DIR}/redox.pc" @ONLY)
   install(FILES "${PROJECT_BINARY_DIR}/redox.pc" DESTINATION lib${LIB_SUFFIX}/pkgconfig/)
 endif()
diff --git a/cmake/redox.pc.in b/cmake/redox.pc.in
index a480d1f..1574542 100644
--- a/cmake/redox.pc.in
+++ b/cmake/redox.pc.in
@@ -7,5 +7,5 @@ Name: redox
 Description: Modern, asynchronous, and wicked fast C++11 client for Redis
 Version: @REDOX_VERSION_STRING@
 
-Libs: -L${libdir} -lredox @HIREDIS_LIBRARIES@ @LIBEV_LIBRARIES@ @CMAKE_THREAD_LIBS_INIT@
-Cflags: -I${includedir}
+Libs: -L${libdir} -lredox -L@HIREDIS_LIBRARY_DIRECTORY@ -lhiredis -L@LIBEV_LIBRARY_DIRECTORY@ -lev @CMAKE_THREAD_LIBS_INIT@
+Cflags: -I${includedir} -I@HIREDIS_INCLUDE_DIRS@