[CMake] macro/functions in ctest scripts

Yngve Inntjore Levinsen yngve.levinsen at gmail.com
Fri Aug 9 04:43:24 EDT 2013


Den 08. aug. 2013 17:54, skrev Yngve Inntjore Levinsen:
> Den 08. aug. 2013 17:36, skrev Jakub Zakrzewski:
>> Hi,
>>
>> a neee - just ignore this - I need more sleep...
>>
>> This indeed looks like a correct piece of code.
>> Moreover - it works perfectly with my ctest...
> No problem. I noticed that if I add this in the "ctest run script", i.e.
> the script I execute like "ctest -S myscript.cmake",
> then the macro works correctly. Hence perhaps it is correct that the
> ctest --help-command is reporting this as such. However what I am trying
> to do now (not sure if it is supposed to work), is to add this to a
> 'CTestTestfile.cmake' file in the project itself, where the project is
> not using cmake (there is nothing to compile so it doesn't make much
> sense to use cmake).
>
> Cheers,
> Yngve

Sorry all, I found my mistake. Essentially in the 'ctest -S script' I
moved all CTestTestfile.cmake to a binary directory using
configure_file() instead of file(COPY .. DESTINATION ..). The
configure_file evaluates all ${}, so the ${MESSAGE} was replaced by
nothing since the variable MESSAGE was not defined in the ctest script.

To explain I attach a minimal example. If you just type 'ctest' in the
folder you will see 'Hello World', but if you instead do 'ctest -S
run.cmake' you will only see 'Hello'.

Me being stupid here.. Thanks to everyone that tried to help!

Cheers,
Yngve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ctest_test.zip
Type: application/zip
Size: 5258 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130809/74b7a54c/attachment-0001.zip>


More information about the CMake mailing list