[CMake] Redirect output from add_custom_target()

Rolf Eike Beer eike at sf-mail.de
Thu Apr 4 08:26:02 EDT 2013


Micha Renner wrote:
> I would try
> 
>         add_custom_target( ${doc_target_name}
>              DEPENDS ${generated_conf}
>              COMMAND ${doxygen_exe} ${generated_conf} 2 > filename
>              WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
>              COMMENT "Generating documentation using Doxygen"
>          )

This will just fail as > has no meaning to doxygen. The only reason 
this works for you when you try that command in a terminal is that your 
Bourne-like shell will interpret the "> filename" and not pass it to 
doxygen at all. When you call doxygen like this from any generated 
project file there will be no shell involved.

Eike


More information about the CMake mailing list