From 2e7018e5336ca1e7d4965f02cda1e788f0d27244 Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Sun, 26 Feb 2017 14:13:33 -0800 Subject: [PATCH] fix build to update the git submodules. --- cmake/build.sh | 27 ++++++++++++++++++++++++++- docs/linux_build.md | 1 + 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/cmake/build.sh b/cmake/build.sh index bb385ddb77..7472d10f55 100644 --- a/cmake/build.sh +++ b/cmake/build.sh @@ -1,4 +1,29 @@ +# Get the location of this script, it is assumed you already cloned "main" and you are running the +# script from that repo. It will then put everything else in a ROS workspace at "../catkin_ws" +SCRIPT=$(readlink -f "$0") +SCRIPTPATH=$(dirname "$SCRIPT") +pushd $SCRIPTPATH + +# update the rpclib git submodule +pushd .. +git submodule update --init --recursive +popd + +if [ -f "CMakeCache.txt" ]; then rm CMakeCache.txt +fi + +if [ -f "CMakeFiles" ]; then rm -rf CMakeFiles -cmake -D CMAKE_BUILD_TYPE=Debug -D CMAKE_C_COMPILER=gcc-6 -D CMAKE_CXX_COMPILER=g++-6 CMakeLists.txt +fi + +GCCARGS="-D CMAKE_BUILD_TYPE=Debug" + +GCCVERSION=$(gcc -v 2>&1 | sed -n "/^gcc version/p" | sed -e "s/^gcc version \([0-9]\)/\1/g" | cut -d"." -f1) +if [ $GCCVERSION -lt 7 ]; then + GCCARGS="$GCCARGS -D CMAKE_C_COMPILER=gcc-6 -D CMAKE_CXX_COMPILER=g++-6" +fi + +cmake $GCCARGS CMakeLists.txt + make diff --git a/docs/linux_build.md b/docs/linux_build.md index 1d78b0bbff..3a9fef1a88 100644 --- a/docs/linux_build.md +++ b/docs/linux_build.md @@ -8,6 +8,7 @@ If you don't have cmake version 3.* (for example, that is not the default on Ubu ```` sudo add-apt-repository ppa:george-edison55/cmake-3.x -y sudo apt-get update +sudo apt-get install cmake ```` Then get the right version of Eigen, see [Install Eigen](install_eigen.md).