I have something like the following snippet in a CMakeLists.txt:
file(READ api.yaml API_YAML)
configure_file(schemautil.h.in schemautil.h)
The variable ${API_YAML}
is used in schemautil.h.in
When I go to build, the configured file schemautil.h
does not regenerate when I make changes to api.yaml
.
How do I make updates to api.yaml
trigger the configure_file
line?
Also, if there is a better way to accomplish what I'm doing here -- i.e. stuffing api.yaml
into source code at compile time, I'm interested.
question from:
https://stackoverflow.com/questions/65945012/how-to-add-fileread-as-a-dependency-to-configure-file 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…