From c98e050515718d9e46c36921407f0d4cf036dd94 Mon Sep 17 00:00:00 2001 From: Christophe Giboudeaux Date: Tue, 6 Mar 2018 17:21:15 +0100 Subject: [PATCH] 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 --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 975eb83..07d64e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -461,8 +461,16 @@ add_subdirectory ( doc ) # pkg-config support set ( prefix "${CMAKE_INSTALL_PREFIX}" ) set ( exec_prefix "\${prefix}" ) -set ( libdir "\${exec_prefix}/${LIB_INSTALL_DIR}" ) -set ( includedir "\${prefix}/${INCLUDE_INSTALL_DIR}" ) +if ( IS_ABSOLUTE "${LIB_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 ${CMAKE_BINARY_DIR}/fluidsynth.pc IMMEDIATE @ONLY ) install ( FILES ${CMAKE_BINARY_DIR}/fluidsynth.pc -- 2.13.6