Skip to content

Commit 99a74f7

Browse files
committed
cmake build script for ubuntu 18.04
1 parent ee37d7e commit 99a74f7

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

cmake-3.18.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
# Reference
4+
# https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line
5+
6+
# Tested on Ubuntu 18.04
7+
8+
# Remove older cmake
9+
sudo apt remove --purge --auto-remove cmake
10+
11+
# Dep install
12+
sudo apt-get update && sudo apt-get install libssl-dev
13+
14+
# Install
15+
version=3.18
16+
build=1
17+
mkdir ~/temp
18+
cd ~/temp
19+
wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz
20+
tar -xzvf cmake-$version.$build.tar.gz
21+
cd cmake-$version.$build/
22+
23+
# Build
24+
./bootstrap
25+
make -j$(nproc)
26+
sudo make install
27+
sudo ldconfig
28+
29+
# Test cmake version
30+
cmake --version
31+
32+
# Remove the older package
33+
cd ~/
34+
rm -rf ~/temp
35+
36+
37+
38+

0 commit comments

Comments
 (0)