-
Notifications
You must be signed in to change notification settings - Fork 57
/
cmake-basis.sh
executable file
·47 lines (35 loc) · 1.05 KB
/
cmake-basis.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# source: https://gist.github.com/phatblat/1713458
# Save script's current directory
DIR=$(pwd)
set -e
set -u
set -x
echo "############################"
echo "# CMAKE-BASIS installer "
echo "############################"
echo ""
echo "https://cmake-basis.github.io/index.html"
echo ""
mkdir -p ~/src
cd ~/src
# We prefer cmake be a version later than the default on 16.04, so check for that and install an update.
cmakeversion=`cmake --version`
if [[ $cmakeversion == *"cmake version 3.5.1"* ]]; then
echo "Detected incompatible cmake version 3.5.1, updating CMake from source, see cmake_source.sh for details"
./cmake_source.sh
fi
if [ ! -d ~/src/cmake-basis ]
then
mkdir -p ~/src/cmake-basis
git clone --depth=1 https://github.com/cmake-basis/BASIS.git cmake-basis --branch v3.3.1
fi
cd cmake-basis
git pull
if [ ! -d ~/src/cmake-basis/build ]
then
mkdir -p ~/src/cmake-basis/build
fi
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_PROJECT_TOOL=ON -DBUILD_APPLICATIONS=ON -DBUILD_EXAMPLE=ON
make -j && sudo make install
cd $DIR