sfizz-ui/CMakeLists.txt
redtide 6953168087
CMake definitions and format rearrangement
- Rename some SFIZZ_ prefixed definitions where possible to permit some modules
  to be generic and be reused in other projects, keep project' information
  in the same place and more explicit
- Fixed non-compliant code formatting
2023-05-20 16:21:00 +02:00

79 lines
2.8 KiB
CMake

if(WIN32)
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW)
else()
# FIXME: The old JPC fork of mod-plugin-builder image used in CI requires 3.5.
# The current upstream one needs a different configuration.
# Minimum required to use SFIZZ_USE_SYSTEM_ABSEIL is 3.11,
# see library/cmake/SfizzDeps.cmake at line 70.
# CMake 3.12 supports object libraries, can be used to share a single build
# between AU, VST2 and VST3 plugins; also to use project' HOMEPAGE_URL.
cmake_minimum_required(VERSION 3.12)
endif()
# The project was splitted in 2 repositories:
# - `sfizz` for the library, which represents the main repository reference
# - `sfizz-ui` for UIs (plugins with a future standalone UI in mind).
# However, to keep the original structure, we assume this as "sfizz" project,
# containing the "libsfizz" sub project in the `library` git submodule.
project(sfizz
DESCRIPTION "SFZ sampler, providing AU, LV2, PureData and VST plugins."
HOMEPAGE_URL "http://sfztools.github.io/sfizz"
LANGUAGES CXX C
VERSION 1.2.2
)
set(PROJECT_REPOSITORY "https://github.com/sfztools/sfizz")
set(PROJECT_AUTHOR "SFZTools")
set(PROJECT_EMAIL "paul@ferrand.cc")
set(LV2_PLUGIN_VERSION_MINOR 10)
set(LV2_PLUGIN_VERSION_MICRO 3)
# External configuration CMake scripts
set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};"
"${CMAKE_CURRENT_SOURCE_DIR}/library/cmake;"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
)
include(BuildType)
include(OptionEx)
option_ex(PLUGIN_AU "Enable AU plug-in build" APPLE)
option_ex(PLUGIN_LV2 "Enable LV2 plug-in build" ON)
option_ex(PLUGIN_LV2_UI "Enable LV2 plug-in user interface" ON)
option_ex(PLUGIN_PUREDATA "Enable Puredata plug-in build" OFF)
option_ex(PLUGIN_VST2 "Enable VST2 plug-in build (unsupported)" OFF)
option_ex(PLUGIN_VST3 "Enable VST3 plug-in build" ON)
option_ex(SFIZZ_USE_SYSTEM_LV2 "Use LV2 headers preinstalled on system" OFF)
option_ex(SFIZZ_USE_SYSTEM_VST3SDK "Use VST3SDK source files preinstalled on system" OFF)
set(MIDI_CC_COUNT 512 CACHE STRING "Maximum amount of Control Change Messages")
# TODO: VCPKG OR SNDFILE_STATIC?
if(PLUGIN_LV2 AND SFIZZ_USE_VCPKG)
set(LV2_PLUGIN_SPDX_LICENSE_ID "LGPL-3.0-only")
endif()
# Set Windows compatibility level to 10 required by VSTGUI
if(WIN32)
add_compile_definitions(_WIN32_WINNT=0x0A00)
endif()
include(SfizzConfig) # Re-used for this project
include(BundleDylibs)
add_subdirectory(library)
add_subdirectory(plugins)
# Windows installer
if(WIN32)
include(VSTConfig)
configure_file(${PROJECT_SOURCE_DIR}/scripts/innosetup.iss.in
${PROJECT_BINARY_DIR}/innosetup.iss @ONLY)
endif()
# Leave this at the end so that the vst/lv2 directories are registered
if(NOT MSVC)
include(PluginsUninstall)
endif()
show_build_info_if_needed()