MantisBT - CMake
View Issue Details
0016076CMakeCMakeSetuppublic2016-04-22 10:392016-06-10 14:21
blackstar 
Brad King 
normalblockalways
closedfixed 
LinuxCentOS6.5
CMake 3.5.2 
CMake 3.7CMake 3.7 
0016076: bin install directory configuration
It is impossible to set the CMake bin install directory with bootstrap options.
The bin install directory is always <PREFIX>/bin.
If cmake binary is moved to other location, The CMAKE_ROOT could not be find, because the unique search directory of /Modules/CMake.cmake file is at the same level of bin directory.

CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in

So it is impossible to have in the same install directory, several CMake binary of different OS.
For example :
   cmake-3.5.2/bin/centos6.2/cmake
   cmake-3.5.2/bin/ubuntu14.04/cmake

Is it possible to add an option in bootstrap, like --docdir, to set the binary install directory relative to <PREFIX> ?
do a cmake installation
move the cmake binary
run cmake
No tags attached.
Issue History
2016-04-22 10:39blackstarNew Issue
2016-04-22 10:54Brad KingNote Added: 0040924
2016-06-01 14:12Brad KingNote Added: 0041120
2016-06-02 09:42Brad KingNote Added: 0041124
2016-06-02 09:43Brad KingAssigned To => Brad King
2016-06-02 09:43Brad KingStatusnew => resolved
2016-06-02 09:43Brad KingResolutionopen => fixed
2016-06-02 09:43Brad KingFixed in Version => CMake 3.7
2016-06-02 09:43Brad KingTarget Version => CMake 3.7
2016-06-10 14:21Kitware RobotNote Added: 0041160
2016-06-10 14:21Kitware RobotStatusresolved => closed

Notes
(0040924)
Brad King   
2016-04-22 10:54   
The install destination is hard-coded here:

 https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/CMakeLists.txt;hb=v3.5.2#l792 [^]

as:

 install(TARGETS ${_tool} DESTINATION bin ${COMPONENT})

If an option were added to change it then cmSystemTools::FindCMakeResources would also need to be updated:

 https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmSystemTools.cxx;hb=v3.5.2#l2214 [^]

and probably a few other places.

We've never needed to do this because we just install all of CMake to a dedicated prefix and then symlink to it from whatever location we want in our PATH. The use case of sharing resources with multiple binaries has not been raised before.
(0041120)
Brad King   
2016-06-01 14:12   
There is a patch discussed on the mailing list here:

 [PATCH] ... Add a --bindir option to bootstrap and use it to install cmake in custom directory
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/16480 [^]
(0041124)
Brad King   
2016-06-02 09:42   
The patch from the thread linked in 0016076:0041120 has been applied:

Add option to control 'bin' directory of CMake's own installation
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18bfbc97 [^]
(0041160)
Kitware Robot   
2016-06-10 14:21   
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.