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'
This commit is contained in:
Daniel Pfeifer 2016-07-28 00:41:13 +02:00
parent 73c618be70
commit 5d0d980d99
58 changed files with 240 additions and 240 deletions

View File

@ -26,6 +26,6 @@ endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching: # 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@") if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") 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) set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif() endif()

View File

@ -42,6 +42,6 @@ endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching: # 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@") if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") 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) set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif() endif()

View File

@ -41,6 +41,6 @@ endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching: # 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@") if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") 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) set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif() endif()

View File

@ -50,7 +50,7 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
endif() endif()
endif() endif()
set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS}) 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(TestForANSIStreamHeaders)
include(CheckIncludeFileCXX) include(CheckIncludeFileCXX)
include(TestForSTDNamespace) include(TestForSTDNamespace)

View File

@ -16,9 +16,9 @@
# cache values that can be initialized in the platform-compiler.cmake file # cache values that can be initialized in the platform-compiler.cmake file
# it may be included by more than one language. # it may be included by more than one language.
set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}") string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " $ENV{LDFLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS_INIT "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}") string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " $ENV{LDFLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}") string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " $ENV{LDFLAGS}")
foreach(t EXE SHARED MODULE STATIC) foreach(t EXE SHARED MODULE STATIC)
foreach(c "" _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO) foreach(c "" _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO)

View File

@ -120,18 +120,18 @@ function(compiler_id_detection outvar lang)
if (CID_ID_STRING) if (CID_ID_STRING)
set(PREFIX ${CID_PREFIX}) set(PREFIX ${CID_PREFIX})
string(CONFIGURE "${_compiler_id_simulate_${Id}}" SIMULATE_BLOCK @ONLY) 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() endif()
if (CID_ID_DEFINE) if (CID_ID_DEFINE)
set(id_content "${id_content}# undef ${CID_PREFIX}COMPILER_IS_${Id}\n") string(APPEND 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 "# define ${CID_PREFIX}COMPILER_IS_${Id} 1\n")
endif() endif()
if (CID_VERSION_STRINGS) if (CID_VERSION_STRINGS)
set(PREFIX ${CID_PREFIX}) set(PREFIX ${CID_PREFIX})
set(MACRO_DEC DEC) set(MACRO_DEC DEC)
set(MACRO_HEX HEX) set(MACRO_HEX HEX)
string(CONFIGURE "${_compiler_id_version_compute_${Id}}" VERSION_BLOCK @ONLY) 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() endif()
set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}\n${id_content}") set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}\n${id_content}")
set(pp_if "#elif") set(pp_if "#elif")

View File

@ -493,11 +493,11 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
if(NOT DEFINED COMPILER_VERSION AND HAVE_COMPILER_VERSION_MAJOR) if(NOT DEFINED COMPILER_VERSION AND HAVE_COMPILER_VERSION_MAJOR)
set(COMPILER_VERSION "${COMPILER_VERSION_MAJOR}") set(COMPILER_VERSION "${COMPILER_VERSION_MAJOR}")
if(HAVE_COMPILER_VERSION_MINOR) 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) 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) if(HAVE_COMPILER_VERSION_TWEAK)
set(COMPILER_VERSION "${COMPILER_VERSION}.${COMPILER_VERSION_TWEAK}") string(APPEND COMPILER_VERSION ".${COMPILER_VERSION_TWEAK}")
endif() endif()
endif() endif()
endif() endif()

View File

@ -141,10 +141,10 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
set(_version_info "") set(_version_info "")
foreach(m MAJOR MINOR PATCH TWEAK) foreach(m MAJOR MINOR PATCH TWEAK)
set(_COMP "_${m}") set(_COMP "_${m}")
set(_version_info "${_version_info} string(APPEND _version_info "
#if defined(COMPILER_VERSION${_COMP})") #if defined(COMPILER_VERSION${_COMP})")
foreach(d 1 2 3 4 5 6 7 8) foreach(d 1 2 3 4 5 6 7 8)
set(_version_info "${_version_info} string(APPEND _version_info "
# undef DEC # undef DEC
# undef HEX # undef HEX
# define DEC(n) DEC_${d}(n) # define DEC(n) DEC_${d}(n)
@ -172,7 +172,7 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
# endif # endif
") ")
endforeach() endforeach()
set(_version_info "${_version_info} string(APPEND _version_info "
#endif") #endif")
endforeach() endforeach()
set(CMAKE_Fortran_COMPILER_ID_VERSION_INFO "${_version_info}") set(CMAKE_Fortran_COMPILER_ID_VERSION_INFO "${_version_info}")

View File

@ -280,7 +280,7 @@ get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/${PACKAGE
if("${absInstallDir}" MATCHES "^(/usr)?/lib(64)?/.+") if("${absInstallDir}" MATCHES "^(/usr)?/lib(64)?/.+")
# Handle "/usr move" symlinks created by some Linux distros. # 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\" # Use original install prefix when loaded through a \"/usr move\"
# cross-prefix symbolic link such as /lib -> /usr/lib. # cross-prefix symbolic link such as /lib -> /usr/lib.
get_filename_component(_realCurr \"\${CMAKE_CURRENT_LIST_DIR}\" REALPATH) get_filename_component(_realCurr \"\${CMAKE_CURRENT_LIST_DIR}\" REALPATH)
@ -294,7 +294,7 @@ unset(_realCurr)
endif() endif()
if(NOT CCF_NO_SET_AND_CHECK_MACRO) if(NOT CCF_NO_SET_AND_CHECK_MACRO)
set(PACKAGE_INIT "${PACKAGE_INIT} string(APPEND PACKAGE_INIT "
macro(set_and_check _var _file) macro(set_and_check _var _file)
set(\${_var} \"\${_file}\") set(\${_var} \"\${_file}\")
if(NOT EXISTS \"\${_file}\") if(NOT EXISTS \"\${_file}\")
@ -306,7 +306,7 @@ endmacro()
if(NOT CCF_NO_CHECK_REQUIRED_COMPONENTS_MACRO) if(NOT CCF_NO_CHECK_REQUIRED_COMPONENTS_MACRO)
set(PACKAGE_INIT "${PACKAGE_INIT} string(APPEND PACKAGE_INIT "
macro(check_required_components _NAME) macro(check_required_components _NAME)
foreach(comp \${\${_NAME}_FIND_COMPONENTS}) foreach(comp \${\${_NAME}_FIND_COMPONENTS})
if(NOT \${_NAME}_\${comp}_FOUND) if(NOT \${_NAME}_\${comp}_FOUND)
@ -319,7 +319,7 @@ endmacro()
") ")
endif() endif()
set(PACKAGE_INIT "${PACKAGE_INIT} string(APPEND PACKAGE_INIT "
####################################################################################") ####################################################################################")
configure_file("${_inputFile}" "${_outputFile}" @ONLY) configure_file("${_inputFile}" "${_outputFile}" @ONLY)

View File

@ -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]). # whole line and just the command (argv[0]).
set(linker_regex "^( *|.*[/\\])(${linker}|([^/\\]+-)?ld|collect2)[^/\\]*( |$)") set(linker_regex "^( *|.*[/\\])(${linker}|([^/\\]+-)?ld|collect2)[^/\\]*( |$)")
set(linker_exclude_regex "collect2 version |^[A-Za-z0-9_]+=|/ldfe ") 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}") string(REGEX REPLACE "\r?\n" ";" output_lines "${text}")
foreach(line IN LISTS output_lines) foreach(line IN LISTS output_lines)
set(cmd) 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 "([][+.*()^])" "\\\\\\1" _dir_regex "${CMAKE_BINARY_DIR}")
string(REGEX REPLACE " -[FL]${_dir_regex}/([^ ]| [^-])+( |$)" " " xline "${line}") string(REGEX REPLACE " -[FL]${_dir_regex}/([^ ]| [^-])+( |$)" " " xline "${line}")
if(NOT "x${xline}" STREQUAL "x${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}") set(line "${xline}")
endif() endif()
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) list(GET args 0 cmd)
endif() endif()
if("${cmd}" MATCHES "${linker_regex}") 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}") string(REGEX REPLACE ";-([LYz]);" ";-\\1" args "${args}")
foreach(arg IN LISTS args) foreach(arg IN LISTS args)
if("${arg}" MATCHES "^-L(.:)?[/\\]") if("${arg}" MATCHES "^-L(.:)?[/\\]")
# Unix search path. # Unix search path.
string(REGEX REPLACE "^-L" "" dir "${arg}") string(REGEX REPLACE "^-L" "" dir "${arg}")
list(APPEND implicit_dirs_tmp ${dir}) 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([^:].*)$") elseif("${arg}" MATCHES "^-l([^:].*)$")
# Unix library. # Unix library.
set(lib "${CMAKE_MATCH_1}") set(lib "${CMAKE_MATCH_1}")
list(APPEND implicit_libs_tmp ${lib}) 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$") elseif("${arg}" MATCHES "^(.:)?[/\\].*\\.a$")
# Unix library full path. # Unix library full path.
list(APPEND implicit_libs_tmp ${arg}) 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$" elseif("${arg}" MATCHES "^(.:)?[/\\].*\\.o$"
AND obj_regex AND "${arg}" MATCHES "${obj_regex}") AND obj_regex AND "${arg}" MATCHES "${obj_regex}")
# Object file full path. # Object file full path.
list(APPEND implicit_libs_tmp ${arg}) 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]") elseif("${arg}" MATCHES "^-Y(P,)?[^0-9]")
# Sun search path ([^0-9] avoids conflict with Mac -Y<num>). # Sun search path ([^0-9] avoids conflict with Mac -Y<num>).
string(REGEX REPLACE "^-Y(P,)?" "" dirs "${arg}") string(REGEX REPLACE "^-Y(P,)?" "" dirs "${arg}")
string(REPLACE ":" ";" dirs "${dirs}") string(REPLACE ":" ";" dirs "${dirs}")
list(APPEND implicit_dirs_tmp ${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:") elseif("${arg}" MATCHES "^-l:")
# HP named library. # HP named library.
list(APPEND implicit_libs_tmp ${arg}) 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") elseif("${arg}" MATCHES "^-z(all|default|weak)extract")
# Link editor option. # Link editor option.
list(APPEND implicit_libs_tmp ${arg}) list(APPEND implicit_libs_tmp ${arg})
set(log "${log} arg [${arg}] ==> opt [${arg}]\n") string(APPEND log " arg [${arg}] ==> opt [${arg}]\n")
else() else()
set(log "${log} arg [${arg}] ==> ignore\n") string(APPEND log " arg [${arg}] ==> ignore\n")
endif() endif()
endforeach() endforeach()
break() break()
elseif("${line}" MATCHES "LPATH(=| is:? *)(.*)$") elseif("${line}" MATCHES "LPATH(=| is:? *)(.*)$")
set(log "${log} LPATH line: [${line}]\n") string(APPEND log " LPATH line: [${line}]\n")
# HP search path. # HP search path.
string(REPLACE ":" ";" paths "${CMAKE_MATCH_2}") string(REPLACE ":" ";" paths "${CMAKE_MATCH_2}")
list(APPEND implicit_dirs_tmp ${paths}) list(APPEND implicit_dirs_tmp ${paths})
set(log "${log} dirs [${paths}]\n") string(APPEND log " dirs [${paths}]\n")
else() else()
set(log "${log} ignore line: [${line}]\n") string(APPEND log " ignore line: [${line}]\n")
endif() endif()
endforeach() endforeach()
# Look for library search paths reported by linker. # Look for library search paths reported by linker.
if("${output_lines}" MATCHES ";Library search paths:((;\t[^;]+)+)") if("${output_lines}" MATCHES ";Library search paths:((;\t[^;]+)+)")
string(REPLACE ";\t" ";" implicit_dirs_match "${CMAKE_MATCH_1}") 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}) list(APPEND implicit_dirs_tmp ${implicit_dirs_match})
endif() endif()
if("${output_lines}" MATCHES ";Framework search paths:((;\t[^;]+)+)") if("${output_lines}" MATCHES ";Framework search paths:((;\t[^;]+)+)")
string(REPLACE ";\t" ";" implicit_fwks_match "${CMAKE_MATCH_1}") 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}) list(APPEND implicit_fwks_tmp ${implicit_fwks_match})
endif() endif()
@ -125,11 +125,11 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
set(implicit_libs "") set(implicit_libs "")
foreach(lib IN LISTS implicit_libs_tmp) foreach(lib IN LISTS implicit_libs_tmp)
if("x${lib}" MATCHES "^x(crt.*\\.o|gcc.*|System.*|.*libclang_rt.*)$") 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}") elseif(IS_ABSOLUTE "${lib}")
get_filename_component(abs "${lib}" ABSOLUTE) get_filename_component(abs "${lib}" ABSOLUTE)
if(NOT "x${lib}" STREQUAL "x${abs}") if(NOT "x${lib}" STREQUAL "x${abs}")
set(log "${log} collapse lib [${lib}] ==> [${abs}]\n") string(APPEND log " collapse lib [${lib}] ==> [${abs}]\n")
endif() endif()
list(APPEND implicit_libs "${abs}") list(APPEND implicit_libs "${abs}")
else() else()
@ -151,15 +151,15 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
set(msg "") set(msg "")
list(APPEND implicit_${t} "${dir}") list(APPEND implicit_${t} "${dir}")
endif() endif()
set(log "${log} collapse ${desc_${t}} dir [${d}] ==> [${dir}]${msg}\n") string(APPEND log " collapse ${desc_${t}} dir [${d}] ==> [${dir}]${msg}\n")
endforeach() endforeach()
list(REMOVE_DUPLICATES implicit_${t}) list(REMOVE_DUPLICATES implicit_${t})
endforeach() endforeach()
# Log results. # Log results.
set(log "${log} implicit libs: [${implicit_libs}]\n") string(APPEND log " implicit libs: [${implicit_libs}]\n")
set(log "${log} implicit dirs: [${implicit_dirs}]\n") string(APPEND log " implicit dirs: [${implicit_dirs}]\n")
set(log "${log} implicit fwks: [${implicit_fwks}]\n") string(APPEND log " implicit fwks: [${implicit_fwks}]\n")
# Return results. # Return results.
set(${lib_var} "${implicit_libs}" PARENT_SCOPE) set(${lib_var} "${implicit_libs}" PARENT_SCOPE)

