[CMake] macro/functions in ctest scripts

Yngve Inntjore Levinsen yngve.levinsen at gmail.com
Thu Aug 8 11:49:09 EDT 2013


Den 08. aug. 2013 17:32, skrev Matthew Woehlke:
> That said, have you tried naming the variable other than the name of a
> built-in command? I could imagine that might cause problems... 

Yes, I did not notice this problem by writing the hello world macro
initially. My macro was something along the lines of

set(MYBIN /path/to/somebin)
macro(run_test testname f1)
...
add_test(mytests_${testname} ${MYBIN} ${f1})
...
endmacro(run_test)

And then when I noticed that this did not work (all tests were called
mytests_, arguments were not added) I tried to just print ${testname} in
a message inside the macro and noticed it was emtpy.

Cheers,
Yngve


More information about the CMake mailing list