Fix the unescaped path MATCH condition in QtHeadersClean
Use plain string find instead since paths containing special regex symbols, give either the invalid MATCH results or lead to regex compilation error. Pick-to: 6.5 Fixes: QTBUG-116042 Change-Id: I9deb2fe760843c9be1e622cf2216c6dc81d73e71 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 41b72465d83af147cef4d560756ced2b457955ec) Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
1038ba6c58
commit
67cb5b9bcf
@ -237,12 +237,14 @@ function(qt_internal_add_headersclean_target module_target module_headers)
|
|||||||
get_filename_component(input_file_name ${input_path} NAME)
|
get_filename_component(input_file_name ${input_path} NAME)
|
||||||
set(artifact_path "${CMAKE_CURRENT_BINARY_DIR}/header_check/${input_file_name}.o")
|
set(artifact_path "${CMAKE_CURRENT_BINARY_DIR}/header_check/${input_file_name}.o")
|
||||||
|
|
||||||
unset(input_base_dir)
|
set(possible_base_dirs "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}")
|
||||||
if(input_path MATCHES "${CMAKE_BINARY_DIR}")
|
foreach(dir IN LISTS possible_base_dirs)
|
||||||
set(input_base_dir "${CMAKE_BINARY_DIR}")
|
string(FIND "${input_path}" "${dir}" idx)
|
||||||
elseif(input_path MATCHES "${CMAKE_SOURCE_DIR}")
|
if(idx EQUAL "0")
|
||||||
set(input_base_dir "${CMAKE_SOURCE_DIR}")
|
set(input_base_dir "${dir}")
|
||||||
endif()
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
if(input_base_dir AND IS_ABSOLUTE "${input_base_dir}" AND IS_ABSOLUTE "${input_path}")
|
if(input_base_dir AND IS_ABSOLUTE "${input_base_dir}" AND IS_ABSOLUTE "${input_path}")
|
||||||
file(RELATIVE_PATH comment_header_path "${input_base_dir}" "${input_path}")
|
file(RELATIVE_PATH comment_header_path "${input_base_dir}" "${input_path}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user