Introduce _qt_internal_append_cmake_configure_depends

The function append the unique entries to the CMAKE_CONFIGURE_DEPENDS
property. This suppress the ninja recompat issue, which complains
about the duplicated entries in that come from the
CMAKE_CONFIGURE_DEPENDS property. It's likely the CMake issue, but
we may work around it.

Pick-to: 6.8 6.9 6.10
Change-Id: I2f10834b0dca3d2aa08fe13fba69849e97fa77d0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexey Edelev 2025-03-11 13:48:28 +01:00
parent 1bcfbfa3bc
commit 1f10cd4b45
5 changed files with 16 additions and 5 deletions

View File

@ -85,7 +85,7 @@ if(QT_WILL_INSTALL)
endforeach()
endif()
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
_qt_internal_append_cmake_configure_depends(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/${__build_internals_standalone_test_template_dir}/CMakeLists.txt"
${__build_internals_extra_files}
)

View File

@ -807,7 +807,7 @@ set(QT_ALLOW_MISSING_TOOLS_PACKAGES TRUE)")
)
# Make sure touched extra cmake files cause a reconfigure, so they get re-copied.
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${cmake_file}")
_qt_internal_append_cmake_configure_depends("${cmake_file}")
endforeach()
list(APPEND extra_cmake_includes ${arg_EXTRA_CMAKE_INCLUDES})

View File

@ -956,3 +956,15 @@ function(_qt_internal_is_c_identifier out_var value)
set(${out_var} "FALSE" PARENT_SCOPE)
endif()
endfunction()
# Makes appending of the CMake configure time dependencies unique.
function(_qt_internal_append_cmake_configure_depends)
get_property(configure_depends DIRECTORY PROPERTY CMAKE_CONFIGURE_DEPENDS)
foreach(path IN LISTS ARGN)
get_filename_component(abs_path "${path}" REALPATH)
if(NOT "${abs_path}" IN_LIST configure_depends)
list(APPEND configure_depends "${abs_path}")
endif()
endforeach()
set_property(DIRECTORY PROPERTY CMAKE_CONFIGURE_DEPENDS "${configure_depends}")
endfunction()

View File

@ -432,8 +432,7 @@ function(_qt_internal_sbom_end_project)
# Add configure-time dependency on project attribution files.
get_property(attribution_files GLOBAL PROPERTY _qt_internal_project_attribution_files)
list(REMOVE_DUPLICATES attribution_files)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${attribution_files}")
_qt_internal_append_cmake_configure_depends(${attribution_files})
endfunction()
# Automatically begins sbom generation for a qt git repo unless QT_SKIP_SBOM_AUTO_PROJECT is TRUE.

View File

@ -19,7 +19,7 @@ foreach(dir global config)
# dependencies should be set up in that case (coarsness, use install vs build dirs,
# etc).
file(GLOB_RECURSE files LIST_DIRECTORIES FALSE "${dir}/*")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${files})
_qt_internal_append_cmake_configure_depends(${files})
endif()
endif()
endforeach()