diff --git a/cmake/QtModuleHelpers.cmake b/cmake/QtModuleHelpers.cmake index 05ddb54177c..cf64e485e81 100644 --- a/cmake/QtModuleHelpers.cmake +++ b/cmake/QtModuleHelpers.cmake @@ -1198,20 +1198,20 @@ function(qt_internal_collect_module_headers out_var target) get_target_property(private_filter ${target} _qt_module_private_headers_filter_regex) get_target_property(qpa_filter ${target} _qt_module_qpa_headers_filter_regex) - foreach(file IN LISTS sources) - if(NOT IS_ABSOLUTE) - get_filename_component(file "${file}" ABSOLUTE) - endif() - get_filename_component(file_name "${file}" NAME) + foreach(file_path IN LISTS sources) + get_filename_component(file_name "${file_path}" NAME) if(NOT file_name MATCHES ".+\\.h$") continue() endif() - if(qpa_filter AND file MATCHES "${qpa_filter}") - list(APPEND ${out_var}_qpa "${file}") - elseif(private_filter AND file MATCHES "${private_filter}") - list(APPEND ${out_var}_private "${file}") - elseif(NOT public_filter OR file MATCHES "${public_filter}") - list(APPEND ${out_var}_public "${file}") + get_filename_component(file_path "${file_path}" ABSOLUTE) + get_filename_component(file_path "${file_path}" REALPATH) + list(APPEND ${out_var}_all "${file_path}") + if(qpa_filter AND file_name MATCHES "${qpa_filter}") + list(APPEND ${out_var}_qpa "${file_path}") + elseif(private_filter AND file_name MATCHES "${private_filter}") + list(APPEND ${out_var}_private "${file_path}") + elseif(NOT public_filter OR file_name MATCHES "${public_filter}") + list(APPEND ${out_var}_public "${file_path}") endif() endforeach()