-
Notifications
You must be signed in to change notification settings - Fork 3
/
liger.pri
218 lines (189 loc) · 6.37 KB
/
liger.pri
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
!isEmpty(LIGER_PRI_INCLUDED):error("liger.pri already included")
LIGER_PRI_INCLUDED = 1
LIGER_VERSION=1.5.0
LIGER_COMPAT_VERSION=1.5.0
QTCREATOR_VERSION = 4.7.1
QTCREATOR_COMPAT_VERSION = 4.7.1
#VERSION = $$LIGER_VERSION
BINARY_ARTIFACTS_BRANCH = develop
# enable c++11
CONFIG += c++11
# Suppress certain warnings globally
macx: {
QMAKE_CXXFLAGS += -Wno-unused-local-typedefs
QMAKE_CXXFLAGS += -Wno-return-stack-address # clang warning
}
win32: {
DEFINES += NOMINMAX
}
include(matlabcheck.pri)
linux-* {
DEFINES += CSDP_LIBRARY
}
defineReplace(cleanPath) {
return($$clean_path($$1))
}
defineReplace(targetPath) {
return($$shell_path($$1))
}
defineReplace(qtLibraryTargetName) {
unset(LIBRARY_NAME)
LIBRARY_NAME = $$1
CONFIG(debug, debug|release) {
!debug_and_release|build_pass {
mac:RET = $$member(LIBRARY_NAME, 0)_debug
else:win32:RET = $$member(LIBRARY_NAME, 0)d
}
}
isEmpty(RET):RET = $$LIBRARY_NAME
return($$RET)
}
defineReplace(qtLibraryName) {
RET = $$qtLibraryTargetName($$1)
# win32 {
# VERSION_LIST = $$split(LIGER_VERSION, .)
# RET = $$RET$$first(VERSION_LIST)
# }
return($$RET)
}
defineTest(minQtVersion) {
maj = $$1
min = $$2
patch = $$3
isEqual(QT_MAJOR_VERSION, $$maj) {
isEqual(QT_MINOR_VERSION, $$min) {
isEqual(QT_PATCH_VERSION, $$patch) {
return(true)
}
greaterThan(QT_PATCH_VERSION, $$patch) {
return(true)
}
}
greaterThan(QT_MINOR_VERSION, $$min) {
return(true)
}
}
greaterThan(QT_MAJOR_VERSION, $$maj) {
return(true)
}
return(false)
}
# For use in custom compilers which just copy files
defineReplace(stripSrcDir) {
return($$relative_path($$absolute_path($$1, $$OUT_PWD), $$_PRO_FILE_PWD_))
}
isEmpty(LIGER_LIBRARY_BASENAME) {
LIGER_LIBRARY_BASENAME = lib
}
LIGER_SOURCE_TREE = $$PWD
isEmpty(LIGER_BUILD_TREE) {
sub_dir = $$_PRO_FILE_PWD_
sub_dir ~= s,^$$re_escape($$PWD),,
LIGER_BUILD_TREE = $$cleanPath($$OUT_PWD)
LIGER_BUILD_TREE ~= s,$$re_escape($$sub_dir)$,,
}
LIGER_APP_PATH = $$LIGER_BUILD_TREE/bin
macx {
LIGER_APP_TARGET = "Liger"
LIGER_LIBRARY_PATH = $$LIGER_APP_PATH/$${LIGER_APP_TARGET}.app/Contents/Frameworks
LIGER_PLUGIN_PATH = $$LIGER_APP_PATH/$${LIGER_APP_TARGET}.app/Contents/PlugIns
TIGON_PLUGIN_PATH = $$LIGER_APP_PATH/$${LIGER_APP_TARGET}.app/Contents/TigonPlugIns
LIGER_LIBEXEC_PATH = $$LIGER_APP_PATH/$${LIGER_APP_TARGET}.app/Contents/Resources
LIGER_DATA_PATH = $$LIGER_APP_PATH/$${LIGER_APP_TARGET}.app/Contents/Resources
LIGER_DOC_PATH = $$LIGER_DATA_PATH/doc
LIGER_BIN_PATH = $$LIGER_APP_PATH/$${LIGER_APP_TARGET}.app/Contents/MacOS
copydata = 1
INSTALL_DATA_PATH = $$LIGER_APP_PATH/$${LIGER_APP_TARGET}.app/Contents/Resources
} else {
contains(TEMPLATE, vc.*):vcproj = 1
LIGER_APP_TARGET = liger
LIGER_LIBRARY_PATH = $$LIGER_BUILD_TREE/bin
LIGER_PLUGIN_PATH = $$LIGER_BUILD_TREE/$$LIGER_LIBRARY_BASENAME/liger/plugins
TIGON_PLUGIN_PATH = $$LIGER_BUILD_TREE/$$LIGER_LIBRARY_BASENAME/tigon/plugins
LIGER_LIBEXEC_PATH = $$LIGER_APP_PATH # FIXME
LIGER_DATA_PATH = $$LIGER_BUILD_TREE/share/liger
LIGER_DOC_PATH = $$LIGER_BUILD_TREE/share/doc
LIGER_BIN_PATH = $$LIGER_APP_PATH
!isEqual(LIGER_SOURCE_TREE, $$LIGER_BUILD_TREE):copydata = 1
INSTALL_DATA_PATH = $$LIGER_BUILD_TREE/share/liger
}
TEST_BIN_PATH = $$LIGER_BUILD_TREE/tests/bin
INCLUDEPATH += \
$$LIGER_BUILD_TREE/src \ # for <app/app_version.h>
$$LIGER_SOURCE_TREE/src/libs \
$$LIGER_SOURCE_TREE/tools
QTC_PLUGIN_DIRS = $$(QTC_PLUGIN_DIRS)
QTC_PLUGIN_DIRS = $$split(QTC_PLUGIN_DIRS, $$QMAKE_DIRLIST_SEP)
QTC_PLUGIN_DIRS += $$LIGER_SOURCE_TREE/src/plugins
for(dir, QTC_PLUGIN_DIRS) {
INCLUDEPATH += $$dir
}
CONFIG += depend_includepath
LIBS += -L$$LIGER_LIBRARY_PATH
LIBS += -L$$TIGON_PLUGIN_PATH
!isEmpty(vcproj) {
DEFINES += LIGER_LIBRARY_BASENAME=\"$$LIGER_LIBRARY_BASENAME\"
} else {
DEFINES += LIGER_LIBRARY_BASENAME=\\\"$$LIGER_LIBRARY_BASENAME\\\"
}
# Note that the QT_NO_CAST_FROM_ASCII disables the QString(char*) constructor
# This is a design choice and makes sense but need time to port the current codebase
# to QLatin1String. So for now keep it commented out. TODO
DEFINES += LIGER QT_NO_CAST_TO_ASCII #QT_NO_CAST_FROM_ASCII
!macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION
unix {
CONFIG(debug, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
CONFIG(release, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
CONFIG(debug, debug|release):MOC_DIR = $${OUT_PWD}/.moc/debug-shared
CONFIG(release, debug|release):MOC_DIR = $${OUT_PWD}/.moc/release-shared
RCC_DIR = $${OUT_PWD}/.rcc
UI_DIR = $${OUT_PWD}/.uic
}
msvc {
#Don't warn about sprintf, fopen etc being 'unsafe'
DEFINES += _CRT_SECURE_NO_WARNINGS
QMAKE_CXXFLAGS_WARN_ON *= -w44996
# Speed up startup time when debugging with cdb
QMAKE_LFLAGS_DEBUG += /INCREMENTAL:NO
}
qt:greaterThan(QT_MAJOR_VERSION, 4) {
contains(QT, core): QT += concurrent
contains(QT, gui): QT += widgets
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900
}
!isEmpty(QTC_PLUGIN_DEPENDS):LIBS *= -L$$LIGER_PLUGIN_PATH
# recursively resolve plugin deps
done_plugins =
for(ever) {
isEmpty(QTC_PLUGIN_DEPENDS): \
break()
done_plugins += $$QTC_PLUGIN_DEPENDS
for(dep, QTC_PLUGIN_DEPENDS) {
dependencies_file =
for(dir, QTC_PLUGIN_DIRS) {
exists($$dir/$$dep/$${dep}_dependencies.pri) {
dependencies_file = $$dir/$$dep/$${dep}_dependencies.pri
break()
}
}
isEmpty(dependencies_file): \
error("Plugin dependency $$dep not found")
include($$dependencies_file)
LIBS += -l$$qtLibraryName($$QTC_PLUGIN_NAME)
}
QTC_PLUGIN_DEPENDS = $$unique(QTC_PLUGIN_DEPENDS)
QTC_PLUGIN_DEPENDS -= $$unique(done_plugins)
}
# recursively resolve library deps
done_libs =
for(ever) {
isEmpty(QTC_LIB_DEPENDS): \
break()
done_libs += $$QTC_LIB_DEPENDS
for(dep, QTC_LIB_DEPENDS) {
include($$PWD/src/libs/$$dep/$${dep}_dependencies.pri)
LIBS += -l$$qtLibraryName($$QTC_LIB_NAME)
}
QTC_LIB_DEPENDS = $$unique(QTC_LIB_DEPENDS)
QTC_LIB_DEPENDS -= $$unique(done_libs)
}