-
Notifications
You must be signed in to change notification settings - Fork 43
/
CMakeLists.txt
441 lines (379 loc) · 17.6 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
# Copyright 2006 Milan Digital Audio LLC
# Copyright 2009-2024 GrandOrgue contributors (see AUTHORS)
# License GPL-2.0 or later
# (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html).
cmake_minimum_required(VERSION 3.10)
# Project version numbers
if(NOT DEFINED VERSION)
file(STRINGS "version.txt" VERSION)
if(NOT VERSION)
message(FATAL_ERROR "Unable to get version from version.txt")
endif()
endif()
project(
GrandOrgue
VERSION "${VERSION}"
DESCRIPTION "GrandOrgue - free pipe organ simulator"
LANGUAGES CXX C
HOMEPAGE_URL "https://github.com/GrandOrgue/grandorgue"
)
set(NUM_VERSION "${PROJECT_VERSION}")
string(REPLACE "." "," NUM_WIN_VERSION ${NUM_VERSION})
if(NOT DEFINED BUILD_VERSION)
set(BUILD_VERSION "0.local")
elseif(NOT BUILD_VERSION)
set(BUILD_VERSION "0.0")
endif()
if (NOT DEFINED GO_BUILD_TESTING OR GO_BUILD_TESTING STREQUAL "")
set(GO_BUILD_TESTING ${BUILD_TESTING})
endif()
set(FULL_VERSION "${PROJECT_VERSION}-${BUILD_VERSION}")
# Set GITHUB_PROJECT variable that is used to configure update checking
if (NOT DEFINED GITHUB_PROJECT)
set(GITHUB_PROJECT "GrandOrgue/grandorgue")
endif()
# Define a c++ standard
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard whose features are requested to build this project")
# Build configuration options
option(RTAUDIO_USE_CORE "Enable RtAudio support for Core Audio (Rt and PortAudio - OS X only)" ON)
option(RTAUDIO_USE_JACK "Enable RtAudio support for Jack (Rt and PortAudio)" ON)
option(RTAUDIO_USE_OSS "Enable RtAudio support for OSS (Rt and PortAudio - Linux only)" OFF)
option(RTAUDIO_USE_ALSA "Enable RtAudio support for ALSA (Rt and PortAudio - Linux only)" ON)
option(RTAUDIO_USE_DSOUND "Enable RtAudio support for DirectSound (Rt and PortAudio - Windows only)" ON)
option(RTAUDIO_USE_ASIO "Enable RtAudio support for ASIO (Rt and PortAudio - Windows only)" ON)
option(RTAUDIO_USE_WMME "Enable RtAudio support for WMME (PortAudio only - Windows only)" ON)
option(RTAUDIO_USE_WDMKS "Enable RtAudio support for WDMKS (PortAudio only - Windows only)" ON)
option(RTAUDIO_USE_WASAPI "Enable RtAudio support for WASAPI (PortAudio only - Windows only)" ON)
option(RTMIDI_USE_CORE "Enable RtMidi support for Core Audio (OS X only)" ON)
option(RTMIDI_USE_JACK "Enable RtMidi support for Jack" ON)
option(RTMIDI_USE_ALSA "Enable RtMidi support for ALSA (Linux only)" ON)
option(RTMIDI_USE_MM "Enable RtMidi support for MM (Windows only)" ON)
option(USE_INTERNAL_RTAUDIO "Use builtin RtAudio/RtMidi sources" ON)
option(INSTALL_DEMO "Install demo sampleset" ON)
option(USE_INTERNAL_PORTAUDIO "Use builtin PortAudio sources" ON)
option(USE_INTERNAL_ZITACONVOLVER "Use builtin Zita Convolver sources" ON)
option(GO_USE_JACK "Use native Jack output" ON)
if (WIN32 OR APPLE)
option(INSTALL_DEPEND "Copy dependencies (wxWidgets libraries and Translations) on installation" ON)
else ()
option(INSTALL_DEPEND "Copy dependencies (wxWidgets libraries and Translations) on installation" OFF)
endif ()
option(GO_SEPARATE_LINUX_PACKAGES "Generate separate linux packages for resources and demo" OFF)
option(USE_BUILD_SYSTEM_LIBDIR "Use build system (distro-specific) libdir (Linux only)" OFF)
# only use options supported by the compiler
include(CheckIncludeFileCXX)
include(CheckFunctionExists)
include(FindPkgConfig)
include(${CMAKE_SOURCE_DIR}/cmake/AddOption.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/AddCXXOption.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/FindTools.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/BuildLibrary.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/BuildExecutable.cmake)
IF (APPLE)
set(BININSTDIR "${PROJECT_NAME}.app/Contents/MacOS")
SET(LIBINSTDIR "${PROJECT_NAME}.app/Contents/Frameworks")
SET(RESOURCEINSTDIR "${PROJECT_NAME}.app/Contents/Resources")
SET(RPATH_PREFIX "${PROJECT_NAME}.app/Contents/Frameworks")
ELSE()
set(BININSTDIR "bin")
IF (WIN32)
SET(LIBINSTDIR "bin")
ELSEIF (USE_BUILD_SYSTEM_LIBDIR)
# See https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html for
# the purpose of this module
include(GNUInstallDirs)
SET(LIBINSTDIR "${CMAKE_INSTALL_LIBDIR}" CACHE STRING "library directory")
ELSE ()
SET(LIBINSTDIR "lib" CACHE STRING "library directory")
ENDIF ()
SET(RESOURCEINSTDIR "share/${PROJECT_NAME}")
SET(RPATH_PREFIX "$ORIGIN")
ENDIF()
SET(BINDIR "${CMAKE_BINARY_DIR}/${BININSTDIR}")
SET(LIBDIR "${CMAKE_BINARY_DIR}/${LIBINSTDIR}")
SET(RESOURCEDIR "${CMAKE_BINARY_DIR}/${RESOURCEINSTDIR}")
if (APPLE AND INSTALL_DEPEND STREQUAL "ON")
set(OBJECT_FIXUP_REQUIRED "ON")
else()
set(OBJECT_FIXUP_REQUIRED "OFF")
endif()
file(RELATIVE_PATH RPATH "${BINDIR}" "${LIBDIR}")
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "${RPATH_PREFIX}/${RPATH}")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
# setup compiler flags for debug vs release compiles
add_option(-Wall)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_option(-g3)
else()
add_option(-O3)
add_option(-g)
add_definitions(-DNDEBUG)
add_option(-fomit-frame-pointer)
add_option(-funroll-loops)
add_option(-ffast-math)
endif ()
if (RTAUDIO_USE_JACK OR RTMIDI_USE_JACK OR GO_USE_JACK)
pkg_check_modules(JACK REQUIRED IMPORTED_TARGET jack)
endif()
# Add ASIO variable
if(WIN32 AND RTAUDIO_USE_ASIO)
add_definitions(-DASIO_INCLUDED)
endif()
if(RTAUDIO_USE_ASIO AND NOT ASIO_SDK_DIR)
set(ASIO_SDK_DIR "${CMAKE_SOURCE_DIR}/ext/rt/asio")
endif()
# include RtAudio
if (USE_INTERNAL_RTAUDIO)
if(NOT RTAUDIO_SRC_DIR)
set(RTAUDIO_SRC_DIR "${CMAKE_SOURCE_DIR}/submodules/RtAudio")
if(NOT EXISTS "${RTAUDIO_SRC_DIR}/RtAudio.h")
message(
FATAL_ERROR
"${RTAUDIO_SRC_DIR}/RtAudio.h file does not exist."
"Possible the RtAudio submodule has not been updated."
"Try to execute 'git submodule update --init --recursive' in the source directory"
)
endif()
endif()
if(NOT RTMIDI_SRC_DIR)
set(RTMIDI_SRC_DIR "${CMAKE_SOURCE_DIR}/submodules/RtMidi")
if(NOT EXISTS "${RTMIDI_SRC_DIR}/RtMidi.h")
message(
FATAL_ERROR
"${RTMIDI_SRC_DIR}/RtMidi.h file does not exist."
"Possible the RtMidi submodule has not been updated."
"Try to execute 'git submodule update --init --recursive' in the source directory"
)
endif()
endif()
add_subdirectory(src/rt)
set(RT_LIBRARIES RtAudio RtMidi)
set(RT_INCLUDE_DIRS ${RTMIDI_SRC_DIR} ${RTAUDIO_SRC_DIR})
else()
pkg_check_modules(RTAUDIO REQUIRED rtaudio)
pkg_check_modules(RTMIDI REQUIRED rtmidi)
set(RT_LIBRARIES ${RTAUDIO_LIBRARIES} ${RTMIDI_LIBRARIES})
set(RT_INCLUDE_DIRS ${RTMIDI_INCLUDE_DIRS} ${RTAUDIO_INCLUDE_DIRS})
endif()
# include portaudio
if (USE_INTERNAL_PORTAUDIO)
set(PORTAUDIO_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/submodules/PortAudio/include)
add_subdirectory(src/portaudio)
set(PORTAUDIO_LIBRARIES PortAudio)
else()
pkg_check_modules(PORTAUDIO REQUIRED portaudio-2.0)
endif()
# include zitaconvolver
if (USE_INTERNAL_ZITACONVOLVER)
set(ZITACONVOLVER_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/submodules/ZitaConvolver/source)
set(ZITACONVOLVER_LIBRARIES "")
else()
set(ZITACONVOLVER_INCLUDE_DIRS "")
set(ZITACONVOLVER_LIBRARIES zita-convolver)
endif()
# include libcurl for automatic cheking for updates
# exports CURL::libcurl that can be used in target_link_libraries
find_package(CURL REQUIRED)
# include FFTW
pkg_check_modules(FFTW REQUIRED fftw3f)
pkg_check_modules(ZLIB REQUIRED zlib)
pkg_check_modules(WAVPACK REQUIRED wavpack)
find_package(wxWidgets REQUIRED base)
message(STATUS " wxWidgets Unicode? : ${wxWidgets_USE_UNICODE}")
message(STATUS " wxWidgets Debug? : ${wxWidgets_USE_DEBUG}")
message(STATUS " wxWidgets Static linking : ${wxWidgets_USE_STATIC}")
message(STATUS " wxWidgets version : ${wxWidgets_VERSION}")
message(STATUS " wxWidgets config binary : ${wxWidgets_CONFIG_EXECUTABLE}")
message(STATUS " wxWidgets configuration : ${wxWidgets_CONFIGURATION}")
message(STATUS "============================================================================")
if (GO_BUILD_TESTING)
# Add coverage configuration to include project files - Don't put extra libraries here under
set(CMAKE_CXX_FLAGS_DEBUG "-g --coverage")
message(STATUS "============================================================================")
message(STATUS " Coverage enabled")
message(STATUS "============================================================================")
endif()
add_subdirectory(src/build)
add_subdirectory(src/images)
add_subdirectory(src/core)
add_subdirectory(src/grandorgue)
add_subdirectory(src/tools)
add_subdirectory(po)
add_subdirectory(help)
add_subdirectory(sounds)
add_subdirectory(packages)
add_subdirectory(perftests)
add_subdirectory(resources)
if (GO_BUILD_TESTING)
enable_testing()
add_subdirectory(src/tests)
message(STATUS "============================================================================")
message(STATUS " Testing enabled")
message(STATUS "============================================================================")
endif()
# packaging
# deal with possible package names among grandorgue, grandorgue-wx30, grandorgue-wx32
set(BASE_PACKAGE_NAME "grandorgue")
set(OTHER_PACKAGE_NAMES "${BASE_PACKAGE_NAME}" "${BASE_PACKAGE_NAME}-wx30" "${BASE_PACKAGE_NAME}-wx32")
set(CPACK_PACKAGE_NAME "${BASE_PACKAGE_NAME}")
if(CMAKE_PACKAGE_SUFFIX)
set(CPACK_PACKAGE_NAME "${BASE_PACKAGE_NAME}-${CMAKE_PACKAGE_SUFFIX}")
endif()
list(REMOVE_ITEM OTHER_PACKAGE_NAMES "${CPACK_PACKAGE_NAME}")
if(NOT GO_SEPARATE_LINUX_PACKAGES)
# For automatic removal of previously installed subpackages
list(APPEND OTHER_PACKAGE_NAMES "${BASE_PACKAGE_NAME}-resources" "${BASE_PACKAGE_NAME}-demo")
endif()
set(CPACK_PACKAGE_VENDOR "GrandOrgue contributors")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenSource Virtual Pipe Organ Software")
set(
CPACK_PACKAGE_DESCRIPTION
"GrandOrgue is a virtual pipe organ sample player application"
)
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_PACKAGE_RELEASE ${BUILD_VERSION})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "GrandOrgue")
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE)
set(CPACK_PACKAGE_CONTACT "osamarin68@gmail.com")
set(CPACK_PACKAGE_EXECUTABLES "GrandOrgue" "GrandOrgue")
set(CPACK_SOURCE_IGNORE_FILES "/\\\\.git/" "/build/")
# components
set(CPACK_COMPONENTS_ALL Unspecified resources demo)
set(CPACK_COMPONENT_UNSPECIFIED_DISPLAY_NAME "GrandOrgue")
set(CPACK_COMPONENT_RESOURCES_DISPLAY_NAME "GrandOrgue Resource Files")
set(
CPACK_COMPONENT_RESOURCES_DESCRIPTION
"This package contains the various resource files for GrandOrgue"
)
set(CPACK_COMPONENT_DEMO_DISPLAY_NAME "GrandOrgue Demo Sampleset")
set(
CPACK_COMPONENT_DEMO_DESCRIPTION
"This package contains the demo sampleset for GrandOrgue"
)
set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN OFF)
set(CPACK_COMPONENT_UNSPECIFIED_DEPENDS resources)
set(CPACK_COMPONENT_DEMO_DEPENDS Unspecified)
if (APPLE)
# see the following URL for information about these variables
# https://developer.apple.com/library/mac/#documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
set(BUNDLE_CFBundleShortVersionString ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_STAGE})
set(BUNDLE_CFBundleVersion ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_STAGE})
set(CPACK_PACKAGE_ICON "${RESOURCEDIR}/GrandOrgue.icns")
configure_file(${CMAKE_SOURCE_DIR}/src/grandorgue/resource/Info.plist.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app/Contents/Info.plist)
INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app/Contents/Info.plist DESTINATION "${PROJECT_NAME}.app/Contents/")
add_custom_target(
macOSApplication
ALL
DEPENDS GrandOrgue GrandOrgueTool GrandOrguePerfTest resources # run after building these targets
COMMAND "${CMAKE_COMMAND}" -DAPP_DIR="${CMAKE_BINARY_DIR}" -P "${CMAKE_SOURCE_DIR}/cmake/SignMacOSApp.cmake"
)
set(CPACK_SYSTEM_NAME "macOS")
set(CPACK_GENERATOR DragNDrop)
set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_SOURCE_DIR}/cmake/SignMacOSApp.cmake")
elseif (WIN32)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CPACK_STRIP_FILES OFF)
else()
set(CPACK_STRIP_FILES ON)
endif()
set (CPACK_SYSTEM_NAME "windows")
set (CPACK_GENERATOR ZIP NSIS)
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
WriteRegStr HKCR \\\".organ\\\" \\\"\\\" \\\"GrandOrgue.odf\\\"
WriteRegStr HKCR \\\".orgue\\\" \\\"\\\" \\\"GrandOrgue.package\\\"
WriteRegStr HKCR \\\"GrandOrgue.odf\\\" \\\"\\\" \\\"GrandOrgue organ definition file\\\"
WriteRegStr HKCR \\\"GrandOrgue.odf\\\\DefaultIcon\\\" \\\"\\\" \\\"$INSTDIR\\\\bin\\\\GrandOrgue.exe,0\\\"
WriteRegStr HKCR \\\"GrandOrgue.odf\\\\shell\\\" \\\"\\\" \\\"open\\\"
WriteRegStr HKCR \\\"GrandOrgue.odf\\\\shell\\\\open\\\\command\\\" \\\"\\\" '$INSTDIR\\\\bin\\\\GrandOrgue.exe \\\"%1\\\"'
WriteRegStr HKCR \\\"GrandOrgue.package\\\" \\\"\\\" \\\"GrandOrgue organ package\\\"
WriteRegStr HKCR \\\"GrandOrgue.package\\\\DefaultIcon\\\" \\\"\\\" \\\"$INSTDIR\\\\bin\\\\GrandOrgue.exe,0\\\"
WriteRegStr HKCR \\\"GrandOrgue.package\\\\shell\\\" \\\"\\\" \\\"open\\\"
WriteRegStr HKCR \\\"GrandOrgue.package\\\\shell\\\\open\\\\command\\\" \\\"\\\" '$INSTDIR\\\\bin\\\\GrandOrgue.exe \\\"%1\\\"'
")
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
ReadRegStr $R0 HKCR \\\".organ\\\" \\\"\\\"
StrCmp $R0 \\\"GrandOrgue.odf\\\" 0 +2
DeleteRegKey HKCR \\\".organ\\\"
ReadRegStr $R0 HKCR \\\".orgue\\\" \\\"\\\"
StrCmp $R0 \\\"GrandOrgue.package\\\" 0 +2
DeleteRegKey HKCR \\\".orgue\\\"
DeleteRegKey HKCR \\\"GrandOrgue.odf\\\"
DeleteRegKey HKCR \\\"GrandOrgue.package\\\"
")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CPACK_STRIP_FILES OFF)
else()
set(CPACK_STRIP_FILES ON)
endif()
set(CPACK_SYSTEM_NAME "linux")
set(CPACK_GENERATOR TGZ RPM DEB)
set(CPACK_RPM_COMPONENT_INSTALL ${GO_SEPARATE_LINUX_PACKAGES})
set(CPACK_RPM_PACKAGE_LICENSE "GPL-2.0-or-later")
set(CPACK_RPM_PACKAGE_RELEASE "${CPACK_PACKAGE_RELEASE}")
set(CPACK_RPM_PACKAGE_GROUP "Productivity/Multimedia/Sound/Midi")
set(CPACK_RPM_PACKAGE_URL "https://github.com/GrandOrgue/grandorgue")
set(CPACK_RPM_MAIN_COMPONENT Unspecified)
set(CPACK_RPM_FILE_NAME RPM-DEFAULT)
set(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
set(CPACK_RPM_UNSPECIFIED_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
set(CPACK_RPM_UNSPECIFIED_PACKAGE_REQUIRES_POST "shared-mime-info, desktop-file-utils")
set(CPACK_RPM_UNSPECIFIED_PACKAGE_REQUIRES_POSTUN "shared-mime-info, desktop-file-utils")
set(CPACK_RPM_UNSPECIFIED_PACKAGE_REQUIRES "grandorgue-resources")
set(CPACK_RPM_UNSPECIFIED_PACKAGE_SUGGESTS "grandorgue-demo")
set(CPACK_RPM_RESOURCES_PACKAGE_SUMMARY "${CPACK_COMPONENT_RESOURCES_DISPLAY_NAME}")
set(CPACK_RPM_RESOURCES_PACKAGE_ARCHITECTURE noarch)
set(CPACK_RPM_RESOURCES_FILE_NAME RPM-DEFAULT)
set(CPACK_RPM_DEMO_PACKAGE_SUMMARY "${CPACK_COMPONENT_DEMO_DISPLAY_NAME}")
set(CPACK_RPM_DEMO_PACKAGE_ARCHITECTURE noarch)
set(CPACK_RPM_DEMO_FILE_NAME RPM-DEFAULT)
string (REPLACE ";" " " CPACK_RPM_PACKAGE_OBSOLETES "${OTHER_PACKAGE_NAMES}")
# On Ubuntu rpmbuild generates a libcurl.so.4(CURL_OPENSSL_4)(64bit) requirement for libcurl.
# In Fedora libcurl is based on openssl, but libcurl package does not provide such symbol.
# As a workaround, we set the right symbol manually.
set(CPACK_RPM_SPEC_MORE_DEFINE "%global __requires_exclude libcurl.*")
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
# dnf tries to install the 32-bit package on x86_64 if '()(64bit)' is omitted
set(CPACK_RPM_PACKAGE_REQUIRES "libcurl.so.4()(64bit)")
else()
set(CPACK_RPM_PACKAGE_REQUIRES "libcurl.so.4")
endif()
# prevent rpmlint errors
set(
CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
/usr/share/icons
/usr/share/man
/usr/share/man/man1
)
# for source rpms
set(CPACK_RPM_BUILDREQUIRES "pkgconfig(alsa), gcc-c++, jack-audio-connection-kit-devel, cmake, wxGTK3-devel, pkgconfig(fftw3f), pkgconfig(libudev), pkgconfig(wavpack), pkgconfig(zlib), libxslt, zip, po4a")
set(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS "-DVERSION=%{version} -DBUILD_VERSION=%{release}")
# for deb
set(CPACK_DEB_COMPONENT_INSTALL GO_SEPARATE_LINUX_PACKAGES)
set(CPACK_DEBIAN_UNSPECIFIED_PACKAGE_NAME "grandorgue")
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_RELEASE "${CPACK_PACKAGE_RELEASE}")
set(CPACK_DEBIAN_RESOURCES_PACKAGE_ARCHITECTURE all)
set(CPACK_DEBIAN_DEMO_PACKAGE_ARCHITECTURE all)
set(CPACK_DEBIAN_UNSPECIFIED_DEPENDS "grandorgue-resources")
set(CPACK_DEBIAN_RESOURCES_DEPENDS "grandorgue")
set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS ON)
set(CPACK_DEBIAN_PACKAGE_SECTION sound)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_UNSPECIFIED_PACKAGE_RECOMMENDS "grandorgue-demo")
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
set(CPACK_DEBIAN_PACKAGE_SOURCE "${CPACK_DEBIAN_UNSPECIFIED_PACKAGE_NAME}")
string (REPLACE ";" ", " CPACK_DEBIAN_PACKAGE_REPLACES "${OTHER_PACKAGE_NAMES}")
endif()
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CPACK_SYSTEM_NAME}.${CMAKE_SYSTEM_PROCESSOR}")
include(CPack)
message(STATUS " Project : ${PROJECT_NAME}")
message(STATUS " Description : ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
message(STATUS " Version : ${VERSION}")
message(STATUS " Build : ${CPACK_PACKAGE_RELEASE}")
message(STATUS " Package name : ${CPACK_PACKAGE_NAME}")
message(STATUS "============================================================================")
message(STATUS " ")