summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject.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/ExternalProject.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/ExternalProject.cmake')
-rw-r--r--Modules/ExternalProject.cmake16
1 files changed, 8 insertions, 8 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 7e179aa..755b4fb 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1117,8 +1117,8 @@ function(_ep_command_line_to_initial_cache var args force)
set(line "${CMAKE_MATCH_1}")
if(setArg)
# This is required to build up lists in variables, or complete an entry
- set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" ${forceArg})")
- set(script_initial_cache "${script_initial_cache}\n${setArg}")
+ string(APPEND setArg "${accumulator}\" CACHE ${type} \"Initial cache\" ${forceArg})")
+ string(APPEND script_initial_cache "\n${setArg}")
set(accumulator "")
set(setArg "")
endif()
@@ -1132,13 +1132,13 @@ function(_ep_command_line_to_initial_cache var args force)
endif()
else()
# Assume this is a list to append to the last var
- set(accumulator "${accumulator};${line}")
+ string(APPEND accumulator ";${line}")
endif()
endforeach()
# Catch the final line of the args
if(setArg)
- set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" ${forceArg})")
- set(script_initial_cache "${script_initial_cache}\n${setArg}")
+ string(APPEND setArg "${accumulator}\" CACHE ${type} \"Initial cache\" ${forceArg})")
+ string(APPEND script_initial_cache "\n${setArg}")
endif()
set(${var} ${script_initial_cache} PARENT_SCOPE)
endfunction()
@@ -1332,16 +1332,16 @@ endif()
foreach(arg IN LISTS command)
if("x${arg}" STREQUAL "xCOMMAND")
if(NOT "x${cmd}" STREQUAL "x")
- set(code "${code}set(command \"${cmd}\")${code_execute_process}")
+ string(APPEND code "set(command \"${cmd}\")${code_execute_process}")
endif()
set(cmd "")
set(sep "")
else()
- set(cmd "${cmd}${sep}${arg}")
+ string(APPEND cmd "${sep}${arg}")
set(sep ";")
endif()
endforeach()
- set(code "${code}set(command \"${cmd}\")${code_execute_process}")
+ string(APPEND code "set(command \"${cmd}\")${code_execute_process}")
file(GENERATE OUTPUT "${stamp_dir}/${name}-${step}-$<CONFIG>-impl.cmake" CONTENT "${code}")
set(command ${CMAKE_COMMAND} "-Dmake=\${make}" "-Dconfig=\${config}" -P ${stamp_dir}/${name}-${step}-$<CONFIG>-impl.cmake)
endif()