View File

@ -55,9 +55,9 @@ function(CMAKE_PRINT_VARIABLES)
set(msg "") set(msg "")
foreach(var ${ARGN}) foreach(var ${ARGN})
if(msg) if(msg)
set(msg "${msg} ; ") string(APPEND msg " ; ")
endif() endif()
set(msg "${msg}${var}=\"${${var}}\"") string(APPEND msg "${var}=\"${${var}}\"")
endforeach() endforeach()
message(STATUS "${msg}") message(STATUS "${msg}")
endfunction() endfunction()
@ -132,21 +132,21 @@ function(CMAKE_PRINT_PROPERTIES )
if(keyword STREQUAL "TARGET") if(keyword STREQUAL "TARGET")
if(NOT TARGET ${item}) if(NOT TARGET ${item})
set(itemExists FALSE) 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()
endif() endif()
if (itemExists) if (itemExists)
set(msg "${msg} Properties for ${keyword} ${item}:\n") string(APPEND msg " Properties for ${keyword} ${item}:\n")
foreach(prop ${CPP_PROPERTIES}) foreach(prop ${CPP_PROPERTIES})
get_property(propertySet ${keyword} ${item} PROPERTY "${prop}" SET) get_property(propertySet ${keyword} ${item} PROPERTY "${prop}" SET)
if(propertySet) if(propertySet)
get_property(property ${keyword} ${item} PROPERTY "${prop}") get_property(property ${keyword} ${item} PROPERTY "${prop}")
set(msg "${msg} ${item}.${prop} = \"${property}\"\n") string(APPEND msg " ${item}.${prop} = \"${property}\"\n")
else() else()
set(msg "${msg} ${item}.${prop} = <NOTFOUND>\n") string(APPEND msg " ${item}.${prop} = <NOTFOUND>\n")
endif() endif()
endforeach() endforeach()
endif() endif()

View File

@ -332,7 +332,7 @@ function(cpack_encode_variables)
set(value "${${var}}") set(value "${${var}}")
endif() endif()
set(commands "${commands}\nSET(${var} \"${value}\")") string(APPEND commands "\nSET(${var} \"${value}\")")
endif() endif()
endforeach() endforeach()

View File

@ -409,11 +409,11 @@ macro(cpack_add_component compname)
# moduled was included. # moduled was included.
if(NOT CPACK_COMPONENTS_ALL_SET_BY_USER) if(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
get_cmake_property(_CPACK_ADDCOMP_COMPONENTS COMPONENTS) 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}) foreach(COMP ${_CPACK_ADDCOMP_COMPONENTS})
set(_CPACK_ADDCOMP_STR "${_CPACK_ADDCOMP_STR} ${COMP}") string(APPEND _CPACK_ADDCOMP_STR " ${COMP}")
endforeach() endforeach()
set(_CPACK_ADDCOMP_STR "${_CPACK_ADDCOMP_STR})\n") string(APPEND _CPACK_ADDCOMP_STR ")\n")
endif() endif()
endif() endif()
@ -501,8 +501,8 @@ macro(cpack_add_install_type insttype)
set(_CPACK_INSTTYPE_STR set(_CPACK_INSTTYPE_STR
"\n# Configuration for installation type \"${insttype}\"\n") "\n# Configuration for installation type \"${insttype}\"\n")
set(_CPACK_INSTTYPE_STR string(APPEND _CPACK_INSTTYPE_STR
"${_CPACK_INSTTYPE_STR}list(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n") "list(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
cpack_append_string_variable_set_command( cpack_append_string_variable_set_command(
CPACK_INSTALL_TYPE_${_CPACK_INSTTYPE_UNAME}_DISPLAY_NAME CPACK_INSTALL_TYPE_${_CPACK_INSTTYPE_UNAME}_DISPLAY_NAME
_CPACK_INSTTYPE_STR) _CPACK_INSTTYPE_STR)

View File

@ -645,7 +645,7 @@ macro(cpack_ifw_add_repository reponame)
endforeach() endforeach()
list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame}) 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) if(CPack_CMake_INCLUDED)
file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${_CPACK_IFWREPO_STR}") 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}_REMOVE
OR CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_REPLACE) OR CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_REPLACE)
list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame}) 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() else()
set(_CPACK_IFWREPO_STR) set(_CPACK_IFWREPO_STR)
endif() endif()

View File

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

View File

