9f21864
diff -Naur miniupnpc-2.2.3.old/CMakeLists.txt miniupnpc-2.2.3/CMakeLists.txt
9f21864
--- miniupnpc-2.2.3.old/CMakeLists.txt	2022-01-28 14:14:29.114014705 +0100
9f21864
+++ miniupnpc-2.2.3/CMakeLists.txt	2022-01-28 14:19:49.875995027 +0100
9f21864
@@ -219,24 +219,30 @@
9f21864
 # set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} testminixml minixmlvalid testupnpreplyparse testigddescparse testminiwget)
9f21864
 endif ()
9f21864
 
9f21864
+configure_file(miniupnpc.pc.in miniupnpc.pc @ONLY)
9f21864
+
9f21864
 if (NOT UPNPC_NO_INSTALL)
9f21864
   install (FILES
9f21864
-    miniupnpc.h
9f21864
-    miniwget.h
9f21864
-    upnpcommands.h
9f21864
-    igd_desc_parse.h
9f21864
-    upnpreplyparse.h
9f21864
-    upnperrors.h
9f21864
-    upnpdev.h
9f21864
-    miniupnpctypes.h
9f21864
-    portlistingparse.h
9f21864
-    miniupnpc_declspec.h
9f21864
+    include/miniupnpc.h
9f21864
+    include/miniwget.h
9f21864
+    include/upnpcommands.h
9f21864
+    include/igd_desc_parse.h
9f21864
+    include/upnpreplyparse.h
9f21864
+    include/upnperrors.h
9f21864
+    include/upnpdev.h
9f21864
+    include/miniupnpctypes.h
9f21864
+    include/portlistingparse.h
9f21864
+    include/miniupnpc_declspec.h
9f21864
     DESTINATION include/miniupnpc
9f21864
   )
9f21864
 
9f21864
   install(FILES miniupnpc-config.cmake
9f21864
     DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/miniupnpc
9f21864
   )
9f21864
+
9f21864
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/miniupnpc.pc
9f21864
+    DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
9f21864
+  )
9f21864
 endif()
9f21864
 
9f21864
 # vim: ts=2:sw=2:expandtab
9f21864
diff -Naur miniupnpc-2.2.3.old/miniupnpc.pc.in miniupnpc-2.2.3/miniupnpc.pc.in
9f21864
--- miniupnpc-2.2.3.old/miniupnpc.pc.in	1970-01-01 01:00:00.000000000 +0100
9f21864
+++ miniupnpc-2.2.3/miniupnpc.pc.in	2022-01-28 14:16:38.206423709 +0100
9f21864
@@ -0,0 +1,18 @@
9f21864
+# this template is filled-in by CMake `configure_file(... @ONLY)`
9f21864
+# the `@....@` are filled in by CMake configure_file(), 
9f21864
+# from variables set in your CMakeLists.txt or by CMake itself
9f21864
+#
9f21864
+# Good tutoral for understanding .pc files: 
9f21864
+# https://people.freedesktop.org/~dbn/pkg-config-guide.html
9f21864
+
9f21864
+prefix="@CMAKE_INSTALL_PREFIX@"
9f21864
+exec_prefix="${prefix}"
9f21864
+libdir="${prefix}/lib"
9f21864
+includedir="${prefix}/include"
9f21864
+
9f21864
+Name: @PROJECT_NAME@
9f21864
+Description: @CMAKE_PROJECT_DESCRIPTION@
9f21864
+URL: @CMAKE_PROJECT_HOMEPAGE_URL@
9f21864
+Version: @PROJECT_VERSION@
9f21864
+Libs: -L"${libdir}" -lminiupnpc
9f21864
+Cflags: -I"${includedir}"