From 42f5102770aee3ed6a2ad9851363b3f166cb9f3b Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 11 Jun 2020 11:04:20 -0700 Subject: [PATCH] More --- QGCCommon.pri | 7 ++++++- QGCPostLinkCommon.pri | 37 +++++++++++++++++++++++++------------ QGCPostLinkInstaller.pri | 1 + 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/QGCCommon.pri b/QGCCommon.pri index 430fe3427..b0284b1b7 100644 --- a/QGCCommon.pri +++ b/QGCCommon.pri @@ -114,7 +114,7 @@ linux { QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6 } #-- Not forcing anything. Let qmake find the latest, installed SDK. - QMAKE_MAC_SDK = macosx10.15 + #QMAKE_MAC_SDK = macosx10.15 QMAKE_CXXFLAGS += -fvisibility=hidden QMAKE_CXXFLAGS_WARN_ON += -Werror \ -Wno-unused-parameter # gst-plugins-good @@ -154,6 +154,11 @@ linux|macx|ios { } } +!MacBuild { + # See QGCPostLinkCommon.pri for details on why MacBuild doesn't set DESTDIR + DESTDIR = staging +} + MobileBuild { DEFINES += __mobile__ } diff --git a/QGCPostLinkCommon.pri b/QGCPostLinkCommon.pri index a545aa887..062249072 100644 --- a/QGCPostLinkCommon.pri +++ b/QGCPostLinkCommon.pri @@ -14,19 +14,32 @@ # MacBuild { + QMAKE_POST_LINK += echo "Post Link Common" + + # 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 { - # XCode Project builds create the .app in BUILT_PRODUCTS_DIR. Copy it to the normal location for QtCreator builds. - QMAKE_POST_LINK += cp -r $BUILT_PRODUCTS_DIR/$${TARGET}.app . - } - - # Copy non-standard frameworks into app package - QMAKE_POST_LINK += rsync -a --delete $$BASEDIR/libs/Frameworks $${TARGET}.app/Contents/ - # SDL2 Framework - 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} - # AirMap - contains (DEFINES, QGC_AIRMAP_ENABLED) { - QMAKE_POST_LINK += && rsync -a $$BASEDIR/libs/airmapd/macOS/$$AIRMAP_QT_PATH/* $${TARGET}.app/Contents/Frameworks/ - QMAKE_POST_LINK += && install_name_tool -change "@rpath/libairmap-qt.0.0.1.dylib" "@executable_path/../Frameworks/libairmap-qt.0.0.1.dylib" $${TARGET}.app/Contents/MacOS/$${TARGET} + # SDL2 Framework + QMAKE_POST_LINK += && rsync -a --delete $$BASEDIR/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} + # AirMap + contains (DEFINES, QGC_AIRMAP_ENABLED) { + QMAKE_POST_LINK += && rsync -a $$BASEDIR/libs/airmapd/macOS/$$AIRMAP_QT_PATH/* $BUILT_PRODUCTS_DIR/$${TARGET}.app/Contents/Frameworks/ + QMAKE_POST_LINK += && install_name_tool -change "@rpath/libairmap-qt.0.0.1.dylib" "@executable_path/../Frameworks/libairmap-qt.0.0.1.dylib" $BUILT_PRODUCTS_DIR/$${TARGET}.app/Contents/MacOS/$${TARGET} + } + } else { + # SDL2 Framework + QMAKE_POST_LINK += && rsync -a --delete $$BASEDIR/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} + # AirMap + contains (DEFINES, QGC_AIRMAP_ENABLED) { + QMAKE_POST_LINK += && rsync -a $$BASEDIR/libs/airmapd/macOS/$$AIRMAP_QT_PATH/* $${TARGET}.app/Contents/Frameworks/ + QMAKE_POST_LINK += && install_name_tool -change "@rpath/libairmap-qt.0.0.1.dylib" "@executable_path/../Frameworks/libairmap-qt.0.0.1.dylib" $${TARGET}.app/Contents/MacOS/$${TARGET} + } } } diff --git a/QGCPostLinkInstaller.pri b/QGCPostLinkInstaller.pri index 5066d6d6b..f753dc63d 100644 --- a/QGCPostLinkInstaller.pri +++ b/QGCPostLinkInstaller.pri @@ -12,6 +12,7 @@ installer { DEFINES += QGC_INSTALL_RELEASE MacBuild { + #QMAKE_POST_LINK += && rsync -a --delete $BUILT_PRODUCTS_DIR/$${TARGET}.app . VideoEnabled { # Install the gstreamer framework # This will: -- 2.22.0