@ -59,7 +59,7 @@ if(CTEST_USE_LAUNCHERS)
"${__launch_common_options} --output <OUTPUT>") "${__launch_common_options} --output <OUTPUT>")
if("${CMAKE_GENERATOR}" MATCHES "Ninja") 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() endif()
set(CTEST_LAUNCH_COMPILE set(CTEST_LAUNCH_COMPILE

View File

@ -60,7 +60,7 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
endif() endif()
if(${ARGC} EQUAL 3) if(${ARGC} EQUAL 3)
set(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS}) set(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARGV2}") string(APPEND CMAKE_C_FLAGS " ${ARGV2}")
endif() endif()
try_compile(${VARIABLE} try_compile(${VARIABLE}

View File

@ -59,7 +59,7 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
endif() endif()
if(${ARGC} EQUAL 3) if(${ARGC} EQUAL 3)
set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS}) set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}") string(APPEND CMAKE_CXX_FLAGS " ${ARGV2}")
endif() endif()
try_compile(${VARIABLE} try_compile(${VARIABLE}

View File

@ -55,11 +55,11 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
set(CHECK_INCLUDE_FILES_CONTENT "/* */\n") set(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
foreach(FILE ${INCLUDE}) foreach(FILE ${INCLUDE})
set(CMAKE_CONFIGURABLE_FILE_CONTENT string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n") "#include <${FILE}>\n")
endforeach() endforeach()
set(CMAKE_CONFIGURABLE_FILE_CONTENT string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(void){return 0;}\n") "\n\nint main(void){return 0;}\n")
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in" configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c" @ONLY) "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c" @ONLY)

View File

@ -75,8 +75,8 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
endif() endif()
foreach(_FILE ${_HEADER}) foreach(_FILE ${_HEADER})
set(CHECK_PROTOTYPE_DEFINITION_HEADER string(APPEND CHECK_PROTOTYPE_DEFINITION_HEADER
"${CHECK_PROTOTYPE_DEFINITION_HEADER}#include <${_FILE}>\n") "#include <${_FILE}>\n")
endforeach() endforeach()
set(CHECK_PROTOTYPE_DEFINITION_SYMBOL ${_FUNCTION}) set(CHECK_PROTOTYPE_DEFINITION_SYMBOL ${_FUNCTION})

View File

@ -54,7 +54,7 @@ include(CheckCXXSourceCompiles)
macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT) macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
set(_INCLUDE_FILES) set(_INCLUDE_FILES)
foreach (it ${_HEADER}) foreach (it ${_HEADER})
set(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") string(APPEND _INCLUDE_FILES "#include <${it}>\n")
endforeach () endforeach ()
if("x${ARGN}" STREQUAL "x") if("x${ARGN}" STREQUAL "x")

View File

@ -71,11 +71,11 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
set(CMAKE_SYMBOL_EXISTS_INCLUDES) set(CMAKE_SYMBOL_EXISTS_INCLUDES)
endif() endif()
foreach(FILE ${FILES}) foreach(FILE ${FILES})
set(CMAKE_CONFIGURABLE_FILE_CONTENT string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n") "#include <${FILE}>\n")
endforeach() endforeach()
set(CMAKE_CONFIGURABLE_FILE_CONTENT string(APPEND 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") "\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" configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${SOURCEFILE}" @ONLY) "${SOURCEFILE}" @ONLY)

View File

@ -97,17 +97,17 @@ function(__check_type_size_impl type var map builtin language)
set(headers) set(headers)
if(builtin) if(builtin)
if(HAVE_SYS_TYPES_H) if(HAVE_SYS_TYPES_H)
set(headers "${headers}#include <sys/types.h>\n") string(APPEND headers "#include <sys/types.h>\n")
endif() endif()
if(HAVE_STDINT_H) if(HAVE_STDINT_H)
set(headers "${headers}#include <stdint.h>\n") string(APPEND headers "#include <stdint.h>\n")
endif() endif()
if(HAVE_STDDEF_H) if(HAVE_STDDEF_H)
set(headers "${headers}#include <stddef.h>\n") string(APPEND headers "#include <stddef.h>\n")
endif() endif()
endif() endif()
foreach(h ${CMAKE_EXTRA_INCLUDE_FILES}) foreach(h ${CMAKE_EXTRA_INCLUDE_FILES})
set(headers "${headers}#include \"${h}\"\n") string(APPEND headers "#include \"${h}\"\n")
endforeach() endforeach()
# Perform the check. # 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 MATCH "${regex_key}" key "${info}")
string(REGEX REPLACE "${regex_key}" "\\1" key "${key}") string(REGEX REPLACE "${regex_key}" "\\1" key "${key}")
if(key) if(key)
set(code "${code}\nset(${var}-${key} \"${size}\")") string(APPEND code "\nset(${var}-${key} \"${size}\")")
list(APPEND keys ${key}) list(APPEND keys ${key})
endif() endif()
endif() endif()

View File

@ -3,5 +3,5 @@ set(_compiler_id_pp_test "defined(__clang__) && defined(__apple_build_version__)
include("${CMAKE_CURRENT_LIST_DIR}/Clang-DetermineCompilerInternal.cmake") 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__)") # define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__apple_build_version__)")

View File

@ -119,7 +119,7 @@ if(BUILD_TESTING)
# add testing targets # add testing targets
set(DART_EXPERIMENTAL_NAME Experimental) set(DART_EXPERIMENTAL_NAME Experimental)
if(DART_EXPERIMENTAL_USE_PROJECT_NAME) if(DART_EXPERIMENTAL_USE_PROJECT_NAME)
set(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}") string(APPEND DART_EXPERIMENTAL_NAME "${PROJECT_NAME}")
endif() endif()
endif () endif ()

View File

@ -247,7 +247,7 @@ function(install_qt4_plugin_path plugin executable copy installed_plugin_path_va
set(plugins_path ".") set(plugins_path ".")
endif() endif()
if(plugins_dir) if(plugins_dir)
set(plugins_path "${plugins_path}/${plugins_dir}") string(APPEND plugins_path "/${plugins_dir}")
endif() endif()
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) get_filename_component(plugin_group "${plugin_path}" NAME)
set(${plugin_group_var} "${plugin_group}") set(${plugin_group_var} "${plugin_group}")
endif() endif()
set(plugins_path "${plugins_path}/${plugin_group}") string(APPEND plugins_path "/${plugin_group}")
if(${copy}) if(${copy})
file(MAKE_DIRECTORY "${plugins_path}") file(MAKE_DIRECTORY "${plugins_path}")

View File

@ -473,10 +473,10 @@ function(ExternalData_expand_arguments target outArgsVar)
if("x${piece}" MATCHES "^x${data_regex}$") if("x${piece}" MATCHES "^x${data_regex}$")
# Replace this DATA{}-piece with a file path. # Replace this DATA{}-piece with a file path.
_ExternalData_arg("${target}" "${piece}" "${CMAKE_MATCH_1}" file) _ExternalData_arg("${target}" "${piece}" "${CMAKE_MATCH_1}" file)
set(outArg "${outArg}${file}") string(APPEND outArg "${file}")
else() else()
# No replacement needed for this piece. # No replacement needed for this piece.
set(outArg "${outArg}${piece}") string(APPEND outArg "${piece}")
endif() endif()
endforeach() endforeach()
else() else()
@ -696,12 +696,12 @@ macro(_ExternalData_arg_associated)
get_filename_component(reldir "${reldata}" PATH) get_filename_component(reldir "${reldata}" PATH)
endif() endif()
if(reldir) if(reldir)
set(reldir "${reldir}/") string(APPEND reldir "/")
endif() endif()
_ExternalData_exact_regex(reldir_regex "${reldir}") _ExternalData_exact_regex(reldir_regex "${reldir}")
if(recurse_option) if(recurse_option)
set(glob GLOB_RECURSE) set(glob GLOB_RECURSE)
set(reldir_regex "${reldir_regex}(.+/)?") string(APPEND reldir_regex "(.+/)?")
else() else()
set(glob GLOB) set(glob GLOB)
endif() endif()
@ -717,7 +717,7 @@ macro(_ExternalData_arg_associated)
set(all "") set(all "")
set(sep "") set(sep "")
foreach(regex ${associated_regex}) foreach(regex ${associated_regex})
set(all "${all}${sep}${reldir_regex}${regex}") string(APPEND all "${sep}${reldir_regex}${regex}")
set(sep "|") set(sep "|")
endforeach() endforeach()
_ExternalData_arg_find_files(${glob} "${reldir}" "${all}") _ExternalData_arg_find_files(${glob} "${reldir}" "${all}")
@ -978,9 +978,9 @@ function(_ExternalData_download_object name hash algo var_obj)
else() else()
_ExternalData_download_file("${url}" "${tmp}" err errMsg) _ExternalData_download_file("${url}" "${tmp}" err errMsg)
endif() endif()
set(tried "${tried}\n ${url}") string(APPEND tried "\n ${url}")
if(err) if(err)
set(tried "${tried} (${errMsg})") string(APPEND tried " (${errMsg})")
else() else()
# Verify downloaded object. # Verify downloaded object.
_ExternalData_compute_hash(dl_hash "${algo}" "${tmp}") _ExternalData_compute_hash(dl_hash "${algo}" "${tmp}")
@ -988,7 +988,7 @@ function(_ExternalData_download_object name hash algo var_obj)
set(found 1) set(found 1)
break() break()
else() else()
set(tried "${tried} (wrong hash ${algo}=${dl_hash})") string(APPEND tried " (wrong hash ${algo}=${dl_hash})")
if("$ENV{ExternalData_DEBUG_DOWNLOAD}" MATCHES ".") if("$ENV{ExternalData_DEBUG_DOWNLOAD}" MATCHES ".")
file(RENAME "${tmp}" "${store}/${algo}/${dl_hash}") file(RENAME "${tmp}" "${store}/${algo}/${dl_hash}")
endif() endif()

View File

@ -1117,8 +1117,8 @@ function(_ep_command_line_to_initial_cache var args force)
set(line "${CMAKE_MATCH_1}") set(line "${CMAKE_MATCH_1}")
if(setArg) if(setArg)
# This is required to build up lists in variables, or complete an entry # This is required to build up lists in variables, or complete an entry
set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" ${forceArg})") string(APPEND setArg "${accumulator}\" CACHE ${type} \"Initial cache\" ${forceArg})")
set(script_initial_cache "${script_initial_cache}\n${setArg}") string(APPEND script_initial_cache "\n${setArg}")
set(accumulator "") set(accumulator "")
set(setArg "") set(setArg "")
endif() endif()
@ -1132,13 +1132,13 @@ function(_ep_command_line_to_initial_cache var args force)
endif() endif()
else() else()
# Assume this is a list to append to the last var # Assume this is a list to append to the last var
set(accumulator "${accumulator};${line}") string(APPEND accumulator ";${line}")
endif() endif()
endforeach() endforeach()
# Catch the final line of the args # Catch the final line of the args
if(setArg) if(setArg)
set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" ${forceArg})") string(APPEND setArg "${accumulator}\" CACHE ${type} \"Initial cache\" ${forceArg})")
set(script_initial_cache "${script_initial_cache}\n${setArg}") string(APPEND script_initial_cache "\n${setArg}")
endif() endif()
set(${var} ${script_initial_cache} PARENT_SCOPE) set(${var} ${script_initial_cache} PARENT_SCOPE)
endfunction() endfunction()
@ -1332,16 +1332,16 @@ endif()
foreach(arg IN LISTS command) foreach(arg IN LISTS command)
if("x${arg}" STREQUAL "xCOMMAND") if("x${arg}" STREQUAL "xCOMMAND")
if(NOT "x${cmd}" STREQUAL "x") 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() endif()
set(cmd "") set(cmd "")
set(sep "") set(sep "")
else() else()
set(cmd "${cmd}${sep}${arg}") string(APPEND cmd "${sep}${arg}")
set(sep ";") set(sep ";")
endif() endif()
endforeach() 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}") 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) set(command ${CMAKE_COMMAND} "-Dmake=\${make}" "-Dconfig=\${config}" -P ${stamp_dir}/${name}-${step}-$<CONFIG>-impl.cmake)
endif() endif()

