[PATCH] OSX build patches against v4.5-branch

Jeroen Massar jeroen at massar.ch
Wed Mar 16 01:31:44 PDT 2016


Hola,

These are quite close to the changes I needed for the patches against
master.

I did add "user home dir Qt5.5/5.6" detection to this too, just in case
as we have that in master.

As noted, I'll do full-clean builds coming weekend, but I think this
resolves the biggest chunks of a clean install already.

Greets,
 Jeroen

-------------- next part --------------
From 937b2b1fb764ed5df0d0353e1d462dba4ec1a1ca Mon Sep 17 00:00:00 2001
From: Jeroen Massar <jeroen at massar.ch>
Date: Wed, 16 Mar 2016 08:57:41 +0100
Subject: [PATCH 1/3] Debug reminder: how to get more verbose details out of
 cmake

Signed-off-by: Jeroen Massar <jeroen at massar.ch>
---
 CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3b78457..7e687c7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,8 @@
 # cmake based build of Subsurface
 
+# Uncomment his to see all commands cmake actually executes
+# set(CMAKE_VERBOSE_MAKEFILE ON)
+
 project(Subsurface)
 cmake_minimum_required(VERSION 2.8.11)
 
-- 
2.7.3

-------------- next part --------------
From 6808b3158d80a09a680fcc46c97a85fb5b26bf75 Mon Sep 17 00:00:00 2001
From: Jeroen Massar <jeroen at massar.ch>
Date: Wed, 16 Mar 2016 09:26:16 +0100
Subject: [PATCH 2/3] Detect user's Qt5.5 + Qt5.6 (as per master) and Homebrew
 qt5 + preserve that path in CMAKE_PREFIX_PATH and pass it along to cmake

Signed-off-by: Jeroen Massar <jeroen at massar.ch>
---
 scripts/build.sh | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/scripts/build.sh b/scripts/build.sh
index 02bb3a6..73b0601 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -142,7 +142,14 @@ fi
 mkdir -p build
 cd build
 if [ $PLATFORM = Darwin ] ; then
-	export CMAKE_PREFIX_PATH=~/Qt/5.5/clang_64/lib/cmake
+	if [ -d "~/Qt/5.5" ] ; then
+		export CMAKE_PREFIX_PATH=~/Qt/5.5/clang_64/lib/cmake
+	elif [ -d "~/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
+	fi
 fi
 cmake -DCMAKE_BUILD_TYPE=Release -DQTONLY=TRUE -DQT5BUILD=ON \
 	-DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT \
@@ -200,7 +207,7 @@ fi
 cd $SRC/subsurface
 mkdir -p build
 cd build
-export CMAKE_PREFIX_PATH=$INSTALL_ROOT/lib/cmake
+export CMAKE_PREFIX_PATH="$INSTALL_ROOT/lib/cmake;${CMAKE_PREFIX_PATH}"
 cmake -DCMAKE_BUILD_TYPE=Debug .. \
 	-DLIBGIT2_INCLUDE_DIR=$INSTALL_ROOT/include \
 	-DLIBGIT2_LIBRARIES=$INSTALL_ROOT/lib/libgit2.$SH_LIB_EXT \
@@ -208,6 +215,7 @@ cmake -DCMAKE_BUILD_TYPE=Debug .. \
 	-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 \
 	-DUSE_LIBGIT23_API=1
 
-- 
2.7.3

-------------- next part --------------
From 9464be1ebe0c3c318cc53e8bea1eee3a1a49c692 Mon Sep 17 00:00:00 2001
From: Jeroen Massar <jeroen at massar.ch>
Date: Wed, 16 Mar 2016 09:28:52 +0100
Subject: [PATCH 3/3] Verify that the Xcode Command Line Tools are installed

Otherwise /usr/include does not exist on a clean-ish install

Signed-off-by: Jeroen Massar <jeroen at massar.ch>
---
 scripts/build.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/scripts/build.sh b/scripts/build.sh
index 73b0601..105a214 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -28,6 +28,18 @@ if [[ ! -d "subsurface" ]] ; then
 	exit 1
 fi
 
+# 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
+
 mkdir -p install-root
 INSTALL_ROOT=$SRC/install-root
 
-- 
2.7.3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160316/5592915d/attachment-0001.sig>


More information about the subsurface mailing list