-
Notifications
You must be signed in to change notification settings - Fork 31
/
qcs.pro
327 lines (264 loc) · 12.1 KB
/
qcs.pro
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
################################################################################
# The following variables can be set in the qmake argument list if they are not
# found in the default locations. Don't forget to use quotes. For example ...
# qmake qutecsound.pro "CSOUND_INCLUDE_DIR = <path to csound.h>"
# CSOUND_INCLUDE_DIR
# CSOUND_LIBRARY_DIR
# RTMIDI_DIR
# PYTHONQT_SRC_DIR
# If the Csound headers and libraries you are using were built from source but
# not installed, set CSOUND_SOURCE_TREE to the directory containing the Csound
# source tree. In this case, the CSOUND_INCLUDE_DIR and CSOUND_LIBRARY_DIR
# variables do not need to be set explicitly.
# These variables can also be set in a file named config.user.pri, which is
# used if it is found in the same directory as this file (config.pri).
################################################################################
# BUILD OPTIONS:
# CONFIG+=build32 To build floats version
# CONFIG+=pythonqt To build with PythonQt support
# CONFIG+=rtmidi To build with RtMidi support
# CONFIG+=record_support
# CONFIG+=debugger
# To support HTML5 via the <html> element in the csd using the Qt WebEngine
# (preferably use Qt 5.8 or later):
# CONFIG+=html_webengine
# If you want to build HTML5 support using QtWebkit framework (Qt 5.5 or earlier):
# CONFIG+=html_webkit
# OS X only OPTIONS:
# CONFIG+=universal # To build i386/ppc version. Default is x86_64
# CONFIG+=i386 # To build i386 version. Default is x86_64
# CONFIG+=bundle_csound # to make a package that incudes Csound in the bundle with make install
# LINUX ONLY:
# To install CsoundQt and its dekstop file and icons somewhere else than /usr/local/bin and /usr/share
# use variables INSTALL_DIR (default /usr/local) and SHARE_DIR (default /usr/share).
# For example for local install use:
# qmake qcs.pro INSTALL_DIR=~ SHARE_DIR=~/.local/share
################################################################################
#Support for Qt4 dropped from v0.9.8 de facto, v1.0.0 declaring it here:
lessThan(QT_MAJOR_VERSION,5): error("Qt5 or higher required. Use CsoundQt 0.9.7 or earlier to build for Qt4.")
csound5: error("Building for Csound5 nont supported.")
DEFINES += NOMINMAX
# DEFINES += USE_WIDGET_MUTEX
csound6 {
message("No need to specify CONFIG+=csound6 anymore as Csound6 build is now default.")
}
# Add C++11 support since version 0.9.4
CONFIG += c++11
# CONFIG += c++14
#for csound6 (may need extra conditions for csound7 later:
DEFINES += CSOUND6
CONFIG += csound6
debugger {
DEFINES += QCS_DEBUGGER
message("Building debugger.")
}
message("Building for Csound 6.")
QT += concurrent network widgets printsupport
DEFINES += USE_QT5
CONFIG += QCS_QT5
greaterThan(QT_MAJOR_VERSION, 4): greaterThan (QT_MINOR_VERSION, 2) {
QT += quickwidgets
DEFINES += USE_QT_GT_53
CONFIG += QCS_QT53
}
greaterThan(QT_MAJOR_VERSION, 4): greaterThan (QT_MINOR_VERSION, 3) {
DEFINES += USE_QT_GT_54
CONFIG += QCS_QT54
}
greaterThan(QT_MAJOR_VERSION, 4): greaterThan (QT_MINOR_VERSION, 5) {
DEFINES += USE_QT_GT_55
CONFIG += QCS_QT55
}
greaterThan(QT_MAJOR_VERSION, 4): greaterThan (QT_MINOR_VERSION, 7) {
DEFINES += USE_QT_GT_58
CONFIG += QCS_QT58
}
buildDoubles: message("Doubles is now built by default, no need to specify buildDoubles option")
!build32: CONFIG += build64
build32:build64:CONFIG -= build32
unix {
macx:include (qcs-macx.pro)
# else:haiku-g++ {include (qcs-haiku.pro) }
else: include (qcs-unix.pro)
}
win32-g++:include (qcs-win32.pro)
win32-msvc2013:include (qcs-win32.pro)
win32-msvc2015:include (qcs-win32.pro)
win32-msvc2017:include (qcs-win32.pro)
win32-msvc:include (qcs-win32.pro)
# Requires Csound >= 6.04
record_support|perfThread_build {
DEFINES += PERFTHREAD_RECORD
message("Building recording support.")
}
debugger {
DEFINES += QCS_DEBUGGER
message("Building debugger.")
}
include(src/src.pri)
TRANSLATIONS = "src/translations/qutecsound_en.ts" \
"src/translations/qutecsound_es.ts" \
"src/translations/qutecsound_de.ts" \
"src/translations/qutecsound_pt.ts" \
"src/translations/qutecsound_fr.ts" \
"src/translations/qutecsound_it.ts" \
"src/translations/qutecsound_tr.ts" \
"src/translations/qutecsound_el.ts" \
"src/translations/qutecsound_uk.ts" \
"src/translations/qutecsound_fi.ts" \
"src/translations/qutecsound_ru.ts" \
"src/translations/qutecsound_fa.ts" \
"src/translations/qutecsound_kr.ts"
pythonqt {
include ( $${PYTHONQT_SRC_DIR}/build/PythonQt.prf )
include ( $${PYTHONQT_SRC_DIR}/build/PythonQt_QtAll.prf )
# Note, this is Python, not PythonQt include dir!
win32:INCLUDEPATH *= $${PYTHON_INCLUDE_DIR}
INCLUDEPATH *= $${PYTHONQT_SRC_DIR}/src
INCLUDEPATH *= $${PYTHONQT_SRC_DIR}/extensions/PythonQt_QtAll
QT += svg sql webkit xmlpatterns opengl
QCS_QT53 {
QT += webkitwidgets multimedia multimediawidgets #positioning sensors
}
QCS_QT55 {
QT -= webkit webkitwidgets
#QT += webengine # maybe we need to add that for some functionality
}
}
html_webengine: {
message("Building html support with QtWebengine")
DEFINES += QCS_QTHTML USE_WEBENGINE
QT += network webenginewidgets webchannel
CONFIG += c++11
}
html_webkit: {
message("Building html support with QtWebkit")
DEFINES += QCS_QTHTML USE_WEBKIT
QT += network webkit webkitwidgets
CONFIG += c++11
}
INCLUDEPATH *= $${CSOUND_API_INCLUDE_DIR}
INCLUDEPATH *= $${CSOUND_INTERFACES_INCLUDE_DIR}
INCLUDEPATH += $$PWD/csound/include
#DESTDIR = $${_PRO_FILE_PWD_}/bin
DESTDIR = bin
MOC_DIR = build/moc
UI_DIR = build/ui
RCC_DIR = build/rc
TARGET = CsoundQt
build32:TARGET = $${TARGET}-f
build64:TARGET = $${TARGET}-d
pythonqt:TARGET = $${TARGET}-py
html_webkit|html_webengine:TARGET = $${TARGET}-html
csound6:TARGET = $${TARGET}-cs6
CONFIG(debug, debug|release):TARGET = $${TARGET}-debug
# install commands for linux (for make install)
# use 'sudo make install' for system wide installation
unix:!macx {
isEmpty(INSTALL_DIR) {
INSTALL_DIR=/usr/local # ~ #for HOME
}
isEmpty(SHARE_DIR) {
SHARE_DIR=/usr/share # ~/.local/share for HOME install
}
target.path = $$INSTALL_DIR/bin
target.files = $$OUT_PWD/$$DESTDIR/$$TARGET # do not install with the full name
INSTALLS += target
postInstall.path = $$INSTALL_DIR/bin
postInstall.commands = cd $(INSTALL_ROOT)/$$INSTALL_DIR/bin; ln -sf $$TARGET csoundqt
INSTALLS += postInstall
# see comments: https://github.com/CsoundQt/CsoundQt/issues/258
desktop.path=$$SHARE_DIR/applications
desktop.files = $$PWD/csoundqt.desktop
INSTALLS += desktop
icon.path=$$SHARE_DIR/icons/hicolor/scalable/apps
icon.files=images/csoundqt.svg
INSTALLS += icon
mimetypes.path=$$INSTALL_DIR # in some reason path must be set to create install target in Makefile
mimetypes.commands = cd $$PWD/mime-types/; ./add_csound_mimetypes.sh $(INSTALL_ROOT)/$$SHARE_DIR
INSTALLS += mimetypes
examples.path = $$SHARE_DIR/csoundqt/
examples.commands = rm -rf $(INSTALL_ROOT)/$$SHARE_DIR/qutecsound #remove the old examples
examples.files = src/Examples
INSTALLS += examples
templates.path = $$SHARE_DIR/csoundqt/
templates.files = templates
INSTALLS += templates
pythonqt {
scripts.path = $$SHARE_DIR/csoundqt/
scripts.files = src/Scripts
INSTALLS += scripts
}
}
# for OSX add Scripts and Examples to be bundle in Contents->Resources
macx {
pythonqt {
scripts.path = Contents/Resources
scripts.files = src/Scripts
QMAKE_BUNDLE_DATA += scripts
}
examples.path = Contents/Resources/Examples
examples.files = "src/Examples/"
QMAKE_BUNDLE_DATA += examples
templates.path = Contents
templates.files = "templates"
QMAKE_BUNDLE_DATA += templates
# EXPERIMENTAL INSTALL instructions for making bundle (ie make install)
first.path = $$PWD
first.commands = $$[QT_INSTALL_PREFIX]/bin/macdeployqt $$OUT_PWD/$$DESTDIR/$${TARGET}.app -qmldir=$$PWD/src/QML # first deployment
INSTALLS += first
cocoa.path = $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/PlugIns/platforms # fix missing plugins (with qt 5.4.2 at least)
cocoa.files = $$[QT_INSTALL_PREFIX]/plugins/platforms/libqcocoa.dylib
printsupport.path = $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/PlugIns/printsupport
printsupport.files = $$[QT_INSTALL_PREFIX]/plugins/printsupport/libcocoaprintersupport.dylib
pythonqt {
#if PythonQt 3.2, naming the libraries is different
#this should be set progammatically but hardcode for now.
pythonQtDylib = libPythonQt-Qt5-Python2.7.3.dylib# before PyhontQt3.2: libPythonQt.1.dylib
pythonQtAllDylib = libPythonQt_QtAll-Qt5-Python2.7.3.dylib # # before PythonQt 3.2: libPythonQt_QtAll.1.dylib
pythonqt.path = $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/Frameworks
pythonqt.files = $${PYTHONQT_LIB_DIR}/$$pythonQtAllDylib $${PYTHONQT_LIB_DIR}/$$pythonQtDylib #TODO: use pythonqt/lib dir
INSTALLS += pythonqt
}
pythonlinks.path= $$PWD
pythonlinks.commands = install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python Python.framework/Versions/2.7/Python $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/MacOS/$$TARGET ;
pythonqt {
pythonlinks.commands += install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python Python.framework/Versions/2.7/Python $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/Frameworks/$$pythonQtDylib ;
pythonlinks.commands += install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python Python.framework/Versions/2.7/Python $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/Frameworks/$$pythonQtAllDylib ;
pythonlinks.commands += install_name_tool -change $$pythonQtDylib @rpath/$$pythonQtDylib $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/MacOS/$$TARGET ;
pythonlinks.commands += install_name_tool -change $$pythonQtAllDylib @rpath/$$pythonQtAllDylib $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/MacOS/$$TARGET ;
pythonlinks.commands += install_name_tool -change $$pythonQtDylib @rpath/$$pythonQtDylib $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/Frameworks/$$pythonQtAllDylib ;
}
bundle_csound {
# Nothing special to do for that, just don't delete, leave the links to @rpath
message("Bundle Csound into the package")
csound.path= $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/Frameworks/
csound.files = /Library/Frameworks/CsoundLib64.framework
INSTALLS+=csound
final.commands += install_name_tool -change @rpath/libcsnd6.6.0.dylib @rpath/CsoundLib64.framework/Versions/6.0/libcsnd6.6.0.dylib $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/MacOS/$$TARGET ;
final.commands += install_name_tool -change CsoundLib64.framework/CsoundLib64 @rpath/CsoundLib64.framework/Versions/6.0/CsoundLib64 $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/MacOS/$$TARGET ;
} else {
final.path = $$PWD
final.commands = rm -rf $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/Frameworks/CsoundLib64.framework ;
final.commands += install_name_tool -change @rpath/libcsnd6.6.0.dylib libcsnd6.6.0.dylib $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/MacOS/$$TARGET ;
final.commands += install_name_tool -change @rpath/CsoundLib64.framework/Versions/6.0/CsoundLib64 CsoundLib64.framework/Versions/6.0/CsoundLib64 $$OUT_PWD/$$DESTDIR/$${TARGET}.app/Contents/MacOS/$$TARGET ;
}
final.path = $$PWD
final.commands += hdiutil create -fs HFS+ -srcfolder $$OUT_PWD/$$DESTDIR/$${TARGET}.app -volname CsoundQt $$OUT_PWD/$$DESTDIR/$${TARGET}.dmg # untested!
INSTALLS += cocoa printsupport pythonlinks final
}
win32 {
first.path = $$PWD
first.commands = $$[QT_INSTALL_PREFIX]/bin/windeployqt -qmldir=$$PWD/src/QML $$OUT_PWD/$$DESTDIR/$${TARGET}.exe # first deployment
templates.path = $$OUT_PWD/$$DESTDIR/ # not sure if this works
templates.files = templates
INSTALLS += first
}
message(CONFIGs are: $${CONFIG})
message(DEFINES are: $${DEFINES})
message(INCLUDEPATH is: $${INCLUDEPATH})
message(LIBS are: $${LIBS})
message(TARGET is: $${TARGET})
DISTFILES += \
Building_on_Windows.md \
config.user.pri