Commit 7a649111 authored by Daniel Pfeifer's avatar Daniel Pfeifer

Use string(APPEND) in Tests

Automate with:

find Tests -type f -print0 | xargs -0 perl -i -0pe \
's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
parent 5d0d980d
...@@ -8,7 +8,7 @@ set(CMAKE_CXX_STANDARD 98) ...@@ -8,7 +8,7 @@ set(CMAKE_CXX_STANDARD 98)
# template support also need a flag to use the newer C++ library. # template support also need a flag to use the newer C++ library.
if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") string(APPEND CMAKE_CXX_FLAGS " -AA")
endif () endif ()
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers # Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
......
...@@ -50,7 +50,7 @@ else () ...@@ -50,7 +50,7 @@ else ()
endif () endif ()
if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") string(APPEND CMAKE_CXX_FLAGS " -O3")
unset(CSE_RESULT_O3 CACHE) unset(CSE_RESULT_O3 CACHE)
message(STATUS "Testing with optimization -O3") message(STATUS "Testing with optimization -O3")
......
...@@ -77,7 +77,7 @@ endforeach() ...@@ -77,7 +77,7 @@ endforeach()
set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE}) set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") string(APPEND CMAKE_C_FLAGS " -O3")
unset(CSHM_RESULT_O3 CACHE) unset(CSHM_RESULT_O3 CACHE)
unset(CSHM_RESULT_O3_C CACHE) unset(CSHM_RESULT_O3_C CACHE)
unset(CSHM_RESULT_O3_CXX CACHE) unset(CSHM_RESULT_O3_CXX CACHE)
......
...@@ -39,7 +39,7 @@ else () ...@@ -39,7 +39,7 @@ else ()
endif () endif ()
if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") string(APPEND CMAKE_C_FLAGS " -O3")
unset(CSE_RESULT_O3 CACHE) unset(CSE_RESULT_O3 CACHE)
message(STATUS "Testing with optimization -O3") message(STATUS "Testing with optimization -O3")
......
...@@ -35,7 +35,7 @@ foreach(module ${all_modules}) ...@@ -35,7 +35,7 @@ foreach(module ${all_modules})
message(STATUS "module: ${module}") message(STATUS "module: ${module}")
file(READ "${dir}/${module}" module_content) file(READ "${dir}/${module}" module_content)
if(NOT "${module_content}" MATCHES "${notice_regex}") if(NOT "${module_content}" MATCHES "${notice_regex}")
set(notice_missing "${notice_missing} ${module}\n") string(APPEND notice_missing " ${module}\n")
endif() endif()
endforeach() endforeach()
......
...@@ -2,13 +2,13 @@ set(NUMBERS "") ...@@ -2,13 +2,13 @@ set(NUMBERS "")
set(COUNT 0) set(COUNT 0)
while(COUNT LESS 200) while(COUNT LESS 200)
set(NUMBERS "${NUMBERS} ${COUNT}") string(APPEND NUMBERS " ${COUNT}")
set(COUNT "2${COUNT}") set(COUNT "2${COUNT}")
set(NCOUNT 3) set(NCOUNT 3)
while(NCOUNT LESS 31) while(NCOUNT LESS 31)
set(NUMBERS "${NUMBERS} ${NCOUNT}") string(APPEND NUMBERS " ${NCOUNT}")
set(NCOUNT "${NCOUNT}0") string(APPEND NCOUNT "0")
endwhile() endwhile()
endwhile() endwhile()
......
...@@ -41,7 +41,7 @@ if(LINTIAN_EXECUTABLE) ...@@ -41,7 +41,7 @@ if(LINTIAN_EXECUTABLE)
FILENAME "${_f}" FILENAME "${_f}"
ERROR_REGEX_STRINGS "${STRINGS_TO_AVOID}") ERROR_REGEX_STRINGS "${STRINGS_TO_AVOID}")
set(lintian_output_errors_all "${lintian_output_errors_all}${lintian_output_errors}") string(APPEND lintian_output_errors_all "${lintian_output_errors}")
endforeach() endforeach()
if(NOT "${lintian_output_errors_all}" STREQUAL "") if(NOT "${lintian_output_errors_all}" STREQUAL "")
......
...@@ -126,7 +126,7 @@ function(lintian_check_specific_errors output_errors) ...@@ -126,7 +126,7 @@ function(lintian_check_specific_errors output_errors)
string(REGEX MATCHALL "${_s}" "_TMP_CHECK_ERROR" "${lintian_output}") string(REGEX MATCHALL "${_s}" "_TMP_CHECK_ERROR" "${lintian_output}")
if(NOT "${_TMP_CHECK_ERROR}" STREQUAL "") if(NOT "${_TMP_CHECK_ERROR}" STREQUAL "")
set(ERROR_ACC "${ERROR_ACC}\nlintian: ${_f}: output contains an undesirable regex:\n\t${_TMP_CHECK_ERROR}") string(APPEND ERROR_ACC "\nlintian: ${_f}: output contains an undesirable regex:\n\t${_TMP_CHECK_ERROR}")
endif() endif()
endforeach() endforeach()
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Test in a directory next to this script. # Test in a directory next to this script.
get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(TOP "${TOP}/@CTestUpdateBZR_DIR@") string(APPEND TOP "/@CTestUpdateBZR_DIR@")
# Include code common to all update tests. # Include code common to all update tests.
include("@CMAKE_CURRENT_SOURCE_DIR@/CTestUpdateCommon.cmake") include("@CMAKE_CURRENT_SOURCE_DIR@/CTestUpdateCommon.cmake")
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Test in a directory next to this script. # Test in a directory next to this script.
get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(TOP "${TOP}/@CTestUpdateCVS_DIR@") string(APPEND TOP "/@CTestUpdateCVS_DIR@")
set(UPDATE_NOT_GLOBAL 1) set(UPDATE_NOT_GLOBAL 1)
set(UPDATE_MAYBE Updated{CTestConfig.cmake}) set(UPDATE_MAYBE Updated{CTestConfig.cmake})
......
...@@ -84,9 +84,9 @@ function(check_updates build) ...@@ -84,9 +84,9 @@ function(check_updates build)
set(MSG "") set(MSG "")
if(MISSING) if(MISSING)
# List the missing entries # List the missing entries
set(MSG "${MSG}Update.xml is missing expected entries:\n") string(APPEND MSG "Update.xml is missing expected entries:\n")
foreach(f ${MISSING}) foreach(f ${MISSING})
set(MSG "${MSG} ${f}\n") string(APPEND MSG " ${f}\n")
endforeach() endforeach()
else() else()
# Success # Success
...@@ -96,9 +96,9 @@ function(check_updates build) ...@@ -96,9 +96,9 @@ function(check_updates build)
# Report the result # Report the result
if(EXTRA) if(EXTRA)
# List the extra entries # List the extra entries
set(MSG "${MSG}Update.xml has extra unexpected entries:\n") string(APPEND MSG "Update.xml has extra unexpected entries:\n")
foreach(f ${EXTRA}) foreach(f ${EXTRA})
set(MSG "${MSG} ${f}\n") string(APPEND MSG " ${f}\n")
endforeach() endforeach()
else() else()
# Success # Success
...@@ -112,9 +112,9 @@ function(check_updates build) ...@@ -112,9 +112,9 @@ function(check_updates build)
if(UPDATE_LOG_FILE) if(UPDATE_LOG_FILE)
file(READ ${UPDATE_LOG_FILE} UPDATE_LOG LIMIT ${max_update_xml_size}) file(READ ${UPDATE_LOG_FILE} UPDATE_LOG LIMIT ${max_update_xml_size})
string(REPLACE "\n" "\n " UPDATE_LOG "${UPDATE_LOG}") string(REPLACE "\n" "\n " UPDATE_LOG "${UPDATE_LOG}")
set(MSG "${MSG}Update log:\n ${UPDATE_LOG}") string(APPEND MSG "Update log:\n ${UPDATE_LOG}")
else() else()
set(MSG "${MSG}No update log found!") string(APPEND MSG "No update log found!")
endif() endif()
# Display the error message # Display the error message
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Test in a directory next to this script. # Test in a directory next to this script.
get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(TOP "${TOP}/@CTestUpdateGIT_DIR@") string(APPEND TOP "/@CTestUpdateGIT_DIR@")
set(UPDATE_EXTRA Updated{module}) set(UPDATE_EXTRA Updated{module})
# Include code common to all update tests. # Include code common to all update tests.
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Test in a directory next to this script. # Test in a directory next to this script.
get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(TOP "${TOP}/@CTestUpdateHG_DIR@") string(APPEND TOP "/@CTestUpdateHG_DIR@")
# Include code common to all update tests. # Include code common to all update tests.
include("@CMAKE_CURRENT_SOURCE_DIR@/CTestUpdateCommon.cmake") include("@CMAKE_CURRENT_SOURCE_DIR@/CTestUpdateCommon.cmake")
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Test in a directory next to this script. # Test in a directory next to this script.
get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(P4_TOP "${TOP}") set(P4_TOP "${TOP}")
set(TOP "${TOP}/@CTestUpdateP4_DIR@") string(APPEND TOP "/@CTestUpdateP4_DIR@")
# Include code common to all update tests. # Include code common to all update tests.
set(REPOSITORY_FILE_PREFIX "//ctest/") set(REPOSITORY_FILE_PREFIX "//ctest/")
...@@ -48,9 +48,9 @@ if(UNIX) ...@@ -48,9 +48,9 @@ if(UNIX)
file(MAKE_DIRECTORY ${P4_ROOT}) file(MAKE_DIRECTORY ${P4_ROOT})
set(P4_SERVER "nohup '${P4D}' -d -r '${P4_ROOT}'") set(P4_SERVER "nohup '${P4D}' -d -r '${P4_ROOT}'")
set(P4_SERVER "${P4_SERVER} -L '${P4_ROOT}/p4.log'") string(APPEND P4_SERVER " -L '${P4_ROOT}/p4.log'")
set(P4_SERVER "${P4_SERVER} -J '${P4_ROOT}/journal'") string(APPEND P4_SERVER " -J '${P4_ROOT}/journal'")
set(P4_SERVER "${P4_SERVER} -p ${P4_PORT} >/dev/null 2>&1 &") string(APPEND P4_SERVER " -p ${P4_PORT} >/dev/null 2>&1 &")
message("Server command line: ${P4_SERVER}") message("Server command line: ${P4_SERVER}")
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Test in a directory next to this script. # Test in a directory next to this script.
get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(TOP "${TOP}/@CTestUpdateSVN_DIR@") string(APPEND TOP "/@CTestUpdateSVN_DIR@")
set(UPDATE_GLOBAL_ELEMENTS SVNPath) set(UPDATE_GLOBAL_ELEMENTS SVNPath)
# Include code common to all update tests. # Include code common to all update tests.
......
...@@ -95,7 +95,7 @@ endif() ...@@ -95,7 +95,7 @@ endif()
if(CMAKE_SYSTEM MATCHES "OSF1-V") if(CMAKE_SYSTEM MATCHES "OSF1-V")
if(NOT CMAKE_COMPILER_IS_GNUCXX) if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") string(APPEND CMAKE_CXX_FLAGS " -timplicit_local -no_implicit_include ")
endif() endif()
endif() endif()
...@@ -436,7 +436,7 @@ set(CMAKE_CXX_EXTENSIONS TRUE) ...@@ -436,7 +436,7 @@ set(CMAKE_CXX_EXTENSIONS TRUE)
# template support also need a flag to use the newer C++ library. # template support also need a flag to use the newer C++ library.
if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") string(APPEND CMAKE_CXX_FLAGS " -AA")
endif () endif ()
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers # Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
......
# #
# Create exe. # Create exe.
# #
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") string(APPEND CMAKE_CXX_FLAGS " -DTEST_CXX_FLAGS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") string(APPEND CMAKE_C_FLAGS " -DTEST_C_FLAGS")
# Create an imported target for if(TARGET) test below. # Create an imported target for if(TARGET) test below.
add_library(ExeImportedTarget UNKNOWN IMPORTED) add_library(ExeImportedTarget UNKNOWN IMPORTED)
......
...@@ -43,7 +43,7 @@ endif() ...@@ -43,7 +43,7 @@ endif()
# #
set(SharedLibrarySources sharedFile) set(SharedLibrarySources sharedFile)
add_library(CMakeTestLibraryShared SHARED ${SharedLibrarySources}) add_library(CMakeTestLibraryShared SHARED ${SharedLibrarySources})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") string(APPEND CMAKE_C_FLAGS " -DTEST_C_FLAGS")
add_library(CMakeTestCLibraryShared SHARED testConly.c) add_library(CMakeTestCLibraryShared SHARED testConly.c)
define_property( define_property(
TARGET PROPERTY FOO TARGET PROPERTY FOO
......
...@@ -180,5 +180,5 @@ endforeach() ...@@ -180,5 +180,5 @@ endforeach()
set(FOREACH_CONCAT "") set(FOREACH_CONCAT "")
foreach (INDEX a;b;c;d;e;f;g) foreach (INDEX a;b;c;d;e;f;g)
set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") string(APPEND FOREACH_CONCAT "${INDEX}")
endforeach() endforeach()
...@@ -88,7 +88,7 @@ endif() ...@@ -88,7 +88,7 @@ endif()
if(CMAKE_SYSTEM MATCHES "OSF1-V") if(CMAKE_SYSTEM MATCHES "OSF1-V")
if(NOT CMAKE_COMPILER_IS_GNUCXX) if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") string(APPEND CMAKE_CXX_FLAGS " -timplicit_local -no_implicit_include ")
endif() endif()
endif() endif()
...@@ -399,7 +399,7 @@ set(CMAKE_CXX_EXTENSIONS TRUE) ...@@ -399,7 +399,7 @@ set(CMAKE_CXX_EXTENSIONS TRUE)
# template support also need a flag to use the newer C++ library. # template support also need a flag to use the newer C++ library.
if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") string(APPEND CMAKE_CXX_FLAGS " -AA")
endif () endif ()
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers # Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
......
# #
# Create exe. # Create exe.
# #
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") string(APPEND CMAKE_CXX_FLAGS " -DTEST_CXX_FLAGS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") string(APPEND CMAKE_C_FLAGS " -DTEST_C_FLAGS")
# Create an imported target for if(TARGET) test below. # Create an imported target for if(TARGET) test below.
add_library(ExeImportedTarget UNKNOWN IMPORTED) add_library(ExeImportedTarget UNKNOWN IMPORTED)
......
...@@ -43,7 +43,7 @@ endif() ...@@ -43,7 +43,7 @@ endif()
# #
set(SharedLibrarySources sharedFile) set(SharedLibrarySources sharedFile)
add_library(CMakeTestLibraryShared SHARED ${SharedLibrarySources}) add_library(CMakeTestLibraryShared SHARED ${SharedLibrarySources})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") string(APPEND CMAKE_C_FLAGS " -DTEST_C_FLAGS")
add_library(CMakeTestCLibraryShared SHARED testConly.c) add_library(CMakeTestCLibraryShared SHARED testConly.c)
define_property( define_property(
TARGET PROPERTY FOO TARGET PROPERTY FOO
......
...@@ -180,5 +180,5 @@ endforeach() ...@@ -180,5 +180,5 @@ endforeach()
set(FOREACH_CONCAT "") set(FOREACH_CONCAT "")
foreach (INDEX a;b;c;d;e;f;g) foreach (INDEX a;b;c;d;e;f;g)
set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") string(APPEND FOREACH_CONCAT "${INDEX}")
endforeach() endforeach()
...@@ -376,8 +376,8 @@ foreach(arg ${CHECK_ARGS} "") ...@@ -376,8 +376,8 @@ foreach(arg ${CHECK_ARGS} "")
set(ARG "${arg}") set(ARG "${arg}")
string(REPLACE "\\" "\\\\" ARG "${ARG}") string(REPLACE "\\" "\\\\" ARG "${ARG}")
string(REPLACE "\"" "\\\"" ARG "${ARG}") string(REPLACE "\"" "\\\"" ARG "${ARG}")
set(EXPECTED_ARGUMENTS string(APPEND EXPECTED_ARGUMENTS
"${EXPECTED_ARGUMENTS} \"${ARG}\", " \"${ARG}\",
") ")
endforeach() endforeach()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in
...@@ -476,7 +476,7 @@ add_custom_command( ...@@ -476,7 +476,7 @@ add_custom_command(
add_library(NormOutput "${gen_file}") add_library(NormOutput "${gen_file}")
set(gen_path "${gen_path}/bar") string(APPEND gen_path "/bar")
set(gen_file "${gen_path}/bar.cxx") set(gen_file "${gen_path}/bar.cxx")
add_custom_command( add_custom_command(
......
...@@ -333,7 +333,7 @@ endif() ...@@ -333,7 +333,7 @@ endif()
# Choose a unique version. # Choose a unique version.
string(REGEX REPLACE "-.*$" "" version ${CMAKE_VERSION}) string(REGEX REPLACE "-.*$" "" version ${CMAKE_VERSION})
string(RANDOM LENGTH 4 ALPHABET "0123456789" v) string(RANDOM LENGTH 4 ALPHABET "0123456789" v)
set(version "${version}.${v}") string(APPEND version ".${v}")
message(STATUS "Preparing export(PACKAGE) test project") message(STATUS "Preparing export(PACKAGE) test project")
try_compile(EXPORTER_COMPILED try_compile(EXPORTER_COMPILED
......
...@@ -188,7 +188,7 @@ if(TEST_MODULE_DEPENDS) ...@@ -188,7 +188,7 @@ if(TEST_MODULE_DEPENDS)
if("${testf_BINARY_DIR}" MATCHES " ") if("${testf_BINARY_DIR}" MATCHES " ")
# Our build tree has a space, so the build tool supports spaces. # Our build tree has a space, so the build tool supports spaces.
# Test using modules from a path with spaces. # Test using modules from a path with spaces.
set(External_BINARY_DIR "${External_BINARY_DIR} Build") string(APPEND External_BINARY_DIR " Build")
endif() endif()
add_custom_command( add_custom_command(
OUTPUT ${testf_BINARY_DIR}/ExternalProject OUTPUT ${testf_BINARY_DIR}/ExternalProject
......
...@@ -39,9 +39,9 @@ if(WATCOM OR MSVC60) ...@@ -39,9 +39,9 @@ if(WATCOM OR MSVC60)
set(USE_FULLPATH FALSE) set(USE_FULLPATH FALSE)
endif() endif()
if(USE_FULLPATH) if(USE_FULLPATH)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \"-I${CMAKE_BINARY_DIR}/Flags\"") string(APPEND CMAKE_CXX_FLAGS " \"-I${CMAKE_BINARY_DIR}/Flags\"")
else() else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -IFlags") string(APPEND CMAKE_CXX_FLAGS " -IFlags")
endif() endif()
include_directories(${CMAKE_BINARY_DIR}/IncDir) include_directories(${CMAKE_BINARY_DIR}/IncDir)
......
...@@ -34,7 +34,7 @@ endforeach() ...@@ -34,7 +34,7 @@ endforeach()
# Configure an executable to check that all the files are missing. # Configure an executable to check that all the files are missing.
set(CHECK_FILES) set(CHECK_FILES)
foreach(f ${TOCLEAN_FILES}) foreach(f ${TOCLEAN_FILES})
set(CHECK_FILES "${CHECK_FILES} \"${f}\",\n") string(APPEND CHECK_FILES " \"${f}\",\n")
endforeach() endforeach()
configure_file(${MakeClean_SOURCE_DIR}/check_clean.c.in configure_file(${MakeClean_SOURCE_DIR}/check_clean.c.in
${MakeClean_BINARY_DIR}/check_clean.c @ONLY) ${MakeClean_BINARY_DIR}/check_clean.c @ONLY)
......
...@@ -16,7 +16,7 @@ set(FILE_EXPRESSIONS "") ...@@ -16,7 +16,7 @@ set(FILE_EXPRESSIONS "")
foreach(expression foreach(expression
${expressions}) ${expressions})
math(EXPR expr "${expression}") math(EXPR expr "${expression}")
set(FILE_EXPRESSIONS "${FILE_EXPRESSIONS}TEST_EXPRESSION(${expression}, ${expr})\n") string(APPEND FILE_EXPRESSIONS "TEST_EXPRESSION(${expression}, ${expr})\n")
endforeach() endforeach()
configure_file( configure_file(
......
...@@ -64,7 +64,7 @@ set(CMAKE_CXX_STANDARD 98) ...@@ -64,7 +64,7 @@ set(CMAKE_CXX_STANDARD 98)
# template support also need a flag to use the newer C++ library. # template support also need a flag to use the newer C++ library.
if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") string(APPEND CMAKE_CXX_FLAGS " -AA")
endif () endif ()
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers # Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
...@@ -103,7 +103,7 @@ endif() ...@@ -103,7 +103,7 @@ endif()
if (CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} MATCHES Clang)) if (CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} MATCHES Clang))
# No need to clutter the test output with warnings. # No need to clutter the test output with warnings.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") string(APPEND CMAKE_CXX_FLAGS " -Wno-deprecated-declarations")
endif() endif()
if(MSVC AND COMPILER_HAS_DEPRECATED) if(MSVC AND COMPILER_HAS_DEPRECATED)
......
...@@ -32,7 +32,7 @@ set(CMAKE_CXX_STANDARD 98) ...@@ -32,7 +32,7 @@ set(CMAKE_CXX_STANDARD 98)
# template support also need a flag to use the newer C++ library. # template support also need a flag to use the newer C++ library.
if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") string(APPEND CMAKE_CXX_FLAGS " -AA")
endif () endif ()
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers # Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
......
...@@ -57,7 +57,7 @@ if(NOT BORLAND AND NOT PP_VS70) ...@@ -57,7 +57,7 @@ if(NOT BORLAND AND NOT PP_VS70)
set(SEMICOLON "\;") set(SEMICOLON "\;")
endif() endif()
set(STRING_EXTRA "${STRING_EXTRA} ") string(APPEND STRING_EXTRA " ")
if(NOT PP_BORLAND AND NOT PP_WATCOM) if(NOT PP_BORLAND AND NOT PP_WATCOM)
# Borland, WMake: multiple spaces # Borland, WMake: multiple spaces
...@@ -65,7 +65,7 @@ if(NOT PP_BORLAND AND NOT PP_WATCOM) ...@@ -65,7 +65,7 @@ if(NOT PP_BORLAND AND NOT PP_WATCOM)
# quoted strings when passing to the compiler. It does not have # quoted strings when passing to the compiler. It does not have
# trouble passing to other tools, and the compiler may be directly # trouble passing to other tools, and the compiler may be directly
# invoked from the command line. # invoked from the command line.
set(STRING_EXTRA "${STRING_EXTRA} ") string(APPEND STRING_EXTRA " ")
endif() endif()
if(NOT PP_VS) if(NOT PP_VS)
...@@ -73,21 +73,21 @@ if(NOT PP_VS) ...@@ -73,21 +73,21 @@ if(NOT PP_VS)
# Visual Studio will not accept a comma in the value of a definition. # Visual Studio will not accept a comma in the value of a definition.
# The comma-separated list of PreprocessorDefinitions in the project # The comma-separated list of PreprocessorDefinitions in the project
# file seems to be parsed before the content of entries is examined. # file seems to be parsed before the content of entries is examined.
set(STRING_EXTRA "${STRING_EXTRA},") string(APPEND STRING_EXTRA ",")
endif() endif()
if(NOT PP_MINGW) if(NOT PP_MINGW)
# MinGW: & # MinGW: &
# When inside -D"FOO=\"a & b\"" MinGW make wants -D"FOO=\"a "&" b\"" # When inside -D"FOO=\"a & b\"" MinGW make wants -D"FOO=\"a "&" b\""
# but it does not like quoted ampersand elsewhere. # but it does not like quoted ampersand elsewhere.
set(STRING_EXTRA "${STRING_EXTRA}&") string(APPEND STRING_EXTRA "&")
endif() endif()
if(NOT PP_MINGW) if(NOT PP_MINGW)
# MinGW: | # MinGW: |
# When inside -D"FOO=\"a | b\"" MinGW make wants -D"FOO=\"a "|" b\"" # When inside -D"FOO=\"a | b\"" MinGW make wants -D"FOO=\"a "|" b\""
# but it does not like quoted pipe elsewhere. # but it does not like quoted pipe elsewhere.
set(STRING_EXTRA "${STRING_EXTRA}|") string(APPEND STRING_EXTRA "|")
endif() endif()
if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE)
...@@ -95,13 +95,13 @@ if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) ...@@ -95,13 +95,13 @@ if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE)
# When inside -D"FOO=\"a ^ b\"" the make tools want -D"FOO=\"a "^" b\"" # When inside -D"FOO=\"a ^ b\"" the make tools want -D"FOO=\"a "^" b\""
# but do not like quoted carrot elsewhere. In NMake the non-quoted # but do not like quoted carrot elsewhere. In NMake the non-quoted
# syntax works when the flags are not in a make variable. # syntax works when the flags are not in a make variable.
set(STRING_EXTRA "${STRING_EXTRA}^") string(APPEND STRING_EXTRA "^")
endif() endif()
if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE)
# Borland, MinGW: < > # Borland, MinGW: < >
# Angle-brackets have funny behavior that is hard to escape. # Angle-brackets have funny behavior that is hard to escape.
set(STRING_EXTRA "${STRING_EXTRA}<>") string(APPEND STRING_EXTRA "<>")
endif() endif()
set(EXPR_OP1 "/") set(EXPR_OP1 "/")
...@@ -122,7 +122,7 @@ if((NOT MSVC OR PP_NMAKE) AND ...@@ -122,7 +122,7 @@ if((NOT MSVC OR PP_NMAKE) AND
# be written just '%'. However nmake requires '%%' except when using # be written just '%'. However nmake requires '%%' except when using
# response files. Currently we have no way to affect escaping based # response files. Currently we have no way to affect escaping based
# on whether flags go in a response file, so we just have to skip it. # on whether flags go in a response file, so we just have to skip it.
set(STRING_EXTRA "${STRING_EXTRA}%") string(APPEND STRING_EXTRA "%")
set(EXPR_OP1 "%") set(EXPR_OP1 "%")
endif() endif()
...@@ -130,9 +130,9 @@ endif() ...@@ -130,9 +130,9 @@ endif()
# The XL compiler cannot pass unbalanced parens correctly to a tool # The XL compiler cannot pass unbalanced parens correctly to a tool
# it launches internally. # it launches internally.
if(CMAKE_C_COMPILER_ID STREQUAL "XL") if(CMAKE_C_COMPILER_ID STREQUAL "XL")
set(STRING_EXTRA "${STRING_EXTRA}()") string(APPEND STRING_EXTRA "()")
else() else()
set(STRING_EXTRA "${STRING_EXTRA})(") string(APPEND STRING_EXTRA ")(")
endif() endif()
# General: \" # General: \"
...@@ -146,7 +146,7 @@ endif() ...@@ -146,7 +146,7 @@ endif()
# internal tool to do preprocessing . # internal tool to do preprocessing .
if((PP_NMAKE OR PP_UMAKE) AND if((PP_NMAKE OR PP_UMAKE) AND
NOT CMAKE_C_COMPILER_ID STREQUAL "XL") NOT CMAKE_C_COMPILER_ID STREQUAL "XL")
set(STRING_EXTRA "${STRING_EXTRA}\\\"") string(APPEND STRING_EXTRA "\\\"")
endif() endif()
# General: # # General: #
...@@ -183,15 +183,15 @@ set(EXPR "x*y+!(x==(y+1*2))*f(x${EXPR_OP1}2)") ...@@ -183,15 +183,15 @@ set(EXPR "x*y+!(x==(y+1*2))*f(x${EXPR_OP1}2)")
if(NOT WATCOM) if(NOT WATCOM)
# Watcom does not support - or / because it parses them as options. # Watcom does not support - or / because it parses them as options.
set(EXPR "${EXPR} + y/x-x") string(APPEND EXPR " + y/x-x")
endif() endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Inform the test if the debug configuration is getting built. # Inform the test if the debug configuration is getting built.
# The NDEBUG definition takes care of this for release. # The NDEBUG definition takes care of this for release.