-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
167 lines (146 loc) · 4.86 KB
/
CMakeLists.txt
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
cmake_minimum_required(VERSION 3.15)
project(AIDA-X VERSION 1.1.0)
set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDISTRHO_NAMESPACE=AidaDISTRHO -DDGL_NAMESPACE=AidaDGL")
# if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(amd64|AMD64|i.86|x64|X64|x86|x86_64|X86)$")
# set(PREFER_RTNEURAL_XSIMD TRUE)
# else()
set(PREFER_RTNEURAL_XSIMD FALSE)
# endif()
set(RTNEURAL_XSIMD ${PREFER_RTNEURAL_XSIMD} CACHE BOOL "Use RTNeural with this backend")
message("RTNEURAL_XSIMD in ${CMAKE_PROJECT_NAME} = ${RTNEURAL_XSIMD}, using processor type ${CMAKE_SYSTEM_PROCESSOR} and system name ${CMAKE_SYSTEM_NAME}")
add_subdirectory(modules/dpf)
add_subdirectory(modules/rtneural)
find_package(Threads REQUIRED)
set_property(GLOBAL PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
dpf_add_plugin(AIDA-X
TARGETS au clap lv2 vst2 vst3
#NO_SHARED_RESOURCES
UI_TYPE opengl
USE_FILE_BROWSER
FILES_DSP
Files.cpp
modules/FFTConvolver/AudioFFT.cpp
modules/FFTConvolver/FFTConvolver.cpp
modules/FFTConvolver/TwoStageFFTConvolver.cpp
modules/FFTConvolver/Utilities.cpp
modules/r8brain/pffft.cpp
modules/r8brain/r8bbase.cpp
src/aidadsp-plugin.cpp
src/Biquad.cpp
src/3rd-party.cpp
FILES_UI
Graphics.cpp
src/aidadsp-ui.cpp)
dpf_add_plugin(AIDA-X-Standalone
TARGETS jack
#NO_SHARED_RESOURCES
UI_TYPE opengl
USE_FILE_BROWSER
FILES_DSP
Files.cpp
modules/FFTConvolver/AudioFFT.cpp
modules/FFTConvolver/FFTConvolver.cpp
modules/FFTConvolver/TwoStageFFTConvolver.cpp
modules/FFTConvolver/Utilities.cpp
modules/r8brain/pffft.cpp
modules/r8brain/r8bbase.cpp
src/aidadsp-plugin.cpp
src/Biquad.cpp
src/3rd-party.cpp
FILES_UI
Graphics.cpp
modules/dpf-widgets/opengl/Blendish.cpp
src/aidadsp-ui.cpp)
target_compile_definitions(dgl-opengl PUBLIC
DGL_NAMESPACE=AidaDGL
DGL_WINDOWS_ICON_ID=401
NVG_FONT_TEXTURE_FLAGS=NVG_IMAGE_NEAREST
)
target_include_directories(AIDA-X PUBLIC
src
src/plugin
modules/dr_libs
modules/FFTConvolver
modules/r8brain
modules/rtneural
${CMAKE_BINARY_DIR}
)
target_include_directories(AIDA-X-Standalone PUBLIC
src
src/standalone
modules/dpf-widgets/opengl
modules/dr_libs
modules/FFTConvolver
modules/r8brain
modules/rtneural
${CMAKE_BINARY_DIR}
)
# needed for enabling SSE in pffft
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86|X86)$")
target_compile_definitions(AIDA-X PUBLIC i386)
target_compile_definitions(AIDA-X-Standalone PUBLIC i386)
endif()
# needed for emscripten
if(EMSCRIPTEN)
target_compile_definitions(RTNeural PUBLIC EIGEN_DONT_VECTORIZE=1)
endif()
# needed for RISC-V
if(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64")
set(CMAKE_OPTIONAL_LIBATOMIC "-latomic")
endif()
target_link_libraries(AIDA-X PUBLIC RTNeural ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_OPTIONAL_LIBATOMIC})
target_link_libraries(AIDA-X-Standalone PUBLIC RTNeural ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_OPTIONAL_LIBATOMIC})
# convert data into code
add_custom_command(
PRE_BUILD
COMMAND ${CMAKE_SOURCE_DIR}/modules/dpf/utils/res2c.py Files ${CMAKE_SOURCE_DIR}/files ${CMAKE_BINARY_DIR}
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/files
OUTPUT Files.cpp
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_command(
PRE_BUILD
COMMAND ${CMAKE_SOURCE_DIR}/modules/dpf/utils/res2c.py Graphics ${CMAKE_SOURCE_DIR}/graphics/png ${CMAKE_BINARY_DIR}
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/graphics
OUTPUT Graphics.cpp
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
# set up extra standalone details
set_target_properties(AIDA-X-Standalone-jack PROPERTIES OUTPUT_NAME "AIDA-X")
if(APPLE)
set_target_properties(AIDA-X-Standalone-jack PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/utils/Info.plist"
)
add_custom_command(
POST_BUILD
COMMAND cmake -E copy "${CMAKE_SOURCE_DIR}/utils/ax.icns" "${CMAKE_BINARY_DIR}/bin/AIDA-X.app/Contents/Resources/ax.icns"
DEPENDS AIDA-X-Standalone-jack
OUTPUT "${CMAKE_BINARY_DIR}/bin/AIDA-X.app/Contents/Resources/ax.icns"
)
add_custom_target(AIDA-X-App ALL
DEPENDS "${CMAKE_BINARY_DIR}/bin/AIDA-X.app/Contents/Resources/ax.icns"
)
elseif(WIN32)
target_sources(AIDA-X-Standalone-jack PUBLIC utils/ax.rc)
endif()
# set up windows installer
if(WIN32 AND MINGW)
add_custom_command(
POST_BUILD
COMMAND utils/windows-installer.sh "${CMAKE_BINARY_DIR}" "${CMAKE_PROJECT_VERSION}"
DEPENDS AIDA-X-clap AIDA-X-lv2 AIDA-X-lv2-ui AIDA-X-vst2 AIDA-X-vst3 AIDA-X-Standalone-jack
OUTPUT "${CMAKE_SOURCE_DIR}/utils/inno/AIDA-X-${CMAKE_PROJECT_VERSION}-win64-installer.exe"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
add_custom_target(AIDA-X-Installer ALL
DEPENDS "${CMAKE_SOURCE_DIR}/utils/inno/AIDA-X-${CMAKE_PROJECT_VERSION}-win64-installer.exe"
)
endif()