sfizz/CMakeLists.txt

61 lines
1.9 KiB
Text
Raw Normal View History

2019-11-23 18:31:14 +01:00
cmake_minimum_required(VERSION 3.13)
2019-11-25 16:10:30 +01:00
project (sfizz VERSION 1.0.0 LANGUAGES CXX)
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
set (LV2PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib/lv2" CACHE STRING
2019-11-25 16:10:30 +01:00
"Install destination for LV2 bundle [default: ${CMAKE_INSTALL_PREFIX}/lib/lv2]")
2019-11-23 18:31:14 +01:00
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: ON]" ON)
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
# 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()
message (STATUS "
Project name: ${CMAKE_PROJECT_NAME}
Build type: ${CMAKE_BUILD_TYPE}
Build using LTO: ${ENABLE_LTO}
2019-11-25 16:10:30 +01:00
Build as shared library: ${SFIZZ_SHARED}
Build JACK stand-alone client: ${SFIZZ_JACK}
Build LV2 plug-in: ${SFIZZ_LV2}
Build benchmarks: ${SFIZZ_BENCHMARKS}
Build tests: ${SFIZZ_TESTS}
Install prefix: ${CMAKE_INSTALL_PREFIX}
LV2 destination directory: ${LV2PLUGIN_INSTALL_DIR}
2019-11-25 16:10:30 +01:00
Compiler CXX debug flags: ${CMAKE_CXX_FLAGS_DEBUG}
Compiler CXX release flags: ${CMAKE_CXX_FLAGS_RELEASE}
Compiler CXX min size flags: ${CMAKE_CXX_FLAGS_MINSIZEREL}
")