[CMake] add_test : expand environment variable at running time

Olivier Pierard olivier.pierard at cenaero.be
Mon Sep 13 12:01:52 EDT 2010


Dear all,

I re-submit a previous question with no answer in a simpler way.

A ctest_test() call on a cluster computation node executes a test
constructed with add_test(..) on the cluster master node.

add_test contains an evironment variable but is not expanded or expanded
at configuration time but not at test running time:

- add_test( mpirun -machinefile $TMPDIR myexec ) => will never expand
TMPDIR  - I don't understand why because in CTestTestfile.cmake, I have
add_test( test_name "mpirun" "-machinefile" "$TMPDIR" "myexec"); if I
submit this as a bash command, environment variable is well expanded; 
Does ctest prevent expanding variables at running time ?

- add_test( mpirun -machinefile ${TMPDIR} myexec ) => expands at
configuration time with cmake (empty because not defined in cmake - logical)

- add_test( mpirun -machinefile $ENV{TMPDIR} myexec ) => expands at
configuration time with cmake but TMPDIR is not yet defined on the
master node (logical)

I'm really stucked because one of our configurations really needs this
machinefile specification !

Did I missed something or do you see a way to circumvent this limitation ?

Thanks for your help

Olivier



More information about the CMake mailing list