[CMake] /usr/share/cmake or /usr/share/Cmake ?

Brad King brad.king at kitware.com
Tue Aug 22 10:54:02 EDT 2006


frederic heem wrote:
> Problems began after upgrading cmake today on a fedora core 5.
> I put before the upgrade some home made FindXXX.cmake in /usr/share/CMake. The 
> problem is that the fedora and suse packager has changed /usr/share/CMake 
> to  /usr/share/cmake, for consistency I suppose. The new cmake cannot my 
> FindXXX.cmake anymore. 
> Would it be possible to agree to common notation between source package from 
> www.cmake.org and the various distribution packager ? 
> Having different path name just create confusion, frustration and wasted time.

We do have one: PREFIX/share/CMake.  If the suse packager has changed
this that is not our problem.  However, if we changed our standard to
PREFIX/share/cmake-2.4 (where 2.4 is the current CMake version) it would
probably be compatible with all Linux distro conventions.  You can
submit a feature request here:

http://www.cmake.org/Bug

> The other question is a wish, it would be very handy to have an environment 
> variable CMAKE_MODULE_PATH or whataver name your prefer. This variable would 
> contain a list of path where FindXXX.cmake reside, the same behavior than 
> PATH to look for executable in other word.

The reason we do not support an environment variable for this is that
CMake stores persistent information about a build in files in the build
tree.  If you had CMAKE_MODULE_PATH set to one value when you create a
build tree and then another value when you re-ran CMake later the
behavior would change.  Note that CMake can re-run magically during the
build when you type "make" because it checks dependencies on
CMakeLists.txt files.

CMake does have a CMAKE_MODULE_PATH variable that can be set in
CMakeLists.txt files or added to the cache by hand with the -D option.
You use this instead, but we tend to discourage users from putting
FindXXX.cmake files anywhere but in a project or contributing them to
CMake.  If a project builds on your computer because you have
FindXXX.cmake installed other users will not be able to build the
project without separately obtaining the file.

-Brad


More information about the CMake mailing list