2020-02-27 23:45:02 +01:00
|
|
|
if (WIN32)
|
|
|
|
|
cmake_minimum_required (VERSION 3.15)
|
|
|
|
|
cmake_policy(SET CMP0091 NEW)
|
2020-01-19 00:26:18 +01:00
|
|
|
else()
|
2020-02-27 23:45:02 +01:00
|
|
|
cmake_minimum_required (VERSION 3.5)
|
|
|
|
|
if (POLICY CMP0069)
|
|
|
|
|
cmake_policy(SET CMP0069 NEW)
|
|
|
|
|
endif()
|
2020-01-19 00:26:18 +01:00
|
|
|
endif()
|
2020-02-27 23:45:02 +01:00
|
|
|
|
2020-03-14 15:01:52 +01:00
|
|
|
project (sfizz VERSION 0.3.1 LANGUAGES CXX C)
|
2020-02-27 23:45:02 +01:00
|
|
|
set (PROJECT_DESCRIPTION "A library to load SFZ description files and use them to render music.")
|
2019-11-23 18:31:14 +01:00
|
|
|
|
2019-11-25 16:10:30 +01:00
|
|
|
# External configuration CMake scripts
|
|
|
|
|
set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
2020-05-19 20:22:29 +02:00
|
|
|
include (BuildType)
|
2019-11-25 16:10:30 +01:00
|
|
|
include (SfizzConfig)
|
2019-11-23 18:31:14 +01:00
|
|
|
|
2019-11-25 16:10:30 +01:00
|
|
|
# Build Options
|
|
|
|
|
set (BUILD_TESTING OFF CACHE BOOL "Disable Abseil's tests [default: OFF]")
|
2019-11-23 19:43:34 +01:00
|
|
|
|
2019-12-23 05:13:29 -08:00
|
|
|
# On macOS add the needed directories for both library and jack client
|
|
|
|
|
if (APPLE)
|
2019-12-30 05:39:39 +01:00
|
|
|
include_directories (SYSTEM /usr/local/opt/libsndfile/include)
|
|
|
|
|
link_directories (/usr/local/opt/libsndfile/lib)
|
2019-12-23 05:13:29 -08:00
|
|
|
endif()
|
|
|
|
|
|
2020-02-26 16:10:35 +01:00
|
|
|
option (ENABLE_LTO "Enable Link Time Optimization [default: ON]" ON)
|
|
|
|
|
option (SFIZZ_JACK "Enable JACK stand-alone build [default: ON]" ON)
|
2020-05-03 06:59:51 +02:00
|
|
|
option (SFIZZ_RENDER "Enable renderer of SMF files [default: ON]" ON)
|
2020-02-26 16:10:35 +01:00
|
|
|
option (SFIZZ_LV2 "Enable LV2 plug-in build [default: ON]" ON)
|
2020-03-05 11:16:47 +01:00
|
|
|
option (SFIZZ_VST "Enable VST plug-in build [default: OFF]" OFF)
|
2020-05-13 04:10:16 -07:00
|
|
|
option (SFIZZ_AU "Enable AU plug-in build [default: OFF]" OFF)
|
2020-02-26 16:10:35 +01:00
|
|
|
option (SFIZZ_BENCHMARKS "Enable benchmarks build [default: OFF]" OFF)
|
|
|
|
|
option (SFIZZ_TESTS "Enable tests build [default: OFF]" OFF)
|
2020-03-26 16:24:37 +01:00
|
|
|
option (SFIZZ_DEVTOOLS "Enable developer tools build [default: OFF]" OFF)
|
2020-02-26 16:10:35 +01:00
|
|
|
option (SFIZZ_SHARED "Enable shared library build [default: ON]" ON)
|
|
|
|
|
option (SFIZZ_USE_VCPKG "Assume that sfizz is build using vcpkg [default: OFF]" OFF)
|
|
|
|
|
option (SFIZZ_STATIC_LIBSNDFILE "Link libsndfile statically [default: OFF]" OFF)
|
2020-05-19 23:42:10 +02:00
|
|
|
option (SFIZZ_RELEASE_ASSERTS "Forced assertions in release builds [default: OFF]" OFF)
|
2019-11-23 18:31:14 +01:00
|
|
|
|
2019-11-26 13:43:07 +01:00
|
|
|
# Don't use IPO in non Release builds
|
|
|
|
|
include (CheckIPO)
|
|
|
|
|
|
2019-11-23 18:31:14 +01:00
|
|
|
# Add Abseil
|
2019-11-25 16:10:30 +01:00
|
|
|
add_subdirectory (external/abseil-cpp EXCLUDE_FROM_ALL)
|
2019-11-23 18:31:14 +01:00
|
|
|
|
|
|
|
|
# Add the static library targets and sources
|
2019-11-25 16:10:30 +01:00
|
|
|
add_subdirectory (src)
|
2019-11-23 18:59:29 +01:00
|
|
|
|
2019-11-23 19:43:34 +01:00
|
|
|
# Optional targets
|
2020-05-03 06:59:51 +02:00
|
|
|
add_subdirectory (clients)
|
2019-11-23 18:59:29 +01:00
|
|
|
|
|
|
|
|
if (SFIZZ_LV2)
|
2019-11-25 16:10:30 +01:00
|
|
|
add_subdirectory (lv2)
|
2019-11-23 18:59:29 +01:00
|
|
|
endif()
|
|
|
|
|
|
2020-03-05 11:16:47 +01:00
|
|
|
if (SFIZZ_VST)
|
|
|
|
|
add_subdirectory (vst)
|
2020-05-14 11:24:02 +02:00
|
|
|
else()
|
|
|
|
|
if (SFIZZ_AU)
|
|
|
|
|
message(WARNING "Audio Unit requires VST to be enabled")
|
|
|
|
|
endif()
|
2020-03-05 11:16:47 +01:00
|
|
|
endif()
|
|
|
|
|
|
2019-11-23 18:59:29 +01:00
|
|
|
if (SFIZZ_BENCHMARKS)
|
2019-11-25 16:10:30 +01:00
|
|
|
add_subdirectory (benchmarks)
|
2019-11-23 19:10:37 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if (SFIZZ_TESTS)
|
2019-11-25 16:10:30 +01:00
|
|
|
add_subdirectory (tests)
|
|
|
|
|
endif()
|
|
|
|
|
|
2020-03-26 16:24:37 +01:00
|
|
|
if (SFIZZ_DEVTOOLS)
|
|
|
|
|
add_subdirectory (devtools)
|
|
|
|
|
endif()
|
|
|
|
|
|
2020-03-14 10:37:35 +01:00
|
|
|
# Put it at the end so that the vst/lv2 directories are registered
|
|
|
|
|
if (NOT MSVC)
|
|
|
|
|
include(SfizzUninstall)
|
|
|
|
|
endif()
|
|
|
|
|
|
2020-01-19 01:10:42 +01:00
|
|
|
show_build_info_if_needed()
|