View File

@ -411,23 +411,23 @@ function(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet)
if(includeThisOne) if(includeThisOne)
set(_currentFeatureText "${_currentFeatureText}\n * ${_currentFeature}") string(APPEND _currentFeatureText "\n * ${_currentFeature}")
get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_REQUIRED_VERSION) get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_REQUIRED_VERSION)
if(_info) if(_info)
set(_currentFeatureText "${_currentFeatureText} (required version ${_info})") string(APPEND _currentFeatureText " (required version ${_info})")
endif() endif()
get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION) get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION)
if(_info) if(_info)
set(_currentFeatureText "${_currentFeatureText} , ${_info}") string(APPEND _currentFeatureText " , ${_info}")
endif() endif()
get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL) get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL)
if(_info) if(_info)
set(_currentFeatureText "${_currentFeatureText} , <${_info}>") string(APPEND _currentFeatureText " , <${_info}>")
endif() endif()
get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE) get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE)
foreach(_purpose ${_info}) foreach(_purpose ${_info})
set(_currentFeatureText "${_currentFeatureText}\n ${_purpose}") string(APPEND _currentFeatureText "\n ${_purpose}")
endforeach() endforeach()
endif() endif()
@ -527,7 +527,7 @@ function(FEATURE_SUMMARY)
set(_tmp) set(_tmp)
_FS_GET_FEATURE_SUMMARY( ${part} _tmp ${_FS_INCLUDE_QUIET_PACKAGES}) _FS_GET_FEATURE_SUMMARY( ${part} _tmp ${_FS_INCLUDE_QUIET_PACKAGES})
if(_tmp) if(_tmp)
set(_fullText "${_fullText}\n-- ${title_${part}}\n${_tmp}\n") string(APPEND _fullText "\n-- ${title_${part}}\n${_tmp}\n")
if("${part}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND") if("${part}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND")
set(requiredPackagesNotFound TRUE) set(requiredPackagesNotFound TRUE)
endif() endif()

View File

@ -1181,8 +1181,8 @@ if(Boost_INCLUDE_DIR)
math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
set(Boost_ERROR_REASON string(APPEND Boost_ERROR_REASON
"${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}") "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
if(Boost_DEBUG) if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"version.hpp reveals boost " "version.hpp reveals boost "
@ -1204,16 +1204,16 @@ if(Boost_INCLUDE_DIR)
endif() endif()
if(NOT Boost_FOUND) if(NOT Boost_FOUND)
# State that we found a version of Boost that is too new or too old. # State that we found a version of Boost that is too new or too old.
set(Boost_ERROR_REASON string(APPEND Boost_ERROR_REASON
"${Boost_ERROR_REASON}\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") "\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
if (Boost_FIND_VERSION_PATCH) if (Boost_FIND_VERSION_PATCH)
set(Boost_ERROR_REASON string(APPEND Boost_ERROR_REASON
"${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}") ".${Boost_FIND_VERSION_PATCH}")
endif () endif ()
if (NOT Boost_FIND_VERSION_EXACT) if (NOT Boost_FIND_VERSION_EXACT)
set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)") string(APPEND Boost_ERROR_REASON " (or newer)")
endif () endif ()
set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.") string(APPEND Boost_ERROR_REASON ".")
endif () endif ()
else() else()
# Caller will accept any Boost version. # Caller will accept any Boost version.
@ -1221,8 +1221,8 @@ if(Boost_INCLUDE_DIR)
endif() endif()
else() else()
set(Boost_FOUND 0) set(Boost_FOUND 0)
set(Boost_ERROR_REASON string(APPEND Boost_ERROR_REASON
"${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.") "Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.")
endif() endif()
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
@ -1302,15 +1302,15 @@ if(WIN32 AND Boost_USE_DEBUG_RUNTIME)
if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC" if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC"
OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" OR "${CMAKE_CXX_COMPILER}" MATCHES "icl"
OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc")
set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g") string(APPEND _boost_DEBUG_ABI_TAG "g")
endif() endif()
endif() endif()
# y using special debug build of python # y using special debug build of python
if(Boost_USE_DEBUG_PYTHON) if(Boost_USE_DEBUG_PYTHON)
set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}y") string(APPEND _boost_DEBUG_ABI_TAG "y")
endif() endif()
# d using a debug version of your code # d using a debug version of your code
set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}d") string(APPEND _boost_DEBUG_ABI_TAG "d")
# p using the STLport standard library rather than the # p using the STLport standard library rather than the
# default one supplied with your compiler # default one supplied with your compiler
if(Boost_USE_STLPORT) if(Boost_USE_STLPORT)
@ -1640,26 +1640,26 @@ if(Boost_FOUND)
set(Boost_FOUND 0) set(Boost_FOUND 0)
# We were unable to find some libraries, so generate a sensible # We were unable to find some libraries, so generate a sensible
# error message that lists the libraries we were unable to find. # error message that lists the libraries we were unable to find.
set(Boost_ERROR_REASON string(APPEND Boost_ERROR_REASON
"${Boost_ERROR_REASON}\nCould not find the following") "\nCould not find the following")
if(Boost_USE_STATIC_LIBS) if(Boost_USE_STATIC_LIBS)
set(Boost_ERROR_REASON "${Boost_ERROR_REASON} static") string(APPEND Boost_ERROR_REASON " static")
endif() endif()
set(Boost_ERROR_REASON string(APPEND Boost_ERROR_REASON
"${Boost_ERROR_REASON} Boost libraries:\n") " Boost libraries:\n")
foreach(COMPONENT ${_Boost_MISSING_COMPONENTS}) foreach(COMPONENT ${_Boost_MISSING_COMPONENTS})
set(Boost_ERROR_REASON string(APPEND Boost_ERROR_REASON
"${Boost_ERROR_REASON} ${Boost_NAMESPACE}_${COMPONENT}\n") " ${Boost_NAMESPACE}_${COMPONENT}\n")
endforeach() endforeach()
list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED) list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED)
list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS) list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS)
if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
set(Boost_ERROR_REASON string(APPEND Boost_ERROR_REASON
"${Boost_ERROR_REASON}No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") "No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
else () else ()
set(Boost_ERROR_REASON string(APPEND Boost_ERROR_REASON
"${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") "Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
endif () endif ()
endif () endif ()

View File

@ -1324,13 +1324,13 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")
endif() endif()
set(_cuda_host_flags "${_cuda_host_flags}\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})") string(APPEND _cuda_host_flags "\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})")
endif() endif()
# Note that if we ever want CUDA_NVCC_FLAGS_<CONFIG> to be string (instead of a list # Note that if we ever want CUDA_NVCC_FLAGS_<CONFIG> to be string (instead of a list
# like it is currently), we can remove the quotes around the # like it is currently), we can remove the quotes around the
# ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_<CONFIG> variable. # ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_<CONFIG> variable.
set(_cuda_nvcc_flags_config "${_cuda_nvcc_flags_config}\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})") string(APPEND _cuda_nvcc_flags_config "\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})")
endforeach() endforeach()
# Process the C++11 flag. If the host sets the flag, we need to add it to nvcc and # Process the C++11 flag. If the host sets the flag, we need to add it to nvcc and

View File

@ -100,7 +100,7 @@ list(REMOVE_DUPLICATES dependency_list)
list(SORT dependency_list) list(SORT dependency_list)
foreach(file ${dependency_list}) foreach(file ${dependency_list})
set(cuda_nvcc_depend "${cuda_nvcc_depend} \"${file}\"\n") string(APPEND cuda_nvcc_depend " \"${file}\"\n")
endforeach() endforeach()
file(WRITE ${output_file} "# Generated by: make2cmake.cmake\nSET(CUDA_NVCC_DEPEND\n ${cuda_nvcc_depend})\n\n") file(WRITE ${output_file} "# Generated by: make2cmake.cmake\nSET(CUDA_NVCC_DEPEND\n ${cuda_nvcc_depend})\n\n")

View File

@ -95,7 +95,7 @@ string(TOUPPER "${build_configuration}" build_configuration)
#message("CUDA_NVCC_HOST_COMPILER_FLAGS = ${CUDA_NVCC_HOST_COMPILER_FLAGS}") #message("CUDA_NVCC_HOST_COMPILER_FLAGS = ${CUDA_NVCC_HOST_COMPILER_FLAGS}")
foreach(flag ${CMAKE_HOST_FLAGS} ${CMAKE_HOST_FLAGS_${build_configuration}}) foreach(flag ${CMAKE_HOST_FLAGS} ${CMAKE_HOST_FLAGS_${build_configuration}})
# Extra quotes are added around each flag to help nvcc parse out flags with spaces. # Extra quotes are added around each flag to help nvcc parse out flags with spaces.
set(nvcc_host_compiler_flags "${nvcc_host_compiler_flags},\"${flag}\"") string(APPEND nvcc_host_compiler_flags ",\"${flag}\"")
endforeach() endforeach()
if (nvcc_host_compiler_flags) if (nvcc_host_compiler_flags)
set(nvcc_host_compiler_flags "-Xcompiler" ${nvcc_host_compiler_flags}) set(nvcc_host_compiler_flags "-Xcompiler" ${nvcc_host_compiler_flags})

View File

@ -55,7 +55,7 @@ if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h")
if(VLINE MATCHES "^#[\t ]*define[\t ]+CUPS_VERSION_${VPART}[\t ]+([0-9]+)$") if(VLINE MATCHES "^#[\t ]*define[\t ]+CUPS_VERSION_${VPART}[\t ]+([0-9]+)$")
set(CUPS_VERSION_PART "${CMAKE_MATCH_1}") set(CUPS_VERSION_PART "${CMAKE_MATCH_1}")
if(CUPS_VERSION_STRING) if(CUPS_VERSION_STRING)
set(CUPS_VERSION_STRING "${CUPS_VERSION_STRING}.${CUPS_VERSION_PART}") string(APPEND CUPS_VERSION_STRING ".${CUPS_VERSION_PART}")
else() else()
set(CUPS_VERSION_STRING "${CUPS_VERSION_PART}") set(CUPS_VERSION_STRING "${CUPS_VERSION_PART}")
endif() endif()

View File

@ -41,7 +41,7 @@ if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
if(VLINE MATCHES "^#[\t ]*define[\t ]+XML_${VPART}_VERSION[\t ]+([0-9]+)$") if(VLINE MATCHES "^#[\t ]*define[\t ]+XML_${VPART}_VERSION[\t ]+([0-9]+)$")
set(EXPAT_VERSION_PART "${CMAKE_MATCH_1}") set(EXPAT_VERSION_PART "${CMAKE_MATCH_1}")
if(EXPAT_VERSION_STRING) if(EXPAT_VERSION_STRING)
set(EXPAT_VERSION_STRING "${EXPAT_VERSION_STRING}.${EXPAT_VERSION_PART}") string(APPEND EXPAT_VERSION_STRING ".${EXPAT_VERSION_PART}")
else() else()
set(EXPAT_VERSION_STRING "${EXPAT_VERSION_PART}") set(EXPAT_VERSION_STRING "${EXPAT_VERSION_PART}")
endif() endif()

View File

@ -135,7 +135,7 @@ if(FREETYPE_INCLUDE_DIR_freetype2 AND FREETYPE_H)
if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$") if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$")
set(FREETYPE_VERSION_PART "${CMAKE_MATCH_1}") set(FREETYPE_VERSION_PART "${CMAKE_MATCH_1}")
if(FREETYPE_VERSION_STRING) if(FREETYPE_VERSION_STRING)
set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}") string(APPEND FREETYPE_VERSION_STRING ".${FREETYPE_VERSION_PART}")
else() else()
set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}") set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
endif() endif()

