forked from sfztools/sfizz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
95 lines (78 loc) · 3.62 KB
/
CMakeLists.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
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
if(WIN32)
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW)
else()
# USE_LIBCPP requires add_link_options() in SfizzConfig.cmake
cmake_minimum_required(VERSION 3.13)
endif()
project(libsfizz
LANGUAGES CXX C
VERSION 1.2.3
)
set(PROJECT_DESCRIPTION "A library to load SFZ description files and use them to render music.")
set(PROJECT_REPOSITORY https://github.com/sfztools/sfizz)
# External configuration CMake scripts
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(BuildType)
# Build Options
include(OptionEx)
set(BUILD_TESTING OFF CACHE BOOL "Disable Abseil's tests [default: OFF]")
option_ex(ENABLE_LTO "Enable Link Time Optimization" ON)
option_ex(SFIZZ_JACK "Enable JACK stand-alone build" CMAKE_SYSTEM_NAME STREQUAL "Linux")
option_ex(SFIZZ_JACK_USE_ALSA "Enable ALSA input port for JACK stand-alone build" CMAKE_SYSTEM_NAME STREQUAL "Linux")
option_ex(SFIZZ_RENDER "Enable renderer of SMF files" ON)
option_ex(SFIZZ_BENCHMARKS "Enable benchmarks build" OFF)
option_ex(SFIZZ_TESTS "Enable tests build" OFF)
option_ex(SFIZZ_DEMOS "Enable feature demos build" OFF)
option_ex(SFIZZ_DEVTOOLS "Enable developer tools build" OFF)
option_ex(SFIZZ_SHARED "Enable shared library build" ON)
option_ex(SFIZZ_USE_SNDFILE "Enable use of the sndfile library" OFF)
option_ex(SFIZZ_USE_SYSTEM_ABSEIL "Use Abseil libraries preinstalled on system" OFF)
option_ex(SFIZZ_USE_SYSTEM_GHC_FS "Use GHC Filesystem libraries preinstalled on system" OFF)
option_ex(SFIZZ_USE_SYSTEM_SIMDE "Use SIMDe libraries preinstalled on system" OFF)
option_ex(SFIZZ_USE_SYSTEM_KISS_FFT "Use KISS FFT libraries preinstalled on system" OFF)
option_ex(SFIZZ_USE_SYSTEM_PUGIXML "Use pugixml libraries preinstalled on system" OFF)
option_ex(SFIZZ_USE_SYSTEM_CXXOPTS "Use CXXOPTS libraries preinstalled on system" OFF)
option_ex(SFIZZ_USE_SYSTEM_CATCH "Use Catch libraries preinstalled on system" OFF)
option_ex(SFIZZ_RELEASE_ASSERTS "Forced assertions in release builds" OFF)
option_ex(SFIZZ_PROFILE_BUILD "Profile the build time" OFF)
option_ex(SFIZZ_SNDFILE_STATIC "Link the sndfile library statically" OFF)
option_ex(SFIZZ_ASAN "Use address sanitizer on all sfizz targets" OFF)
option_ex(SFIZZ_GIT_SUBMODULE_CHECK "Check Git submodules presence" ON)
# Continuous Controller count (0 to 511)
set(MIDI_CC_COUNT 512 CACHE STRING "Maximum number of managed Control Change messages")
# Ensure presence of Git submodules (when not using the source tarball)
if(SFIZZ_GIT_SUBMODULE_CHECK AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git"
AND NOT CMAKE_VERSION VERSION_LESS "3.19.0")
include(GitSubmoduleCheck)
git_submodule_check(external/abseil-cpp)
git_submodule_check(external/filesystem)
git_submodule_check(external/simde)
git_submodule_check(external/st_audiofile/thirdparty/dr_libs)
git_submodule_check(external/st_audiofile/thirdparty/libaiff)
git_submodule_check(external/st_audiofile/thirdparty/wavpack)
git_submodule_check(external/invoke.hpp)
endif()
include(SfizzConfig)
include(SfizzDeps)
include(SfizzFaust)
# Don't use IPO in non Release builds
include(CheckIPO)
# Add the static library targets and sources
add_subdirectory(src)
# Optional targets
add_subdirectory(clients)
if(SFIZZ_BENCHMARKS)
add_subdirectory(benchmarks)
endif()
if(SFIZZ_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
if(SFIZZ_DEMOS)
add_subdirectory(demos)
endif()
if(SFIZZ_DEVTOOLS)
add_subdirectory(devtools)
endif()
show_build_info_if_needed()