-
Notifications
You must be signed in to change notification settings - Fork 318
Expand file tree
/
Copy pathFluidSynthConfig.cmake.in
More file actions
201 lines (170 loc) · 6.93 KB
/
FluidSynthConfig.cmake.in
File metadata and controls
201 lines (170 loc) · 6.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# Audio / MIDI driver support
set(FLUIDSYNTH_SUPPORT_ALSA @ALSA_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_COREAUDIO @COREAUDIO_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_COREMIDI @COREMIDI_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_DART @DART_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_DSOUND @DSOUND_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_JACK @JACK_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_KAI @KAI_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_MIDISHARE @MIDISHARE_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_OBOE @OBOE_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_OPENSLES @OPENSLES_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_OSS @OSS_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_PIPEWIRE @PIPEWIRE_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_PORTAUDIO @PORTAUDIO_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_PULSE @PULSE_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_SDL3 @SDL3_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_WASAPI @WASAPI_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_WAVEOUT @WAVEOUT_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_WINMIDI @WINMIDI_SUPPORT@)
# Files support
set(FLUIDSYNTH_SUPPORT_DLS @LIBINSTPATCH_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_LIBINSTPATCH @LIBINSTPATCH_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_LIBSNDFILE @LIBSNDFILE_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_LIBSNDFILE_LEGACY @SndFileLegacy_FOUND@)
set(FLUIDSYNTH_SUPPORT_SF3 @LIBSNDFILE_HASVORBIS@)
# Miscellaneous support
set(FLUIDSYNTH_SUPPORT_GLIB @GLIB_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_DBUS @DBUS_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_GETOPT @HAVE_GETOPT_H@)
set(FLUIDSYNTH_SUPPORT_IPV6 @IPV6_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_LADSPA @LADSPA_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_NETWORK @NETWORK_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_READLINE @READLINE_SUPPORT@)
set(FLUIDSYNTH_SUPPORT_SYSTEMD @SYSTEMD_SUPPORT@)
# Extra info
set(FLUIDSYNTH_OSAL @osal@)
set(FLUIDSYNTH_IS_SHARED @BUILD_SHARED_LIBS@)
set(FLUIDSYNTH_SUPPORT_COVERAGE @ENABLE_COVERAGE@)
set(FLUIDSYNTH_SUPPORT_FLOAT @WITH_FLOAT@)
set(FLUIDSYNTH_SUPPORT_FPECHECK @ENABLE_FPECHECK@)
set(FLUIDSYNTH_SUPPORT_FPETRAP @ENABLE_TRAPONFPE@)
set(FLUIDSYNTH_SUPPORT_OPENMP @HAVE_OPENMP@)
set(FLUIDSYNTH_SUPPORT_PROFILING @WITH_PROFILING@)
set(FLUIDSYNTH_SUPPORT_THREADS @ENABLE_MIXER_THREADS@)
set(FLUIDSYNTH_SUPPORT_UBSAN @ENABLE_UBSAN@)
# Only load dependencies on static builds
if(NOT FLUIDSYNTH_IS_SHARED)
# Allows CMake to use the additional modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
# Make searching for packages easier on VCPKG
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.15 AND VCPKG_TOOLCHAIN)
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
endif()
# Load the pkg-config helpers
include(PkgConfigHelpers)
# Check the system has a separated math library
find_library(HAS_LIBM NAMES "m" NO_CACHE)
if(HAS_LIBM)
set(MATH_LIBRARY "m")
endif(HAS_LIBM)
# Load find_dependency macro
include(CMakeFindDependencyMacro)
# Optional dependencies
if(NOT TARGET Threads::Threads AND NOT ((CMAKE_SYSTEM_NAME MATCHES "SunOS") OR (FLUIDSYNTH_OSAL STREQUAL "embedded")))
find_dependency(Threads)
endif()
if(FLUIDSYNTH_SUPPORT_GLIB AND (NOT TARGET GLib2::glib-2 OR NOT TARGET GLib2::gthread-2))
find_dependency(GLib2 @GLIB2_MINIMUM_VERSION@)
endif()
if(FLUIDSYNTH_SUPPORT_ALSA AND NOT TARGET ALSA::ALSA)
find_dependency(ALSA @ALSA_MINIMUM_VERSION@)
endif()
if(FLUIDSYNTH_SUPPORT_DBUS AND NOT TARGET dbus-1)
find_dependency(DBus1 @DBUS_MINIMUM_VERSION@)
endif()
if(FLUIDSYNTH_SUPPORT_JACK AND NOT TARGET Jack::Jack)
find_dependency(Jack)
endif()
if(FLUIDSYNTH_SUPPORT_LADSPA AND NOT TARGET GLib2::gmodule-2)
message(WARN "LADSPA support was built in but gmodule could not be found.")
endif()
if(FLUIDSYNTH_SUPPORT_LIBINSTPATCH AND NOT TARGET InstPatch::libinstpatch)
find_dependency(InstPatch @LIBINSTPATCH_MINIMUM_VERSION@)
endif()
if(FLUIDSYNTH_SUPPORT_LIBSNDFILE_LEGACY AND NOT TARGET SndFile::sndfile)
find_dependency(SndFileLegacy @LIBSNDFILE_MINIMUM_VERSION@)
elseif(FLUIDSYNTH_SUPPORT_LIBSNDFILE AND NOT TARGET SndFile::sndfile)
find_dependency(SndFile @LIBSNDFILE_MINIMUM_VERSION@)
endif()
if(FLUIDSYNTH_SUPPORT_MIDISHARE AND NOT TARGET MidiShare::MidiShare)
find_dependency(MidiShare)
endif()
if(FLUIDSYNTH_SUPPORT_OBOE AND NOT TARGET oboe::oboe)
find_dependency(oboe)
endif()
if(FLUIDSYNTH_SUPPORT_OPENMP AND NOT TARGET OpenMP::OpenMP_C)
find_dependency(OpenMP COMPONENTS C)
endif()
if(FLUIDSYNTH_SUPPORT_OPENSLES AND NOT TARGET OpenSLES::OpenSLES)
find_dependency(OpenSLES)
endif()
if(FLUIDSYNTH_SUPPORT_PIPEWIRE AND NOT TARGET PipeWire::PipeWire)
find_dependency(PipeWire @PIPEWIRE_MINIMUM_VERSION@)
endif()
if(FLUIDSYNTH_SUPPORT_PORTAUDIO AND NOT TARGET PortAudio::PortAudio)
find_dependency(PortAudio @PORTAUDIO_MINIMUM_VERSION@)
endif()
if(FLUIDSYNTH_SUPPORT_READLINE AND NOT TARGET Readline::Readline)
find_dependency(Readline)
endif()
if(FLUIDSYNTH_SUPPORT_SDL3 AND NOT TARGET SDL3::SDL3)
find_dependency(SDL3)
endif()
if(FLUIDSYNTH_SUPPORT_SYSTEMD AND NOT Systemd::libsystemd)
find_dependency(Systemd)
endif()
# Restore the module path
list(REMOVE_ITEM CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
endif()
set(FluidSynth_known_comps static shared)
set(FluidSynth_comp_static NO)
set(FluidSynth_comp_shared NO)
foreach (FluidSynth_comp IN LISTS ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS)
if (FluidSynth_comp IN_LIST FluidSynth_known_comps)
set(FluidSynth_comp_${FluidSynth_comp} YES)
else ()
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"FluidSynth does not recognize component `${FluidSynth_comp}`.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif ()
endforeach ()
if (FluidSynth_comp_static AND FluidSynth_comp_shared)
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"FluidSynth `static` and `shared` components are mutually exclusive.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif ()
set(FluidSynth_static_targets "${CMAKE_CURRENT_LIST_DIR}/FluidSynth-static-targets.cmake")
set(FluidSynth_shared_targets "${CMAKE_CURRENT_LIST_DIR}/FluidSynth-shared-targets.cmake")
macro(FluidSynth_load_targets type)
if (NOT EXISTS "${FluidSynth_${type}_targets}")
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"FluidSynth `${type}` libraries were requested but not found.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif ()
include("${FluidSynth_${type}_targets}")
endmacro()
if (FluidSynth_comp_static)
FluidSynth_load_targets(static)
elseif (FluidSynth_comp_shared)
FluidSynth_load_targets(shared)
elseif (DEFINED FluidSynth_SHARED_LIBS AND FluidSynth_SHARED_LIBS)
FluidSynth_load_targets(shared)
elseif (DEFINED FluidSynth_SHARED_LIBS AND NOT FluidSynth_SHARED_LIBS)
FluidSynth_load_targets(static)
elseif (BUILD_SHARED_LIBS)
if (EXISTS "${FluidSynth_shared_targets}")
FluidSynth_load_targets(shared)
else ()
FluidSynth_load_targets(static)
endif ()
else ()
if (EXISTS "${FluidSynth_shared_targets}")
FluidSynth_load_targets(shared)
else ()
FluidSynth_load_targets(static)
endif ()
endif ()