summaryrefslogtreecommitdiffstats
path: root/scripts/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build.sh')
-rwxr-xr-xscripts/build.sh24
1 files changed, 20 insertions, 4 deletions
diff --git a/scripts/build.sh b/scripts/build.sh
index e4164db4f..014d2d32b 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -23,6 +23,18 @@ exec 1> >(tee build.log) 2>&1
SRC=$(pwd)
PLATFORM=$(uname)
+# Verify that the Xcode Command Line Tools are installed
+if [ $PLATFORM = Darwin ] ; then
+ if [ ! -d /usr/include ] ; then
+ echo "Error: Xcode Command Line Tools are not installed"
+ echo ""
+ echo "Please run:"
+ echo " xcode-select --install"
+ echo "to install them (you'll have to agree to Apple's licensing terms etc), then run build.sh again"
+ exit 1;
+ fi
+fi
+
# normally this script builds the desktop version in subsurface/build
# if the first argument is "-mobile" then build Subsurface-mobile in subsurface/build-mobile
# if the first argument is "-both" then build both in subsurface/build and subsurface/build-mobile
@@ -116,7 +128,7 @@ cd build
if [ ! -f ../configure ] ; then
autoreconf --install ..
fi
-../configure --prefix=$INSTALL_ROOT
+../configure --prefix=$INSTALL_ROOT --disable-examples
make -j4
make install
@@ -140,10 +152,13 @@ fi
mkdir -p build
cd build
if [ $PLATFORM = Darwin ] ; then
- if [ -d "~/Qt/5.5" ] ; then
+ if [ -d "$HOME/Qt/5.5" ] ; then
export CMAKE_PREFIX_PATH=~/Qt/5.5/clang_64/lib/cmake
- elif [ -d "~/Qt/5.6" ] ; then
+ elif [ -d "$HOME/Qt/5.6" ] ; then
export CMAKE_PREFIX_PATH=~/Qt/5.6/clang_64/lib/cmake
+ elif [ -d /usr/local/opt/qt5/lib ] ; then
+ # Homebrew location for qt5 package
+ export CMAKE_PREFIX_PATH=/usr/local/opt/qt5/lib/cmake
else
echo "cannot find Qt 5.5 or 5.6 in ~/Qt"
exit 1
@@ -218,7 +233,7 @@ for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do
mkdir -p $SRC/subsurface/$BUILDDIR
cd $SRC/subsurface/$BUILDDIR
- export CMAKE_PREFIX_PATH=$INSTALL_ROOT/lib/cmake
+ export CMAKE_PREFIX_PATH="$INSTALL_ROOT/lib/cmake;${CMAKE_PREFIX_PATH}"
cmake -DCMAKE_BUILD_TYPE=Debug .. \
-DSUBSURFACE_TARGET_EXECUTABLE=$SUBSURFACE_EXECUTABLE \
-DLIBGIT2_INCLUDE_DIR=$INSTALL_ROOT/include \
@@ -227,6 +242,7 @@ for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do
-DLIBDIVECOMPUTER_LIBRARIES=$INSTALL_ROOT/lib/libdivecomputer.a \
-DMARBLE_INCLUDE_DIR=$INSTALL_ROOT/include \
-DMARBLE_LIBRARIES=$INSTALL_ROOT/lib/libssrfmarblewidget.$SH_LIB_EXT \
+ -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH \
-DNO_PRINTING=OFF
if [ $PLATFORM = Darwin ] ; then