diff options
author | Brad King <brad.king@kitware.com> | 2013-05-24 19:33:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-05-24 19:45:38 (GMT) |
commit | c35961b010da87492a60afb6e5dd7436ea36ed8b (patch) | |
tree | 1c6d8f1abccd6fd9a787a4a5a99b52ed3c28a21d /Modules/ExternalData.cmake | |
parent | 5dd8c01429da90a7417b72f17e784cc98f70f57c (diff) | |
download | CMake-c35961b010da87492a60afb6e5dd7436ea36ed8b.zip CMake-c35961b010da87492a60afb6e5dd7436ea36ed8b.tar.gz CMake-c35961b010da87492a60afb6e5dd7436ea36ed8b.tar.bz2 |
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.
Diffstat (limited to 'Modules/ExternalData.cmake')
-rw-r--r-- | Modules/ExternalData.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake index 187f408..8332725 100644 --- a/Modules/ExternalData.cmake +++ b/Modules/ExternalData.cmake @@ -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) |