[CMake] setting CMAKE_MODULE_PATH removes the default path?

Pierre pierre.php at gmail.com
Thu Jan 11 11:11:39 EST 2007


Hell David,

On 1/11/07, David Cole <david.cole at kitware.com> wrote:
> Use:
>
> SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${FOO_CMAKE_DIR}")
> to append your own path...
>
> SET(CMAKE_MODULE_PATH "${FOO_CMAKE_DIR}" ${CMAKE_MODULE_PATH})
> to prepend your own path...

CMAKE_MODULE_PATH is empty, cmake uses the default path. It is always
${CMAKE_ROOT}/Modules right?

SET(CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules")
SET(GD_CMAKE_DIR "${FOO_SOURCE_DIR}/CMakeModules")
SET(CMAKE_MODULE_PATH "${FOO_CMAKE_DIR}" ${CMAKE_MODULE_PATH})

CMAKE_MODULE_PATH is now:

/home/test/projects/foo/CMakeModules;/usr/share/CMake/Modules

Am I right that it should first look in the first path and then the
second? Allowing me to override existing macros (or other files). But
it still does not find the default macros. Whether I append or prepend
my path does not change anything. Is it a bug in 2.4.3?

If I do not set CMAKE_MODULE_PATH or set it using CMAKE_ROOT/Modules,
it works, but I cannot add any path without loosing the system path.

--Pierre


More information about the CMake mailing list