Comment 1 for bug 1262273

Revision history for this message
Dimitri John Ledkov (xnox) wrote : Re: qt5 automoc detection is not smart enough

So qt5 upstream generates automoc integration Find modules that set Qt5::moc variable. It is set based on the qt5 build time configuration. Which is not correct, since it should use the location of the system that is executing moc, not the location of the system the compilation is performed for.

Hence, the defaults were changed in CMake package as distributed for compiling packages on Ubuntu system.

Above are examples of non-distribution targetted builds (custom) and henceworth it is expected that a Toolchain file is provided with overrides of default values which are not appropriate for the sys-root style builds as demonstrated above (a toolchain file typically sets PREFIX path, paths to pkg-config .pc modules, and from now on paths to Qt5::* variables as well)

I strongly advise project-neon to use a Toolchain file, instead of relying on default fallthroughs, to guarantee that CMake uses expected (important) toolchain binaries (compilers, generators, et. al.). Setting environmental variables and relying on the default detection is fragile, as it relies on the internal implementation details instead of choosing known-in-advance non-standard binaries.

I'll look into how to make default Ubuntu toolchain modifications in CMake more resiliant to this kind of abuse.