From 868fb9d5a929f05dc91f9d3f908ddf7c0fd23114 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Wed, 5 Jul 2017 11:26:12 +0200 Subject: Enable building with standard Qt install path layout In general this patch enables building of subsurface without being forced to use the official Qt binary packages. This is particularly helpful when having to debug Qt internals or having to deal with custom patches on top of the official Qt releases. The architecture dependent file path layout is only employed by official Qt binary packages. They are the result of a reordering at package generation time. If Qt was build for a single architecture, the standard layout does not add the architecture specific top level patch for the resulting binaries. Signed-off-by: Alex Blasche --- packaging/android/build.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packaging/android/build.sh b/packaging/android/build.sh index 9c1fdf3e5..12f11c1a8 100755 --- a/packaging/android/build.sh +++ b/packaging/android/build.sh @@ -121,6 +121,18 @@ elif [ "$ARCH" = "x86" ] ; then OPENSSL_MACHINE=i686 fi +# Verify Qt install and adjust for single-arch Qt install layout +# (e.g. when building Qt from scratch) +export QT5_ANDROID_CMAKE +if [ -d "${QT5_ANDROID}/android_${QT_ARCH}/lib/cmake" ] ; then + export QT5_ANDROID_CMAKE=$QT5_ANDROID/android_${QT_ARCH}/lib/cmake +elif [ -d "${QT5_ANDROID}lib/cmake" ] ; then + export QT5_ANDROID_CMAKE=$QT5_ANDROID/lib/cmake +else + echo "Cannot find Qt cmake configuration" + exit 1 +fi + if [ ! -e ndk-"$ARCH" ] ; then "$ANDROID_NDK_ROOT/build/tools/make_standalone_toolchain.py" --arch="$ARCH" --install-dir=ndk-"$ARCH" --api=16 fi @@ -376,7 +388,7 @@ cmake $MOBILE_CMAKE \ -DNO_PRINTING=ON \ -DNO_USERMANUAL=ON \ -DFBSUPPORT=OFF \ - -DCMAKE_PREFIX_PATH:UNINITIALIZED="$QT5_ANDROID/android_$QT_ARCH/lib/cmake" \ + -DCMAKE_PREFIX_PATH:UNINITIALIZED="$QT5_ANDROID_CMAKE" \ -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \ -DMAKE_TESTS=OFF \ -DFTDISUPPORT=${FTDI} \ -- cgit v1.2.3-70-g09d2