It's worth mentioning that the file listed in OUTPUT of a custom command should be included by every other generated file. Otherwise, the situation is possible that consumer target does not include it directly or indirectly and recompilation won't be triggered when schema changes. When SCHEMA_NAME is known, such file is OUTPUT_DIR/SCHEMA_NAME/schema/schema.hpp because it's included by all other generated headers. Otherwise, schema root directory is not known (it depends on schema name), so we don't know path to schema/schema.hpp so a fake anchor file is created (outside schema root directory) and injected into schema.hpp using new --inject-include CLI option.
It's worth mentioning that the file listed in
OUTPUT
of a custom command should be included by every other generated file. Otherwise, the situation is possible that consumer target does not include it directly or indirectly and recompilation won't be triggered when schema changes. WhenSCHEMA_NAME
is known, such file isOUTPUT_DIR/SCHEMA_NAME/schema/schema.hpp
because it's included by all other generated headers. Otherwise, schema root directory is not known (it depends on schema name), so we don't know path toschema/schema.hpp
so a fake anchor file is created (outside schema root directory) and injected intoschema.hpp
using new--inject-include
CLI option.