summaryrefslogtreecommitdiff
path: root/topics/build-systems
diff options
context:
space:
mode:
authorPjotr Prins2023-01-25 05:56:37 -0600
committerPjotr Prins2023-01-25 05:56:51 -0600
commit8589cf2813b44f93b3471eb26203e8107d72d4a4 (patch)
tree3a77e5000cefc75507e382d2bd8ef7342548768e /topics/build-systems
parent8070cea02cd281755f881ca9c805e6ead19bcd9f (diff)
downloadgn-gemtext-8589cf2813b44f93b3471eb26203e8107d72d4a4.tar.gz
Notes by Pjotr
Diffstat (limited to 'topics/build-systems')
-rw-r--r--topics/build-systems/pkgconfig.gmi31
1 files changed, 31 insertions, 0 deletions
diff --git a/topics/build-systems/pkgconfig.gmi b/topics/build-systems/pkgconfig.gmi
new file mode 100644
index 0000000..0cd99fd
--- /dev/null
+++ b/topics/build-systems/pkgconfig.gmi
@@ -0,0 +1,31 @@
+# Pkgconfig
+
+## Creating pkgconfig files with cmake
+
+=> https://gist.github.com/scivision/ed109f7a1256141b3e821e2a82ec17f1
+
+Cmake can write files and fill in/expand variables. For pkg-config
+
+```cmake
+configure_file(pkg-config.pc.in my_package.pc @ONLY)
+```
+
+expands
+
+```
+# pkg-config.pc.in
+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@
+Requires: @pc_req_public@
+Requires.private: @pc_req_private@
+Cflags: -I"${includedir}"
+Libs: -L"${libdir}" -l@target1@ -l@target2@
+Libs.private: -L"${libdir}" -l@target1@ -l@target2@ @pc_libs_private@
+```