sfizz/CMakeLists.txt

80 lines
2.8 KiB
Text
Raw Normal View History

if(WIN32)
cmake_minimum_required(VERSION 3.15)
2020-02-27 23:45:02 +01:00
cmake_policy(SET CMP0091 NEW)
2020-01-19 00:26:18 +01:00
else()
# USE_LIBCPP requires add_link_options() in SfizzConfig.cmake
cmake_minimum_required(VERSION 3.13)
2020-01-19 00:26:18 +01:00
endif()
2020-02-27 23:45:02 +01:00
project(libsfizz
LANGUAGES CXX C
VERSION 1.2.2
)
set(PROJECT_DESCRIPTION "A library to load SFZ description files and use them to render music.")
set(PROJECT_REPOSITORY https://github.com/sfztools/sfizz)
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")
include(BuildType)
2019-11-23 18:31:14 +01:00
2019-11-25 16:10:30 +01:00
# Build Options
include(OptionEx)
2021-02-01 02:47:40 +01:00
set(BUILD_TESTING OFF CACHE BOOL "Disable Abseil's tests [default: OFF]")
2019-11-23 19:43:34 +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_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)
2019-11-23 18:31:14 +01:00
# Continuous Controller count (0 to 511)
set(MIDI_CC_COUNT 512 CACHE STRING "Maximum number of managed Control Change messages")
include(SfizzConfig)
include(SfizzDeps)
include(SfizzFaust)
2019-11-26 13:43:07 +01:00
# Don't use IPO in non Release builds
include(CheckIPO)
2019-11-26 13:43:07 +01:00
2019-11-23 18:31:14 +01:00
# Add the static library targets and sources
add_subdirectory(src)
2019-11-23 18:59:29 +01:00
2019-11-23 19:43:34 +01:00
# Optional targets
add_subdirectory(clients)
2020-03-05 11:16:47 +01:00
if(SFIZZ_BENCHMARKS)
add_subdirectory(benchmarks)
2019-11-23 19:10:37 +01:00
endif()
if(SFIZZ_TESTS)
enable_testing()
add_subdirectory(tests)
2019-11-25 16:10:30 +01:00
endif()
if(SFIZZ_DEMOS)
add_subdirectory(demos)
endif()
if(SFIZZ_DEVTOOLS)
add_subdirectory(devtools)
endif()
show_build_info_if_needed()