summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2022-09-21 13:30:37 +0200
committerAlexey Edelev <alexey.edelev@qt.io>2022-09-21 20:41:43 +0200
commit0a4761522b9a3f74efc1abde032700368c47d40d (patch)
treecf08c9499f7705af4f444df68c0119437ba91666 /cmake
parentae22bff97ea31175f1458827c762609bc9ef05a3 (diff)
Avoid the 'file' command shadowing
Avoid the 'file' command shadowing by a variable and use file name when filtering header files by type. Amends 8539e641f6f48a605547f66c47266d19e537f74e Task-number: QTBUG-103196 Change-Id: If012975efafaf119cffbd89baf84df334bc057ac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtModuleHelpers.cmake22
1 files changed, 11 insertions, 11 deletions
diff --git a/cmake/QtModuleHelpers.cmake b/cmake/QtModuleHelpers.cmake
index 05ddb54177..cf64e485e8 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()