Fix pkgconfig file for absolute paths (#347)

When building fluidsynth, we can use relative or absolute paths for LIB_INSTALL_DIR and INCLUDE_INSTALL_DIR. Check whether the two vars were defined absolute before writing fluidsynth.pc.

Fixes https://bugzilla.opensuse.org/1084081
This commit is contained in:
Christophe Giboudeaux 2018-03-06 17:21:15 +01:00 committed by Tom M
parent 657c784dc9
commit ce00c35012

View file

@ -458,8 +458,16 @@ add_subdirectory ( doc )
# pkg-config support # pkg-config support
set ( prefix "${CMAKE_INSTALL_PREFIX}" ) set ( prefix "${CMAKE_INSTALL_PREFIX}" )
set ( exec_prefix "\${prefix}" ) set ( exec_prefix "\${prefix}" )
set ( libdir "\${exec_prefix}/${LIB_INSTALL_DIR}" ) if ( IS_ABSOLUTE "${LIB_INSTALL_DIR}" )
set ( includedir "\${prefix}/${INCLUDE_INSTALL_DIR}" ) set ( libdir "${LIB_INSTALL_DIR}" )
else ()
set ( libdir "\${exec_prefix}/${LIB_INSTALL_DIR}" )
endif ()
if ( IS_ABSOLUTE "${INCLUDE_INSTALL_DIR}" )
set ( includedir "${INCLUDE_INSTALL_DIR}" )
else ()
set ( includedir "\${prefix}/${INCLUDE_INSTALL_DIR}" )
endif ()
configure_file ( fluidsynth.pc.in configure_file ( fluidsynth.pc.in
${CMAKE_BINARY_DIR}/fluidsynth.pc IMMEDIATE @ONLY ) ${CMAKE_BINARY_DIR}/fluidsynth.pc IMMEDIATE @ONLY )
install ( FILES ${CMAKE_BINARY_DIR}/fluidsynth.pc install ( FILES ${CMAKE_BINARY_DIR}/fluidsynth.pc