-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.plugins.txt
59 lines (50 loc) · 2.03 KB
/
CMakeLists.plugins.txt
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
# -*- mode: cmake; -*-
add_library(plugin-common STATIC EXCLUDE_FROM_ALL
"sources/synth/synth_utility.cc"
"sources/utility/charset.cc"
"sources/utility/paths.cc"
"sources/utility/logs.cc")
target_include_directories(plugin-common PUBLIC "sources")
target_link_libraries(plugin-common PUBLIC vendor::utf vendor::scope-lite vendor::string-view-lite sys::iconv)
if(CMAKE_SYSTEM_NAME MATCHES "^(Windows|Darwin)$")
target_link_libraries(plugin-common PRIVATE ICU::uc ICU::i18n)
target_compile_definitions(plugin-common PRIVATE "UNICODE_ICU")
else()
target_link_libraries(plugin-common PRIVATE PkgConfig::glib)
target_compile_definitions(plugin-common PRIVATE "UNICODE_GLIB")
endif()
function(add_plugin TARGET)
add_library("${TARGET}" MODULE ${ARGN})
target_compile_definitions("${TARGET}" PRIVATE
"SMF_DSP_DEFAULT_SF2=\"${SMF_DSP_DEFAULT_SF2}\"")
target_link_libraries("${TARGET}" PRIVATE plugin-common)
set_target_properties("${TARGET}" PROPERTIES PREFIX "")
link_what_you_use("${TARGET}")
install(TARGETS "${TARGET}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}"
COMPONENT "plugins")
endfunction()
if(TARGET vendor::fluidsynth)
add_plugin(s_fluid "sources/synth/plugins/fluid.cc")
target_link_libraries(s_fluid PRIVATE vendor::fluidsynth)
endif()
if(TARGET vendor::adlmidi)
add_plugin(s_adlmidi "sources/synth/plugins/adlmidi.cc")
target_link_libraries(s_adlmidi PRIVATE vendor::adlmidi)
endif()
if(TARGET vendor::opnmidi)
add_plugin(s_opnmidi "sources/synth/plugins/opnmidi.cc")
target_link_libraries(s_opnmidi PRIVATE vendor::opnmidi)
endif()
if(TARGET vendor::scc)
add_plugin(s_scc "sources/synth/plugins/scc.cc")
target_link_libraries(s_scc PRIVATE vendor::scc)
endif()
if(TARGET vendor::mt32emu)
add_plugin(s_mt32emu "sources/synth/plugins/mt32emu.cc")
target_link_libraries(s_mt32emu PRIVATE vendor::mt32emu)
endif()
if(TARGET vendor::timiditypp)
add_plugin(s_timiditypp "sources/synth/plugins/timiditypp.cc")
target_link_libraries(s_timiditypp PRIVATE vendor::timiditypp)
endif()