The installation script has a few options that it accepts:
$ ./cmake-3.17.0-Linux-x86_64.sh --help
Usage: ./cmake-3.17.0-Linux-x86_64.sh [options]
Options: [defaults in brackets after descriptions]
--help print this message
--version print cmake installer version
--prefix=dir directory in which to install
--include-subdir include the cmake-3.17.0-Linux-x86_64 subdirectory
--exclude-subdir exclude the cmake-3.17.0-Linux-x86_64 subdirectory
--skip-license accept license
--prefix option, you can choose exactly where to install it. Here, I'm installing it in
$ ./cmake-3.17.0-Linux-x86_64.sh --skip-license --exclude-subdir --prefix=/opt
(I'm also accepting the license with
--skip-license and opting for creating the directories directly beneath the installation prefix and not in a separate
cmake-3.17.0-Linux-x86_64 directory with
After this, you will need to add the
bin directory (
/opt/bin in the above example) to your
$PATH. You do that by modifying your shell's startup files. If you're using
bash, this means adding a line saying
~/.bash_profile file. This change will enable you to use
cmake as any other command and will be in effect the next time you log in.
share directory contain files that
cmake uses. You will not need to do anything special with this.
man directory contain manuals. To be able to read these with the
man command, set your
$MANPATH variable like so:
export MANPATH="$(manpath -g):/opt/man"
(this obviously still assumes you used
/opt as the installation prefix).
doc directory contains some documentation in HTML format that you could read in a browser (start at