[CMake] execute a script before and after configuration

Dominik Szczerba dominik at itis.ethz.ch
Sat Jan 21 05:28:43 EST 2012


On Sat, Jan 21, 2012 at 10:50 AM, Dominik Szczerba <dominik at itis.ethz.ch> wrote:
>>>> You might use an EXECUTE_PROCESS() command at the beginning of your
>>>> CMakeLists.txt to unload the modules, and another EXECUTE_PROCESS()
>>>> at the end to reload them.
>
> Will try, thanks for the hint!

Unfortunately, it does not work. Unloading the module via a call to a
bash script only unloads it for this script's process - the test run
is not affected. Instead of calling the script I tried sourcing it
(like 'source script', so the whole current session is affected) but
this in turn seems to somehow silently do nothing, it does not even
seem to be called.

Still dead end, any more ideas? It would be nice to have a general
elegant solution for cases where user is not allowed to directly run
their programs on the current node. Similar scenario will arise for
executing tests - currently make test fails because the tests are
built for the scheduler so will not run locally.

Regards,
Dominik


More information about the CMake mailing list