On 8. Jan, 2010, at 9:54 , Mahendra Ladhe wrote:

> Hi,
>    I've a Ubuntu 8.04.1 Linux machine and cmake version 2.4-patch 7 in 
> /usr/bin/
> Due to project requirement, I installed cmake version 2.6-patch 4 under 
> /usr/local/
> 
> I want to make sure that when I or other users execute cmake, by default it's 
> always the 2.4 version in /usr/bin/cmake irrespective of PATH env var 
> settings. Those who want
> to invoke cmake version 2.6 should explicitly use the full path.
> To ensure this I renamed the cmake 2.6 executable under /usr/local/bin/cmake 
> to
> /usr/local/bin/cmake-2.6
> 
> But this renaming is causing problems as follows.
> 
> r...@linux:/usr/local/bin#  ./cmake-2.6 --version
> CMake Error: CMake executable cannot be found at /usr/local/bin/cmake
> Segmentation fault
> 
> mla...@linux:~/bld] /usr/local/bin/cmake-2.6 ..
> CMake Error: CMake executable cannot be found at /usr/local/bin/cmake
> CMake Error: Error executing cmake::LoadCache(). Aborting.
> 
> I did the renaming so that plain 'cmake' always refers to version 2.4 under 
> /usr/bin
> irrespective of PATH setting.
> 
> What could be the reason for choosing above behaviour by cmake implementors ?
> 
> Thank you,
> Mahendra
> 

Well, that's because the name "cmake" is hard-coded in cmake.cxx. If you really 
want to force users to use the full path, you shouldn't put it in 
/usr/local/bin anyways. I suggest you put it in e.g. /opt/software/cmake-2.6.4 
without any renaming. You might also want to have a look into 
http://modules.sf.net in order to manage heterogeneous environments, where you 
have multiple versions of the same software installed and want to make them 
available to the user with as little fuzz as possible. If you set it up 
correctly, a user can just type "module add cmake/2.6" and the environment will 
be set up to use this installation instead of the default one...


Michael

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to