Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.4, 6.6.1, 6.7.0 Beta1
-
None
-
67b7b51e8 (dev), 24befe64f (6.7)
Description
qt_examples_build_end() calls _qt_internal_collect_buildsystem_targets() to then call qt_autogen_tools() on the collected targets.
For source directories that have been added via add_subdirectory() multiple times with different binary directories, _qt_internal_collect_buildsystem_targets will not collect targets from the latter calls of add_subdirectory, but only the first one.
This is relevant for qtdeclarative/examples/quick/CMakeLists.txt where each example does
add_subdirectory("../../quick/shared" "shared")
Because of that, each time a new example is aded that uses the shared bits, we need to manually ensure to call qt_autogen_tools(${example_name}_shared).
People tend to forget to do that (myself included), and we discover this only during failed qt5.git integrations, because the issue only manifests in top-level builds with an error like:
CMake Error: AUTOMOC for target weatherforecast_shared: The "moc" executable "/Users/qt/work/qt/qt5/qtbase/libexec/moc" does not exist.
This was handled pragmatically by adding each shared target manually, but we should try to automate this instead.
If SUBDIRECTORIES property in _qt_internal_collect_buildsystem_targets does not give us the full list of build directories, maybe we should just use another custom property to collect the extra build directories.
See also the following comment that originally described the issue (point 2)
Attachments
Issue Links
- relates to
-
QTBUG-96159 Qt5.git integration fails in '6.2': The "moc" executable "/Users/qt/work/qt/qt5/qtbase/libexec/moc" does not exist
- Closed