Skip to content

Commit

Permalink
Done for now
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmaphobic committed Nov 12, 2015
1 parent 5dbc0d5 commit 25a7957
Show file tree
Hide file tree
Showing 1,277 changed files with 185 additions and 179,048 deletions.
44 changes: 28 additions & 16 deletions QGCApplication.pro
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ include(QGCCommon.pri)

TARGET = qgroundcontrol
TEMPLATE = app
DESTDIR = $${OUT_PWD}/build

DebugBuild {
DESTDIR = $${OUT_PWD}/debug
} else {
DESTDIR = $${OUT_PWD}/release
}

# Load additional config flags from user_config.pri
exists(user_config.pri):infile(user_config.pri, CONFIG) {
Expand All @@ -35,7 +40,7 @@ LinuxBuild {

# QGC QtLocation plugin (for ios, it's all compiled in with the rest.)

!ios {
!iOSBuild {
LIBS += -L$${LOCATION_PLUGIN_DESTDIR}
LIBS += -l$${LOCATION_PLUGIN_NAME}
}
Expand Down Expand Up @@ -78,18 +83,25 @@ QT += testlib
#

MacBuild {
QMAKE_INFO_PLIST = Custom-Info.plist
ICON = $${BASEDIR}/resources/icons/macx.icns
OTHER_FILES += Custom-Info.plist
QMAKE_INFO_PLIST = Custom-Info.plist
ICON = $${BASEDIR}/resources/icons/macx.icns
OTHER_FILES += Custom-Info.plist
}

iOSBuild {
QMAKE_INFO_PLIST = $${BASEDIR}/ios/iOS-Info.plist
OTHER_FILES += $${BASEDIR}/ios/iOS-Info.plist
BUNDLE.files = $$files($$PWD/ios/AppIcon*.png) $$PWD/ios/LaunchScreen.xib
BUNDLE.files = $$files($$PWD/ios/AppIcon*.png) $$PWD/ios/QGCLaunchScreen.xib
QMAKE_BUNDLE_DATA += BUNDLE
LIBS += -framework AVFoundation
OBJECTIVE_SOURCES += src/audio/QGCAudioWorker_iOS.mm
#-- Info.plist (need an "official" one for the App Store)
ForAppStore {
message(App Store Build)
QMAKE_INFO_PLIST = $${BASEDIR}/ios/iOSForAppStore-Info.plist
OTHER_FILES += $${BASEDIR}/ios/iOSForAppStore-Info.plist
} else {
QMAKE_INFO_PLIST = $${BASEDIR}/ios/iOS-Info.plist
OTHER_FILES += $${BASEDIR}/ios/iOS-Info.plist
}
#-- TODO: Add iTunesArtwork
}

Expand Down Expand Up @@ -662,6 +674,14 @@ AndroidBuild {
$$PWD/android/src/com/hoho/android/usbserial/driver/UsbSerialRuntimeException.java \
$$PWD/android/src/org/qgroundcontrol/qgchelper/UsbDeviceJNI.java \
$$PWD/android/src/org/qgroundcontrol/qgchelper/UsbIoManager.java

DISTFILES += \
android/gradle/wrapper/gradle-wrapper.jar \
android/gradlew \
android/res/values/libs.xml \
android/build.gradle \
android/gradle/wrapper/gradle-wrapper.properties \
android/gradlew.bat
}

#-------------------------------------------------------------------------------------
Expand All @@ -676,11 +696,3 @@ include(QGCSetup.pri)
#

include(QGCInstaller.pri)

DISTFILES += \
android/gradle/wrapper/gradle-wrapper.jar \
android/gradlew \
android/res/values/libs.xml \
android/build.gradle \
android/gradle/wrapper/gradle-wrapper.properties \
android/gradlew.bat
2 changes: 1 addition & 1 deletion QGCCommon.pri
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ win32:debug_and_release {

BASEDIR = $$IN_PWD

!ios {
!iOSBuild {
OBJECTS_DIR = $${OUT_PWD}/obj
MOC_DIR = $${OUT_PWD}/moc
UI_DIR = $${OUT_PWD}/ui
Expand Down
26 changes: 14 additions & 12 deletions QGCInstaller.pri
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,41 @@ installer {
VideoEnabled {
# Install the gstreamer framework
# This will:
# Copy from the original distibution into libs/lib/Framworks (if not already there)
# Copy from the original distibution into DESTDIR/gstwork (if not already there)
# 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
message("Preparing GStreamer Framework")
QMAKE_POST_LINK += && $$BASEDIR/tools/prepare_gstreamer_framework.sh $$BASEDIR/libs/lib/Frameworks/ $$DESTDIR/$${TARGET}.app $${TARGET}
QMAKE_POST_LINK += && $$BASEDIR/tools/prepare_gstreamer_framework.sh $${OUT_PWD}/gstwork/ $${DESTDIR}/$${TARGET}.app $${TARGET}
} else {
message("Skipping GStreamer Framework")
}
# We cd to release directory so we can run macdeployqt without a path to the
# qgroundcontrol.app file. If you specify a path to the .app file the symbolic
# links to plugins will not be created correctly.
QMAKE_POST_LINK += && cd release && mkdir package
QMAKE_POST_LINK += && $$dirname(QMAKE_QMAKE)/macdeployqt qgroundcontrol.app -verbose=2 -qmldir=../src
QMAKE_POST_LINK += && cd ..
QMAKE_POST_LINK += && cd $${DESTDIR} && mkdir package
QMAKE_POST_LINK += && $$dirname(QMAKE_QMAKE)/macdeployqt qgroundcontrol.app -verbose=2 -qmldir=$${BASEDIR}/src
QMAKE_POST_LINK += && cd $${OUT_PWD}
QMAKE_POST_LINK += && hdiutil create -layout SPUD -srcfolder $${DESTDIR}/qgroundcontrol.app -volname QGroundControl $${DESTDIR}/package/qgroundcontrol.dmg
}
WindowsBuild {
# The pdb moving command are commented out for now since we are including the .pdb in the installer. This makes it much
# easier to debug user crashes.
#QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY $${DESTDIR_WIN}\\qgroundcontrol.pdb
#QMAKE_POST_LINK += $$escape_expand(\\n) del $${DESTDIR_WIN}\\qgroundcontrol.pdb
# The pdb moving command are commented out for now since we are including the .pdb in the installer. This makes it much
# easier to debug user crashes.
#QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY $${DESTDIR_WIN}\\qgroundcontrol.pdb
#QMAKE_POST_LINK += $$escape_expand(\\n) del $${DESTDIR_WIN}\\qgroundcontrol.pdb
QMAKE_POST_LINK += $$escape_expand(\\n) $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /NOCD "\"/XOutFile $${DESTDIR_WIN}\\qgroundcontrol-installer.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
#QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY qgroundcontrol.pdb $${DESTDIR_WIN}
#QMAKE_POST_LINK += $$escape_expand(\\n) del qgroundcontrol.pdb
#QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY qgroundcontrol.pdb $${DESTDIR_WIN}
#QMAKE_POST_LINK += $$escape_expand(\\n) del qgroundcontrol.pdb
OTHER_FILES += deploy/qgroundcontrol_installer.nsi
}
LinuxBuild {
#-- TODO: This uses hardcoded paths. It should use $${DESTDIR}
QMAKE_POST_LINK += && mkdir -p release/package
QMAKE_POST_LINK += && tar -cjf release/package/qgroundcontrol.tar.bz2 release --exclude='package' --transform 's/release/qgroundcontrol/'
QMAKE_POST_LINK += && tar -cjf release/package/qgroundcontrol.tar.bz2 release --exclude='package' --transform 's/release/qgroundcontrol/'
}
AndroidBuild {
#-- TODO: This uses hardcoded paths. It should use $${DESTDIR}
QMAKE_POST_LINK += && mkdir -p release/package
QMAKE_POST_LINK += && make install INSTALL_ROOT=release/android-build/
QMAKE_POST_LINK += && androiddeployqt --input android-libqgroundcontrol.so-deployment-settings.json --output release/android-build --deployment bundled --gradle --sign android/android_release.keystore dagar --storepass $$(ANDROID_STOREPASS)
Expand Down
136 changes: 20 additions & 116 deletions QGCSetup.pri
Original file line number Diff line number Diff line change
Expand Up @@ -51,106 +51,10 @@ WindowsBuild {
#

MacBuild {

# Copy non-standard libraries and frameworks into app package
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR $$BASEDIR/libs/lib/mac64/lib $$DESTDIR/$${TARGET}.app/Contents/libs
# Copy non-standard frameworks into app package
QMAKE_POST_LINK += && rsync -a --delete $$BASEDIR/libs/lib/Frameworks $$DESTDIR/$${TARGET}.app/Contents/

# Fix library paths inside executable

INSTALL_NAME_TARGET = $$DESTDIR/$${TARGET}.app/Contents/MacOS/$${TARGET}
INSTALL_NAME_LIB_LIST = \
libOpenThreads.dylib \
libosg.dylib \
libosgViewer.dylib \
libosgGA.dylib \
libosgDB.dylib \
libosgText.dylib \
libosgWidget.dylib
for(INSTALL_NAME_LIB, INSTALL_NAME_LIB_LIST) {
QMAKE_POST_LINK += && install_name_tool -change $$INSTALL_NAME_LIB "@executable_path/../libs/$${INSTALL_NAME_LIB}" $$INSTALL_NAME_TARGET
}

# Fix library paths within libraries (inter-library dependencies)

# OSG GA LIBRARY
INSTALL_NAME_TARGET = $$DESTDIR/$${TARGET}.app/Contents/libs/libosgGA.dylib
INSTALL_NAME_LIB_LIST = \
libOpenThreads.dylib \
libosg.dylib \
libosgGA.dylib \
libosgDB.dylib \
libosgUtil.dylib
for(INSTALL_NAME_LIB, INSTALL_NAME_LIB_LIST) {
QMAKE_POST_LINK += && install_name_tool -change $$INSTALL_NAME_LIB "@executable_path/../libs/$${INSTALL_NAME_LIB}" $$INSTALL_NAME_TARGET
}

# OSG DB LIBRARY
INSTALL_NAME_TARGET = $$DESTDIR/$${TARGET}.app/Contents/libs/libosgDB.dylib
INSTALL_NAME_LIB_LIST = \
libOpenThreads.dylib \
libosg.dylib \
libosgDB.dylib \
libosgUtil.dylib
for(INSTALL_NAME_LIB, INSTALL_NAME_LIB_LIST) {
QMAKE_POST_LINK += && install_name_tool -change $$INSTALL_NAME_LIB "@executable_path/../libs/$${INSTALL_NAME_LIB}" $$INSTALL_NAME_TARGET
}

# OSG TEXT LIBRARY
INSTALL_NAME_TARGET = $$DESTDIR/$${TARGET}.app/Contents/libs/libosgText.dylib
INSTALL_NAME_LIB_LIST = \
libOpenThreads.dylib \
libosg.dylib \
libosgDB.dylib \
libosgUtil.dylib \
libosgText.dylib
for(INSTALL_NAME_LIB, INSTALL_NAME_LIB_LIST) {
QMAKE_POST_LINK += && install_name_tool -change $$INSTALL_NAME_LIB "@executable_path/../libs/$${INSTALL_NAME_LIB}" $$INSTALL_NAME_TARGET
}

# OSG UTIL LIBRARY
INSTALL_NAME_TARGET = $$DESTDIR/$${TARGET}.app/Contents/libs/libosgUtil.dylib
INSTALL_NAME_LIB_LIST = \
libOpenThreads.dylib \
libosg.dylib
for(INSTALL_NAME_LIB, INSTALL_NAME_LIB_LIST) {
QMAKE_POST_LINK += && install_name_tool -change $$INSTALL_NAME_LIB "@executable_path/../libs/$${INSTALL_NAME_LIB}" $$INSTALL_NAME_TARGET
}


# OSG VIEWER LIBRARY
INSTALL_NAME_TARGET = $$DESTDIR/$${TARGET}.app/Contents/libs/libosgViewer.dylib
INSTALL_NAME_LIB_LIST = \
libOpenThreads.dylib \
libosg.dylib \
libosgGA.dylib \
libosgDB.dylib \
libosgUtil.dylib \
libosgText.dylib
for(INSTALL_NAME_LIB, INSTALL_NAME_LIB_LIST) {
QMAKE_POST_LINK += && install_name_tool -change $$INSTALL_NAME_LIB "@executable_path/../libs/$${INSTALL_NAME_LIB}" $$INSTALL_NAME_TARGET
}

# OSG WIDGET LIBRARY
INSTALL_NAME_TARGET = $$DESTDIR/$${TARGET}.app/Contents/libs/libosgWidget.dylib
INSTALL_NAME_LIB_LIST = \
libOpenThreads.dylib \
libosg.dylib \
libosgGA.dylib \
libosgDB.dylib \
libosgUtil.dylib \
libosgText.dylib \
libosgViewer.dylib
for(INSTALL_NAME_LIB, INSTALL_NAME_LIB_LIST) {
QMAKE_POST_LINK += && install_name_tool -change $$INSTALL_NAME_LIB "@executable_path/../libs/$${INSTALL_NAME_LIB}" $$INSTALL_NAME_TARGET
}

# CORE OSG LIBRARY
QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$DESTDIR/$${TARGET}.app/Contents/libs/libosg.dylib

# SDL Framework
QMAKE_POST_LINK += && install_name_tool -change "@rpath/SDL.framework/Versions/A/SDL" "@executable_path/../Frameworks/SDL.framework/Versions/A/SDL" $$DESTDIR/$${TARGET}.app/Contents/MacOS/$${TARGET}

}

WindowsBuild {
Expand All @@ -165,29 +69,29 @@ WindowsBuild {
$$BASEDIR\\libs\\thirdParty\\libxbee\\lib\\libxbee.dll

for(COPY_FILE, COPY_FILE_LIST) {
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"$$COPY_FILE\" \"$$DESTDIR_WIN\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$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.")
}
}
# 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}\\src $${DEPLOY_TARGET}
Expand Down
16 changes: 4 additions & 12 deletions android_environment.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#----------------------------------------------------------
# You will need:
# - Qt 5.4 android_armv7 kit
# - Qt 5.5.x android_armv7 kit
# - Android SDK
# - Androig NDK
# - Current Java
Expand All @@ -10,7 +10,7 @@
# Update with correct location for these
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_SDK_ROOT=~/Library/Android/sdk
export ANDROID_NDK_ROOT=~/Library/Android/ndk
export ANDROID_NDK_ROOT=~/Library/Android/sdk/ndk-bundle
export ANDROID_NDK_HOST=darwin-x86_64
export ANDROID_NDK_PLATFORM=/android-9
export ANDROID_NDK_TOOLCHAIN_PREFIX=arm-linux-androideabi
Expand All @@ -19,19 +19,11 @@ export ANDROID_NDK_TOOLS_PREFIX=arm-linux-androideabi
#----------------------------------------------------------
# To build it, run (replacing the path with where you have Qt installed)
#
# For a shadow build: (strongly recomended)
#
# >source android_environment.sh
# cd ../
# mkdir android_build
# cd android_build
# >~/local/Qt/5.4/android_armv7/bin/qmake -r -spec android-g++ CONFIG+=debug ../qgroundcontrol/qgroundcontrol.pro
# >make -j24
# >~/local/Qt/5.4/android_armv7/bin/androiddeployqt --input ./android-libqgroundcontrol.so-deployment-settings.json --output ./android-build --deployment bundled --android-platform android-22 --jdk /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home --verbose --ant /opt/local/bin/ant
#
# For an in place build (not recomended)
# >make -j24 install INSTALL_ROOT=./android-build/
# >~/local/Qt/5.4/android_armv7/bin/androiddeployqt --input ./android-libqgroundcontrol.so-deployment-settings.json --output ./android-build --deployment bundled --android-platform android-22 --jdk /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home --verbose --ant /usr/local/bin/ant
#
# >source android_environment.sh
# >~/local/Qt/5.4/android_armv7/bin/qmake -r -spec android-g++ CONFIG+=debug qgroundcontrol.pro
# >make -j24
# >~/local/Qt/5.4/android_armv7/bin/androiddeployqt --input ./android-libqgroundcontrol.so-deployment-settings.json --output ./android-build --deployment bundled --android-platform android-22 --jdk /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home --verbose --ant /opt/local/bin/ant
File renamed without changes.
6 changes: 3 additions & 3 deletions ios/iOS-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.grubba.qgroundcontrol</string>
<string>org.mavlink.qgroundcontrol</string>
<key>CFBundleName</key>
<string>QGroundControl</string>
<key>CFBundlePackageType</key>
Expand All @@ -27,13 +27,13 @@
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen.xib</string>
<string>QGCLaunchScreen</string>
<key>UIRequiresFullScreen</key>
<true/>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>ForAppStore</key>
<string>Yes</string>
<string>No</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
Expand Down
Loading

0 comments on commit 25a7957

Please sign in to comment.