View File

@ -327,7 +327,7 @@ function (interrogate_mpi_compiler lang try_libs)
foreach(FLAG ${MPI_ALL_COMPILE_FLAGS}) foreach(FLAG ${MPI_ALL_COMPILE_FLAGS})
if (MPI_COMPILE_FLAGS_WORK) if (MPI_COMPILE_FLAGS_WORK)
set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}") string(APPEND MPI_COMPILE_FLAGS_WORK " ${FLAG}")
else() else()
set(MPI_COMPILE_FLAGS_WORK ${FLAG}) set(MPI_COMPILE_FLAGS_WORK ${FLAG})
endif() endif()
@ -376,7 +376,7 @@ function (interrogate_mpi_compiler lang try_libs)
set(MPI_LINK_FLAGS_WORK) set(MPI_LINK_FLAGS_WORK)
foreach(FLAG ${MPI_ALL_LINK_FLAGS}) foreach(FLAG ${MPI_ALL_LINK_FLAGS})
if (MPI_LINK_FLAGS_WORK) if (MPI_LINK_FLAGS_WORK)
set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}") string(APPEND MPI_LINK_FLAGS_WORK " ${FLAG}")
else() else()
set(MPI_LINK_FLAGS_WORK ${FLAG}) set(MPI_LINK_FLAGS_WORK ${FLAG})
endif() endif()
@ -398,8 +398,8 @@ function (interrogate_mpi_compiler lang try_libs)
# in the showme list that can only be found in the implicit # in the showme list that can only be found in the implicit
# link directories of the compiler. # link directories of the compiler.
if (DEFINED CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES) if (DEFINED CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES)
set(MPI_LINK_PATH string(APPEND MPI_LINK_PATH
"${MPI_LINK_PATH};${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}") ";${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}")
endif () endif ()
# Determine full path names for all of the libraries that one needs # Determine full path names for all of the libraries that one needs

View File

@ -58,8 +58,8 @@ mark_as_advanced(
if(APPLE) if(APPLE)
# this is a hack for now # this is a hack for now
set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS string(APPEND CMAKE_SHARED_MODULE_CREATE_C_FLAGS
"${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -Wl,-flat_namespace") " -Wl,-flat_namespace")
foreach(symbol foreach(symbol
__efree __efree
__emalloc __emalloc
@ -82,8 +82,8 @@ if(APPLE)
_zend_wrong_param_count _zend_wrong_param_count
_zval_used_for_init _zval_used_for_init
) )
set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS string(APPEND CMAKE_SHARED_MODULE_CREATE_C_FLAGS
"${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}") ",-U,${symbol}")
endforeach() endforeach()
endif() endif()

View File

@ -169,10 +169,10 @@ macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
foreach(currentConfigIndex RANGE ${configsCount}) foreach(currentConfigIndex RANGE ${configsCount})
list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename) list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version) list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
set(configsText "${configsText} ${filename} (version ${version})\n") string(APPEND configsText " ${filename} (version ${version})\n")
endforeach() endforeach()
if (${_NAME}_NOT_FOUND_MESSAGE) if (${_NAME}_NOT_FOUND_MESSAGE)
set(configsText "${configsText} Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n") string(APPEND configsText " Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n")
endif() endif()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}") _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
@ -253,9 +253,9 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS}) foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
if(NOT ${_CURRENT_VAR}) if(NOT ${_CURRENT_VAR})
set(FPHSA_FOUND_${_NAME} FALSE) set(FPHSA_FOUND_${_NAME} FALSE)
set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}") string(APPEND MISSING_VARS " ${_CURRENT_VAR}")
else() else()
set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]") string(APPEND DETAILS "[${${_CURRENT_VAR}}]")
endif() endif()
endforeach() endforeach()
if(FPHSA_FOUND_${_NAME}) if(FPHSA_FOUND_${_NAME})
@ -277,24 +277,24 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
if(NOT DEFINED FOUND_COMPONENTS_MSG) if(NOT DEFINED FOUND_COMPONENTS_MSG)
set(FOUND_COMPONENTS_MSG "found components: ") set(FOUND_COMPONENTS_MSG "found components: ")
endif() endif()
set(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}") string(APPEND FOUND_COMPONENTS_MSG " ${comp}")
else() else()
if(NOT DEFINED MISSING_COMPONENTS_MSG) if(NOT DEFINED MISSING_COMPONENTS_MSG)
set(MISSING_COMPONENTS_MSG "missing components: ") set(MISSING_COMPONENTS_MSG "missing components: ")
endif() endif()
set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}") string(APPEND MISSING_COMPONENTS_MSG " ${comp}")
if(${_NAME}_FIND_REQUIRED_${comp}) if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE) set(${_NAME}_FOUND FALSE)
set(MISSING_VARS "${MISSING_VARS} ${comp}") string(APPEND MISSING_VARS " ${comp}")
endif() endif()
endif() endif()
endforeach() endforeach()
set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}") set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]") string(APPEND DETAILS "[c${COMPONENT_MSG}]")
endif() endif()
# version handling: # version handling:
@ -368,7 +368,7 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
endif () endif ()
if(VERSION_OK) if(VERSION_OK)
set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]") string(APPEND DETAILS "[v${VERSION}(${${_NAME}_FIND_VERSION})]")
else() else()
set(${_NAME}_FOUND FALSE) set(${_NAME}_FOUND FALSE)
endif() endif()

View File

@ -200,7 +200,7 @@ function(_pkg_create_imp_target _prefix _no_cmake_path _no_cmake_environment_pat
set(_find_opts "NO_CMAKE_PATH") set(_find_opts "NO_CMAKE_PATH")
endif() endif()
if(_no_cmake_environment_path) if(_no_cmake_environment_path)
set(_find_opts "${_find_opts} NO_CMAKE_ENVIRONMENT_PATH") string(APPEND _find_opts " NO_CMAKE_ENVIRONMENT_PATH")
endif() endif()
foreach (flag IN LISTS ${_prefix}_LDFLAGS) foreach (flag IN LISTS ${_prefix}_LDFLAGS)

View File

@ -764,7 +764,7 @@ if (QT_QMAKE_EXECUTABLE AND
############################################# #############################################
cmake_push_check_state() cmake_push_check_state()
# Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES # Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}") string(APPEND CMAKE_REQUIRED_INCLUDES ";${QT_INCLUDE_DIR}")
set(CMAKE_REQUIRED_QUIET ${Qt4_FIND_QUIETLY}) set(CMAKE_REQUIRED_QUIET ${Qt4_FIND_QUIETLY})
# Check for Window system symbols (note: only one should end up being set) # Check for Window system symbols (note: only one should end up being set)
CHECK_CXX_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11) CHECK_CXX_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)

View File

