Skip to content

Commit

Permalink
[setup][osx] Install cmake only if not already installed
Browse files Browse the repository at this point in the history
  • Loading branch information
rajat2004 committed Jun 9, 2020
1 parent 6a0d553 commit ad91942
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ if [ "$(uname)" == "Darwin" ]; then # osx

brew install wget
brew install coreutils
brew install cmake # should get cmake 3.8

else #linux
if [[ ! -z "${whoami}" ]]; then #this happens when running in travis
Expand All @@ -70,18 +69,25 @@ fi

#download cmake - v3.10.2 is not out of box in Ubuntu 16.04
if version_less_than_equal_to $cmake_ver $MIN_CMAKE_VERSION; then
if [[ ! -d "cmake_build/bin" ]]; then
echo "Downloading cmake..."
wget https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz \
-O cmake.tar.gz
tar -xzf cmake.tar.gz
rm cmake.tar.gz
rm -rf ./cmake_build
mv ./cmake-3.10.2 ./cmake_build
pushd cmake_build
./bootstrap
make
popd

if [ "$(uname)" == "Darwin" ]; then
brew install cmake # should get 3.17 os OSX 10.15
else

if [[ ! -d "cmake_build/bin" ]]; then
echo "Downloading cmake..."
wget https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz \
-O cmake.tar.gz
tar -xzf cmake.tar.gz
rm cmake.tar.gz
rm -rf ./cmake_build
mv ./cmake-3.10.2 ./cmake_build
pushd cmake_build
./bootstrap
make
popd
fi

fi
else
echo "Already have good version of cmake: $cmake_ver"
Expand Down

0 comments on commit ad91942

Please sign in to comment.