Commit 5d0d980d authored by Daniel Pfeifer's avatar Daniel Pfeifer

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'
parent 73c618be
......@@ -26,6 +26,6 @@ endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
string(APPEND PACKAGE_VERSION " (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()
......@@ -42,6 +42,6 @@ endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
string(APPEND PACKAGE_VERSION " (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()
......@@ -41,6 +41,6 @@ endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
string(APPEND PACKAGE_VERSION " (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()
......@@ -50,7 +50,7 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
endif()
endif()
set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
string(APPEND CMAKE_CXX_FLAGS " ${CMAKE_ANSI_CXXFLAGS}")
include(TestForANSIStreamHeaders)
include(CheckIncludeFileCXX)
include(TestForSTDNamespace)
......
......@@ -16,9 +16,9 @@
# cache values that can be initialized in the platform-compiler.cmake file
# it may be included by more than one language.
set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS_INIT "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " $ENV{LDFLAGS}")
string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " $ENV{LDFLAGS}")
string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " $ENV{LDFLAGS}")
foreach(t EXE SHARED MODULE STATIC)
foreach(c "" _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO)
......
......@@ -120,18 +120,18 @@ function(compiler_id_detection outvar lang)
if (CID_ID_STRING)
set(PREFIX ${CID_PREFIX})
string(CONFIGURE "${_compiler_id_simulate_${Id}}" SIMULATE_BLOCK @ONLY)
set(id_content "${id_content}# define ${CID_PREFIX}COMPILER_ID \"${Id}\"${SIMULATE_BLOCK}")
string(APPEND id_content "# define ${CID_PREFIX}COMPILER_ID \"${Id}\"${SIMULATE_BLOCK}")
endif()
if (CID_ID_DEFINE)
set(id_content "${id_content}# undef ${CID_PREFIX}COMPILER_IS_${Id}\n")
set(id_content "${id_content}# define ${CID_PREFIX}COMPILER_IS_${Id} 1\n")
string(APPEND id_content "# undef ${CID_PREFIX}COMPILER_IS_${Id}\n")
string(APPEND id_content "# define ${CID_PREFIX}COMPILER_IS_${Id} 1\n")
endif()
if (CID_VERSION_STRINGS)
set(PREFIX ${CID_PREFIX})
set(MACRO_DEC DEC)
set(MACRO_HEX HEX)
string(CONFIGURE "${_compiler_id_version_compute_${Id}}" VERSION_BLOCK @ONLY)
set(id_content "${id_content}${VERSION_BLOCK}\n")
string(APPEND id_content "${VERSION_BLOCK}\n")
endif()
set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}\n${id_content}")
set(pp_if "#elif")
......
......@@ -493,11 +493,11 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
if(NOT DEFINED COMPILER_VERSION AND HAVE_COMPILER_VERSION_MAJOR)
set(COMPILER_VERSION "${COMPILER_VERSION_MAJOR}")
if(HAVE_COMPILER_VERSION_MINOR)
set(COMPILER_VERSION "${COMPILER_VERSION}.${COMPILER_VERSION_MINOR}")
string(APPEND COMPILER_VERSION ".${COMPILER_VERSION_MINOR}")
if(HAVE_COMPILER_VERSION_PATCH)
set(COMPILER_VERSION "${COMPILER_VERSION}.${COMPILER_VERSION_PATCH}")
string(APPEND COMPILER_VERSION ".${COMPILER_VERSION_PATCH}")
if(HAVE_COMPILER_VERSION_TWEAK)
set(COMPILER_VERSION "${COMPILER_VERSION}.${COMPILER_VERSION_TWEAK}")
string(APPEND COMPILER_VERSION ".${COMPILER_VERSION_TWEAK}")
endif()
endif()
endif()
......
......@@ -141,10 +141,10 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
set(_version_info "")
foreach(m MAJOR MINOR PATCH TWEAK)
set(_COMP "_${m}")
set(_version_info "${_version_info}
string(APPEND _version_info "
#if defined(COMPILER_VERSION${_COMP})")
foreach(d 1 2 3 4 5 6 7 8)
set(_version_info "${_version_info}
string(APPEND _version_info "
# undef DEC
# undef HEX
# define DEC(n) DEC_${d}(n)
......@@ -172,7 +172,7 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
# endif
")
endforeach()
set(_version_info "${_version_info}
string(APPEND _version_info "
#endif")
endforeach()
set(CMAKE_Fortran_COMPILER_ID_VERSION_INFO "${_version_info}")
......
......@@ -280,7 +280,7 @@ get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/${PACKAGE
if("${absInstallDir}" MATCHES "^(/usr)?/lib(64)?/.+")
# Handle "/usr move" symlinks created by some Linux distros.
set(PACKAGE_INIT "${PACKAGE_INIT}
string(APPEND PACKAGE_INIT "
# Use original install prefix when loaded through a \"/usr move\"
# cross-prefix symbolic link such as /lib -> /usr/lib.
get_filename_component(_realCurr \"\${CMAKE_CURRENT_LIST_DIR}\" REALPATH)
......@@ -294,7 +294,7 @@ unset(_realCurr)
endif()
if(NOT CCF_NO_SET_AND_CHECK_MACRO)
set(PACKAGE_INIT "${PACKAGE_INIT}
string(APPEND PACKAGE_INIT "
macro(set_and_check _var _file)
set(\${_var} \"\${_file}\")
if(NOT EXISTS \"\${_file}\")
......@@ -306,7 +306,7 @@ endmacro()
if(NOT CCF_NO_CHECK_REQUIRED_COMPONENTS_MACRO)
set(PACKAGE_INIT "${PACKAGE_INIT}
string(APPEND PACKAGE_INIT "
macro(check_required_components _NAME)
foreach(comp \${\${_NAME}_FIND_COMPONENTS})
if(NOT \${_NAME}_\${comp}_FOUND)
......@@ -319,7 +319,7 @@ endmacro()
")
endif()
set(PACKAGE_INIT "${PACKAGE_INIT}
string(APPEND PACKAGE_INIT "
####################################################################################")
configure_file("${_inputFile}" "${_outputFile}" @ONLY)
......
......@@ -32,7 +32,7 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
# whole line and just the command (argv[0]).
set(linker_regex "^( *|.*[/\\])(${linker}|([^/\\]+-)?ld|collect2)[^/\\]*( |$)")
set(linker_exclude_regex "collect2 version |^[A-Za-z0-9_]+=|/ldfe ")
set(log "${log} link line regex: [${linker_regex}]\n")
string(APPEND log " link line regex: [${linker_regex}]\n")
string(REGEX REPLACE "\r?\n" ";" output_lines "${text}")
foreach(line IN LISTS output_lines)
set(cmd)
......@@ -44,7 +44,7 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" _dir_regex "${CMAKE_BINARY_DIR}")
string(REGEX REPLACE " -[FL]${_dir_regex}/([^ ]| [^-])+( |$)" " " xline "${line}")
if(NOT "x${xline}" STREQUAL "x${line}")
set(log "${log} reduced line: [${line}]\n to: [${xline}]\n")
string(APPEND log " reduced line: [${line}]\n to: [${xline}]\n")
set(line "${xline}")
endif()
endif()
......@@ -56,67 +56,67 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
list(GET args 0 cmd)
endif()
if("${cmd}" MATCHES "${linker_regex}")
set(log "${log} link line: [${line}]\n")
string(APPEND log " link line: [${line}]\n")
string(REGEX REPLACE ";-([LYz]);" ";-\\1" args "${args}")
foreach(arg IN LISTS args)
if("${arg}" MATCHES "^-L(.:)?[/\\]")
# Unix search path.
string(REGEX REPLACE "^-L" "" dir "${arg}")
list(APPEND implicit_dirs_tmp ${dir})
set(log "${log} arg [${arg}] ==> dir [${dir}]\n")
string(APPEND log " arg [${arg}] ==> dir [${dir}]\n")
elseif("${arg}" MATCHES "^-l([^:].*)$")
# Unix library.
set(lib "${CMAKE_MATCH_1}")
list(APPEND implicit_libs_tmp ${lib})
set(log "${log} arg [${arg}] ==> lib [${lib}]\n")
string(APPEND log " arg [${arg}] ==> lib [${lib}]\n")
elseif("${arg}" MATCHES "^(.:)?[/\\].*\\.a$")
# Unix library full path.
list(APPEND implicit_libs_tmp ${arg})
set(log "${log} arg [${arg}] ==> lib [${arg}]\n")
string(APPEND log " arg [${arg}] ==> lib [${arg}]\n")
elseif("${arg}" MATCHES "^(.:)?[/\\].*\\.o$"
AND obj_regex AND "${arg}" MATCHES "${obj_regex}")
# Object file full path.
list(APPEND implicit_libs_tmp ${arg})
set(log "${log} arg [${arg}] ==> obj [${arg}]\n")
string(APPEND log " arg [${arg}] ==> obj [${arg}]\n")
elseif("${arg}" MATCHES "^-Y(P,)?[^0-9]")
# Sun search path ([^0-9] avoids conflict with Mac -Y<num>).
string(REGEX REPLACE "^-Y(P,)?" "" dirs "${arg}")
string(REPLACE ":" ";" dirs "${dirs}")
list(APPEND implicit_dirs_tmp ${dirs})
set(log "${log} arg [${arg}] ==> dirs [${dirs}]\n")
string(APPEND log " arg [${arg}] ==> dirs [${dirs}]\n")
elseif("${arg}" MATCHES "^-l:")
# HP named library.
list(APPEND implicit_libs_tmp ${arg})
set(log "${log} arg [${arg}] ==> lib [${arg}]\n")
string(APPEND log " arg [${arg}] ==> lib [${arg}]\n")
elseif("${arg}" MATCHES "^-z(all|default|weak)extract")
# Link editor option.
list(APPEND implicit_libs_tmp ${arg})
set(log "${log} arg [${arg}] ==> opt [${arg}]\n")
string(APPEND log " arg [${arg}] ==> opt [${arg}]\n")
else()
set(log "${log} arg [${arg}] ==> ignore\n")
string(APPEND log " arg [${arg}] ==> ignore\n")
endif()
endforeach()
break()
elseif("${line}" MATCHES "LPATH(=| is:? *)(.*)$")
set(log "${log} LPATH line: [${line}]\n")
string(APPEND log " LPATH line: [${line}]\n")
# HP search path.
string(REPLACE ":" ";" paths "${CMAKE_MATCH_2}")
list(APPEND implicit_dirs_tmp ${paths})
set(log "${log} dirs [${paths}]\n")
string(APPEND log " dirs [${paths}]\n")
else()
set(log "${log} ignore line: [${line}]\n")
string(APPEND log " ignore line: [${line}]\n")
endif()
endforeach()
# Look for library search paths reported by linker.
if("${output_lines}" MATCHES ";Library search paths:((;\t[^;]+)+)")
string(REPLACE ";\t" ";" implicit_dirs_match "${CMAKE_MATCH_1}")
set(log "${log} Library search paths: [${implicit_dirs_match}]\n")
string(APPEND log " Library search paths: [${implicit_dirs_match}]\n")
list(APPEND implicit_dirs_tmp ${implicit_dirs_match})
endif()
if("${output_lines}" MATCHES ";Framework search paths:((;\t[^;]+)+)")
string(REPLACE ";\t" ";" implicit_fwks_match "${CMAKE_MATCH_1}")
set(log "${log} Framework search paths: [${implicit_fwks_match}]\n")
string(APPEND log " Framework search paths: [${implicit_fwks_match}]\n")
list(APPEND implicit_fwks_tmp ${implicit_fwks_match})
endif()
......@@ -125,11 +125,11 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
set(implicit_libs "")
foreach(lib IN LISTS implicit_libs_tmp)
if("x${lib}" MATCHES "^x(crt.*\\.o|gcc.*|System.*|.*libclang_rt.*)$")
set(log "${log} remove lib [${lib}]\n")
string(APPEND log " remove lib [${lib}]\n")
elseif(IS_ABSOLUTE "${lib}")
get_filename_component(abs "${lib}" ABSOLUTE)
if(NOT "x${lib}" STREQUAL "x${abs}")
set(log "${log} collapse lib [${lib}] ==> [${abs}]\n")
string(APPEND log " collapse lib [${lib}] ==> [${abs}]\n")
endif()
list(APPEND implicit_libs "${abs}")
else()
......@@ -151,15 +151,15 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
set(msg "")
list(APPEND implicit_${t} "${dir}")
endif()
set(log "${log} collapse ${desc_${t}} dir [${d}] ==> [${dir}]${msg}\n")
string(APPEND log " collapse ${desc_${t}} dir [${d}] ==> [${dir}]${msg}\n")
endforeach()
list(REMOVE_DUPLICATES implicit_${t})
endforeach()
# Log results.
set(log "${log} implicit libs: [${implicit_libs}]\n")
set(log "${log} implicit dirs: [${implicit_dirs}]\n")
set(log "${log} implicit fwks: [${implicit_fwks}]\n")
string(APPEND log " implicit libs: [${implicit_libs}]\n")
string(APPEND log " implicit dirs: [${implicit_dirs}]\n")
string(APPEND log " implicit fwks: [${implicit_fwks}]\n")
# Return results.
set(${lib_var} "${implicit_libs}" PARENT_SCOPE)
......
......@@ -55,9 +55,9 @@ function(CMAKE_PRINT_VARIABLES)
set(msg "")
foreach(var ${ARGN})
if(msg)
set(msg "${msg} ; ")
string(APPEND msg " ; ")
endif()
set(msg "${msg}${var}=\"${${var}}\"")
string(APPEND msg "${var}=\"${${var}}\"")
endforeach()
message(STATUS "${msg}")
endfunction()
......@@ -132,21 +132,21 @@ function(CMAKE_PRINT_PROPERTIES )
if(keyword STREQUAL "TARGET")
if(NOT TARGET ${item})
set(itemExists FALSE)
set(msg "${msg}\n No such TARGET \"${item}\" !\n\n")
string(APPEND msg "\n No such TARGET \"${item}\" !\n\n")
endif()
endif()
if (itemExists)
set(msg "${msg} Properties for ${keyword} ${item}:\n")
string(APPEND msg " Properties for ${keyword} ${item}:\n")
foreach(prop ${CPP_PROPERTIES})
get_property(propertySet ${keyword} ${item} PROPERTY "${prop}" SET)
if(propertySet)
get_property(property ${keyword} ${item} PROPERTY "${prop}")
set(msg "${msg} ${item}.${prop} = \"${property}\"\n")
string(APPEND msg " ${item}.${prop} = \"${property}\"\n")
else()
set(msg "${msg} ${item}.${prop} = <NOTFOUND>\n")
string(APPEND msg " ${item}.${prop} = <NOTFOUND>\n")
endif()
endforeach()
endif()
......
......@@ -332,7 +332,7 @@ function(cpack_encode_variables)
set(value "${${var}}")
endif()
set(commands "${commands}\nSET(${var} \"${value}\")")
string(APPEND commands "\nSET(${var} \"${value}\")")
endif()
endforeach()
......
......@@ -409,11 +409,11 @@ macro(cpack_add_component compname)
# moduled was included.
if(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
get_cmake_property(_CPACK_ADDCOMP_COMPONENTS COMPONENTS)
set(_CPACK_ADDCOMP_STR "${_CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
string(APPEND _CPACK_ADDCOMP_STR "\nSET(CPACK_COMPONENTS_ALL")
foreach(COMP ${_CPACK_ADDCOMP_COMPONENTS})
set(_CPACK_ADDCOMP_STR "${_CPACK_ADDCOMP_STR} ${COMP}")
string(APPEND _CPACK_ADDCOMP_STR " ${COMP}")
endforeach()
set(_CPACK_ADDCOMP_STR "${_CPACK_ADDCOMP_STR})\n")
string(APPEND _CPACK_ADDCOMP_STR ")\n")
endif()
endif()
......@@ -501,8 +501,8 @@ macro(cpack_add_install_type insttype)
set(_CPACK_INSTTYPE_STR
"\n# Configuration for installation type \"${insttype}\"\n")
set(_CPACK_INSTTYPE_STR
"${_CPACK_INSTTYPE_STR}list(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
string(APPEND _CPACK_INSTTYPE_STR
"list(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
cpack_append_string_variable_set_command(
CPACK_INSTALL_TYPE_${_CPACK_INSTTYPE_UNAME}_DISPLAY_NAME
_CPACK_INSTTYPE_STR)
......
......@@ -645,7 +645,7 @@ macro(cpack_ifw_add_repository reponame)
endforeach()
list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame})
set(_CPACK_IFWREPO_STR "${_CPACK_IFWREPO_STR}list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame})\n")
string(APPEND _CPACK_IFWREPO_STR "list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame})\n")
if(CPack_CMake_INCLUDED)
file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${_CPACK_IFWREPO_STR}")
......@@ -687,7 +687,7 @@ macro(cpack_ifw_update_repository reponame)
OR CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_REMOVE
OR CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_REPLACE)
list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame})
set(_CPACK_IFWREPO_STR "${_CPACK_IFWREPO_STR}list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame})\n")
string(APPEND _CPACK_IFWREPO_STR "list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame})\n")
else()
set(_CPACK_IFWREPO_STR)
endif()
......
This diff is collapsed.
......@@ -59,7 +59,7 @@ if(CTEST_USE_LAUNCHERS)
"${__launch_common_options} --output <OUTPUT>")
if("${CMAKE_GENERATOR}" MATCHES "Ninja")
set(__launch_compile_options "${__launch_compile_options} --filter-prefix <CMAKE_CL_SHOWINCLUDES_PREFIX>")
string(APPEND __launch_compile_options " --filter-prefix <CMAKE_CL_SHOWINCLUDES_PREFIX>")
endif()
set(CTEST_LAUNCH_COMPILE
......
......@@ -60,7 +60,7 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
endif()
if(${ARGC} EQUAL 3)
set(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARGV2}")
string(APPEND CMAKE_C_FLAGS " ${ARGV2}")
endif()
try_compile(${VARIABLE}
......
......@@ -59,7 +59,7 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
endif()
if(${ARGC} EQUAL 3)
set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}")
string(APPEND CMAKE_CXX_FLAGS " ${ARGV2}")
endif()
try_compile(${VARIABLE}
......
......@@ -55,11 +55,11 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
set(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
foreach(FILE ${INCLUDE})
set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT
"#include <${FILE}>\n")
endforeach()
set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(void){return 0;}\n")
string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT
"\n\nint main(void){return 0;}\n")
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c" @ONLY)
......
......@@ -75,8 +75,8 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
endif()
foreach(_FILE ${_HEADER})
set(CHECK_PROTOTYPE_DEFINITION_HEADER
"${CHECK_PROTOTYPE_DEFINITION_HEADER}#include <${_FILE}>\n")
string(APPEND CHECK_PROTOTYPE_DEFINITION_HEADER
"#include <${_FILE}>\n")
endforeach()
set(CHECK_PROTOTYPE_DEFINITION_SYMBOL ${_FUNCTION})
......
......@@ -54,7 +54,7 @@ include(CheckCXXSourceCompiles)
macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
set(_INCLUDE_FILES)
foreach (it ${_HEADER})
set(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
string(APPEND _INCLUDE_FILES "#include <${it}>\n")
endforeach ()
if("x${ARGN}" STREQUAL "x")
......
......@@ -71,11 +71,11 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
set(CMAKE_SYMBOL_EXISTS_INCLUDES)
endif()
foreach(FILE ${FILES})
set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT
"#include <${FILE}>\n")
endforeach()
set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\nint main(int argc, char** argv)\n{\n (void)argv;\n#ifndef ${SYMBOL}\n return ((int*)(&${SYMBOL}))[argc];\n#else\n (void)argc;\n return 0;\n#endif\n}\n")
string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT
"\nint main(int argc, char** argv)\n{\n (void)argv;\n#ifndef ${SYMBOL}\n return ((int*)(&${SYMBOL}))[argc];\n#else\n (void)argc;\n return 0;\n#endif\n}\n")
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${SOURCEFILE}" @ONLY)
......
......@@ -97,17 +97,17 @@ function(__check_type_size_impl type var map builtin language)
set(headers)
if(builtin)
if(HAVE_SYS_TYPES_H)
set(headers "${headers}#include <sys/types.h>\n")
string(APPEND headers "#include <sys/types.h>\n")
endif()
if(HAVE_STDINT_H)
set(headers "${headers}#include <stdint.h>\n")
string(APPEND headers "#include <stdint.h>\n")
endif()
if(HAVE_STDDEF_H)
set(headers "${headers}#include <stddef.h>\n")
string(APPEND headers "#include <stddef.h>\n")
endif()
endif()
foreach(h ${CMAKE_EXTRA_INCLUDE_FILES})
set(headers "${headers}#include \"${h}\"\n")
string(APPEND headers "#include \"${h}\"\n")
endforeach()
# Perform the check.
......@@ -157,7 +157,7 @@ function(__check_type_size_impl type var map builtin language)
string(REGEX MATCH "${regex_key}" key "${info}")
string(REGEX REPLACE "${regex_key}" "\\1" key "${key}")
if(key)
set(code "${code}\nset(${var}-${key} \"${size}\")")
string(APPEND code "\nset(${var}-${key} \"${size}\")")
list(APPEND keys ${key})
endif()
endif()
......
......@@ -3,5 +3,5 @@ set(_compiler_id_pp_test "defined(__clang__) && defined(__apple_build_version__)
include("${CMAKE_CURRENT_LIST_DIR}/Clang-DetermineCompilerInternal.cmake")
set(_compiler_id_version_compute "${_compiler_id_version_compute}
string(APPEND _compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__apple_build_version__)")
......@@ -119,7 +119,7 @@ if(BUILD_TESTING)
# add testing targets
set(DART_EXPERIMENTAL_NAME Experimental)
if(DART_EXPERIMENTAL_USE_PROJECT_NAME)
set(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}")
string(APPEND DART_EXPERIMENTAL_NAME "${PROJECT_NAME}")
endif()
endif ()
......
......@@ -247,7 +247,7 @@ function(install_qt4_plugin_path plugin executable copy installed_plugin_path_va
set(plugins_path ".")
endif()
if(plugins_dir)
set(plugins_path "${plugins_path}/${plugins_dir}")
string(APPEND plugins_path "/${plugins_dir}")
endif()
endif()
......@@ -263,7 +263,7 @@ function(install_qt4_plugin_path plugin executable copy installed_plugin_path_va
get_filename_component(plugin_group "${plugin_path}" NAME)
set(${plugin_group_var} "${plugin_group}")
endif()
set(plugins_path "${plugins_path}/${plugin_group}")
string(APPEND plugins_path "/${plugin_group}")
if(${copy})
file(MAKE_DIRECTORY "${plugins_path}")
......
......@@ -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()
......
......@@ -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()
......
......@@ -411,23 +411,23 @@ function(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet)
if(includeThisOne)
set(_currentFeatureText "${_currentFeatureText}\n * ${_currentFeature}")
string(APPEND _currentFeatureText "\n * ${_currentFeature}")
get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_REQUIRED_VERSION)
if(_info)
set(_currentFeatureText "${_currentFeatureText} (required version ${_info})")
string(APPEND _currentFeatureText " (required version ${_info})")
endif()
get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION)
if(_info)
set(_currentFeatureText "${_currentFeatureText} , ${_info}")
string(APPEND _currentFeatureText " , ${_info}")
endif()
get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL)
if(_info)
set(_currentFeatureText "${_currentFeatureText} , <${_info}>")
string(APPEND _currentFeatureText " , <${_info}>")
endif()
get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE)
foreach(_purpose ${_info})
set(_currentFeatureText "${_currentFeatureText}\n ${_purpose}")
string(APPEND _currentFeatureText "\n ${_purpose}")
endforeach()
endif()
......@@ -527,7 +527,7 @@ function(FEATURE_SUMMARY)
set(_tmp)
_FS_GET_FEATURE_SUMMARY( ${part} _tmp ${_FS_INCLUDE_QUIET_PACKAGES})
if(_tmp)
set(_fullText "${_fullText}\n-- ${title_${part}}\n${_tmp}\n")