summarylogtreecommitdiffstats
path: root/0001-add-pkg-config-file.patch
blob: 8f0ef00ce716253f8e2d0330d9ca0aa97fab49ad (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
42
From 13c5834a80a338cac364a08e5e0dc1873752199b Mon Sep 17 00:00:00 2001
From: Christoph Haag <christoph.haag@collabora.com>
Date: Thu, 7 May 2020 14:29:28 +0200
Subject: [PATCH 1/2] add pkg-config file

---
 CMakeLists.txt |  4 ++++
 survive.pc.in  | 10 ++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 survive.pc.in

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ce53d9..4ab40e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -247,3 +247,7 @@ if(CTYPESGEN)
 	add_custom_target(pysurvive COMMAND ${CTYPESGEN} ${CMAKE_SOURCE_DIR}/include/libsurvive/*.h ${INCLUDE_FLAGS} --no-macros -L$<TARGET_FILE_DIR:survive> -llibsurvive.so
 			--strip-prefix=survive_ -P Survive -o ${PYTHON_GENERATED_DIR}pysurvive_generated.py )
 endif()
+
+include(GNUInstallDirs)
+configure_file(survive.pc.in survive.pc @ONLY)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/survive.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
diff --git a/survive.pc.in b/survive.pc.in
new file mode 100644
index 0000000..5e3ce69
--- /dev/null
+++ b/survive.pc.in
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/include/libsurvive
+
+Name: @CMAKE_PROJECT_NAME@
+Description: Libsurvive
+Version: 0
+Libs: -L${libdir} -lsurvive @EXTRA_LIBS@
+Cflags: -I${includedir}
-- 
2.26.2