Details
-
User Story
-
Resolution: Done
-
P2: Important
-
None
-
None
Description
This would provide cleaner CMake API inside the Qt CMake files.
For example for qml, without this feature, you could have a hypothetical API as follows.
add_qml_module(Foo)
qml_target_sources(Foo a.qml)
if(APPLE)
qml_target_sources(Foo b.qml)
endif()
more qml_target_source calls .....
qml_run_quick_compiler(Foo)
qml_run_quick_compiler needs to be called manually by a user after all qml_target_sources have been called.
With proposed feature, we could have a cleaner API where the user does not have to specify the qml_run_quick_compiler call, it would be called automatically by CMake.
add_qml_module(Foo)
qml_target_sources(Foo a.qml)
if(APPLE)
qml_target_sources(Foo b.qml)
endif()
more qml_target_source calls .....
and inside add_qml_module you would have something like:
function(qml_run_quick_compiler target)
...
set_property(TARGET ${target} PROPERTY CALL_ON_TARGET_FINALIZE "qml_run_quick_compiler")
...
endfunction()
Thus the user can't accidentally forget to call qml_run_quick_compiler(), CMake would do it for them.
Upstream issue https://gitlab.kitware.com/cmake/cmake/issues/19575
Attachments
Issue Links
- is required for
-
QTBUG-88172 Reconfiguration of static qtdeclarative builds rebuilds some files
- Closed
- relates to
-
QTBUG-83498 Fix handling of plugins in static builds (and the dependency cycles it creates)
- Open
-
QTBUG-86669 Investigate automatic calling of qt6_import_qml_plugins for examples using a static Qt build
- Closed