zdoom-macos-deps/deps/sdl2_mixer/lib/cmake/SDL2_mixer/FindFluidSynth.cmake

45 lines
1.6 KiB
CMake
Raw Normal View History

2022-07-09 14:01:49 +00:00
include(FindPackageHandleStandardArgs)
2024-01-24 11:34:08 +00:00
find_package(PkgConfig QUIET)
pkg_check_modules(PC_FLUIDSYNTH QUIET fluidsynth)
2022-07-09 14:01:49 +00:00
find_library(FluidSynth_LIBRARY
2024-01-24 11:34:08 +00:00
NAMES fluidsynth libfluidsynth
HINTS ${PC_FLUIDSYNTH_LIBDIR}
2022-07-09 14:01:49 +00:00
)
find_path(FluidSynth_INCLUDE_PATH
NAMES fluidsynth.h
2024-01-24 11:34:08 +00:00
HINTS ${PC_FLUIDSYNTH_INCLUDEDIR}
2022-07-09 14:01:49 +00:00
)
2024-01-24 11:34:08 +00:00
if(PC_FLUIDSYNTH_FOUND)
get_flags_from_pkg_config("${FluidSynth_LIBRARY}" "PC_FLUIDSYNTH" "_fluidsynth")
endif()
set(FluidSynth_COMPILE_OPTIONS "${_fluidsynth_compile_options}" CACHE STRING "Extra compile options of FluidSynth")
set(FluidSynth_LINK_LIBRARIES "${_fluidsynth_link_libraries}" CACHE STRING "Extra link libraries of FluidSynth")
2022-07-09 14:01:49 +00:00
2024-01-24 11:34:08 +00:00
set(FluidSynth_LINK_OPTIONS "${_fluidsynth_link_options}" CACHE STRING "Extra link flags of FluidSynth")
2022-07-09 14:01:49 +00:00
2024-01-24 11:34:08 +00:00
set(FluidSynth_LINK_DIRECTORIES "${_fluidsynth_link_directories}" CACHE PATH "Extra link directories of FluidSynth")
2022-07-09 14:01:49 +00:00
find_package_handle_standard_args(FluidSynth
REQUIRED_VARS FluidSynth_LIBRARY FluidSynth_INCLUDE_PATH
)
if(FluidSynth_FOUND)
2024-01-24 11:34:08 +00:00
if(NOT TARGET FluidSynth::libfluidsynth)
add_library(FluidSynth::libfluidsynth UNKNOWN IMPORTED)
set_target_properties(FluidSynth::libfluidsynth PROPERTIES
2022-07-09 14:01:49 +00:00
IMPORTED_LOCATION "${FluidSynth_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${FluidSynth_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${FluidSynth_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${FluidSynth_LINK_LIBRARIES}"
2024-01-24 11:34:08 +00:00
INTERFACE_LINK_OPTIONS "${FluidSynth_LINK_OPTIONS}"
INTERFACE_LINK_DIRECTORIES "${FluidSynth_LINK_DIRECTORIES}"
2022-07-09 14:01:49 +00:00
)
endif()
endif()