Details
-
Bug
-
Resolution: Incomplete
-
P1: Critical
-
6.3.0
Description
i've been experimenting with the qml type compiler, trying to integrate it into cmake. i'm using statically linked qt and build the qml module (and plugin) as static libraries:
something like:
add_library(MyModule STATIC ...) qt_add_qml_module( MyModule PLUGIN_TARGET MyPlugin ) qt6_target_compile_qml_to_cpp(MyModule ...)
this gives me an automoc error, because `MyModule_autogen/timestamp` depends on headers, which are generated by qmltc. this seems to be an issue on clean rebuilds, as i've mainly seen this on clean buildserver builds.
i can obviously work around this by not using my static library as backing target for the module:
add_library(MyLib STATIC ...) qt_add_qml_module( MyModule PLUGIN_TARGET MyModule ) qt6_target_compile_qml_to_cpp(MyModule ...) target_link_libraries(MyLib PUBLIC MyModule)
but i wonder if there is a way to catch this error early (e.g. raise a cmake error in qt6_target_compile_qml_to_cpp when the backing target is a separate static library)