@ -123,7 +123,7 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
# To get multiple single variables to work, I must separate them with a "\;" # To get multiple single variables to work, I must separate them with a "\;"
# I could go back and modify the FindSDL.cmake module, but that's kind of painful. # I could go back and modify the FindSDL.cmake module, but that's kind of painful.
# The solution would be to try something like: # The solution would be to try something like:
# set(SDL_TRY_COMPILE_LIBRARY_LIST "${SDL_TRY_COMPILE_LIBRARY_LIST}\;${CMAKE_THREAD_LIBS_INIT}") # string(APPEND SDL_TRY_COMPILE_LIBRARY_LIST "\;${CMAKE_THREAD_LIBS_INIT}")
# Instead, it was suggested on the mailing list to write a temporary CMakeLists.txt # Instead, it was suggested on the mailing list to write a temporary CMakeLists.txt
# with a temporary test project and invoke that with TRY_COMPILE. # with a temporary test project and invoke that with TRY_COMPILE.
# See message thread "Figuring out dependencies for a library in order to build" # See message thread "Figuring out dependencies for a library in order to build"
@ -173,7 +173,7 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
# would fix the problem. # would fix the problem.
set(TMP_TRY_LIBS) set(TMP_TRY_LIBS)
foreach(lib ${SDL_SOUND_LIBRARY} ${SDL_LIBRARY}) foreach(lib ${SDL_SOUND_LIBRARY} ${SDL_LIBRARY})
set(TMP_TRY_LIBS "${TMP_TRY_LIBS} \"${lib}\"") string(APPEND TMP_TRY_LIBS " \"${lib}\"")
endforeach() endforeach()
# message("TMP_TRY_LIBS ${TMP_TRY_LIBS}") # message("TMP_TRY_LIBS ${TMP_TRY_LIBS}")

View File

@ -110,7 +110,7 @@ if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
set(ZLIB_VERSION_TWEAK "") set(ZLIB_VERSION_TWEAK "")
if( "${ZLIB_H}" MATCHES "ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)") if( "${ZLIB_H}" MATCHES "ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)")
set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}") set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}") string(APPEND ZLIB_VERSION_STRING ".${ZLIB_VERSION_TWEAK}")
endif() endif()
set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}") set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")

View File

@ -854,7 +854,7 @@ else()
if(_retv EQUAL 0) if(_retv EQUAL 0)
file(TO_CMAKE_PATH ${_native_path} _native_path) file(TO_CMAKE_PATH ${_native_path} _native_path)
DBG_MSG_V("Path ${_path} converted to ${_native_path}") DBG_MSG_V("Path ${_path} converted to ${_native_path}")
set(_tmp_path "${_tmp_path} ${_native_path}") string(APPEND _tmp_path " ${_native_path}")
endif() endif()
endforeach() endforeach()
DBG_MSG("Setting wxWidgets_INCLUDE_DIRS = ${_tmp_path}") DBG_MSG("Setting wxWidgets_INCLUDE_DIRS = ${_tmp_path}")

View File

@ -650,7 +650,7 @@ else()
# do we need additionial wx GL stuff like GLCanvas ? # do we need additionial wx GL stuff like GLCanvas ?
if(WXWINDOWS_USE_GL) if(WXWINDOWS_USE_GL)
set(WX_CONFIG_ARGS_LIBS "${WX_CONFIG_ARGS_LIBS} --gl-libs" ) string(APPEND WX_CONFIG_ARGS_LIBS " --gl-libs" )
endif() endif()
##message("DBG: WX_CONFIG_ARGS_LIBS=${WX_CONFIG_ARGS_LIBS}===") ##message("DBG: WX_CONFIG_ARGS_LIBS=${WX_CONFIG_ARGS_LIBS}===")

View File

@ -270,7 +270,7 @@ function(FortranCInterface_HEADER file)
set(_desc_MODULE_ "/* Mangling for Fortran module symbols with underscores. */") set(_desc_MODULE_ "/* Mangling for Fortran module symbols with underscores. */")
foreach(macro GLOBAL GLOBAL_ MODULE MODULE_) foreach(macro GLOBAL GLOBAL_ MODULE MODULE_)
if(FortranCInterface_${macro}_MACRO) if(FortranCInterface_${macro}_MACRO)
set(HEADER_CONTENT "${HEADER_CONTENT} string(APPEND HEADER_CONTENT "
${_desc_${macro}} ${_desc_${macro}}
#define ${MACRO_NAMESPACE}${macro}${FortranCInterface_${macro}_MACRO} #define ${MACRO_NAMESPACE}${macro}${FortranCInterface_${macro}_MACRO}
") ")
@ -279,7 +279,7 @@ ${_desc_${macro}}
# Generate symbol mangling definitions. # Generate symbol mangling definitions.
if(SYMBOLS) if(SYMBOLS)
set(HEADER_CONTENT "${HEADER_CONTENT} string(APPEND HEADER_CONTENT "
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/* Mangle some symbols automatically. */ /* Mangle some symbols automatically. */
") ")
@ -300,7 +300,7 @@ ${_desc_${macro}}
set(form "") set(form "")
endif() endif()
if(FortranCInterface_MODULE${form}_MACRO) if(FortranCInterface_MODULE${form}_MACRO)
set(HEADER_CONTENT "${HEADER_CONTENT}#define ${SYMBOL_NAMESPACE}${module}_${function} ${MACRO_NAMESPACE}MODULE${form}(${m_lower},${f_lower}, ${m_upper},${f_upper})\n") string(APPEND HEADER_CONTENT "#define ${SYMBOL_NAMESPACE}${module}_${function} ${MACRO_NAMESPACE}MODULE${form}(${m_lower},${f_lower}, ${m_upper},${f_upper})\n")
else() else()
message(AUTHOR_WARNING "No FortranCInterface mangling known for ${f}") message(AUTHOR_WARNING "No FortranCInterface mangling known for ${f}")
endif() endif()
@ -314,7 +314,7 @@ ${_desc_${macro}}
string(TOUPPER "${f}" f_upper) string(TOUPPER "${f}" f_upper)
string(TOLOWER "${f}" f_lower) string(TOLOWER "${f}" f_lower)
if(FortranCInterface_GLOBAL${form}_MACRO) if(FortranCInterface_GLOBAL${form}_MACRO)
set(HEADER_CONTENT "${HEADER_CONTENT}#define ${SYMBOL_NAMESPACE}${f} ${MACRO_NAMESPACE}GLOBAL${form}(${f_lower}, ${f_upper})\n") string(APPEND HEADER_CONTENT "#define ${SYMBOL_NAMESPACE}${f} ${MACRO_NAMESPACE}GLOBAL${form}(${f_lower}, ${f_upper})\n")
else() else()
message(AUTHOR_WARNING "No FortranCInterface mangling known for ${f}") message(AUTHOR_WARNING "No FortranCInterface mangling known for ${f}")
endif() endif()

View File

@ -415,6 +415,6 @@ function(add_compiler_export_flags)
if(ARGC GREATER 0) if(ARGC GREATER 0)
set(${ARGV0} "${EXTRA_FLAGS}" PARENT_SCOPE) set(${ARGV0} "${EXTRA_FLAGS}" PARENT_SCOPE)
else() else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS}" PARENT_SCOPE) string(APPEND CMAKE_CXX_FLAGS " ${EXTRA_FLAGS}" PARENT_SCOPE)
endif() endif()
endfunction() endfunction()

View File

@ -796,7 +796,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
set(old_ld_env "$ENV{LD_LIBRARY_PATH}") set(old_ld_env "$ENV{LD_LIBRARY_PATH}")
set(new_ld_env "${exepath}") set(new_ld_env "${exepath}")
foreach(dir ${dirs}) foreach(dir ${dirs})
set(new_ld_env "${new_ld_env}:${dir}") string(APPEND new_ld_env ":${dir}")
endforeach() endforeach()
set(ENV{LD_LIBRARY_PATH} "${new_ld_env}:$ENV{LD_LIBRARY_PATH}") set(ENV{LD_LIBRARY_PATH} "${new_ld_env}:$ENV{LD_LIBRARY_PATH}")
endif() endif()

View File

@ -46,7 +46,7 @@ get_filename_component(unittest_file_to_run_name "${unittest_file_to_run}" NAME_
set(concat_string '${unittest_file_directory}') set(concat_string '${unittest_file_directory}')
foreach(s IN LISTS additional_paths) foreach(s IN LISTS additional_paths)
if(NOT "${s}" STREQUAL "") if(NOT "${s}" STREQUAL "")
set(concat_string "${concat_string}, '${s}'") string(APPEND concat_string ", '${s}'")
endif() endif()
endforeach() endforeach()

View File

@ -110,7 +110,7 @@ macro(__BlueGeneQ_common_setup compiler_id lang)
# to do the same thing as the MPI compilers, which add these flags. # to do the same thing as the MPI compilers, which add these flags.
set(BGQ_SYSTEM_INCLUDES "") set(BGQ_SYSTEM_INCLUDES "")
foreach(dir ${CMAKE_SYSTEM_INCLUDE_PATH}) foreach(dir ${CMAKE_SYSTEM_INCLUDE_PATH})
set(BGQ_SYSTEM_INCLUDES "${BGQ_SYSTEM_INCLUDES} -I${dir}") string(APPEND BGQ_SYSTEM_INCLUDES " -I${dir}")
endforeach() endforeach()
set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${BGQ_SYSTEM_INCLUDES} <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>") set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${BGQ_SYSTEM_INCLUDES} <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${BGQ_SYSTEM_INCLUDES} <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>") set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${BGQ_SYSTEM_INCLUDES} <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")

View File

@ -1,4 +1,4 @@
include(Platform/Linux-Intel) include(Platform/Linux-Intel)
__linux_compiler_intel(Fortran) __linux_compiler_intel(Fortran)
set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS} -nofor_main") string(APPEND CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS " -nofor_main")
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "") set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "")

View File

