[CMake] macro/functions in ctest scripts

Matthew Woehlke matthew.woehlke at kitware.com
Fri Aug 9 12:37:48 EDT 2013


On 2013-08-09 04:43, Yngve Inntjore Levinsen wrote:
> 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.

I'm not sure file(COPY) implements the same copy-if-different semantics 
as configure_file (or creates dependencies to re-run CMake when an input 
changes). You might want to use configure_file(COPYONLY) instead.

Note there is also an @ONLY if you do need to perform substitutions but 
need to leave ${} alone.

-- 
Matthew



More information about the CMake mailing list