shithub: dumb

Download patch

ref: 14f227f0fb90e65ce7378c7c03a727e4086cf707
parent: ecf988994c9fbc7ba7281a8db8484512e1b91e66
author: Andreas Gnau <Rondom@Rondom.de>
date: Sun Sep 17 10:23:09 EDT 2017

Add pkg-config-file

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -146,6 +146,14 @@
 )
 
 
+set(PKG_CONFIG_FILE "${CMAKE_CURRENT_BINARY_DIR}/dumb.pc")
+
+configure_file(
+    "${CMAKE_CURRENT_SOURCE_DIR}/pkg-config.pc.in"
+    ${PKG_CONFIG_FILE}
+    @ONLY
+)
+
 add_library(dumb ${SOURCES})
 set_target_properties(dumb PROPERTIES DEBUG_POSTFIX d)
 set_target_properties(dumb PROPERTIES VERSION ${DUMB_VERSION})
@@ -179,13 +187,14 @@
 
 # Make sure the dylib install name path is set on OSX so you can include dumb in app bundles
 IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-    set_target_properties(dumb PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
+    set_target_properties(dumb PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_FULL_LIBDIR})
 ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
 
 target_link_libraries(dumb m)
 
-INSTALL(FILES ${INSTALL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-INSTALL(TARGETS dumb ${DUMB_TARGETS}
+install(FILES ${PKG_CONFIG_FILE} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+install(FILES ${INSTALL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+install(TARGETS dumb ${DUMB_TARGETS}
     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
     LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
     ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
--- /dev/null
+++ b/pkg-config.pc.in
@@ -1,0 +1,12 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+
+Name: DUMB
+Description: DUMB is a module audio renderer library. 
+Version: @DUMB_VERSION@
+URL: https://github.com/kode54/dumb/
+Libs: -L${libdir} -l@PROJECT_NAME@
+Libs.private: -lm
+Cflags: -I${includedir}