forked from mavlink/qgroundcontrol
-
Notifications
You must be signed in to change notification settings - Fork 2
/
QGCPostLinkCommon.pri
184 lines (163 loc) · 7.32 KB
/
QGCPostLinkCommon.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
################################################################################
#
# (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
#
# QGroundControl is licensed according to the terms in the file
# COPYING.md in the root of the source code directory.
#
################################################################################
# These are the Post Link steps which are common to all builds
QMAKE_POST_LINK += echo "Post Link Common"
#
# Perform platform specific setup
#
MacBuild {
# Qt is screwed up if you use qmake to create an XCode Project which has a DESTDIR set on it.
# This is because XCode builds create the .app in BUILT_PRODUCTS_DIR. If you use a DESTDIR then
# Qt adds a Copy Phase to the build which copies the .app from the BUILT_PRODUCTS_DIR to DESTDIR.
# This causes all sort of problem which are too long to list here. In order to work around this
# We have to duplicate the post link commands here to work from two different locations. And to deal
# with the differences between post list command running in a shell script (XCode) versus a makefile (Qt Creator)
macx-xcode {
# SDL2 Framework
QMAKE_POST_LINK += && rsync -a --delete $$SOURCE_DIR/libs/Frameworks/SDL2.framework $BUILT_PRODUCTS_DIR/$${TARGET}.app/Contents/Frameworks
QMAKE_POST_LINK += && install_name_tool -change "@rpath/SDL2.framework/Versions/A/SDL2" "@executable_path/../Frameworks/SDL2.framework/Versions/A/SDL2" $BUILT_PRODUCTS_DIR/$${TARGET}.app/Contents/MacOS/$${TARGET}
} else {
# SDL2 Framework
QMAKE_POST_LINK += && rsync -a --delete $$SOURCE_DIR/libs/Frameworks/SDL2.framework $${TARGET}.app/Contents/Frameworks
QMAKE_POST_LINK += && install_name_tool -change "@rpath/SDL2.framework/Versions/A/SDL2" "@executable_path/../Frameworks/SDL2.framework/Versions/A/SDL2" $${TARGET}.app/Contents/MacOS/$${TARGET}
}
}
WindowsBuild {
#BASEDIR_WIN = $$replace(SOURCE_DIR, "/", "\\")
QT_BIN_DIR = $$dirname(QMAKE_QMAKE)
# Copy dependencies
DebugBuild: DLL_QT_DEBUGCHAR = "d"
ReleaseBuild: DLL_QT_DEBUGCHAR = ""
COPY_FILE_LIST = \
$$SOURCE_DIR\\libs\\sdl2\\msvc\\lib\\x64\\SDL2.dll \
$$SOURCE_DIR\\libs\\OpenSSL\\windows\\libcrypto-1_1-x64.dll \
$$SOURCE_DIR\\libs\\OpenSSL\\windows\\libssl-1_1-x64.dll
for(COPY_FILE, COPY_FILE_LIST) {
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"$$COPY_FILE\" \"$$DESTDIR\"
}
ReleaseBuild {
# Copy Visual Studio DLLs
# Note that this is only done for release because the debugging versions of these DLLs cannot be redistributed.
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"$$SOURCE_DIR\\libs\\Microsoft\\windows\\msvcp140.dll\" \"$$DESTDIR\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"$$SOURCE_DIR\\libs\\Microsoft\\windows\\msvcp140_1.dll\" \"$$DESTDIR\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"$$SOURCE_DIR\\libs\\Microsoft\\windows\\msvcp140_2.dll\" \"$$DESTDIR\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"$$SOURCE_DIR\\libs\\Microsoft\\windows\\vcruntime140.dll\" \"$$DESTDIR\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"$$SOURCE_DIR\\libs\\Microsoft\\windows\\vcruntime140_1.dll\" \"$$DESTDIR\"
}
DEPLOY_TARGET = $$shell_quote($$shell_path($$DESTDIR\\$${TARGET}.exe))
QMAKE_POST_LINK += $$escape_expand(\\n) $$QT_BIN_DIR\\windeployqt --qmldir=$${SOURCE_DIR}\\src $${DEPLOY_TARGET}
}
LinuxBuild {
QMAKE_POST_LINK += && mkdir -p $$DESTDIR/Qt/lib && mkdir -p $$DESTDIR/Qt/plugins
QMAKE_RPATHDIR += $ORIGIN/Qt/lib
# QT_INSTALL_LIBS
QT_LIB_LIST += \
libicudata.so.56 \
libQt6LabsFolderListModel.so.6 \
libQt6QmlCore.so.6 \
libQt6QuickDialogs2Utils.so.6 \
libQt6Svg.so.6 \
libicui18n.so.56 \
libQt6LabsQmlModels.so.6 \
libQt6QmlLocalStorage.so.6 \
libQt6QuickEffects.so.6 \
libQt6Test.so.6 \
libicuuc.so.56 \
libQt6Location.so.6 \
libQt6QmlModels.so.6 \
libQt6QuickLayouts.so.6 \
libQt6TextToSpeech.so.6 \
libQt6ChartsQml.so.6 \
libQt6MultimediaQuick.so.6 \
libQt6Qml.so.6 \
libQt6QuickParticles.so.6 \
libQt6Widgets.so.6 \
libQt6Charts.so.6 \
libQt6Multimedia.so.6 \
libQt6QmlWorkerScript.so.6 \
libQt6QuickShapes.so.6 \
libQt6XcbQpa.so.6 \
libQt6Core5Compat.so.6 \
libQt6Network.so.6 \
libQt6QmlXmlListModel.so.6 \
libQt6Quick.so.6 \
libQt6Xml.so.6 \
libQt6Core.so.6 \
libQt6OpenGL.so.6 \
libQt6QuickControls2Impl.so.6 \
libQt6QuickTemplates2.so.6\
libQt6DBus.so.6 \
libQt6OpenGLWidgets.so.6 \
libQt6QuickControls2.so.6 \
libQt6SerialPort.so.6 \
libQt6Gui.so.6 \
libQt6PositioningQuick.so.6 \
libQt6QuickDialogs2QuickImpl.so.6 \
libQt6ShaderTools.so.6 \
libQt6LabsAnimation.so.6 \
libQt6Positioning.so.6 \
libQt6QuickDialogs2.so.6 \
libQt6Sql.so.6
# Not all Qt libs are built in all systems. CI doesn't build Wayland, for example.
QT_LIB_OPTIONALS = \
libQt5WaylandClient.so.5 \
libQt5WaylandCompositor.so.5
for(QT_LIB, QT_LIB_OPTIONALS) {
exists("$$[QT_INSTALL_LIBS]/$$QT_LIB") {
QT_LIB_LIST += $$QT_LIB
}
}
exists($$[QT_INSTALL_LIBS]/libicudata.so.56) {
# Some Qt distributions link with *.so.56
QT_LIB_LIST += \
libicudata.so.56 \
libicui18n.so.56 \
libicuuc.so.56
} else {
QT_LIB_LIST += \
libicudata.so \
libicui18n.so \
libicuuc.so
}
# Copy only if non-existing to avoid file timestamp updates
for(QT_LIB, QT_LIB_LIST) {
QMAKE_POST_LINK += && $$QMAKE_COPY -n --dereference $$[QT_INSTALL_LIBS]/$$QT_LIB $$DESTDIR/Qt/lib/
}
# QT_INSTALL_PLUGINS
QT_PLUGIN_LIST = \
geoservices \
iconengines \
imageformats \
platforminputcontexts \
platforms \
position \
sqldrivers \
texttospeech \
multimedia
!contains(DEFINES, __rasp_pi2__) {
QT_PLUGIN_LIST += xcbglintegrations
}
for(QT_PLUGIN, QT_PLUGIN_LIST) {
QMAKE_POST_LINK += && $$QMAKE_COPY -n --dereference --recursive $$[QT_INSTALL_PLUGINS]/$$QT_PLUGIN $$DESTDIR/Qt/plugins/
}
# QT_INSTALL_QML
QMAKE_POST_LINK += && $$QMAKE_COPY -n --dereference --recursive $$[QT_INSTALL_QML] $$DESTDIR/Qt/
# QGroundControl start script
contains (CONFIG, QGC_DISABLE_CUSTOM_BUILD) | !exists($$PWD/custom/custom.pri) {
QMAKE_POST_LINK += && $$QMAKE_COPY $$SOURCE_DIR/deploy/qgroundcontrol-start.sh $$DESTDIR
QMAKE_POST_LINK += && $$QMAKE_COPY $$SOURCE_DIR/deploy/qgroundcontrol.desktop $$DESTDIR
QMAKE_POST_LINK += && $$QMAKE_COPY $$SOURCE_DIR/resources/icons/qgroundcontrol.png $$DESTDIR
} else {
include($$PWD/custom/custom_deploy.pri)
}
# FIXME-QT6 I don't think this is needed any more -testing
#QMAKE_POST_LINK += && SEARCHDIR="$$DESTDIR/Qt" RPATHDIR="$$DESTDIR/Qt/lib" "$$PWD/deploy/linux-fixup-rpaths.bash"
# https://doc.qt.io/qt-5/qt-conf.html
QMAKE_POST_LINK += && $$QMAKE_COPY "$$SOURCE_DIR/deploy/qt.conf" "$$DESTDIR"
}