[CMake] CMAKE_ROOT path

Ken Martin ken.martin at kitware.com
Mon Apr 25 16:48:11 EDT 2005


> >> This is the output from which and gmake:
> >>
> >> % which cmake
> >> /home/sci/bigler/pub/irix/bin/cmake
> >> % gmake
> >> Building dependencies. cmake.depends...
> >> CMAKE_ROOT = /usr/sci/local/cmake-1.8.3/share/CMake
> >>
> >> I built my copy from source and installed it to my local directory.

This could be perfectly OK. I believe the full path to cmake is written into
the Makefiles when cmake generates them. That way if you use one version of
cmake to produce some Makefiles, any rules in the Makefiles that run cmake
will use that path. This supports having Makefiles generated by a cmake that
may not be the first cmake in your path, etc, etc. So if your Makefile was
generated with /usr/sci/local/cmake-1.8.3/share/CMake then that will be the
cmake used for any rules in the make process. If you want to change that
tree to use a different cmake you must run the desired cmake on that tree
explicitly. Just changing your path will not do it.

e.g.

% which cmake
/home/sci/bigler/pub/irix/bin/cmake
% /home/sci/bigler/pub/irix/bin/cmake ../whatever
% gmake

== happiness...

I could be off base but that is what I'm guessing is going on here based on
my quick read ...

Ken





More information about the CMake mailing list