COMP: Fixed build during cross-compiling to use target names instead of LOCATIONs for custom commands.