sfizz/CMakeLists.txt

57 lines
1.6 KiB
Text
Raw Normal View History

2020-01-19 00:26:18 +01:00
if(WIN32)
cmake_minimum_required (VERSION 3.15)
2020-01-19 00:22:16 +01:00
cmake_policy(SET CMP0091 NEW)
2020-01-19 00:26:18 +01:00
else()
cmake_minimum_required (VERSION 3.11)
endif()
2020-01-23 22:26:34 +01:00
project (sfizz VERSION 0.2.0 LANGUAGES CXX C)
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")
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()
option (ENABLE_LTO "Enable Link Time Optimization [default: ON]" ON)
2019-11-25 16:10:30 +01:00
option (SFIZZ_JACK "Enable JACK stand-alone build [default: ON]" ON)
option (SFIZZ_LV2 "Enable LV2 plug-in build [default: OFF]" OFF)
2019-11-25 16:10:30 +01:00
option (SFIZZ_BENCHMARKS "Enable benchmarks build [default: OFF]" OFF)
option (SFIZZ_TESTS "Enable tests build [default: OFF]" OFF)
option (SFIZZ_SHARED "Enable shared library build [default: ON]" ON)
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
2019-11-25 16:10:30 +01:00
if (SFIZZ_JACK)
add_subdirectory (clients)
2019-11-23 18:59:29 +01:00
endif()
if (SFIZZ_LV2)
2019-11-25 16:10:30 +01:00
add_subdirectory (lv2)
2019-11-23 18:59:29 +01:00
endif()
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()
show_build_info_if_needed()