[physfs] [patch] pkg-config support

Jonas Kulla nyocurio at gmail.com
Mon Oct 14 22:26:33 EDT 2013


Hi everyone,

With my limited cmake knowledge, I took a shot at implementing proper
pkg-config support. Not
sure about conventions on attaching patches, so I'll just inline it in case
anyone wants to comment
on parts of it.

I guess the Right Way to Do It™ would be to name the package "physfs-1";
this all really depends
on how soon Ryan intends on breaking the API (when it would become
"physfs-2"). Otherwise,
just plain "physfs.pc" is nice and simple.

diff -r 3b2e649c044c CMakeLists.txt
--- a/CMakeLists.txt Fri Aug 23 23:41:35 2013 -0400
+++ b/CMakeLists.txt Tue Oct 15 04:19:00 2013 +0200
@@ -358,6 +358,18 @@
     )
 endif()

+if (UNIX AND NOT APPLE)
+    configure_file(
+        "extras/physfs.pc.in"
+        "extras/physfs.pc"
+        @ONLY
+    )
+    install(
+        FILES "${CMAKE_CURRENT_BINARY_DIR}/extras/physfs.pc"
+        DESTINATION "lib/pkgconfig"
+    )
+endif()
+
 macro(message_bool_option _NAME _VALUE)
     if(${_VALUE})
         message(STATUS "  ${_NAME}: enabled")
diff -r 3b2e649c044c extras/physfs.pc.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/physfs.pc.in Tue Oct 15 04:19:00 2013 +0200
@@ -0,0 +1,11 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib at LIB_SUFFIX@
+includedir=${prefix}/include
+
+Name: PhysicsFS
+Description: PhysicsFS is a library to provide abstract access to various
archives.
+URL: https://icculus.org/physfs/
+Version: @PHYSFS_VERSION@
+Libs: -L${libdir} -lphysfs
+Cflags: -I${includedir}


Thanks,
Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/physfs/attachments/20131015/20035ad1/attachment.html>


More information about the physfs mailing list