summarylogtreecommitdiffstats
path: root/pr340.patch
blob: b9d5b89b980249b22d6decc773bf281a9345475d (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
43
44
45
46
47
48
49
50
51
From 431467bad477b8d9440ecf2a9374f69ed560a85e Mon Sep 17 00:00:00 2001
From: Ewout van Mansom <ewout@vanmansom.name>
Date: Mon, 24 Apr 2023 14:12:28 +0200
Subject: [PATCH] add pkg-config file (#339)

---
 CMakeLists.txt                   |  9 ++++++++-
 tools/pkg-config/stumpless.pc.in | 10 ++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 tools/pkg-config/stumpless.pc.in

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c9946ce6..8de594ce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.2.3)
+cmake_minimum_required(VERSION 3.12)
 
 if(POLICY CMP0135)
   cmake_policy(SET CMP0135 NEW)
@@ -1000,6 +1000,13 @@ install(FILES
 
 include(tools/cmake/cpack.cmake)
 
+include(FindPkgConfig QUIET)
+if(PKG_CONFIG_FOUND)
+  configure_file("${PROJECT_SOURCE_DIR}/tools/pkg-config/stumpless.pc.in" "${PROJECT_BINARY_DIR}/tools/pkg-config/stumpless.pc" @ONLY)
+  install(FILES "${PROJECT_BINARY_DIR}/tools/pkg-config/stumpless.pc"
+    DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
+endif()
+
 
 # functionality tests
 add_function_test(buffer
diff --git a/tools/pkg-config/stumpless.pc.in b/tools/pkg-config/stumpless.pc.in
new file mode 100644
index 00000000..d0d5b84f
--- /dev/null
+++ b/tools/pkg-config/stumpless.pc.in
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: @CMAKE_PROJECT_NAME@
+Description: C logging library built for high performance and a rich feature set
+Version: @CMAKE_PROJECT_VERSION@
+Libs: -L${libdir} -lstumpless
+Cflags: -I${includedir}