[CMake] add_test does not work as documented

Jesper Eskilson jesper.eskilson at iar.se
Tue Sep 21 04:19:01 EDT 2010


Hi,

I cannot get add_test to work as documented.

   add_test(mytest MyExe)

correctly runs MyExe. However, if I try to use any of the "generator 
expressions" (such as $<CONFIGURATION>), it fails:

   add_test(mytest ${SOMEVARIABLE}/$<CONFIGURATION>/MyExe)

fails to locate MyExe correctly, since it isn't expanding 
$<CONFIGURATION> correctly.

> Looked in the following places:
> /home/jesperes/dev/tooticki/core/ide/../stage/$<CONFIGURATION>/common/bin/TestIDE
> /home/jesperes/dev/tooticki/core/ide/../stage/$<CONFIGURATION>/common/bin/TestIDE
> /home/jesperes/dev/tooticki/core/ide/../stage/$<CONFIGURATION>/common/bin/Release/TestIDE
> /home/jesperes/dev/tooticki/core/ide/../stage/$<CONFIGURATION>/common/bin/Release/TestIDE
> /home/jesperes/dev/tooticki/core/ide/../stage/$<CONFIGURATION>/common/bin/Debug/TestIDE
> /home/jesperes/dev/tooticki/core/ide/../stage/$<CONFIGURATION>/common/bin/Debug/TestIDE
> /home/jesperes/dev/tooticki/core/ide/../stage/$<CONFIGURATION>/common/bin/MinSizeRel/TestIDE
> /home/jesperes/dev/tooticki/core/ide/../stage/$<CONFIGURATION>/common/bin/MinSizeRel/TestIDE
> /home/jesperes/dev/tooticki/core/ide/../stage/$<CONFIGURATION>/common/bin/RelWithDebInfo/TestIDE
> /home/jesperes/dev/tooticki/core/ide/../stage/$<CONFIGURATION>/common/bin/RelWithDebInfo/TestIDE
> /home/jesperes/dev/tooticki/core/ide/../stage/$<CONFIGURATION>/common/bin/Deployment/TestIDE
> /home/jesperes/dev/tooticki/core/ide/../stage/$<CONFIGURATION>/common/bin/Deployment/TestIDE
> /home/jesperes/dev/tooticki/core/ide/../stage/$<CONFIGURATION>/common/bin/Development/TestIDE
> /home/jesperes/dev/tooticki/core/ide/../stage/$<CONFIGURATION>/common/bin/Development/TestIDE

Also, the form

   add_test(NAME mytest COMMAND MyCommand)

doesn't work at all. No tests are generated, and "make test" complains 
that there aren't any tests.

What am I doing wrong?

I'm using CMake 2.8.2.

--
/Jesper



More information about the CMake mailing list