Since we only provide latest version of packages for Ubuntu (see https://apt.kitware.com/), you have the following options:
-
Download the pre-build binaries into
~/softwaredirectory, and create symlinks to~/binmkdir ~/software cd ~/software CMAKE_VERSION=3.17.3 CMAKE_ROOT=cmake-${CMAKE_VERSION}-Linux-x86_64 url=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_ROOT}.tar.gz curl -# -LO $url tar -xzvf ${CMAKE_ROOT}.tar.gz rm -f ${CMAKE_ROOT}.tar.gz for prog in cmake ccmake ctest cpack cmake-gui; do ln -s ~/software/${CMAKE_ROOT}/bin/${prog} ~/bin/${prog} done -
Create a python virtual env and
pip install cmakeCaveat: this approach do not provide
cmake-guiandccmakeenv_dir=~/software/cmake-latest-venv python -m venv ${env_dir} ${env_dir}/bin/python -m pip install cmake for prog in cmake ctest cpack; do ln -s ${env_dir}/${prog} ~/bin/${prog} doneThen, each time you would like to update cmake, you could simply run
~/software/cmake-latest-venv/bin/python -m pip install --upgrade cmakeAlternatively, you could create one virtual env directory per version.