[cmake-developers] CMake 3.13 - Generated moc files not added to VStudio solution

Sebastian Holtermann seblist at xwmw.org
Wed Jan 30 09:30:59 EST 2019


Hello Venedict,

I took a look at this again, thanks for the additional information.
In fact this isn't VS specific. I was able to reproduce the issue using
Linux/Makefiles.

> Got the fix, hopefully it can be merged in :)
> https://github.com/Personwithhat/custom_cmake/commit/d7930c36c6aa7956a806a28
> 4aa7e1e430ef6c174

This change is too intrusive and breaks a lot of other things.

> >>> set (MOC_COMPILATION
> >>> "${CMAKE_CURRENT_BINARY_DIR}/${TargetProject}_autogen/mocs_compilation.c
> >>> pp") # stdafx.h needs to be included to ensure platform definitions are
> >>> visible
> >>> set_property(SOURCE "${MOC_COMPILATION}" APPEND_STRING PROPERTY
> >>> COMPILE_FLAGS " /FI\"${PrecompiledHeader}\"")

Setting compiler flags on the mocs_compilation.cpp file is the root cause.
I'll investigate this deeper.

-Sebastian





More information about the cmake-developers mailing list