Skip to content

Commit

Permalink
improve pkg-config file generation.
Browse files Browse the repository at this point in the history
Fixes: #236
  • Loading branch information
sezero committed Apr 4, 2024
1 parent 27d63af commit c4a6330
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ IF (UNIX AND NOT APPLE)
MESSAGE(STATUS "M_LIBRARY: ${M_LIBRARY}")
IF (NOT M_LIBRARY)
SET(M_LIBRARY "")
SET(PKG_PRIVATELIBS "")
ELSE()
SET(PKG_PRIVATELIBS "-lm")
ENDIF()
ENDIF()

Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ IF (WANT_DEVTEST)
ENDIF()

# prepare pkg-config file
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
CONFIGURE_FILE("wildmidi.pc.in" "${PROJECT_BINARY_DIR}/wildmidi.pc" @ONLY)

INSTALL(TARGETS ${wildmidi_lib_install}
Expand Down
10 changes: 5 additions & 5 deletions src/wildmidi.pc.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# WildMIDI pkg-config file

prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${exec_prefix}/@CMAKE_INSTALL_INCLUDEDIR@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: WildMIDI
Description: software synthesizer library
Version: @WILDMIDI_VERSION@
URL: https://github.com/Mindwerks/wildmidi

Libs: -L${libdir} -lWildMidi
Libs.private: -lm
Libs.private: @PKG_PRIVATELIBS@
Cflags: -I${includedir}

0 comments on commit c4a6330

Please sign in to comment.