qt5 automoc detection is not smart enough, when system CMake is used with non-system qt5 (undeclared, toolchain-less sys-root/prefix builds)
Bug #1262273 reported by
Harald Sitter
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cmake (Ubuntu) |
Fix Released
|
Wishlist
|
Dimitri John Ledkov |
Bug Description
since Dec 13 (~2.8.12.
broken example from Dec 18:
https:/
working example from Dec 11
https:/
summary: |
- 2.8.12.1-1ubuntu2 broke automoc + qt5 automoc detection is not smart enough |
Changed in cmake (Ubuntu): | |
status: | Triaged → In Progress |
To post a comment you must log in.
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.