Use configure_file() instead of custom_target(). This resolves the following warning: WARNING: Source item '/home/user/ModemManager/header-generator.xsl' cannot be converted to File object, because it is a generated file. This will become a hard error in the future.