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
|
|
|
|
2021-04-15 22:47:40 +02:00
|
|
|
project (sfizz VERSION 1.0.0 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-23 18:31:14 +01:00
|
|
|
|
2019-11-25 16:10:30 +01:00
|
|
|
# Build Options
|
2021-02-01 02:47:40 +01:00
|
|
|
include (OptionEx)
|
|
|
|
|
|
2019-11-25 16:10:30 +01:00
|
|
|
set (BUILD_TESTING OFF CACHE BOOL "Disable Abseil's tests [default: OFF]")
|
2019-11-23 19:43:34 +01:00
|
|
|
|
2021-02-01 02:47:40 +01:00
|
|
|
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_RENDER "Enable renderer of SMF files" ON)
|
|
|
|
|
option_ex (SFIZZ_LV2 "Enable LV2 plug-in build" ON)
|
|
|
|
|
option_ex (SFIZZ_LV2_UI "Enable LV2 plug-in user interface" ON)
|
|
|
|
|
option_ex (SFIZZ_VST "Enable VST plug-in build" ON)
|
|
|
|
|
option_ex (SFIZZ_AU "Enable AU plug-in build" APPLE)
|
2021-04-08 04:13:57 +02:00
|
|
|
option_ex (SFIZZ_VST2 "Enable VST2 plug-in build (unsupported)" OFF)
|
2021-02-01 02:47:40 +01:00
|
|
|
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)
|
2021-03-23 12:04:03 +01:00
|
|
|
option_ex (SFIZZ_USE_SNDFILE "Enable use of the sndfile library" OFF)
|
2021-02-01 02:47:40 +01:00
|
|
|
option_ex (SFIZZ_USE_VCPKG "Assume that sfizz is build using vcpkg" OFF)
|
2021-02-23 00:38:44 +01:00
|
|
|
option_ex (SFIZZ_USE_SYSTEM_ABSEIL "Use Abseil libraries preinstalled on system" OFF)
|
2021-02-23 01:11:22 +01:00
|
|
|
option_ex (SFIZZ_USE_SYSTEM_SIMDE "Use SIMDe libraries preinstalled on system" OFF)
|
2021-02-01 02:47:40 +01:00
|
|
|
option_ex (SFIZZ_STATIC_DEPENDENCIES "Link dependencies statically" OFF)
|
|
|
|
|
option_ex (SFIZZ_RELEASE_ASSERTS "Forced assertions in release builds" OFF)
|
2021-04-25 05:49:45 +02:00
|
|
|
option_ex (SFIZZ_PROFILE_BUILD "Profile the build time" OFF)
|
2019-11-23 18:31:14 +01:00
|
|
|
|
2021-04-04 15:58:25 +02:00
|
|
|
# The fixed number of controller parameters
|
|
|
|
|
set(SFIZZ_NUM_CCS 512)
|
|
|
|
|
|
2020-10-09 14:00:13 +02:00
|
|
|
include (SfizzConfig)
|
2020-12-14 14:11:57 +01:00
|
|
|
include (SfizzDeps)
|
2021-02-24 23:54:32 +01:00
|
|
|
include (SfizzFaust)
|
2020-10-09 14:00:13 +02:00
|
|
|
|
2019-11-26 13:43:07 +01:00
|
|
|
# Don't use IPO in non Release builds
|
|
|
|
|
include (CheckIPO)
|
|
|
|
|
|
2020-10-23 23:08:56 -07:00
|
|
|
# Dylib bunder for macOS
|
|
|
|
|
include (BundleDylibs)
|
|
|
|
|
|
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)
|
2021-02-08 20:39:24 +01:00
|
|
|
add_subdirectory (plugins)
|
2020-03-05 11:16:47 +01:00
|
|
|
|
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)
|
2021-03-18 00:42:04 +01:00
|
|
|
enable_testing ()
|
2019-11-25 16:10:30 +01:00
|
|
|
add_subdirectory (tests)
|
|
|
|
|
endif()
|
|
|
|
|
|
2020-11-01 10:56:49 +01:00
|
|
|
if (SFIZZ_DEMOS)
|
|
|
|
|
add_subdirectory (demos)
|
|
|
|
|
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()
|