[CMake] execute a script before and after configuration

Dominik Szczerba dominik at itis.ethz.ch
Sat Jan 21 12:12:55 EST 2012


> Running something from the command line does not mean it doesn't change the
> environment.
>
> Would you try
>
> $ env > env1.txt
> $ module unload sysmodule_you_dont_want
> $ env > env2.txt
> $ cmake -E compare_files env1.txt env2.txt
>
> I'd be surprise if nothing changed but I may be wrong.

You are of course right, but this is not the scenario here. If you put
"module un/load XXX" into a bash script, and call it from command
line, it will only modify the env for this script/process. On the
return your original env will not be changed. To change it,  you need
to "source" your script, but that is what seems to do nothing with
cmake.

Thanks
Dominik

> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
>


More information about the CMake mailing list