forked from mavlink/qgroundcontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
QGCSetup.pri
239 lines (212 loc) · 10.8 KB
/
QGCSetup.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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# -------------------------------------------------
# QGroundControl - Micro Air Vehicle Groundstation
# Please see our website at <http://qgroundcontrol.org>
# Maintainer:
# Lorenz Meier <lm@inf.ethz.ch>
# (c) 2009-2011 QGroundControl Developers
# This file is part of the open groundstation project
# QGroundControl is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# QGroundControl is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with QGroundControl. If not, see <http://www.gnu.org/licenses/>.
# -------------------------------------------------
QMAKE_POST_LINK += echo "Copying files"
AndroidBuild {
INSTALLS += $$DESTDIR
}
#
# Copy the application resources to the associated place alongside the application
#
LinuxBuild {
DESTDIR_COPY_RESOURCE_LIST = $$DESTDIR
}
MacBuild {
DESTDIR_COPY_RESOURCE_LIST = $$DESTDIR/$${TARGET}.app/Contents/MacOS
}
# Windows version of QMAKE_COPY_DIR of course doesn't work the same as Mac/Linux. It will only
# copy the contents of the source directory. It doesn't create the top level source directory
# in the target.
WindowsBuild {
# Make sure to keep both side of this if using the same set of directories
DESTDIR_COPY_RESOURCE_LIST = $$replace(DESTDIR,"/","\\")
BASEDIR_COPY_RESOURCE_LIST = $$replace(BASEDIR,"/","\\")
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$BASEDIR_COPY_RESOURCE_LIST\\flightgear\" \"$$DESTDIR_COPY_RESOURCE_LIST\\flightgear\"
} else {
!MobileBuild {
# Make sure to keep both sides of this if using the same set of directories
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR $$BASEDIR/flightgear $$DESTDIR_COPY_RESOURCE_LIST
}
}
#
# Perform platform specific setup
#
MacBuild {
# Copy non-standard libraries and frameworks into app package
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR $$BASEDIR/libs/lib/mac64/lib $$DESTDIR/$${TARGET}.app/Contents/libs
QMAKE_POST_LINK += && rsync -a --delete $$BASEDIR/libs/lib/Frameworks $$DESTDIR/$${TARGET}.app/Contents/
# Fix library paths inside executable
INSTALL_NAME_TARGET = $$DESTDIR/$${TARGET}.app/Contents/MacOS/$${TARGET}
INSTALL_NAME_LIB_LIST = \
libOpenThreads.dylib \
libosg.dylib \
libosgViewer.dylib \
libosgGA.dylib \
libosgDB.dylib \
libosgText.dylib \
libosgWidget.dylib
for(INSTALL_NAME_LIB, INSTALL_NAME_LIB_LIST) {
QMAKE_POST_LINK += && install_name_tool -change $$INSTALL_NAME_LIB "@executable_path/../libs/$${INSTALL_NAME_LIB}" $$INSTALL_NAME_TARGET
}
# Fix library paths within libraries (inter-library dependencies)
# OSG GA LIBRARY
INSTALL_NAME_TARGET = $$DESTDIR/$${TARGET}.app/Contents/libs/libosgGA.dylib
INSTALL_NAME_LIB_LIST = \
libOpenThreads.dylib \
libosg.dylib \
libosgGA.dylib \
libosgDB.dylib \
libosgUtil.dylib
for(INSTALL_NAME_LIB, INSTALL_NAME_LIB_LIST) {
QMAKE_POST_LINK += && install_name_tool -change $$INSTALL_NAME_LIB "@executable_path/../libs/$${INSTALL_NAME_LIB}" $$INSTALL_NAME_TARGET
}
# OSG DB LIBRARY
INSTALL_NAME_TARGET = $$DESTDIR/$${TARGET}.app/Contents/libs/libosgDB.dylib
INSTALL_NAME_LIB_LIST = \
libOpenThreads.dylib \
libosg.dylib \
libosgDB.dylib \
libosgUtil.dylib
for(INSTALL_NAME_LIB, INSTALL_NAME_LIB_LIST) {
QMAKE_POST_LINK += && install_name_tool -change $$INSTALL_NAME_LIB "@executable_path/../libs/$${INSTALL_NAME_LIB}" $$INSTALL_NAME_TARGET
}
# OSG TEXT LIBRARY
INSTALL_NAME_TARGET = $$DESTDIR/$${TARGET}.app/Contents/libs/libosgText.dylib
INSTALL_NAME_LIB_LIST = \
libOpenThreads.dylib \
libosg.dylib \
libosgDB.dylib \
libosgUtil.dylib \
libosgText.dylib
for(INSTALL_NAME_LIB, INSTALL_NAME_LIB_LIST) {
QMAKE_POST_LINK += && install_name_tool -change $$INSTALL_NAME_LIB "@executable_path/../libs/$${INSTALL_NAME_LIB}" $$INSTALL_NAME_TARGET
}
# OSG UTIL LIBRARY
INSTALL_NAME_TARGET = $$DESTDIR/$${TARGET}.app/Contents/libs/libosgUtil.dylib
INSTALL_NAME_LIB_LIST = \
libOpenThreads.dylib \
libosg.dylib
for(INSTALL_NAME_LIB, INSTALL_NAME_LIB_LIST) {
QMAKE_POST_LINK += && install_name_tool -change $$INSTALL_NAME_LIB "@executable_path/../libs/$${INSTALL_NAME_LIB}" $$INSTALL_NAME_TARGET
}
# OSG VIEWER LIBRARY
INSTALL_NAME_TARGET = $$DESTDIR/$${TARGET}.app/Contents/libs/libosgViewer.dylib
INSTALL_NAME_LIB_LIST = \
libOpenThreads.dylib \
libosg.dylib \
libosgGA.dylib \
libosgDB.dylib \
libosgUtil.dylib \
libosgText.dylib
for(INSTALL_NAME_LIB, INSTALL_NAME_LIB_LIST) {
QMAKE_POST_LINK += && install_name_tool -change $$INSTALL_NAME_LIB "@executable_path/../libs/$${INSTALL_NAME_LIB}" $$INSTALL_NAME_TARGET
}
# OSG WIDGET LIBRARY
INSTALL_NAME_TARGET = $$DESTDIR/$${TARGET}.app/Contents/libs/libosgWidget.dylib
INSTALL_NAME_LIB_LIST = \
libOpenThreads.dylib \
libosg.dylib \
libosgGA.dylib \
libosgDB.dylib \
libosgUtil.dylib \
libosgText.dylib \
libosgViewer.dylib
for(INSTALL_NAME_LIB, INSTALL_NAME_LIB_LIST) {
QMAKE_POST_LINK += && install_name_tool -change $$INSTALL_NAME_LIB "@executable_path/../libs/$${INSTALL_NAME_LIB}" $$INSTALL_NAME_TARGET
}
# CORE OSG LIBRARY
QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$DESTDIR/$${TARGET}.app/Contents/libs/libosg.dylib
# SDL Framework
QMAKE_POST_LINK += && install_name_tool -change "@rpath/SDL.framework/Versions/A/SDL" "@executable_path/../Frameworks/SDL.framework/Versions/A/SDL" $$DESTDIR/$${TARGET}.app/Contents/MacOS/$${TARGET}
}
WindowsBuild {
BASEDIR_WIN = $$replace(BASEDIR, "/", "\\")
DESTDIR_WIN = $$replace(DESTDIR, "/", "\\")
D_DIR = $$[QT_INSTALL_LIBEXECS]
DLL_DIR = $$replace(D_DIR, "/", "\\")
# Copy dependencies
DebugBuild: DLL_QT_DEBUGCHAR = "d"
ReleaseBuild: DLL_QT_DEBUGCHAR = ""
COPY_FILE_LIST = \
$$BASEDIR\\libs\\lib\\sdl\\win32\\SDL.dll \
$$BASEDIR\\libs\\thirdParty\\libxbee\\lib\\libxbee.dll \
$$DLL_DIR\\icu*.dll \
$$DLL_DIR\\Qt5Core$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5Gui$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5Location$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5Multimedia$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5MultimediaWidgets$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5Network$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5OpenGL$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5Positioning$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5PrintSupport$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5Qml$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5Quick$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5QuickWidgets$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5Sensors$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5SerialPort$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5Sql$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5Svg$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5Test$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5WebKit$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5WebKitWidgets$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5Widgets$${DLL_QT_DEBUGCHAR}.dll \
$$DLL_DIR\\Qt5Xml$${DLL_QT_DEBUGCHAR}.dll
for(COPY_FILE, COPY_FILE_LIST) {
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"$$COPY_FILE\" \"$$DESTDIR_WIN\"
}
# Copy platform plugins
P_DIR = $$[QT_INSTALL_PLUGINS]
PLUGINS_DIR_WIN = $$replace(P_DIR, "/", "\\")
QMAKE_POST_LINK += $$escape_expand(\\n) mkdir "$$DESTDIR_WIN\\platforms"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"$$PLUGINS_DIR_WIN\\platforms\\qwindows$${DLL_QT_DEBUGCHAR}.dll\" \"$$DESTDIR_WIN\\platforms\\qwindows$${DLL_QT_DEBUGCHAR}.dll\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$PLUGINS_DIR_WIN\\imageformats\" \"$$DESTDIR_WIN\\imageformats\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$PLUGINS_DIR_WIN\\sqldrivers\" \"$$DESTDIR_WIN\\sqldrivers\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$PLUGINS_DIR_WIN\\bearer\" \"$$DESTDIR_WIN\\bearer\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$PLUGINS_DIR_WIN\\iconengines\" \"$$DESTDIR_WIN\\iconengines\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$PLUGINS_DIR_WIN\\printsupport\" \"$$DESTDIR_WIN\\printsupport\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$PLUGINS_DIR_WIN\\qmltooling\" \"$$DESTDIR_WIN\\qmltooling\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$PLUGINS_DIR_WIN\\geoservices\" \"$$DESTDIR_WIN\\geoservices\"
# Copy Qml libraries
Q_DIR = $$[QT_INSTALL_QML]
QML_DIR_WIN = $$replace(Q_DIR, "/", "\\")
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$QML_DIR_WIN\\QtGraphicalEffects\" \"$$DESTDIR_WIN\\QtGraphicalEffects\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$QML_DIR_WIN\\QtQuick\" \"$$DESTDIR_WIN\\QtQuick\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$QML_DIR_WIN\\QtQuick.2\" \"$$DESTDIR_WIN\\QtQuick.2\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$QML_DIR_WIN\\QtLocation\" \"$$DESTDIR_WIN\\QtLocation\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$QML_DIR_WIN\\QtPositioning\" \"$$DESTDIR_WIN\\QtPositioning\"
ReleaseBuild {
# Copy Visual Studio DLLs
# Note that this is only done for release because the debugging versions of these DLLs cannot be redistributed.
win32-msvc2010 {
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"C:\\Windows\\System32\\msvcp100.dll\" \"$$DESTDIR_WIN\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"C:\\Windows\\System32\\msvcr100.dll\" \"$$DESTDIR_WIN\"
}
else:win32-msvc2012 {
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"C:\\Windows\\System32\\msvcp110.dll\" \"$$DESTDIR_WIN\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"C:\\Windows\\System32\\msvcr110.dll\" \"$$DESTDIR_WIN\"
}
else:win32-msvc2013 {
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"C:\\Windows\\System32\\msvcp120.dll\" \"$$DESTDIR_WIN\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"C:\\Windows\\System32\\msvcr120.dll\" \"$$DESTDIR_WIN\"
}
else {
error("Visual studio version not supported, installation cannot be completed.")
}
}
}