Autogen: Add moc path prefix generation (AUTOMOC_PATH_PREFIX)
This series of patches refactors AUTOGEN
in the following areas.
- Use collapsed full paths internally, instead of evaluated real paths. This improves compatibility with source or build directories that are symbolic links.
- Automatically generate the
-p
path prefix option formoc
(when a header is in the include directories). The behavior can be configured by the new variableCMAKE_AUTOMOC_PATH_PREFIX
and target propertyAUTOMOC_PATH_PREFIX
. It improves reproducability (closes #18815 (closed)) and ensures thatmoc
output files will compile correctly when the source and/or build directory is a symbolic link. - Abbreviate paths in messages by prefixing them with either "SRC:" or "BIN:" instead of the project source or binary directory. This reduces message sizes and improves their readability.
- Extend concurrency in the
_autogen
target by evaluating files forAUTOMOC
andAUTOUIC
in parallel. This reduces the runtime of the_autogen
target, when bothAUTOMOC
andAUTOUIC
are enabled and a project has many sources. - Add
AUTOMOC
tests for source and build directories, that are symbolic links. - Code cleanups.