I have downloaded the cmake-3.11.3-Linux-x86_64.sh
file. Then I executed it and it created a folder that has a bin
file there is cmake
on it. I tried to edit /etc/environment
like this:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/m/FILES/CMake/cmake-3.11.3-Linux-x86_64/bin"
But when I try this command:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
I get this message:
The program 'cmake' is currently not installed. You can install it by typing: sudo apt install cmake
Which part of what I did, is wrong and how can I fix that?
I assume you downloaded the script from CMake's Download Page. The documentation how to use it is admittedly a little sparse.
In short, call (installation path for CMake here is
/usr/local
):Note: You need to uninstall any package manager installed CMake packages first
Options
The script has the following options:
The one you are searching for is
--prefix=dir
. Otherwise it will just use the current directory to extract the installation files.Test Output on Ubuntu
Reference / Alternative
Rather than installing CMake mannually,
Please let apt take care of it.
Just rollback whatever changes you've done.
Simply type
sudo apt install cmake
on your terminal.and you're ready to use CMake since apt takes care of all dependencies installations and environment variable settings.
I hope, this will help.