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

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()
......
......@@ -761,7 +761,7 @@ function(cpack_rpm_prepare_relocation_paths)
if(NOT CPACK_RPM_NO_INSTALL_PREFIX_RELOCATION AND
NOT CPACK_RPM_NO_${CPACK_RPM_PACKAGE_COMPONENT}_INSTALL_PREFIX_RELOCATION AND
NOT CPACK_RPM_NO_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_INSTALL_PREFIX_RELOCATION)
set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}Prefix: ${PATH_PREFIX}\n")
string(APPEND TMP_RPM_PREFIXES "Prefix: ${PATH_PREFIX}\n")
list(APPEND RPM_USED_PACKAGE_PREFIXES "${PATH_PREFIX}")
if(CPACK_RPM_PACKAGE_DEBUG)
......@@ -779,7 +779,7 @@ function(cpack_rpm_prepare_relocation_paths)
endif()
if(EXISTS "${WDIR}/${PREPARED_RELOCATION_PATH}")
set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}Prefix: ${PREPARED_RELOCATION_PATH}\n")
string(APPEND TMP_RPM_PREFIXES "Prefix: ${PREPARED_RELOCATION_PATH}\n")
list(APPEND RPM_USED_PACKAGE_PREFIXES "${PREPARED_RELOCATION_PATH}")
endif()
endforeach()
......@@ -954,7 +954,7 @@ function(cpack_rpm_symlink_create_relocation_script PACKAGE_PREFIXES)
if("${SYMLINK_INDEX}" EQUAL "${POINT_INDEX}")
set(INDENT "")
else()
set(SCRIPT_PART "${SCRIPT_PART} if [ \"$RPM_INSTALL_PREFIX${POINT_INDEX}\" != \"${POINT_PATH}\" ]; then\n")
string(APPEND SCRIPT_PART " if [ \"$RPM_INSTALL_PREFIX${POINT_INDEX}\" != \"${POINT_PATH}\" ]; then\n")
set(INDENT " ")
endif()
......@@ -971,14 +971,14 @@ function(cpack_rpm_symlink_create_relocation_script PACKAGE_PREFIXES)
math(EXPR POINT_PATH_START ${SPLIT_INDEX}+1+${POINT_PATH_LEN})
string(SUBSTRING ${RELOCATION_SCRIPT_PAIR} ${POINT_PATH_START} -1 POINT_)
set(SCRIPT_PART "${SCRIPT_PART} ${INDENT}if [ -z \"$CPACK_RPM_RELOCATED_SYMLINK_${RELOCATION_INDEX}\" ]; then\n")
set(SCRIPT_PART "${SCRIPT_PART} ${INDENT}ln -s \"$RPM_INSTALL_PREFIX${POINT_INDEX}${POINT_}\" \"$RPM_INSTALL_PREFIX${SYMLINK_INDEX}${SYMLINK_}\"\n")
set(SCRIPT_PART "${SCRIPT_PART} ${INDENT}CPACK_RPM_RELOCATED_SYMLINK_${RELOCATION_INDEX}=true\n")
set(SCRIPT_PART "${SCRIPT_PART} ${INDENT}fi\n")
string(APPEND SCRIPT_PART " ${INDENT}if [ -z \"$CPACK_RPM_RELOCATED_SYMLINK_${RELOCATION_INDEX}\" ]; then\n")
string(APPEND SCRIPT_PART " ${INDENT}ln -s \"$RPM_INSTALL_PREFIX${POINT_INDEX}${POINT_}\" \"$RPM_INSTALL_PREFIX${SYMLINK_INDEX}${SYMLINK_}\"\n")
string(APPEND SCRIPT_PART " ${INDENT}CPACK_RPM_RELOCATED_SYMLINK_${RELOCATION_INDEX}=true\n")
string(APPEND SCRIPT_PART " ${INDENT}fi\n")
endforeach()
if(NOT "${SYMLINK_INDEX}" EQUAL "${POINT_INDEX}")
set(SCRIPT_PART "${SCRIPT_PART} fi\n")
string(APPEND SCRIPT_PART " fi\n")
endif()
endif()
endforeach()
......@@ -998,16 +998,16 @@ function(cpack_rpm_symlink_create_relocation_script PACKAGE_PREFIXES)
math(EXPR POINT_PATH_START ${SPLIT_INDEX}+1)
string(SUBSTRING ${RELOCATION_SCRIPT_PAIR} ${POINT_PATH_START} -1 POINT_)
set(SCRIPT_PART "${SCRIPT_PART} if [ -z \"$CPACK_RPM_RELOCATED_SYMLINK_${RELOCATION_INDEX}\" ]; then\n")
set(SCRIPT_PART "${SCRIPT_PART} ln -s \"${POINT_}\" \"$RPM_INSTALL_PREFIX${SYMLINK_INDEX}${SYMLINK_}\"\n")
set(SCRIPT_PART "${SCRIPT_PART} CPACK_RPM_RELOCATED_SYMLINK_${RELOCATION_INDEX}=true\n")
set(SCRIPT_PART "${SCRIPT_PART} fi\n")
string(APPEND SCRIPT_PART " if [ -z \"$CPACK_RPM_RELOCATED_SYMLINK_${RELOCATION_INDEX}\" ]; then\n")
string(APPEND SCRIPT_PART " ln -s \"${POINT_}\" \"$RPM_INSTALL_PREFIX${SYMLINK_INDEX}${SYMLINK_}\"\n")
string(APPEND SCRIPT_PART " CPACK_RPM_RELOCATED_SYMLINK_${RELOCATION_INDEX}=true\n")
string(APPEND SCRIPT_PART " fi\n")
endforeach()
endif()
if(PARTS_CNT)
set(SCRIPT "${SCRIPT_PART}")
set(SCRIPT "${SCRIPT}fi\n")
string(APPEND SCRIPT "fi\n")
endif()
endforeach()
......@@ -1018,7 +1018,7 @@ function(cpack_rpm_symlink_create_relocation_script PACKAGE_PREFIXES)
string(LENGTH "${POINT_PATH}" POINT_PATH_LEN)
if(_RPM_RELOCATION_SCRIPT_X_${POINT_INDEX})
set(SCRIPT "${SCRIPT}if [ \"$RPM_INSTALL_PREFIX${POINT_INDEX}\" != \"${POINT_PATH}\" ]; then\n")
string(APPEND SCRIPT "if [ \"$RPM_INSTALL_PREFIX${POINT_INDEX}\" != \"${POINT_PATH}\" ]; then\n")
foreach(RELOCATION_NO IN LISTS _RPM_RELOCATION_SCRIPT_X_${POINT_INDEX})
math(EXPR RELOCATION_INDEX ${RELOCATION_NO}-1)
......@@ -1030,13 +1030,13 @@ function(cpack_rpm_symlink_create_relocation_script PACKAGE_PREFIXES)
math(EXPR POINT_PATH_START ${SPLIT_INDEX}+1+${POINT_PATH_LEN})
string(SUBSTRING ${RELOCATION_SCRIPT_PAIR} ${POINT_PATH_START} -1 POINT_)
set(SCRIPT "${SCRIPT} if [ -z \"$CPACK_RPM_RELOCATED_SYMLINK_${RELOCATION_INDEX}\" ]; then\n")
set(SCRIPT "${SCRIPT} ln -s \"$RPM_INSTALL_PREFIX${POINT_INDEX}${POINT_}\" \"${SYMLINK_}\"\n")
set(SCRIPT "${SCRIPT} CPACK_RPM_RELOCATED_SYMLINK_${RELOCATION_INDEX}=true\n")
set(SCRIPT "${SCRIPT} fi\n")
string(APPEND SCRIPT " if [ -z \"$CPACK_RPM_RELOCATED_SYMLINK_${RELOCATION_INDEX}\" ]; then\n")
string(APPEND SCRIPT " ln -s \"$RPM_INSTALL_PREFIX${POINT_INDEX}${POINT_}\" \"${SYMLINK_}\"\n")
string(APPEND SCRIPT " CPACK_RPM_RELOCATED_SYMLINK_${RELOCATION_INDEX}=true\n")
string(APPEND SCRIPT " fi\n")
endforeach()
set(SCRIPT "${SCRIPT}fi\n")
string(APPEND SCRIPT "fi\n")
endif()
endforeach()
......@@ -1052,9 +1052,9 @@ function(cpack_rpm_symlink_create_relocation_script PACKAGE_PREFIXES)
math(EXPR POINT_PATH_START ${SPLIT_INDEX}+1)
string(SUBSTRING ${RELOCATION_SCRIPT_PAIR} ${POINT_PATH_START} -1 POINT_)
set(SCRIPT "${SCRIPT}if [ -z \"$CPACK_RPM_RELOCATED_SYMLINK_${RELOCATION_INDEX}\" ]; then\n")
set(SCRIPT "${SCRIPT} ln -s \"${POINT_}\" \"${SYMLINK_}\"\n")
set(SCRIPT "${SCRIPT}fi\n")
string(APPEND SCRIPT "if [ -z \"$CPACK_RPM_RELOCATED_SYMLINK_${RELOCATION_INDEX}\" ]; then\n")
string(APPEND SCRIPT " ln -s \"${POINT_}\" \"${SYMLINK_}\"\n")
string(APPEND SCRIPT "fi\n")
endforeach()
endif()
......@@ -1217,7 +1217,7 @@ function(cpack_rpm_prepare_install_files INSTALL_FILES_LIST WDIR PACKAGE_PREFIXE
set(DIRECTIVE "%dir ")
endif()
set(INSTALL_FILES "${INSTALL_FILES}${DIRECTIVE}\"${F}\"\n")
string(APPEND INSTALL_FILES "${DIRECTIVE}\"${F}\"\n")
endforeach()
if(REQUIRES_SYMLINK_RELOCATION_SCRIPT)
......@@ -1348,7 +1348,7 @@ function(cpack_rpm_generate_package)
endif()
if(CPACK_RPM_PACKAGE_COMPONENT)
set(CPACK_RPM_PACKAGE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_COMPONENT}")
string(APPEND CPACK_RPM_PACKAGE_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}")
cpack_rpm_variable_fallback("CPACK_RPM_PACKAGE_NAME"
"CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_NAME"
"CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_PACKAGE_NAME")
......@@ -1407,7 +1407,7 @@ function(cpack_rpm_generate_package)
endif()
if(CPACK_RPM_PACKAGE_RELEASE_DIST)
set(CPACK_RPM_PACKAGE_RELEASE "${CPACK_RPM_PACKAGE_RELEASE}%{?dist}")
string(APPEND CPACK_RPM_PACKAGE_RELEASE "%{?dist}")
endif()
# CPACK_RPM_PACKAGE_LICENSE
......@@ -1526,13 +1526,13 @@ function(cpack_rpm_generate_package)
string(SUBSTRING ${_RPM_SPEC_HEADER} 1 -1 _PACKAGE_HEADER_TAIL)
string(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL)
string(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME)
set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
string(APPEND _PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_TAIL}")
# The following keywords require parentheses around the "pre" or "post" suffix in the final RPM spec file.
set(SCRIPTS_REQUIREMENTS_LIST REQUIRES_PRE REQUIRES_POST REQUIRES_PREUN REQUIRES_POSTUN)
list(FIND SCRIPTS_REQUIREMENTS_LIST ${_RPM_SPEC_HEADER} IS_SCRIPTS_REQUIREMENT_FOUND)
if(NOT ${IS_SCRIPTS_REQUIREMENT_FOUND} EQUAL -1)
string(REPLACE "_" "(" _PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}")
set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME})")
string(APPEND _PACKAGE_HEADER_NAME ")")
endif()
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
......@@ -1692,10 +1692,10 @@ function(cpack_rpm_generate_package)
message("CPackRPM:Debug: F_PREFIX=<${F_PREFIX}>, F_PATH=<${F_PATH}>")
endif()
if(F_PREFIX)
set(F_PREFIX "${F_PREFIX} ")
string(APPEND F_PREFIX " ")
endif()
# Rebuild the user list file
set(CPACK_RPM_USER_INSTALL_FILES "${CPACK_RPM_USER_INSTALL_FILES}${F_PREFIX}\"${F_PATH}\"\n")
string(APPEND CPACK_RPM_USER_INSTALL_FILES "${F_PREFIX}\"${F_PATH}\"\n")
# Remove from CPACK_RPM_INSTALL_FILES and CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL
list(REMOVE_ITEM CPACK_RPM_INSTALL_FILES_LIST ${F_PATH})
......@@ -1708,7 +1708,7 @@ function(cpack_rpm_generate_package)
# Rebuild CPACK_RPM_INSTALL_FILES
set(CPACK_RPM_INSTALL_FILES "")
foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
string(APPEND CPACK_RPM_INSTALL_FILES "\"${F}\"\n")
endforeach()
else()
set(CPACK_RPM_USER_INSTALL_FILES "")
......@@ -1729,12 +1729,12 @@ function(cpack_rpm_generate_package)
# Rebuild INSTALL_FILES
set(CPACK_RPM_INSTALL_FILES "")
foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
string(APPEND CPACK_RPM_INSTALL_FILES "\"${F}\"\n")
endforeach()
# Build ABSOLUTE_INSTALL_FILES
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "${CPACK_RPM_ABSOLUTE_INSTALL_FILES}%config \"${F}\"\n")
string(APPEND CPACK_RPM_ABSOLUTE_INSTALL_FILES "%config \"${F}\"\n")
endforeach()
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}")
......
......@@ -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>")