QGCPostLinkInstaller.pri 3.68 KB
Newer Older
Gus Grubba's avatar
Gus Grubba committed
1 2 3 4 5 6 7 8
################################################################################
#
# (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.
#
################################################################################
9

Don Gagne's avatar
Don Gagne committed
10 11
# These are the Post Link steps which are specific to installer builds

12
installer {
13
    DEFINES += QGC_INSTALL_RELEASE
14
    MacBuild {
Don Gagne's avatar
Don Gagne committed
15
        #QMAKE_POST_LINK += && rsync -a --delete $BUILT_PRODUCTS_DIR/$${TARGET}.app .
16 17 18
        VideoEnabled {
            # Install the gstreamer framework
            # This will:
dogmaphobic's avatar
dogmaphobic committed
19
            # Copy from the original distibution into DESTDIR/gstwork (if not already there)
20 21 22 23
            # Prune the framework, removing stuff we don't need
            # Relocate all dylibs so they can work under @executable_path/...
            # Copy the result into the app bundle
            # Make sure qgroundcontrol can find them
DonLakeFlyer's avatar
DonLakeFlyer committed
24
            QMAKE_POST_LINK += && $$SOURCE_DIR/tools/prepare_gstreamer_framework.sh $${OUT_PWD}/gstwork/ $${TARGET}.app $${TARGET}
25
        }
DonLakeFlyer's avatar
DonLakeFlyer committed
26

Don Gagne's avatar
Don Gagne committed
27
        QMAKE_POST_LINK += && echo macdeployqt
DonLakeFlyer's avatar
DonLakeFlyer committed
28
        QMAKE_POST_LINK += && $$dirname(QMAKE_QMAKE)/macdeployqt $${TARGET}.app -appstore-compliant -verbose=1 -qmldir=$${SOURCE_DIR}/src
DonLakeFlyer's avatar
DonLakeFlyer committed
29 30

        # macdeployqt is missing some relocations once in a while. "Fix" it:
Don Gagne's avatar
Don Gagne committed
31
        QMAKE_POST_LINK += && echo osxrelocator
DonLakeFlyer's avatar
DonLakeFlyer committed
32
        QMAKE_POST_LINK += && python $$SOURCE_DIR/tools/osxrelocator.py $${TARGET}.app/Contents @rpath @executable_path/../Frameworks -r > /dev/null 2>&1
DonLakeFlyer's avatar
DonLakeFlyer committed
33

34
        # Create package
Don Gagne's avatar
Don Gagne committed
35 36
        QMAKE_POST_LINK += && echo hdiutil
        QMAKE_POST_LINK += && mkdir -p package
Don Gagne's avatar
Don Gagne committed
37 38
        QMAKE_POST_LINK += && mkdir -p staging
        QMAKE_POST_LINK += && rsync -a --delete $${TARGET}.app staging
Don Gagne's avatar
Don Gagne committed
39 40
        QMAKE_POST_LINK += && hdiutil create /tmp/tmp.dmg -ov -volname "$${TARGET}-$${MAC_VERSION}" -fs HFS+ -srcfolder "staging"
        QMAKE_POST_LINK += && hdiutil convert /tmp/tmp.dmg -format UDBZ -o package/$${TARGET}.dmg
41
        QMAKE_POST_LINK += && rm /tmp/tmp.dmg
42 43
    }
    WindowsBuild {
DonLakeFlyer's avatar
DonLakeFlyer committed
44
        QMAKE_POST_LINK += $$escape_expand(\\n) $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" $$(QGC_NSIS_INSTALLER_PARAMETERS) /DDRIVER_MSI="$$SOURCE_DIR\\deploy\\driver.msi" /DINSTALLER_ICON="\"$${QGC_INSTALLER_ICON}\"" /DHEADER_BITMAP="\"$${QGC_INSTALLER_HEADER_BITMAP}\"" /DAPPNAME="\"$${QGC_APP_NAME}\"" /DEXENAME="\"$${TARGET}\"" /DORGNAME="\"$${QGC_ORG_NAME}\"" /DDESTDIR=$${DESTDIR} /NOCD "\"/XOutFile $${DESTDIR}\\$${TARGET}-installer.exe\"" "$$SOURCE_DIR\\deploy\\qgroundcontrol_installer.nsi")
45
        OTHER_FILES += deploy/qgroundcontrol_installer.nsi
46
    }
47
    LinuxBuild {
dogmaphobic's avatar
dogmaphobic committed
48
        #-- TODO: This uses hardcoded paths. It should use $${DESTDIR}
DonLakeFlyer's avatar
DonLakeFlyer committed
49 50
        QMAKE_POST_LINK += && mkdir -p package
        QMAKE_POST_LINK += && tar -cj --exclude='package' -f package/QGroundControl.tar.bz2 staging --transform 's/$${DESTDIR}/qgroundcontrol/'
51
    }
52
    AndroidBuild {
Don Gagne's avatar
Don Gagne committed
53 54
        QMAKE_POST_LINK += && mkdir -p package
        QMAKE_POST_LINK += && make install INSTALL_ROOT=android-build/
DonLakeFlyer's avatar
DonLakeFlyer committed
55
        QMAKE_POST_LINK += && androiddeployqt --input android-libQGroundControl.so-deployment-settings.json --output android-build --deployment bundled --gradle --sign $${SOURCE_DIR}/android/android_release.keystore dagar --storepass $$(ANDROID_STOREPASS)
56 57 58 59 60 61 62
        contains(QT_ARCH, arm) {
            QGC_APK_BITNESS = "32"
        } else:contains(QT_ARCH, arm64) {
            QGC_APK_BITNESS = "64"
        } else {
            QGC_APK_BITNESS = ""
        }
Don Gagne's avatar
Don Gagne committed
63
        QMAKE_POST_LINK += && cp android-build/build/outputs/apk/android-build-release-signed.apk package/QGroundControl$${QGC_APK_BITNESS}.apk
64
    }
65
}