AUTOMOC for generated targets interferes with forward $<TARGET_OBJECT> generator expressions
Using a generator expression referring to a target defined later (than the use of the generator expression) yields different results in CMake 3.8 and 3.9: it's expressions like add_library(three SHARED $<TARGET_OBJECTS:one_src>)
, and with the Ninja generator, in 3.8 this builds target "three" as expected, while in 3.9 the Ninja build fails with an error that an output is a directory.
Sample is attached; the tarball contains a Makefile that does four builds: with make and with ninja, with target "one" defined before "three" and with target "one" defined after.