Build, Test, and package your software with Cmake !
CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice.
Well, we can install it by following these simple steps:
- Uninstall the default version provided by Ubuntu’s package manager:
sudo apt-get purge cmake
- Go to the official CMake webpage, then download and extract the latest version. Update the
buildvariables in the following command to get the desired version:
version=3.x build=3 mkdir ~/temp cd ~/temp wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz tar -xzvf cmake-$version.$build.tar.gz cd cmake-$version.$build/
- Install the extracted source by running:
./bootstrap make -j4 sudo make install
- Test your new
$ cmake --version
cmake version 3.10.X
In 3.10.X the X represents the last part of the version that we defined as build. The build may change if cmake is updated. Just for example given below:-