mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 15:01:40 +00:00
cf5fbac9af
The build system creates two exported targets: - The executable FluidSynth::fluidsynth - The library FluidSynth::libfluidsynth A downstream project using CMake can find and link the library target directly with cmake (without needing pkg-config) this way: ~~~ project(sample LANGUAGES C) find_package ( FluidSynth ) if (FluidSynth_FOUND) add_executable( sample sample.c ) target_link_libraries ( sample PRIVATE FluidSynth::libfluidsynth ) endif () ~~~ After installing fluidsynth in a prefix like "$HOME/Fluidsynth3": cmake -DCNAKE_PREFIX_PATH="$HOME/Fluidsynth3/;..." Instead installing, the build directory can be used directly, for instance: cmake -DFluidSynth_DIR="$HOME/fluidsynth-2.2.2/build/" ...
11 lines
408 B
CMake
11 lines
408 B
CMake
# for the find_dependency() macro:
|
|
# include(CMakeFindDependencyMacro)
|
|
# it has the same syntax as find_package:
|
|
# find_dependency(MYDEP REQUIRED)
|
|
|
|
# define variables for configuration options:
|
|
# set(network-enabled @enable-network@)
|
|
|
|
# finally, include the targets/version files
|
|
include("${CMAKE_CURRENT_LIST_DIR}/FluidSynthTargets.cmake")
|
|
include("${CMAKE_CURRENT_LIST_DIR}/FluidSynthConfigVersion.cmake")
|