libgme/libgme-0.5.5-pkg_config.patch

61 lines
2.1 KiB
Diff

Index: gme/libgme.pc.in
===================================================================
--- /dev/null
+++ gme/libgme.pc.in
@@ -0,0 +1,15 @@
+# entries grouped with CMake are expanded by CMake
+# ${foo} entries are left alone by CMake and much
+# later are used by pkg-config.
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+lib_suffix=@LIB_SUFFIX@
+libdir=${exec_prefix}/lib${lib_suffix}
+includedir=${prefix}/include
+
+Name: Game_Music_Emu
+Description: A video game emulation library for music.
+URL: http://code.google.com/p/game-music-emu/
+Version: @GME_VERSION@
+Cflags: -I${includedir}
+Libs: -L${libdir} -lgme
Index: gme/CMakeLists.txt
===================================================================
--- gme/CMakeLists.txt.orig
+++ gme/CMakeLists.txt
@@ -144,6 +144,9 @@ set (EXPORTED_HEADERS gme.h
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/gme_types.h.in
${CMAKE_CURRENT_BINARY_DIR}/gme_types.h)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libgme.pc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/libgme.pc @ONLY)
+
# For the gme_types.h
include_directories(${CMAKE_CURRENT_BINARY_DIR})
@@ -154,10 +157,11 @@ add_library(gme SHARED ${libgme_SRCS})
# as only build fixes are performed (i.e. no changes/additions to API) the
# SOVERSION should be the same even when bumping up VERSION.
set_target_properties(gme
- PROPERTIES VERSION 0.5.3
+ PROPERTIES VERSION ${GME_VERSION}
SOVERSION 0)
# TODO: Libsuffix for 64-bit?
install(TARGETS gme LIBRARY DESTINATION lib${LIB_SUFFIX})
install(FILES ${EXPORTED_HEADERS} DESTINATION include/gme)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgme.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -1,6 +1,8 @@
# CMake project definition file.
project(libgme)
+set(GME_VERSION 0.5.5 CACHE INTERNAL "libgme Version")
+
# 2.6+ always assumes FATAL_ERROR, but 2.4 and below don't.
# Of course, 2.4 might work, in which case you're welcome to drop
# down the requirement, but I can't test that.