[CMake] Specifying an alternate location for cmake Modules directory

Paul Smith paul at mad-scientist.net
Wed Nov 13 17:50:37 EST 2013


I need to maintain my own copy of the latest cmake, and for multiple
different target systems (GNU/Linux, MacOS, Windows, Solaris...)

I have a shared location where all tools like this go, so that
regardless of the system architecture you can access this one location.
Obviously inside that location are architecture-specific areas for
binaries, etc.

There is also a common area for files that can be shared, to reduce disk
usage, copying time, etc.

Since all of the cmake installation with the exception of the binaries
is identical between the different architectures, I want to share all of
the installation (for example the Modules directory, etc.)  I can't use
symlinks.

So what I'd like is a structure something like this:

  .../common/cmake/Modules/...

  .../linux/bin/cmake
  .../darwin/bin/cmake
  .../windows/bin/cmake.exe
  .../sunos/bin/cmake

I can use a wrapper around cmake to set environment variables or pass in
command line flags to the REAL cmake, if necessary.

Is there any way to convince cmake to look in a different place for
Modules etc.?



More information about the CMake mailing list