unity build: include moc files ?
I'm testing the new UNITY_BUILD feature with a qt project. The qt moc files are excluded from unity because it has the GENERATED property set to ON.
I want to include them, because I have lots of them, so I have to do:
qt5_wrap_cpp (MOC_SRCS ${headers})
if (CMAKE_UNITY_BUILD)
foreach (moc ${MOC_SRCS})
set_source_files_properties (${moc} PROPERTIES GENERATED FALSE)
endforeach ()
endif ()
add_library (foo ${SRCS} ${MOC_SRCS})
Could we imagine a simpler way to do this ?
Also why cant I set SKIP_UNITY_BUILD_INCLUSION to OFF instead ?
Edited by Julien Schueller