[CMake] Install on Ubuntu

Eric Noulard eric.noulard at gmail.com
Thu Feb 21 02:36:13 EST 2013


2013/2/20 Alain Aupeix <alain.aupeix at wanadoo.fr>:
> Le 20/02/2013 21:35, Jean-Christophe Fillion-Robin a écrit :
>
> Hi Alain,
>
> Instead, in a terminal you could simply do the following:
>
>  cd && mkdir Support && cd Support && \
>  wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2-Linux-i386.tar.gz && \
>  tar -xzvf cmake-2.8.10.2-Linux-i386.tar.gz && \
> ./cmake-2.8.10.2-Linux-i386/bin/cmake -version
>
> This will create a directory named "Support" in your home folder, download
> and extract CMake 2.8.10. Finally it invokes cmake with the "-version" param
> to check that cmake run.
>
> You can then create symlinks into your /usr/local/bin folder to ensure you
> could simply call cmake, ctest, ...  without having to specify the full
> path.
>
> sudo ln -s ~/Support/cmake-2.8.10.2-Linux-i386/bin/cmake
> /usr/local/bin/cmake && \
> sudo ln -s ~/Support/cmake-2.8.10.2-Linux-i386/bin/ccmake
> /usr/local/bin/ccmake && \
> sudo ln -s ~/Support/cmake-2.8.10.2-Linux-i386/bin/cpack
> /usr/local/bin/cpack && \
> sudo ln -s ~/Support/cmake-2.8.10.2-Linux-i386/bin/ctest
> /usr/local/bin/ctest
>
> Hth
> Jc
>
> Thanks, I see what you want me to do, but I have another question:
>
> Actually, cmake is in /usr/bin
> If I put my symlink in /usr/local/bin, which version will be used ?
> Is there an order to execute programs in path ? /usr/local/bin before
> /usr/bin ?

If you want to only use the cmake version you've just compiled/downloaded
you may simply remove the one installed by Ubuntu:

sudo aptitude remove cmake

should be fine.

If you want to install both because you may sometimes use both then the symlink
to /usr/local is fine but I'd rather use update-alternatives(8)
command to do that.

You'll find attached a script which does just that.

sudo cmake-alternatives-VerkHEAD.sh on
sets up the links,

then
sudo cmake-alternatives-VerkHEAD.sh off
removes the links.

 you can check with:
update-alternatives --display cmake

You'll have to change the "CMAKE_HOME" inside that script.

-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake-alternatives-VerkHEAD.sh
Type: application/x-sh
Size: 726 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130221/91b2e0bb/attachment.sh>


More information about the CMake mailing list