[CMake] execute a script before and after configuration

Rolf Eike Beer eike at sf-mail.de
Fri Jan 20 08:06:20 EST 2012


> Hi,
>
> I am building a big software framework on a cray system whereby during
> cmake "configuration" phase I need to unload certain system modules
> (so that some small test programs are allowed to run without
> scheduler) and afterwards, before the actual build phase starts, I
> need to load them back. Doing it manually is troublesome, because
> sometimes typing "make" triggers cmake to re-run, and then re-build,
> so there is no chance to load/unload the modules.
>
> So, how would I force one script to run when cmake is started and one
> other script before build starts?
>
> Many thanks for any directions.

What about overriding CMAKE_COMMAND in your CMakeCache.txt with a script
that does your module fiddling, run cmake, and fiddle back?

Eike


More information about the CMake mailing list