-
Notifications
You must be signed in to change notification settings - Fork 23
/
Mosaic.qbs
163 lines (137 loc) · 5.85 KB
/
Mosaic.qbs
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
import qbs
import qbs.Process
import qbs.File
import qbs.FileInfo
import qbs.TextFile
import "../../../libs/openFrameworksCompiled/project/qtcreator/ofApp.qbs" as ofApp
Project{
property string of_root: '../../..'
ofApp {
name: { return FileInfo.baseName(sourceDirectory) }
files: [
"profiler/tracy/TracyClient.cpp",
"src/MosaicTheme.cpp",
"src/MosaicTheme.h",
"src/SplashScreen.cpp",
"src/SplashScreen.h",
"src/TextEditor.cpp",
"src/TextEditor.h",
"src/SynchTimer.h",
"src/config.h",
"src/includes.h",
'src/main.cpp',
'src/ofApp.cpp',
'src/ofApp.h',
]
of.addons: [
'ofxVisualProgramming'
]
// additional flags for the project. the of module sets some
// flags by default to add the core libraries, search paths...
// this flags can be augmented through the following properties:
of.pkgConfigs: [] // list of additional system pkgs to include
of.includePaths: ['profiler/tracy'] // include search paths
of.cFlags: [] // flags passed to the c compiler
// flags passed to the c++ compiler
of.cxxFlags: {
var flags = []; // Enter global flags here
if(qbs.configurationName.contains('Debug')){
flags = flags.concat(['-g']);
}else if(qbs.configurationName.contains('Release')){
flags = flags.concat(['-O2']);
}else if(qbs.configurationName.contains('Profiling')){
flags = flags.concat(['-g', '-O2']); // Optimize to have release performance, but with exporting symbols for the profiler.
}
return flags;
}
// flags passed to the linker
of.linkerFlags: []
// defines are passed as -D to the compiler, and can be checked with #ifdef or #if in the code
of.defines: {
var defs = []; // Enter global flags here
// defs = defs.concat(['OFXIMGUI_DEBUG']); // Uncomment to debug ofxImGui
defs = defs.concat([]);
if(qbs.configurationName.contains('Debug')){
defs = defs.concat(['NDEBUG']);
}else if(qbs.configurationName.contains('Release')){
defs = defs.concat([]);
}else if(qbs.configurationName.contains('Profiling')){
defs = defs.concat(['TRACY_ENABLE','TRACY_ONLY_IPV4','MOSAIC_ENABLE_PROFILING']);
}
return defs;
}
// osx only, additional frameworks to link with the project
of.frameworks: []
// static libraries
of.staticLibraries: {
var libs = [];
if(qbs.hostOS.contains("osx")){
libs = libs.concat([]);
}else if(qbs.hostOS.contains("windows")){
libs = libs.concat([]);
}else if(qbs.hostOS.contains("linux")){
libs = libs.concat([]);
}
return libs;
}
// dynamic libraries
of.dynamicLibraries: {
var libs = [];
if(qbs.hostOS.contains("osx")){
libs = libs.concat([]);
}else if(qbs.hostOS.contains("windows")){
libs = libs.concat(['openal','mpg123','libsndfile','pd']);
}else if(qbs.hostOS.contains("linux")){
libs = libs.concat([]);
}
return libs;
}
// other flags can be set through the cpp module: http://doc.qt.io/qbs/cpp-module.html
// eg: this will enable ccache when compiling
//
// cpp.compilerWrapper: 'ccache'
// add CoreMIDI for osx before big sur
Properties {
condition: qbs.hostOS.contains("10.12") || qbs.hostOS.contains("10.13") || qbs.hostOS.contains("10.14") || qbs.hostOS.contains("10.15")
of.frameworks: outer.concat(['/System/Library/Frameworks/CoreMIDI.framework']);
}
// add QTKit support on osx 10.12
Properties {
condition: qbs.hostOS.contains("osx") && qbs.hostOS.contains("10.12")
of.frameworks: outer.concat(['QTKit']);
}
// Include ofxSyphon on osx
Properties {
// osx only, additional frameworks to link with the project
condition: qbs.targetOS.contains("osx") || qbs.targetOS.contains("macos")
of.addons: outer.concat(['ofxSyphon'])
of.frameworks: outer.concat(['Syphon'])
cpp.frameworkPaths: ['../../../addons/ofxSyphon/libs/Syphon/lib/osx/']
// dirty fix for compiling .mm files (not auto-detected on qt)
files: outer.concat([
'../../../addons/ofxSyphon/src/ofxSyphonClient.mm',
'../../../addons/ofxSyphon/src/ofxSyphonServer.mm',
'../../../addons/ofxSyphon/src/ofxSyphonServerDirectory.mm',
'../../../addons/ofxSyphon/libs/Syphon/src/SyphonNameboundClient.m',
])
}
Depends{
name: "cpp"
}
// common rules that parse the include search paths, core libraries...
Depends{
name: "of"
}
// dependency with the OF library
Depends{
name: "openFrameworks"
}
}
property bool makeOF: true // use makfiles to compile the OF library
// will compile OF only once for all your projects
// otherwise compiled per project with qbs
property bool precompileOfMain: false // precompile ofMain.h
// faster to recompile when including ofMain.h
// but might use a lot of space per project
references: [FileInfo.joinPaths(of_root, "/libs/openFrameworksCompiled/project/qtcreator/openFrameworks.qbs")]
}