Commit f1bab8d0 authored by Christophe Giboudeaux's avatar Christophe Giboudeaux

Fix build with fluidsynth 1.1.9.

An issue exists in fluidsynth 1.1.9 where the pkgconfig file may contain wrong
paths.
A fix was submitted upstream but the minuet issue remains:
*never* rely only on pkgconfig files. This is the perfect example why the CMake
code should only use the paths obtained using pkgconfig as 'HINTS'.
Also rename the pkgconfig vars names to avoid another issue.
parent ad43d57d
......@@ -6,18 +6,22 @@ IF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Android")
message(FATAL_ERROR "Program pkg-config not found")
endif()
pkg_check_modules(FLUIDSYNTH REQUIRED fluidsynth>=1.1.6)
pkg_check_modules(PC_FLUIDSYNTH REQUIRED fluidsynth>=1.1.6)
if(NOT FLUIDSYNTH_FOUND)
if(NOT PC_FLUIDSYNTH_FOUND)
message(WARNING "Please install fluidsynth libraries and headers (package fluidsynth) if you want to build fluidsynth soundcontroller")
endif()
if(FLUIDSYNTH_FOUND)
link_directories(${FLUIDSYNTH_LIBDIR})
include_directories(${FLUIDSYNTH_INCLUDEDIR})
endif()
if(PC_FLUIDSYNTH_FOUND)
find_library(FLUIDSYNTH_LIBRARIES
NAMES fluidsynth
HINTS ${PC_FLUIDSYNTH_LIBDIR}
)
find_path(FLUIDSYNTH_INCLUDE_DIRS
NAMES fluidsynth.h
HINTS ${PC_FLUIDSYNTH_INCLUDEDIR}
)
if(FLUIDSYNTH_FOUND)
add_subdirectory(fluidsynthsoundcontroller)
endif()
ENDIF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Android")
......
include_directories(${FLUIDSYNTH_INCLUDE_DIRS})
set(fluidsynthsoundcontroller_PLUGIN_SRCS
fluidsynthsoundcontroller.cpp
)
......@@ -7,7 +9,7 @@ add_library(minuetfluidsynthsoundcontroller MODULE ${fluidsynthsoundcontroller_P
target_link_libraries(minuetfluidsynthsoundcontroller
Qt5::Core
Minuet::Interfaces
fluidsynth
${FLUIDSYNTH_LIBRARIES}
)
IF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Android")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment