-
Notifications
You must be signed in to change notification settings - Fork 95
/
CMakeLists.txt
254 lines (224 loc) · 8.03 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
cmake_minimum_required(VERSION 3.15)
project(calf)
string(TOUPPER "${CMAKE_PROJECT_NAME}" PROJECT_NAME_UCASE)
set(PROJECT_YEAR 2023)
set(PROJECT_AUTHOR "${PROJECT_NAME_UCASE} Developers")
set(PROJECT_URL "https://calf-studio-gear.org/")
set(PROJECT_DESCRIPTION "${PROJECT_NAME_UCASE} Studio Gear")
set(PROJECT_COPYRIGHT "2007-${PROJECT_YEAR} ${PROJECT_AUTHOR}")
set(VERSION_MAJOR "0")
set(VERSION_MINOR "90")
set(VERSION_RELEASE "4")
set(VERSION_STAGE "alpha")
set(VERSION_BUILD "")
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}")
configure_file("${CMAKE_SOURCE_DIR}/COPYING" "${CMAKE_BINARY_DIR}/COPYING.txt" COPYONLY)
#
# CPack
#
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
SET(CPACK_PACKAGE_VENDOR "${PROJECT_AUTHOR}")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/COPYING.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${VERSION_RELEASE}")
IF(VERSION_STAGE)
SET(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${VERSION_STAGE}")
ENDIF()
IF(VERSION_BUILD)
SET(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${VERSION_BUILD}")
ENDIF()
SET(CPACK_SOURCE_GENERATOR "TBZ2")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}")
set(CPACK_SOURCE_IGNORE_FILES "/build;/\.github;/\.git/;/\.gitignore;/\.svnignore;/autogen\.sh;/configure\.ac;/Makefile\.am;${CPACK_SOURCE_IGNORE_FILES}")
SET(CPACK_PACKAGE_EXECUTABLES "${CMAKE_PROJECT_NAME}jackhost" "${PROJECT_NAME_UCASE} binary")
# Disable strip for Debug|RelWithDebInfo
if(CMAKE_BUILD_TYPE MATCHES "Deb")
unset(CPACK_STRIP_FILES)
else()
set(CPACK_STRIP_FILES TRUE)
endif()
INCLUDE(CPack)
#
# Options
#
option(WANT_GUI "Include Graphical User Interface" ON)
option(WANT_JACK "Include JACK (Jack Audio Connection Kit) support" ON)
option(WANT_LASH "Include LASH (LASH Audio Session Handler) support" ON)
option(WANT_DEBUG "Create debug build" OFF)
option(WANT_LV2 "Build Lv2 wrapper" ON)
option(WANT_LV2_GUI "GUI executable will be used for LV2" ON)
option(WANT_SORDI "Use the sordi tool to check Lv2 files" ON)
option(WANT_EXPERIMENTAL "Enable experimental effects" OFF)
#
# Configuration
#
if(CMAKE_BUILD_TYPE STREQUAL "")
SET(CMAKE_BUILD_TYPE "Release")
endif()
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
find_package(EXPAT REQUIRED)
if(WANT_GUI)
if(PKG_CONFIG_FOUND)
pkg_check_modules(GTK gtk+-2.0>=2.12.0 cairo>=1.2.0)
endif()
find_package(FluidSynth REQUIRED)
if(GTK_FOUND AND FluidSynth_FOUND)
include_directories(${GTK_INCLUDE_DIRS})
set(USE_GUI TRUE)
set(STATUS_GUI "OK")
elseif(NOT GTK_FOUND)
set(STATUS_GUI "not found - (GTK+ 2.12 and cairo 1.2 or newer required)")
elseif(NOT FluidSynth_FOUND)
set(STATUS_GUI "not found - (FLUIDSYNTH required)")
endif()
else()
set(STATUS_GUI "not built as requested")
endif()
if(WANT_JACK)
if(PKG_CONFIG_FOUND)
pkg_check_modules(JACK jack>=0.77)
endif()
if(JACK_FOUND)
set(USE_JACK TRUE)
if(JACK_VERSION VERSION_GREATER_EQUAL "0.105.0")
set(OLD_JACK FALSE)
else()
set(OLD_JACK TRUE)
endif()
if(JACK_VERSION VERSION_GREATER_EQUAL "0.124.0")
set(JACK_HAS_RENAME TRUE)
else()
set(JACK_HAS_RENAME FALSE)
endif()
set(STATUS_JACK "OK")
else()
set(STATUS_JACK "not found, install it or set PKG_CONFIG_PATH appropriately")
endif()
else()
set(STATUS_JACK "not built as requested")
endif()
if(WANT_LASH)
if(PKG_CONFIG_FOUND)
pkg_search_module(LASH lash-1.0)
endif()
if(LASH_FOUND)
include_directories(${LASH_INCLUDE_DIRS})
add_definitions(-DLASH=1)
list(APPEND AUDIO_LIBRARIES ${LASH_LIBRARIES})
list(APPEND AUDIO_LIBRARY_DIRS ${LASH_LIBRARY_DIRS})
if(LASH_VERSION VERSION_GREATER_EQUAL "0.6")
set(USE_LASH_0_6 TRUE)
else()
set(USE_LASH_0_6 FALSE)
endif()
set(STATUS_LASH "OK")
else()
set(STATUS_LASH "not found, install it or set PKG_CONFIG_PATH appropriately")
endif()
# mark_as_advanced(LASH_LIBRARIES)
else()
set(STATUS_LASH "not built as requested")
endif()
if(WANT_LV2)
if(PKG_CONFIG_FOUND)
pkg_check_modules(LV2 lv2)
endif()
if(NOT LV2_FOUND)
unset(LV2_FOUND CACHE)
find_package(LV2 CONFIG)
endif()
if(LV2_FOUND)
set(USE_LV2 TRUE)
set(STATUS_LV2 "OK")
else()
set(STATUS_LV2 "not found, install it or set PKG_CONFIG_PATH appropriately")
endif()
else()
set(STATUS_LV2 "not built, as requested")
endif()
if(WANT_LV2_GUI)
if(USE_LV2 AND USE_GUI)
set(USE_LV2_GUI TRUE)
set(STATUS_LV2_GUI "OK")
elseif(USE_LV2 AND NOT USE_GUI)
set(STATUS_LV2_GUI "not build, because no GUI support")
elseif(NOT USE_LV2 AND USE_GUI)
set(STATUS_LV2_GUI "not build, because no Lv2 support")
else(NOT USE_LV2 AND USE_GUI)
set(STATUS_LV2_GUI "not build, because no GUI and no Lv2 support")
endif()
else()
set(STATUS_LV2_GUI "not built, as requested")
endif()
if(WANT_SORDI)
find_program(SORDI NAMES sordi)
if(SORDI)
set(USE_SORDI TRUE)
set(STATUS_SORDI "OK")
else()
set(STATUS_SORDI "not found")
endif()
else()
set(STATUS_LV2_SORDI "not run, as requested")
endif()
if(WANT_EXPERIMENTAL)
set(STATUS_EXPERIMENTAL "OK")
set(ENABLE_EXPERIMENTAL TRUE)
else()
set(STATUS_EXPERIMENTAL "not built, as requested")
endif()
configure_file(config.h.cmake.in config.h)
include_directories(${CMAKE_BINARY_DIR})
#
# Compile & Install
#
add_subdirectory(src)
add_subdirectory(gui)
add_subdirectory(icons)
#
# Install targets (except src)
#
install(DIRECTORY ${CMAKE_SOURCE_DIR}/doc/manuals/
DESTINATION share/doc/${PROJECT_NAME} FILES_MATCHING PATTERN "*.html")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/doc/manuals/images/
DESTINATION share/doc/${PROJECT_NAME}/images FILES_MATCHING PATTERN "*.png")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/doc/manuals/images/
DESTINATION share/doc/${PROJECT_NAME}/images FILES_MATCHING PATTERN "*.jpg")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/doc/manuals/images/prettyPhoto/dark_rounded/
DESTINATION share/doc/${PROJECT_NAME}/images/prettyPhoto/dark_rounded)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/doc/manuals/images/icons/
DESTINATION share/doc/${PROJECT_NAME}/images/icons)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/doc/manuals/scripts
DESTINATION share/doc/${PROJECT_NAME} FILES_MATCHING PATTERN "*.css")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/doc/manuals/scripts/
DESTINATION share/doc/${PROJECT_NAME}/scripts FILES_MATCHING PATTERN "*.js")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/sf2/
DESTINATION share/${PROJECT_NAME}/sf2 FILES_MATCHING PATTERN "*.sf2")
#
# Status
#
message(
"\n"
"Summary\n"
"-------\n"
"* Build product : ${PROJECT_NAME} ${VERSION}\n")
if(CMAKE_BUILD_TYPE)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(BUILD_TYPE_HINT " (WARNING: VERY SLOW!)")
endif()
message("* Build type : ${CMAKE_BUILD_TYPE}${BUILD_TYPE_HINT}\n")
endif()
message(
"* Install Prefix : ${CMAKE_INSTALL_PREFIX}\n"
"* Jack : ${STATUS_JACK}\n"
"* LASH : ${STATUS_LASH}\n"
"* GUI : ${STATUS_GUI}\n"
"* LV2 : ${STATUS_LV2}\n"
"* LV2 GUI : ${STATUS_LV2_GUI}\n"
"* Sordi sanity checks : ${STATUS_SORDI}\n"
"* Experimental plugins : ${STATUS_EXPERIMENTAL}\n"
)