qmake + MSBuild: "specified dependency moc_predefs.h.cbt does not exist" and incremental build problems
-
I have a qmake SUBDIRS project, with some customizations but not a complicated one. I generate a Visual Studio project with
qmake -tp vc -r
and open it in VS 2022.Usually it works fine, but today I'm having an issue that some parts of some sub-projects are being rebuilt every time I click "Build". The usual troubleshooting steps of deleting all the output folders and the .vs folder didn't help. There are messages like this in the build log:
1>Generate moc_predefs.h 1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): warning MSB8064: Custom build for item "..\build\protect\x64-release\moc_predefs.h.cbt" succeeded, but specified dependency "e:\development\projects\my_project\build\lib1\x64-release\moc_predefs.h.cbt" does not exist. This may cause incremental build to work incorrectly.
Does anyone know what causes it / how to solve? In the past I would sometimes get this but it went away quickly, maybe after cleaning all the build output folders. Now I can't make it go away.
P. S. Qt 6.6.2 msvc2019_64 -
@Violet-Giraffe What is this predefs.h file? A pre-compiled header that does not exist yet perhaps?