@ -171,7 +171,7 @@ if(WINCE)
endforeach() endforeach()
if (MSVC_VERSION LESS 1600) if (MSVC_VERSION LESS 1600)
set(CMAKE_C_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT} corelibc.lib") string(APPEND CMAKE_C_STANDARD_LIBRARIES_INIT " corelibc.lib")
endif () endif ()
elseif(WINDOWS_PHONE OR WINDOWS_STORE) elseif(WINDOWS_PHONE OR WINDOWS_STORE)
set(_PLATFORM_DEFINES "/DWIN32") set(_PLATFORM_DEFINES "/DWIN32")

View File

@ -441,14 +441,14 @@ macro(QT4_CREATE_TRANSLATION _qm_files)
set(_ts_pro ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lupdate.pro) set(_ts_pro ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lupdate.pro)
set(_pro_srcs) set(_pro_srcs)
foreach(_pro_src ${_my_sources}) foreach(_pro_src ${_my_sources})
set(_pro_srcs "${_pro_srcs} \\\n \"${_pro_src}\"") string(APPEND _pro_srcs " \\\n \"${_pro_src}\"")
endforeach() endforeach()
set(_pro_includes) set(_pro_includes)
get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES) get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
list(REMOVE_DUPLICATES _inc_DIRS) list(REMOVE_DUPLICATES _inc_DIRS)
foreach(_pro_include ${_inc_DIRS}) foreach(_pro_include ${_inc_DIRS})
get_filename_component(_abs_include "${_pro_include}" ABSOLUTE) get_filename_component(_abs_include "${_pro_include}" ABSOLUTE)
set(_pro_includes "${_pro_includes} \\\n \"${_abs_include}\"") string(APPEND _pro_includes " \\\n \"${_abs_include}\"")
endforeach() endforeach()
file(WRITE ${_ts_pro} "SOURCES =${_pro_srcs}\nINCLUDEPATH =${_pro_includes}\n") file(WRITE ${_ts_pro} "SOURCES =${_pro_srcs}\nINCLUDEPATH =${_pro_includes}\n")
endif() endif()

View File

@ -522,7 +522,7 @@ function(add_jar _TARGET_NAME)
endif() endif()
foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH}) foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH})
set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
endforeach() endforeach()
set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${_add_jar_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir") set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${_add_jar_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
@ -594,7 +594,7 @@ function(add_jar _TARGET_NAME)
if (TARGET ${_JAVA_INCLUDE_JAR}) if (TARGET ${_JAVA_INCLUDE_JAR})
get_target_property(_JAVA_JAR_PATH ${_JAVA_INCLUDE_JAR} JAR_FILE) get_target_property(_JAVA_JAR_PATH ${_JAVA_INCLUDE_JAR} JAR_FILE)
if (_JAVA_JAR_PATH) if (_JAVA_JAR_PATH)
set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}") string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}")
list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH}) list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH})
list(APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR}) list(APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR})
list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_INCLUDE_JAR}) list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_INCLUDE_JAR})
@ -602,7 +602,7 @@ function(add_jar _TARGET_NAME)
message(SEND_ERROR "add_jar: INCLUDE_JARS target ${_JAVA_INCLUDE_JAR} is not a jar") message(SEND_ERROR "add_jar: INCLUDE_JARS target ${_JAVA_INCLUDE_JAR} is not a jar")
endif () endif ()
else () else ()
set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}") string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}")
list(APPEND CMAKE_JAVA_INCLUDE_PATH "${_JAVA_INCLUDE_JAR}") list(APPEND CMAKE_JAVA_INCLUDE_PATH "${_JAVA_INCLUDE_JAR}")
list(APPEND _JAVA_DEPENDS "${_JAVA_INCLUDE_JAR}") list(APPEND _JAVA_DEPENDS "${_JAVA_INCLUDE_JAR}")
list(APPEND _JAVA_COMPILE_DEPENDS "${_JAVA_INCLUDE_JAR}") list(APPEND _JAVA_COMPILE_DEPENDS "${_JAVA_INCLUDE_JAR}")

View File

@ -163,15 +163,15 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
"${swig_outdir}/${swig_source_file_name_we}") "${swig_outdir}/${swig_source_file_name_we}")
# add the language into the name of the file (i.e. TCL_wrap) # add the language into the name of the file (i.e. TCL_wrap)
# this allows for the same .i file to be wrapped into different languages # this allows for the same .i file to be wrapped into different languages
set(swig_generated_file_fullname string(APPEND swig_generated_file_fullname
"${swig_generated_file_fullname}${SWIG_MODULE_${name}_LANGUAGE}_wrap") "${SWIG_MODULE_${name}_LANGUAGE}_wrap")
if(swig_source_file_cplusplus) if(swig_source_file_cplusplus)
set(swig_generated_file_fullname string(APPEND swig_generated_file_fullname
"${swig_generated_file_fullname}.${SWIG_CXX_EXTENSION}") ".${SWIG_CXX_EXTENSION}")
else() else()
set(swig_generated_file_fullname string(APPEND swig_generated_file_fullname
"${swig_generated_file_fullname}.c") ".c")
endif() endif()
#message("Full path to source file: ${swig_source_file_fullname}") #message("Full path to source file: ${swig_source_file_fullname}")

View File

@ -68,7 +68,7 @@ if(WXWINDOWS_FOUND)
link_libraries(${WXWINDOWS_LIBRARIES}) link_libraries(${WXWINDOWS_LIBRARIES})
endif() endif()
if (CMAKE_WXWINDOWS_CXX_FLAGS) if (CMAKE_WXWINDOWS_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_WXWINDOWS_CXX_FLAGS}") string(APPEND CMAKE_CXX_FLAGS " ${CMAKE_WXWINDOWS_CXX_FLAGS}")
endif() endif()
if(WXWINDOWS_DEFINITIONS) if(WXWINDOWS_DEFINITIONS)
add_definitions(${WXWINDOWS_DEFINITIONS}) add_definitions(${WXWINDOWS_DEFINITIONS})

View File

@ -90,7 +90,7 @@ if (wxWidgets_FOUND)
if (wxWidgets_CXX_FLAGS) if (wxWidgets_CXX_FLAGS)
# Flags are expected to be a string here, not a list. # Flags are expected to be a string here, not a list.
string(REPLACE ";" " " wxWidgets_CXX_FLAGS_str "${wxWidgets_CXX_FLAGS}") string(REPLACE ";" " " wxWidgets_CXX_FLAGS_str "${wxWidgets_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${wxWidgets_CXX_FLAGS_str}") string(APPEND CMAKE_CXX_FLAGS " ${wxWidgets_CXX_FLAGS_str}")
MSG("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS_str}") MSG("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS_str}")
unset(wxWidgets_CXX_FLAGS_str) unset(wxWidgets_CXX_FLAGS_str)
endif() endif()

View File

