Yes. CMake first parses the entire file, sees no literal, direct call to project
, issues the warning, adds a synthesized project()
call on the first virtual line of the file contents, then executes it. So yes, it happens before your macro does the include.
This piece of boilerplate will just have to be dealt with manually. I don’t know the reason for this synthesized project()
behavior, but it’s probably to handle some backwards compat behavior. Alas, it cannot be managed by policies because it happens before the contents are executed to be able to manage policies.