-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
148 lines (113 loc) · 4.58 KB
/
Copy pathCMakeLists.txt
File metadata and controls
148 lines (113 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
cmake_minimum_required(VERSION 3.28)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15 CACHE STRING "Build for 10.14")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# TODO Remove This before we ship non beta version. Remember
# the AU rescans only when versions change even if binaries are
# different.
string(TIMESTAMP DAY_OF_YEAR "%j")
string(TIMESTAMP YEAR "%Y")
math(EXPR PART0 "${YEAR}-2025 + 5")
math(EXPR PART1 "${DAY_OF_YEAR} + 1")
project(two-filters VERSION 0.${PART0}.${PART1} LANGUAGES C CXX)
set(PRODUCT_NAME "Two Filters")
option(USE_SANITIZER "Build and link with ASAN" FALSE)
option(COPY_AFTER_BUILD "Will copy after build" TRUE)
option(BUILD_SINGLE_ONLY "Only build the one plugin - no seven sines out" FALSE)
include(cmake/compile-options.cmake)
## New version
include(libs/sst/sst-plugininfra/cmake/git-version-functions.cmake)
version_from_versionfile_or_git()
message(STATUS "DISPLAY_VERSION=${GIT_IMPLIED_DISPLAY_VERSION}; COMMIT_HASH=${GIT_COMMIT_HASH}; BRANCH=${GIT_BRANCH}")
add_compile_definitions(CLAP_WRAPPER_LOGLEVEL=0)
include(cmake/CmakeRC.cmake)
file(GLOB_RECURSE PATCHES "resources/factory_patches/*.twofl")
cmrc_add_resource_library(${PROJECT_NAME}-patches NAMESPACE twofilters_patches ${PATCHES})
# About-screen assets (icon + acknowledgements) embedded for the modal overlay.
cmrc_add_resource_library(${PROJECT_NAME}-assets NAMESPACE twofilters_assets
resources/TwoFiltersIcon.png
doc/ack.md)
set(JUCE_PATH "${CMAKE_SOURCE_DIR}/libs/JUCE")
add_subdirectory(libs)
add_library(${PROJECT_NAME}-impl STATIC
src/clap/plugin-clap.cpp
src/clap/plugin-clap-entry-impl.cpp
src/ui/plugin-editor.cpp
src/ui/about-screen.cpp
src/ui/debug-panel.cpp
src/ui/filter-panel.cpp
src/ui/routing-panel.cpp
src/ui/steplfo-panel.cpp
src/presets/preset-manager.cpp
src/engine/engine.cpp
src/engine/patch.cpp
)
target_include_directories(${PROJECT_NAME}-impl PUBLIC src)
# Important setup variables
target_compile_definitions(${PROJECT_NAME}-impl PRIVATE
PRODUCT_NAME="${PRODUCT_NAME}"
PATCH_EXTENSION=".twofl"
)
if (${BUILD_SINGLE_ONLY})
message(STATUS "Building single plugin version only")
target_compile_definitions(${PROJECT_NAME}-impl PRIVATE
CLAP_PLUGIN_COUNT=1
)
endif()
if (WIN32)
message(STATUS "Activating wchar presets")
target_compile_definitions(${PROJECT_NAME}-impl PUBLIC USE_WCHAR_PRESET=1)
endif()
target_link_libraries(${PROJECT_NAME}-impl PUBLIC
clap
)
target_link_libraries(${PROJECT_NAME}-impl PRIVATE
simde
clap-helpers clap-wrapper-extensions
mts-esp-client
fmt-header-only
sst-basic-blocks sst-jucegui sst-cpputils sst-filters sst-filters-extras sst-waveshapers
sst-plugininfra
sst-plugininfra::filesystem
sst-plugininfra::tinyxml
sst-plugininfra::strnatcmp
sst-plugininfra::patchbase
sst-plugininfra::version_information
sst::clap_juce_shim sst::clap_juce_shim_headers
juce::juce_dsp
${PROJECT_NAME}-patches
${PROJECT_NAME}-assets
)
make_clapfirst_plugins(
TARGET_NAME ${PROJECT_NAME}
IMPL_TARGET ${PROJECT_NAME}-impl
OUTPUT_NAME "${PRODUCT_NAME}"
ENTRY_SOURCE src/clap/plugin-clap-entry.cpp
BUNDLE_IDENTIFER "org.baconpaul.twofilters"
BUNDLE_VERSION ${PROJECT_VERSION}
COPY_AFTER_BUILD ${COPY_AFTER_BUILD}
PLUGIN_FORMATS CLAP VST3 AUV2
WINDOWS_FOLDER_VST3 TRUE
ASSET_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PROJECT_NAME}_assets
# You can add a target-per-standalone you want. Syntax here is
# target-postfix output-name clap-id
# This allows you to make multiple standalones from a multi-plugin clap
STANDALONE_CONFIGURATIONS
standalone "${PRODUCT_NAME}" "org.baconpaul.twofilters"
STANDALONE_MACOS_ICON "${CMAKE_SOURCE_DIR}/resources/installer_mac/TwoFiltersIcon.icns"
STANDALONE_WINDOWS_ICON "${CMAKE_SOURCE_DIR}/resources/TwoFiltersIcon.ico"
)
add_subdirectory(tests)
include(cmake/basic_installer_clapfirst.cmake)
add_clapfirst_installer(
INSTALLER_TARGET ${PROJECT_NAME}-installer
ASSET_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PROJECT_NAME}_assets
INSTALLER_PREFIX "two-filters"
PRODUCT_NAME "${PRODUCT_NAME}"
TARGETS
${PROJECT_NAME}_clap
${PROJECT_NAME}_vst3
${PROJECT_NAME}_auv2
${PROJECT_NAME}_standalone
)