forked from ArduPilot/apm_planner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
QGCSetup.pri
170 lines (138 loc) · 6.98 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
# -------------------------------------------------
# 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 += $$quote(echo "Copying files")
#
# Copy the application resources to the associated place alongside the application
#
# Dev note: Used to move "files","data","sik_uploader", and "qml".
# Fow now only the last two
LinuxBuild {
DESTDIR_COPY_RESOURCE_LIST = $$DESTDIR
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR $$BASEDIR/qml $$DESTDIR_COPY_RESOURCE_LIST
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR $$BASEDIR/sik_uploader $$DESTDIR_COPY_RESOURCE_LIST
}
MacBuild {
DESTDIR_COPY_RESOURCE_LIST = $$DESTDIR/$${TARGET}.app/Contents/MacOS
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR $$BASEDIR/qml $$DESTDIR_COPY_RESOURCE_LIST
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR $$BASEDIR/sik_uploader $$DESTDIR_COPY_RESOURCE_LIST
}
WindowsCrossBuild {
DESTDIR_COPY_RESOURCE_LIST = $$DESTDIR
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR $$BASEDIR/qml $$DESTDIR_COPY_RESOURCE_LIST
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR $$BASEDIR/sik_uploader $$DESTDIR_COPY_RESOURCE_LIST
}
# 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\\qml\" \"$$DESTDIR_COPY_RESOURCE_LIST\\qml\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$BASEDIR_COPY_RESOURCE_LIST\\sik_uploader\" \"$$DESTDIR_COPY_RESOURCE_LIST\\sik_uploader\"
}
#
# Perform platform specific setup
#
LinuxBuild {
#Installer section
BINDIR = $$PREFIX/bin
DATADIR =$$PREFIX/share
DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\"
#MAKE INSTALL - copy files
INSTALLS += target radioup_bin radioup_firmware datafiles desktopLink
target.path =$$BINDIR
radioup_bin.path = $$BINDIR
radioup_bin.files += $$BASEDIR/sik_uploader/sik_uploader.py
radioup_firmware.path = $$DATADIR/sik_uploader
radioup_firmware.files += $$BASEDIR/sik_uploader/firmware
datafiles.path = $$DATADIR/APMPlanner2
datafiles.files += $$BASEDIR/files
datafiles.files += $$BASEDIR/data
datafiles.files += $$BASEDIR/qml
desktopLink.path = $$DATADIR/applications
desktopLink.files += $$BASEDIR/common/apmplanner2.desktop
}
DebianIntegration {
INSTALLS += menuLink
menuLink.path = $$DATADIR/menu
menuLink.files += $$BASEDIR/debian/apmplanner2.menu
}
MacBuild {
# Copy libraries and frameworks into app package
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR -L $$BASEDIR/libs/lib/Frameworks $$DESTDIR/$${TARGET}.app/Contents/Frameworks
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR -L $$[QT_INSTALL_PREFIX]/qml/QtQuick $$DESTDIR/$${TARGET}.app/Contents/MacOS/qml/QtQuick
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR -L $$[QT_INSTALL_PREFIX]/qml/QtQuick.2 $$DESTDIR/$${TARGET}.app/Contents/MacOS/qml/QtQuick.2
# SDL Framework
QMAKE_POST_LINK += && install_name_tool -change "@rpath/SDL2.framework/Versions/A/SDL2" "@executable_path/../Frameworks/SDL2.framework/Versions/A/SDL2" $$DESTDIR/$${TARGET}.app/Contents/MacOS/$${TARGET}
}
WindowsCrossBuild {
# Copy dependencies
DebugBuild: DLL_QT_DEBUGCHAR = "d"
ReleaseBuild: DLL_QT_DEBUGCHAR = ""
COPY_FILE_LIST = \
$$BASEDIR/libs/lib/sdl/win32/SDL2.dll \
$$BASEDIR/libs/thirdParty/libxbee/lib/libxbee.dll \
$$[QT_INSTALL_PREFIX]/bin/libgcc_s_dw2-1.dll \
$$[QT_INSTALL_PREFIX]/bin/libwinpthread-1.dll \
$$[QT_INSTALL_PREFIX]/bin/libstdc++-6.dll
for(COPY_FILE, COPY_FILE_LIST) {
QMAKE_POST_LINK += && $$QMAKE_COPY $$COPY_FILE $$DESTDIR_COPY_RESOURCE_LIST
}
DEPLOY_TARGET = $$DESTDIR/$${TARGET}.exe
QMAKE_POST_LINK += && windeployqt --no-compiler-runtime --qmldir=$${BASEDIR}/qml $${DEPLOY_TARGET}
}
WindowsBuild {
BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
DESTDIR_WIN = $$replace(DESTDIR,"/","\\")
# Copy dependencies
DebugBuild: DLL_QT_DEBUGCHAR = "d"
ReleaseBuild: DLL_QT_DEBUGCHAR = ""
COPY_FILE_LIST = \
$$BASEDIR_WIN\\libs\\thirdParty\\libxbee\\lib\\libxbee.dll \
contains(QT_ARCH, i386) {
COPY_FILE_LIST += $$BASEDIR_WIN\\libs\\lib\\sdl\\msvc\\lib\\x86\\SDL2.dll
}else {
COPY_FILE_LIST += $$BASEDIR_WIN\\libs\\lib\\sdl\\msvc\\lib\\x64\\SDL2.dll
}
for(COPY_FILE, COPY_FILE_LIST) {
QMAKE_POST_LINK += $$escape_expand(\\n) $$quote($$QMAKE_COPY "$$COPY_FILE" "$$DESTDIR_WIN")
}
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.")
}
}
DEPLOY_TARGET = $$shell_quote($$shell_path($$DESTDIR_WIN\\$${TARGET}.exe))
QMAKE_POST_LINK += $$escape_expand(\\n) windeployqt --no-compiler-runtime --qmldir=$${BASEDIR_WIN}\\qml $${DEPLOY_TARGET}
}