mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 07:08:38 -05:00
ExternalData: Do not re-stage staged object files
The ExternalData_LINK_CONTENT option tells ExternalData to convert real data files it finds into content links and to "stage" the original content in a ".ExternalData_<algo>_<hash>" file. However, after a data object has been staged it is possible that a user-provided pattern in the "REGEX:" option will later match the staged object file. We must not process staged object files even when a user pattern matches them. Fix the implementation to not match a staged object file as a normal data file for conversion. Extend the RunCMake.ExternalData test to cover this case.
This commit is contained in:
@@ -551,7 +551,10 @@ function(_ExternalData_arg_find_files pattern regex)
|
||||
set(relname "${entry}")
|
||||
set(alg "")
|
||||
endif()
|
||||
if("x${relname}" MATCHES "^x${regex}$" AND NOT IS_DIRECTORY "${top_src}/${entry}")
|
||||
if("x${relname}" MATCHES "^x${regex}$" # matches
|
||||
AND NOT IS_DIRECTORY "${top_src}/${entry}" # not a directory
|
||||
AND NOT "x${relname}" MATCHES "(^x|/)\\.ExternalData_" # not staged obj
|
||||
)
|
||||
set(name "${top_src}/${relname}")
|
||||
set(file "${top_bin}/${relname}")
|
||||
if(alg)
|
||||
|
||||
Reference in New Issue
Block a user