add_custom_command()

add_custom_command

Add a custom build rule to the generated build system.

There are two main signatures for add_custom_command.

Generating Files

The first signature is for adding a custom command to produce an output:

add_custom_command(OUTPUT output1 [output2 ...]
                   COMMAND command1 [ARGS] [args1...]
                   [COMMAND command2 [ARGS] [args2...] ...]
                   [MAIN_DEPENDENCY depend]
                   [DEPENDS [depends...]]
                   [BYPRODUCTS [files...]]
                   [IMPLICIT_DEPENDS <lang1> depend1
                                    [<lang2> depend2] ...]
                   [WORKING_DIRECTORY dir]
                   [COMMENT comment]
                   [VERBATIM] [APPEND] [USES_TERMINAL])

This defines a command to generate specified OUTPUT登录查看完整内容