Problem with target_precompile_headers

I use the target_precompile_headers( REUSE_FROM <other_target>) for a Qt project,but happend a LINK200 failed,and my environment is:

  • visual studio 2017
  • Qt 5.14.0(5.6.0 or 5.9.4 is also a failure)
  • CMAKE 3.18.5(3.19 or 3.17 is also a failure)


Likely already a known issue with a potential fix, but CC’ing @cristianadam just in case.

That’s great, which version fixes it

I tried 3.19.4 as if I had failed

Probably in the upcoming 3.19.5 if it has been fixed already.

I fixed a problem with MSVC and REUSE_FROM signature from target_precompile_headers in CMake 3.20. See issue 20201.

Well, thank you.

I tried and failed with 3.20. 0 - rc1 and The reason is that the Qt moc definition of the REUSE_FROM library could not be found

That could be related to the problem I reported earlier today, but hard to say.