문제

Lets consider that I have registered a custom command for a target:

add_custom_command(TARGET ${target_name} POST_BUILD
                   COMMAND cmake -E copy_if_different ${file_path} ${dest_file}
                   COMMENT "exporting ${file_path} to ${dest_file}"
                   VERBATIM)

What I am struggling to find out is when the command is actually being run. Always after the target has been checked like this ?

[ 10%] Built target libzmq

Even if 'nothing has to be done' ?

Or just in case that for the target something had to be done ?

도움이 되었습니까?

해결책

Documentation:

The command becomes part of the target and will only execute when the
target itself is built. If the target is already built, the command will
not execute.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top