Skip to content

Commit

Permalink
fix build to update the git submodules.
Browse files Browse the repository at this point in the history
  • Loading branch information
lovettchris authored and Chris Lovett committed Feb 26, 2017
1 parent ee9a479 commit 2e7018e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
27 changes: 26 additions & 1 deletion cmake/build.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions docs/linux_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 2e7018e

Please sign in to comment.