@ -282,9 +282,9 @@ function(write_compiler_detection_header
set(_min_version 3.1.0) # Version which introduced this function set(_min_version 3.1.0) # Version which introduced this function
if (_WCD_VERSION VERSION_LESS _min_version) if (_WCD_VERSION VERSION_LESS _min_version)
set(err "VERSION compatibility for write_compiler_detection_header is set to ${_WCD_VERSION}, which is too low.") set(err "VERSION compatibility for write_compiler_detection_header is set to ${_WCD_VERSION}, which is too low.")
set(err "${err} It must be set to at least ${_min_version}. ") string(APPEND err " It must be set to at least ${_min_version}. ")
set(err "${err} Either set the VERSION parameter to the write_compiler_detection_header function, or update") string(APPEND err " Either set the VERSION parameter to the write_compiler_detection_header function, or update")
set(err "${err} your minimum required CMake version with the cmake_minimum_required command.") string(APPEND err " your minimum required CMake version with the cmake_minimum_required command.")
message(FATAL_ERROR "${err}") message(FATAL_ERROR "${err}")
endif() endif()
@ -349,11 +349,11 @@ function(write_compiler_detection_header
") ")
if (_WCD_PROLOG) if (_WCD_PROLOG)
set(file_content "${file_content}\n${_WCD_PROLOG}\n") string(APPEND file_content "\n${_WCD_PROLOG}\n")
endif() endif()
if (_need_hex_conversion) if (_need_hex_conversion)
set(file_content "${file_content} string(APPEND file_content "
#define ${prefix_arg}_DEC(X) (X) #define ${prefix_arg}_DEC(X) (X)
#define ${prefix_arg}_HEX(X) ( \\ #define ${prefix_arg}_HEX(X) ( \\
((X)>>28 & 0xF) * 10000000 + \\ ((X)>>28 & 0xF) * 10000000 + \\
@ -406,24 +406,24 @@ function(write_compiler_detection_header
endforeach() endforeach()
if(_lang STREQUAL CXX) if(_lang STREQUAL CXX)
set(file_content "${file_content}\n#ifdef __cplusplus\n") string(APPEND file_content "\n#ifdef __cplusplus\n")
else() else()
set(file_content "${file_content}\n#ifndef __cplusplus\n") string(APPEND file_content "\n#ifndef __cplusplus\n")
endif() endif()
compiler_id_detection(ID_CONTENT ${_lang} PREFIX ${prefix_arg}_ compiler_id_detection(ID_CONTENT ${_lang} PREFIX ${prefix_arg}_
ID_DEFINE ID_DEFINE
) )
set(file_content "${file_content}${ID_CONTENT}\n") string(APPEND file_content "${ID_CONTENT}\n")
set(pp_if "if") set(pp_if "if")
foreach(compiler ${target_compilers}) foreach(compiler ${target_compilers})
set(file_content "${file_content}\n# ${pp_if} ${prefix_arg}_COMPILER_IS_${compiler}\n") string(APPEND file_content "\n# ${pp_if} ${prefix_arg}_COMPILER_IS_${compiler}\n")
if(_WCD_OUTPUT_FILES_VAR) if(_WCD_OUTPUT_FILES_VAR)
set(compile_file_name "${_WCD_OUTPUT_DIR}${prefix_arg}_COMPILER_INFO_${compiler}_${_lang}.h") set(compile_file_name "${_WCD_OUTPUT_DIR}${prefix_arg}_COMPILER_INFO_${compiler}_${_lang}.h")
set(file_content "${file_content}\n# include \"${compile_file_name}\"\n") string(APPEND file_content "\n# include \"${compile_file_name}\"\n")
endif() endif()
if(_WCD_OUTPUT_FILES_VAR) if(_WCD_OUTPUT_FILES_VAR)
@ -466,7 +466,7 @@ function(write_compiler_detection_header
endforeach() endforeach()
endforeach() endforeach()
if(pp_if STREQUAL "elif") if(pp_if STREQUAL "elif")
set(file_content "${file_content} string(APPEND file_content "
# else # else
# error Unsupported compiler # error Unsupported compiler
# endif\n") # endif\n")
@ -477,7 +477,7 @@ function(write_compiler_detection_header
set(def_name ${prefix_arg}_${feature_PP}) set(def_name ${prefix_arg}_${feature_PP})
if (feature STREQUAL c_restrict) if (feature STREQUAL c_restrict)
set(def_value "${prefix_arg}_RESTRICT") set(def_value "${prefix_arg}_RESTRICT")
set(file_content "${file_content} string(APPEND file_content "
# if ${def_name} # if ${def_name}
# define ${def_value} restrict # define ${def_value} restrict
# else # else
@ -487,7 +487,7 @@ function(write_compiler_detection_header
endif() endif()
if (feature STREQUAL cxx_constexpr) if (feature STREQUAL cxx_constexpr)
set(def_value "${prefix_arg}_CONSTEXPR") set(def_value "${prefix_arg}_CONSTEXPR")
set(file_content "${file_content} string(APPEND file_content "
# if ${def_name} # if ${def_name}
# define ${def_value} constexpr # define ${def_value} constexpr
# else # else
@ -497,7 +497,7 @@ function(write_compiler_detection_header
endif() endif()
if (feature STREQUAL cxx_final) if (feature STREQUAL cxx_final)
set(def_value "${prefix_arg}_FINAL") set(def_value "${prefix_arg}_FINAL")
set(file_content "${file_content} string(APPEND file_content "
# if ${def_name} # if ${def_name}
# define ${def_value} final # define ${def_value} final
# else # else
@ -507,7 +507,7 @@ function(write_compiler_detection_header
endif() endif()
if (feature STREQUAL cxx_override) if (feature STREQUAL cxx_override)
set(def_value "${prefix_arg}_OVERRIDE") set(def_value "${prefix_arg}_OVERRIDE")
set(file_content "${file_content} string(APPEND file_content "
# if ${def_name} # if ${def_name}
# define ${def_value} override # define ${def_value} override
# else # else
@ -521,11 +521,11 @@ function(write_compiler_detection_header
set(static_assert_struct "template<bool> struct ${prefix_arg}StaticAssert;\ntemplate<> struct ${prefix_arg}StaticAssert<true>{};\n") set(static_assert_struct "template<bool> struct ${prefix_arg}StaticAssert;\ntemplate<> struct ${prefix_arg}StaticAssert<true>{};\n")
set(def_standard "# define ${def_value} static_assert(X, #X)\n# define ${def_value_msg} static_assert(X, MSG)") set(def_standard "# define ${def_value} static_assert(X, #X)\n# define ${def_value_msg} static_assert(X, MSG)")
set(def_alternative "${static_assert_struct}# define ${def_value} sizeof(${prefix_arg}StaticAssert<X>)\n# define ${def_value_msg} sizeof(${prefix_arg}StaticAssert<X>)") set(def_alternative "${static_assert_struct}# define ${def_value} sizeof(${prefix_arg}StaticAssert<X>)\n# define ${def_value_msg} sizeof(${prefix_arg}StaticAssert<X>)")
set(file_content "${file_content}# if ${def_name}\n${def_standard}\n# else\n${def_alternative}\n# endif\n\n") string(APPEND file_content "# if ${def_name}\n${def_standard}\n# else\n${def_alternative}\n# endif\n\n")
endif() endif()
if (feature STREQUAL cxx_alignas) if (feature STREQUAL cxx_alignas)
set(def_value "${prefix_arg}_ALIGNAS(X)") set(def_value "${prefix_arg}_ALIGNAS(X)")
set(file_content "${file_content} string(APPEND file_content "
# if ${def_name} # if ${def_name}
# define ${def_value} alignas(X) # define ${def_value} alignas(X)
# elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang
@ -539,7 +539,7 @@ function(write_compiler_detection_header
endif() endif()
if (feature STREQUAL cxx_alignof) if (feature STREQUAL cxx_alignof)
set(def_value "${prefix_arg}_ALIGNOF(X)") set(def_value "${prefix_arg}_ALIGNOF(X)")
set(file_content "${file_content} string(APPEND file_content "
# if ${def_name} # if ${def_name}
# define ${def_value} alignof(X) # define ${def_value} alignof(X)
# elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang
@ -551,7 +551,7 @@ function(write_compiler_detection_header
endif() endif()
if (feature STREQUAL cxx_deleted_functions) if (feature STREQUAL cxx_deleted_functions)
set(def_value "${prefix_arg}_DELETED_FUNCTION") set(def_value "${prefix_arg}_DELETED_FUNCTION")
set(file_content "${file_content} string(APPEND file_content "
# if ${def_name} # if ${def_name}
# define ${def_value} = delete # define ${def_value} = delete
# else # else
@ -561,7 +561,7 @@ function(write_compiler_detection_header
endif() endif()
if (feature STREQUAL cxx_extern_templates) if (feature STREQUAL cxx_extern_templates)
set(def_value "${prefix_arg}_EXTERN_TEMPLATE") set(def_value "${prefix_arg}_EXTERN_TEMPLATE")
set(file_content "${file_content} string(APPEND file_content "
# if ${def_name} # if ${def_name}
# define ${def_value} extern # define ${def_value} extern
# else # else
@ -571,7 +571,7 @@ function(write_compiler_detection_header
endif() endif()
if (feature STREQUAL cxx_noexcept) if (feature STREQUAL cxx_noexcept)
set(def_value "${prefix_arg}_NOEXCEPT") set(def_value "${prefix_arg}_NOEXCEPT")
set(file_content "${file_content} string(APPEND file_content "
# if ${def_name} # if ${def_name}
# define ${def_value} noexcept # define ${def_value} noexcept
# define ${def_value}_EXPR(X) noexcept(X) # define ${def_value}_EXPR(X) noexcept(X)
@ -583,7 +583,7 @@ function(write_compiler_detection_header
endif() endif()
if (feature STREQUAL cxx_nullptr) if (feature STREQUAL cxx_nullptr)
set(def_value "${prefix_arg}_NULLPTR") set(def_value "${prefix_arg}_NULLPTR")
set(file_content "${file_content} string(APPEND file_content "
# if ${def_name} # if ${def_name}
# define ${def_value} nullptr # define ${def_value} nullptr
# else # else
@ -593,7 +593,7 @@ function(write_compiler_detection_header
endif() endif()
if (feature STREQUAL cxx_thread_local) if (feature STREQUAL cxx_thread_local)
set(def_value "${prefix_arg}_THREAD_LOCAL") set(def_value "${prefix_arg}_THREAD_LOCAL")
set(file_content "${file_content} string(APPEND file_content "
# if ${def_name} # if ${def_name}
# define ${def_value} thread_local # define ${def_value} thread_local
# elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang
@ -608,7 +608,7 @@ function(write_compiler_detection_header
if (feature STREQUAL cxx_attribute_deprecated) if (feature STREQUAL cxx_attribute_deprecated)
set(def_name ${prefix_arg}_${feature_PP}) set(def_name ${prefix_arg}_${feature_PP})
set(def_value "${prefix_arg}_DEPRECATED") set(def_value "${prefix_arg}_DEPRECATED")
set(file_content "${file_content} string(APPEND file_content "
# ifndef ${def_value} # ifndef ${def_value}
# if ${def_name} # if ${def_name}
# define ${def_value} [[deprecated]] # define ${def_value} [[deprecated]]
@ -628,7 +628,7 @@ function(write_compiler_detection_header
endif() endif()
endforeach() endforeach()
set(file_content "${file_content}#endif\n") string(APPEND file_content "#endif\n")
endforeach() endforeach()
@ -637,7 +637,7 @@ function(write_compiler_detection_header
foreach(_lang ${_langs}) foreach(_lang ${_langs})
if(compiler_file_content_${compiler}_${_lang}) if(compiler_file_content_${compiler}_${_lang})
set(CMAKE_CONFIGURABLE_FILE_CONTENT "${compiler_file_content_}") set(CMAKE_CONFIGURABLE_FILE_CONTENT "${compiler_file_content_}")
set(CMAKE_CONFIGURABLE_FILE_CONTENT "${CMAKE_CONFIGURABLE_FILE_CONTENT}${compiler_file_content_${compiler}_${_lang}}") string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT "${compiler_file_content_${compiler}_${_lang}}")
set(compile_file_name "${_WCD_OUTPUT_DIR}${prefix_arg}_COMPILER_INFO_${compiler}_${_lang}.h") set(compile_file_name "${_WCD_OUTPUT_DIR}${prefix_arg}_COMPILER_INFO_${compiler}_${_lang}.h")
set(full_path "${main_file_dir}/${compile_file_name}") set(full_path "${main_file_dir}/${compile_file_name}")
@ -653,9 +653,9 @@ function(write_compiler_detection_header
endif() endif()
if (_WCD_EPILOG) if (_WCD_EPILOG)
set(file_content "${file_content}\n${_WCD_EPILOG}\n") string(APPEND file_content "\n${_WCD_EPILOG}\n")
endif() endif()
set(file_content "${file_content}\n#endif") string(APPEND file_content "\n#endif")
set(CMAKE_CONFIGURABLE_FILE_CONTENT ${file_content}) set(CMAKE_CONFIGURABLE_FILE_CONTENT ${file_content})
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in" configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"