AUTOMOC shares .moc files between different configurations
AUTOMOC runs moc with different options for different configurations (e.g. AM_MOC_COMPILE_DEFINITIONS vs AM_MOC_COMPILE_DEFINITIONS_Debug in AutogenInfo.cmake) and the auto-generated MOC files can be different from configuration to configuration. But, CMake shares exact same directory / file name for the MOC file between different configurations.
This works ok as long as the build is done from scratch (with no auto-generated MOC file before the build). But, if a project is built for one configuration and re-built for another configuration, MOC files are not re-generated for the second build. As a result, it can cause compile error, or even worse, build succeeds with unintended MOC file.