[CMake] Running two executables sequentially in a test

David Doria daviddoria at gmail.com
Mon May 2 14:07:55 EDT 2011


On Mon, May 2, 2011 at 1:57 PM, David Cole <david.cole at kitware.com> wrote:
> script.cmake:
> execute_process(x)
> execute_process(y)
>
> CMakeLists.txt:
> add_test(NAME MyTest COMMAND ${CMAKE_COMMAND} -P
> ${CMAKE_CURRENT_SOURCE_DIR}/script.cmake)
>
> Or, configure the script into the build tree if you need variable values
> from the CMakeLists.txt file and then reference the configured copy instead.
>
> The NAME/COMMAND signature of add_test is only available in 2.8 and later,
> though.

How are 'x' and 'y' passed to the script.cmake? (I haven't found any
tutorials on .cmake files.) Or are you suggesting I have to make a
separate .cmake file for each of these tests and hard code the name of
the executable in each one?

David


More information about the CMake mailing list