summaryrefslogtreecommitdiff
path: root/libraries/miniupnpc/miniupnpc-cmake.patch
blob: 2000af165ac0332d73564f326130612fc8444013 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
diff -Naur miniupnpc-2.2.3.old/CMakeLists.txt miniupnpc-2.2.3/CMakeLists.txt
--- miniupnpc-2.2.3.old/CMakeLists.txt	2022-01-28 14:14:29.114014705 +0100
+++ miniupnpc-2.2.3/CMakeLists.txt	2022-01-28 14:19:49.875995027 +0100
@@ -219,24 +219,30 @@
 # set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} testminixml minixmlvalid testupnpreplyparse testigddescparse testminiwget)
 endif ()
 
+configure_file(miniupnpc.pc.in miniupnpc.pc @ONLY)
+
 if (NOT UPNPC_NO_INSTALL)
   install (FILES
-    miniupnpc.h
-    miniwget.h
-    upnpcommands.h
-    igd_desc_parse.h
-    upnpreplyparse.h
-    upnperrors.h
-    upnpdev.h
-    miniupnpctypes.h
-    portlistingparse.h
-    miniupnpc_declspec.h
+    include/miniupnpc.h
+    include/miniwget.h
+    include/upnpcommands.h
+    include/igd_desc_parse.h
+    include/upnpreplyparse.h
+    include/upnperrors.h
+    include/upnpdev.h
+    include/miniupnpctypes.h
+    include/portlistingparse.h
+    include/miniupnpc_declspec.h
     DESTINATION include/miniupnpc
   )
 
   install(FILES miniupnpc-config.cmake
     DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/miniupnpc
   )
+
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/miniupnpc.pc
+    DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
+  )
 endif()
 
 # vim: ts=2:sw=2:expandtab
diff -Naur miniupnpc-2.2.3.old/miniupnpc.pc.in miniupnpc-2.2.3/miniupnpc.pc.in
--- miniupnpc-2.2.3.old/miniupnpc.pc.in	1970-01-01 01:00:00.000000000 +0100
+++ miniupnpc-2.2.3/miniupnpc.pc.in	2022-01-28 14:16:38.206423709 +0100
@@ -0,0 +1,18 @@
+# this template is filled-in by CMake `configure_file(... @ONLY)`
+# the `@....@` are filled in by CMake configure_file(), 
+# from variables set in your CMakeLists.txt or by CMake itself
+#
+# Good tutoral for understanding .pc files: 
+# https://people.freedesktop.org/~dbn/pkg-config-guide.html
+
+prefix="@CMAKE_INSTALL_PREFIX@"
+exec_prefix="${prefix}"
+libdir="${prefix}/lib"
+includedir="${prefix}/include"
+
+Name: @PROJECT_NAME@
+Description: @CMAKE_PROJECT_DESCRIPTION@
+URL: @CMAKE_PROJECT_HOMEPAGE_URL@
+Version: @PROJECT_VERSION@
+Libs: -L"${libdir}" -lminiupnpc
+Cflags: -I"${includedir}"