Skip to content

add_custom_command: Allow adding build event via ALIAS target

When I want to use ALIAS target which is created in current directory with add_custom_command, I receive an error message says that "The TARGET xxx was not created in this directory".

This message is print here: https://gitlab.kitware.com/cmake/cmake/-/blob/3cd2c59ecf7104d0b3d6bf5609bf96959bdcdfb0/Source/cmMakefile.cxx#L1175

I notice it not check alias at all. So I make add_custom_command works with ALIAS target.

Topic-rename: add_custom_command-target-alias

Edited by Brad King

Merge request reports