Revert "Add the explicit CMake dependencies between QML module targets"

This reverts commit 8a238c0ab8, as it caused configure issues in qtcharts, qtquick3d that need to be figured
out first.

Change-Id: I0544d57f15e0c8613300edacc97c3505a986dc69
Pick-to: 6.7
Fixes: QTBUG-120279
Fixes: QTBUG-120282
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Kai Köhne 2023-12-20 08:47:02 +00:00
parent f70fd38bfe
commit dae1f74d8a
1 changed files with 2 additions and 39 deletions

View File

@ -349,7 +349,6 @@ function(qt6_add_qml_module target)
)
endif()
endif()
set_property(GLOBAL APPEND PROPERTY _qt_all_qml_uris ${arg_URI})
set_property(GLOBAL APPEND PROPERTY _qt_all_qml_output_dirs ${arg_OUTPUT_DIRECTORY})
set_property(GLOBAL APPEND PROPERTY _qt_all_qml_targets ${target})
@ -429,12 +428,12 @@ function(qt6_add_qml_module target)
QT_QML_MODULE_DEPENDENCIES "${dependency}"
)
else()
string(SUBSTRING ${dependency} 0 ${slash_position} dep_module_uri)
string(SUBSTRING ${dependency} 0 ${slash_position} dep_module)
math(EXPR slash_position "${slash_position} + 1")
string(SUBSTRING ${dependency} ${slash_position} -1 dep_version)
if (dep_version MATCHES "^([0-9]+(\\.[0-9]+)?|auto)$")
set_property(TARGET ${target} APPEND PROPERTY
QT_QML_MODULE_DEPENDENCIES "${dep_module_uri} ${dep_version}"
QT_QML_MODULE_DEPENDENCIES "${dep_module} ${dep_version}"
)
else()
message(FATAL_ERROR
@ -444,7 +443,6 @@ function(qt6_add_qml_module target)
endif()
endif()
endforeach()
_qt_internal_collect_qml_module_dependencies(${target})
if(arg_AUTO_RESOURCE_PREFIX)
if(arg_RESOURCE_PREFIX)
@ -4060,38 +4058,3 @@ function(_qt_internal_add_qml_static_plugin_dependency target dep_target)
"$<${skip_prl_marker}:$<TARGET_NAME:${dep_target}>>")
endif()
endfunction()
function(_qt_internal_collect_qml_module_dependencies target)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19.0")
cmake_language(EVAL CODE
"cmake_language(DEFER CALL _qt_internal_collect_qml_module_dependencies_deferred \"${target}\")"
)
else()
_qt_internal_collect_qml_module_dependencies_deferred("${target}")
endif()
endfunction()
function(_qt_internal_collect_qml_module_dependencies_deferred target)
get_target_property(deps ${target} QT_QML_MODULE_DEPENDENCIES)
if(NOT deps)
return()
endif()
foreach(dep IN LISTS deps)
string(REPLACE " " ";" dep "${dep}")
list(GET dep 0 dep_module_uri)
get_property(qml_uris GLOBAL PROPERTY _qt_all_qml_uris)
list(FIND qml_uris "${dep_module_uri}" index)
if(index LESS 0)
continue()
endif()
get_property(qml_targets GLOBAL PROPERTY _qt_all_qml_targets)
list(GET qml_targets ${index} dep_module)
# Make the module target dependent on its non-imported QML dependencies.
if(TARGET "${dep_module}")
get_target_property(is_imported ${dep_module} IMPORTED)
if(NOT is_imported)
add_dependencies(${target} ${dep_module})
endif()
endif()
endforeach()
endfunction()