[Cmake] Searching for CMAKE_ROOT

Ken Martin ken.martin at kitware.com
Tue May 22 10:45:29 EDT 2001


>
> With the out-of-source CMake, would it be possible to search for
> CMAKE_ROOT in a well defined place in the project source directory?
> Currently, it looks at where the executable is, then at a "share"
> directory. It could look for it in the source directory first,
> perhaps, since large projects (vxl) have their own modules and
> templates and such--ones that may not be installed as part of the
> "system".

CMAKE_ROOT is only for the standard CMake modules. For project
specific modules you can put them in the projects source tree and in
the projects cmake lists file just use a different include. For
example

# uses CMAKE_ROOT
INCLUDE (${CMAKE_ROOT}/FindOpenGL.cmake)

# uses project directory
INCLUDE (${VNL_SOURCE_DIR}/CmakeModules/FindFortran.cmake)

Does that make sense? As for different templates I believe someone
added a cmake command to change the directory where the templates are
loaded from.

Ken





More information about the CMake mailing list