[CMake] add_custom_command

Totte Karlsson totte at dunescientific.com
Sun Oct 14 18:54:51 EDT 2012


Hi,
I have an executable target, that I want to be executed as part of its 
own build.

The target takes one argument, which is output folder of a text file. 
This text file is part of my source dir.

In my CMake file I have, at the end

set( resultFileFolder "${PROJECT_SOURCE_DIR}/wiki/reports")
set( resultFile "${resFileFolder}/tests_auto.xml")

add_custom_command(
     DEPENDS ${target}
     OUTPUT ${resultFile}
     COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/${target}
     ARGS ${resultFileFolder}
     )

Now, this never seem to execute. No warnings, no nothing.

How to get it going?

-totte



More information about the CMake mailing list