diff --git a/QGCCommon.pri b/QGCCommon.pri index 430fe34271fd8f5da807447a93c599e3ecfa8d8b..b0284b1b73bf6f7cffba14f7da62493a9dd18782 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 a545aa8873c9392c2160d20e4c0cfd18eb292d30..062249072efb60a5ca8f61e3016e0303734fb4cd 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 5066d6d6b76d7c10dcb2d54097867a56c231a906..f753dc63d0fd4904af02586063a2480f547c22bb 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: