Custom commands and relative paths

It seems like relative paths cause issues with custom commands and custom targets.

Please see this stackoverflow for details: How to call a custom cmake script only when files are updated? - Stack Overflow

Perhaps CMake should warn users to use absolute paths for arguments to these commands?


Relative paths work in many cases with add_custom_command and add_custom_target, and are covered by our test suite. It may be that paths starting in ../ do not quite work in the example’s case, but that would take some investigation.

the custom target depends on ALL and its commands are executed every time (custom targets are always out of date). You need to add_custom_command with OUTPUT mode to bring the output product up to date.

Both absolute and relative paths are allowed in this cases.