summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalData.cmake
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-07-27 22:41:13 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-07-27 22:41:13 (GMT)
commit5d0d980d9949daf596e10715d686adc95c1c232b (patch)
tree45ec5b1fd21b10dc996083f5fe5657d8b07c3232 /Modules/ExternalData.cmake
parent73c618be7036c693cbff764b3765de1bf4626cfb (diff)
downloadCMake-5d0d980d9949daf596e10715d686adc95c1c232b.zip
CMake-5d0d980d9949daf596e10715d686adc95c1c232b.tar.gz
CMake-5d0d980d9949daf596e10715d686adc95c1c232b.tar.bz2
Use string(APPEND) in Modules
Automate with: find Modules -type f -print0 | xargs -0 perl -i -0pe \ 's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
Diffstat (limited to 'Modules/ExternalData.cmake')
-rw-r--r--Modules/ExternalData.cmake16
1 files changed, 8 insertions, 8 deletions
diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake
index 02d2b15..a0bffe7 100644
--- a/Modules/ExternalData.cmake
+++ b/Modules/ExternalData.cmake
@@ -473,10 +473,10 @@ function(ExternalData_expand_arguments target outArgsVar)
if("x${piece}" MATCHES "^x${data_regex}$")
# Replace this DATA{}-piece with a file path.
_ExternalData_arg("${target}" "${piece}" "${CMAKE_MATCH_1}" file)
- set(outArg "${outArg}${file}")
+ string(APPEND outArg "${file}")
else()
# No replacement needed for this piece.
- set(outArg "${outArg}${piece}")
+ string(APPEND outArg "${piece}")
endif()
endforeach()
else()
@@ -696,12 +696,12 @@ macro(_ExternalData_arg_associated)
get_filename_component(reldir "${reldata}" PATH)
endif()
if(reldir)
- set(reldir "${reldir}/")
+ string(APPEND reldir "/")
endif()
_ExternalData_exact_regex(reldir_regex "${reldir}")
if(recurse_option)
set(glob GLOB_RECURSE)
- set(reldir_regex "${reldir_regex}(.+/)?")
+ string(APPEND reldir_regex "(.+/)?")
else()
set(glob GLOB)
endif()
@@ -717,7 +717,7 @@ macro(_ExternalData_arg_associated)
set(all "")
set(sep "")
foreach(regex ${associated_regex})
- set(all "${all}${sep}${reldir_regex}${regex}")
+ string(APPEND all "${sep}${reldir_regex}${regex}")
set(sep "|")
endforeach()
_ExternalData_arg_find_files(${glob} "${reldir}" "${all}")
@@ -978,9 +978,9 @@ function(_ExternalData_download_object name hash algo var_obj)
else()
_ExternalData_download_file("${url}" "${tmp}" err errMsg)
endif()
- set(tried "${tried}\n ${url}")
+ string(APPEND tried "\n ${url}")
if(err)
- set(tried "${tried} (${errMsg})")
+ string(APPEND tried " (${errMsg})")
else()
# Verify downloaded object.
_ExternalData_compute_hash(dl_hash "${algo}" "${tmp}")
@@ -988,7 +988,7 @@ function(_ExternalData_download_object name hash algo var_obj)
set(found 1)
break()
else()
- set(tried "${tried} (wrong hash ${algo}=${dl_hash})")
+ string(APPEND tried " (wrong hash ${algo}=${dl_hash})")
if("$ENV{ExternalData_DEBUG_DOWNLOAD}" MATCHES ".")
file(RENAME "${tmp}" "${store}/${algo}/${dl_hash}")
endif()