summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt8
-rw-r--r--Tests/CMakeTests/CMakeLists.txt15
-rw-r--r--Tests/CMakeTests/CheckSourceTreeTest.cmake.in365
-rw-r--r--Tests/CheckSourceTree/CMakeLists.txt6
-rw-r--r--Tests/CheckSourceTree/check.cmake22
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake38
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake27
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagC.cmake33
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagCUDA.cmake (renamed from Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagCXX.cmake26
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagFortran.cmake (renamed from Tests/RunCMake/CheckCompilerFlag/CheckFortranCompilerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagHIP.cmake (renamed from Tests/RunCMake/CheckCompilerFlag/CheckHIPCompilerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagISPC.cmake (renamed from Tests/RunCMake/CheckCompilerFlag/CheckISPCCompilerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagOBJC.cmake (renamed from Tests/RunCMake/CheckCompilerFlag/CheckOBJCCompilerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagOBJCXX.cmake (renamed from Tests/RunCMake/CheckCompilerFlag/CheckOBJCXXCompilerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake16
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagC.cmake (renamed from Tests/RunCMake/CheckLinkerFlag/CheckCLinkerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagCUDA.cmake (renamed from Tests/RunCMake/CheckLinkerFlag/CheckCUDALinkerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagCXX.cmake (renamed from Tests/RunCMake/CheckLinkerFlag/CheckCXXLinkerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagFortran.cmake (renamed from Tests/RunCMake/CheckLinkerFlag/CheckFortranLinkerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagHIP.cmake (renamed from Tests/RunCMake/CheckLinkerFlag/CheckHIPLinkerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagOBJC.cmake (renamed from Tests/RunCMake/CheckLinkerFlag/CheckOBJCLinkerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagOBJCXX.cmake (renamed from Tests/RunCMake/CheckLinkerFlag/CheckOBJCXXLinkerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/RunCMakeTest.cmake14
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake6
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake10
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake9
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake9
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesC.cmake15
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesCUDA.cmake (renamed from Tests/RunCMake/CheckSourceCompiles/CheckCUDASourceCompiles.cmake)0
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesCXX.cmake28
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesFortran.cmake (renamed from Tests/RunCMake/CheckSourceCompiles/CheckFortranSourceCompiles.cmake)0
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesHIP.cmake (renamed from Tests/RunCMake/CheckSourceCompiles/CheckHIPSourceCompiles.cmake)0
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesISPC.cmake (renamed from Tests/RunCMake/CheckSourceCompiles/CheckISPCSourceCompiles.cmake)0
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesOBJC.cmake16
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesOBJCXX.cmake19
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake10
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake10
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake9
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake9
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsC.cmake15
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsCUDA.cmake (renamed from Tests/RunCMake/CheckSourceRuns/CheckCUDASourceRuns.cmake)0
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsCXX.cmake22
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsFortran.cmake (renamed from Tests/RunCMake/CheckSourceRuns/CheckFortranSourceRuns.cmake)0
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsHIP.cmake (renamed from Tests/RunCMake/CheckSourceRuns/CheckHIPSourceRuns.cmake)0
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsOBJC.cmake16
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsOBJCXX.cmake19
-rw-r--r--Tests/RunCMake/CheckSourceRuns/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/CommandLine/debug-trycompile-stderr.txt11
-rw-r--r--Tests/RunCMake/Ninja/QtAutoMocSkipPch.cmake17
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake16
-rw-r--r--Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-result.txt1
-rw-r--r--Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stderr.txt12
-rw-r--r--Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt12
-rw-r--r--Tests/RunCMake/install/DIRECTORY-symlink-clobber.cmake11
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/try_compile/PlatformVariables-stderr.txt11
-rw-r--r--Tests/RunCMake/try_compile/WarnDeprecated-stderr.txt11
-rw-r--r--Tests/TryCompile/CMakeLists.txt144
60 files changed, 454 insertions, 610 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index da87213aa1..10242fd622 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -3616,6 +3616,14 @@ if(BUILD_TESTING)
add_subdirectory(CMakeGUI)
endif()
+ # Run CheckSourceTree as the very last test in the CMake/CTest/CPack test
+ # suite. It detects if any changes have been made to the CMake source tree
+ # by any previous configure, build or test steps.
+ if(GIT_EXECUTABLE AND EXISTS "${CMake_SOURCE_DIR}/.git"
+ AND NOT "${CMake_SOURCE_DIR}" STREQUAL "${CMake_BINARY_DIR}")
+ add_subdirectory(CheckSourceTree)
+ endif()
+
# If this is not an in-source build, provide a target to wipe out
# all the test build directories. This must come at the end after
# all the above logic has finished adding to TEST_BUILD_DIRS
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt
index 9e0b89101d..bd2dd7e940 100644
--- a/Tests/CMakeTests/CMakeLists.txt
+++ b/Tests/CMakeTests/CMakeLists.txt
@@ -59,18 +59,3 @@ if(GIT_EXECUTABLE)
)
AddCMakeTest(PolicyCheck "${PolicyCheck_PreArgs}")
endif()
-
-# Run CheckSourceTree as the very last test in the CMake/CTest/CPack test
-# suite. It detects if any changes have been made to the CMake source tree
-# by any previous configure, build or test steps.
-#
-if(GIT_EXECUTABLE)
- string(REPLACE "\\" "/" ENV_HOME "$ENV{HOME}")
- set(CheckSourceTree_PreArgs
- "-DCMake_BINARY_DIR:PATH=${CMake_BINARY_DIR}"
- "-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}"
- "-DGIT_EXECUTABLE:STRING=${GIT_EXECUTABLE}"
- "-DHOME:STRING=${ENV_HOME}"
- )
- AddCMakeTest(CheckSourceTree "${CheckSourceTree_PreArgs}")
-endif()
diff --git a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
deleted file mode 100644
index 4f2aaea9cf..0000000000
--- a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
+++ /dev/null
@@ -1,365 +0,0 @@
-# Check the CMake source tree and report anything suspicious...
-#
-message("=============================================================================")
-message("CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
-message("")
-message("CMake_BINARY_DIR='${CMake_BINARY_DIR}'")
-message("CMake_SOURCE_DIR='${CMake_SOURCE_DIR}'")
-message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
-message("HOME='${HOME}'")
-message("ENV{DASHBOARD_TEST_FROM_CTEST}='$ENV{DASHBOARD_TEST_FROM_CTEST}'")
-message("")
-string(REPLACE "\\" "\\\\" HOME "${HOME}")
-
-
-# Is the build directory the same as or underneath the source directory?
-# (i.e. - is it an "in source" build?)
-#
-set(in_source_build 0)
-set(build_under_source 0)
-
-string(FIND "${CMake_BINARY_DIR}" "${CMake_SOURCE_DIR}/" pos)
-if(pos EQUAL 0)
- message("build dir is *inside* source dir")
- set(build_under_source 1)
-elseif(CMake_SOURCE_DIR STREQUAL "${CMake_BINARY_DIR}")
- message("build dir *is* source dir")
- set(in_source_build 1)
-else()
- string(LENGTH "${CMake_SOURCE_DIR}" src_len)
- string(LENGTH "${CMake_BINARY_DIR}" bin_len)
-
- if(bin_len GREATER src_len)
- math(EXPR substr_len "${src_len}+1")
- string(SUBSTRING "${CMake_BINARY_DIR}" 0 ${substr_len} bin_dir)
- if(bin_dir STREQUAL "${CMake_SOURCE_DIR}/")
- message("build dir is under source dir")
- set(in_source_build 1)
- endif()
- endif()
-endif()
-
-message("src_len='${src_len}'")
-message("bin_len='${bin_len}'")
-message("substr_len='${substr_len}'")
-message("bin_dir='${bin_dir}'")
-message("in_source_build='${in_source_build}'")
-message("build_under_source='${build_under_source}'")
-message("")
-
-if(build_under_source)
- message(STATUS "Skipping rest of test because build tree is under source tree")
- return()
-endif()
-
-# If this does not appear to be a git checkout, just pass the test here
-# and now. (Do not let the test fail if it is run in a tree *exported* from a
-# repository or unpacked from a .zip file source installer...)
-#
-set(is_git_checkout 0)
-if(EXISTS "${CMake_SOURCE_DIR}/.git")
- set(is_git_checkout 1)
-endif()
-
-message("is_git_checkout='${is_git_checkout}'")
-message("")
-
-if(NOT is_git_checkout)
- message("source tree is not a git checkout... test passes by early return...")
- return()
-endif()
-
-# This test looks for the following types of changes in the source tree:
-#
-set(additions 0)
-set(conflicts 0)
-set(modifications 0)
-set(nonadditions 0)
-
-# ov == output variable... conditionally filled in by either git below:
-#
-set(cmd "")
-set(ov "")
-set(ev "")
-set(rv "")
-
-# If no GIT_EXECUTABLE, see if we can figure out which git was used
-# for the ctest_update step on this dashboard...
-#
-if(is_git_checkout AND NOT GIT_EXECUTABLE)
- set(ctest_ini_file "")
- set(exe "")
-
- # Use the old name:
- if(EXISTS "${CMake_BINARY_DIR}/DartConfiguration.tcl")
- set(ctest_ini_file "${CMake_BINARY_DIR}/DartConfiguration.tcl")
- endif()
-
- # But if it exists, prefer the new name:
- if(EXISTS "${CMake_BINARY_DIR}/CTestConfiguration.ini")
- set(ctest_ini_file "${CMake_BINARY_DIR}/CTestConfiguration.ini")
- endif()
-
- # If there is a ctest ini file, read the update command or git command
- # from it:
- #
- if(ctest_ini_file)
- file(STRINGS "${ctest_ini_file}" line REGEX "^GITCommand: (.*)$")
- string(REGEX REPLACE "^GITCommand: (.*)$" "\\1" line "${line}")
- if("${line}" MATCHES "^\"")
- string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
- else()
- string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
- endif()
- set(exe "${line}")
- if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND")
- set(exe "")
- endif()
- if(exe)
- message("info: GIT_EXECUTABLE set by 'GITCommand:' from '${ctest_ini_file}'")
- endif()
-
- if(NOT exe)
- file(STRINGS "${ctest_ini_file}" line REGEX "^UpdateCommand: (.*)$")
- string(REGEX REPLACE "^UpdateCommand: (.*)$" "\\1" line "${line}")
- if("${line}" MATCHES "^\"")
- string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
- else()
- string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
- endif()
- set(exe "${line}")
- if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND")
- set(exe "")
- endif()
- if(exe)
- message("info: GIT_EXECUTABLE set by 'UpdateCommand:' from '${ctest_ini_file}'")
- endif()
- endif()
- else()
- message("info: no DartConfiguration.tcl or CTestConfiguration.ini file...")
- endif()
-
- # If we have still not grokked the exe, look in the Update.xml file to see
- # if we can parse it from there...
- #
- if(NOT exe)
- file(GLOB_RECURSE update_xml_file "${CMake_BINARY_DIR}/Testing/Update.xml")
- if(update_xml_file)
- file(STRINGS "${update_xml_file}" line
- REGEX "^.*<UpdateCommand>(.*)</UpdateCommand>$" LIMIT_COUNT 1)
- string(REPLACE "&quot\;" "\"" line "${line}")
- string(REGEX REPLACE "^.*<UpdateCommand>(.*)</UpdateCommand>$" "\\1" line "${line}")
- if("${line}" MATCHES "^\"")
- string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
- else()
- string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
- endif()
- if(line)
- set(exe "${line}")
- endif()
- if(exe)
- message("info: GIT_EXECUTABLE set by '<UpdateCommand>' from '${update_xml_file}'")
- endif()
- else()
- message("info: no Update.xml file...")
- endif()
- endif()
-
- if(exe)
- set(GIT_EXECUTABLE "${exe}")
- message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
- message("")
-
- if(NOT EXISTS "${GIT_EXECUTABLE}")
- message(FATAL_ERROR "GIT_EXECUTABLE does not exist...")
- endif()
- else()
- message(FATAL_ERROR "could not determine GIT_EXECUTABLE...")
- endif()
-endif()
-
-
-if(is_git_checkout AND GIT_EXECUTABLE)
- # Check with "git status" if there are any local modifications to the
- # CMake source tree:
- #
- message("=============================================================================")
- message("This is a git checkout, using git to verify source tree....")
- message("")
-
- execute_process(COMMAND ${GIT_EXECUTABLE} --version
- WORKING_DIRECTORY ${CMake_SOURCE_DIR}
- OUTPUT_VARIABLE version_output
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- message("=== output of 'git --version' ===")
- message("${version_output}")
- message("=== end output ===")
- message("")
-
- execute_process(COMMAND ${GIT_EXECUTABLE} branch -a
- WORKING_DIRECTORY ${CMake_SOURCE_DIR}
- OUTPUT_VARIABLE git_branch_output
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- message("=== output of 'git branch -a' ===")
- message("${git_branch_output}")
- message("=== end output ===")
- message("")
-
- execute_process(COMMAND ${GIT_EXECUTABLE} log -1
- WORKING_DIRECTORY ${CMake_SOURCE_DIR}
- OUTPUT_VARIABLE git_log_output
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- message("=== output of 'git log -1' ===")
- message("${git_log_output}")
- message("=== end output ===")
- message("")
-
- message("Copy/paste this command to reproduce:")
- message("cd \"${CMake_SOURCE_DIR}\" && \"${GIT_EXECUTABLE}\" status")
- message("")
-
- set(cmd ${GIT_EXECUTABLE} status)
-endif()
-
-
-if(cmd)
- # Use the HOME value passed in to the script for calling git so it can
- # find its user/global config settings...
- #
- set(original_ENV_HOME "$ENV{HOME}")
- set(ENV{HOME} "${HOME}")
-
- execute_process(COMMAND ${cmd}
- WORKING_DIRECTORY ${CMake_SOURCE_DIR}
- OUTPUT_VARIABLE ov
- ERROR_VARIABLE ev
- RESULT_VARIABLE rv)
-
- set(ENV{HOME} "${original_ENV_HOME}")
-
- message("Results of running ${cmd}")
- message("rv='${rv}'")
- message("ov='${ov}'")
- message("ev='${ev}'")
- message("")
-
- if(NOT rv STREQUAL 0)
- if(is_git_checkout AND (rv STREQUAL "1"))
- # Many builds of git return "1" from a "nothing is changed" git status call...
- # Do not fail with an error for rv==1 with git...
- else()
- message(FATAL_ERROR "error: ${cmd} attempt failed... (see output above)")
- endif()
- endif()
-else()
- message(FATAL_ERROR "error: no COMMAND to run to analyze source tree...")
-endif()
-
-
-# Analyze output:
-#
-if(NOT ov STREQUAL "")
- string(REPLACE ";" "\\\\;" lines "${ov}")
- string(REPLACE "\n" "E;" lines "${lines}")
-
- foreach(line ${lines})
- message("'${line}'")
-
- # But do not consider files that exist just because some user poked around
- # the file system with Windows Explorer or with the Finder from a Mac...
- # ('Thumbs.db' and '.DS_Store' files...)
- #
- set(consider 1)
- set(ignore_files_regex "^(. |.*(/|\\\\))(\\.DS_Store|Thumbs.db)E$")
- if(line MATCHES "${ignore_files_regex}")
- message(" line matches '${ignore_files_regex}' -- not considered")
- set(consider 0)
- endif()
-
- if(consider)
- if(is_git_checkout)
- if(line MATCHES "^#?[ \t]*modified:")
- message(" locally modified file detected...")
- set(modifications 1)
- endif()
-
- if(line MATCHES "^(# )?Untracked")
- message(" locally non-added file/directory detected...")
- set(nonadditions 1)
- endif()
- endif()
- endif()
- endforeach()
-endif()
-
-
-message("=============================================================================")
-message("additions='${additions}'")
-message("conflicts='${conflicts}'")
-message("modifications='${modifications}'")
-message("nonadditions='${nonadditions}'")
-message("")
-
-
-# Decide if the test passes or fails:
-#
-message("=============================================================================")
-
-if("$ENV{DASHBOARD_TEST_FROM_CTEST}" STREQUAL "")
-
- # developers are allowed to have local additions and modifications...
- message("interactive test run")
- message("")
-
-else()
-
- message("dashboard test run")
- message("")
-
- # but dashboard machines are not allowed to have local additions or modifications...
- if(additions)
- message(FATAL_ERROR "test fails: local source tree additions")
- endif()
-
- if(modifications)
- message(FATAL_ERROR "test fails: local source tree modifications")
- endif()
-
- #
- # It's a dashboard run if ctest was run with '-D ExperimentalTest' or some
- # other -D arg on its command line or if ctest is running a -S script to run
- # a dashboard... Running ctest like that sets the DASHBOARD_TEST_FROM_CTEST
- # env var.
- #
-
-endif()
-
-
-# ...and nobody is allowed to have local non-additions or conflicts...
-# Not even developers.
-#
-if(nonadditions)
- if(in_source_build)
- message("
-warning: test results confounded because this is an 'in-source' build - cannot
-distinguish between non-added files that are in-source build products and
-non-added source files that somebody forgot to 'git add'... - this is only ok
-if this is intentionally an in-source dashboard build... Developers should
-use out-of-source builds to verify a clean source tree with this test...
-
-Allowing test to pass despite the warning message...
-")
- else()
- message(FATAL_ERROR "test fails: local source tree non-additions: use git add before committing, or remove the files from the source tree")
- endif()
-endif()
-
-if(conflicts)
- message(FATAL_ERROR "test fails: local source tree conflicts: resolve before committing")
-endif()
-
-
-# Still here? Good then...
-#
-message("test passes")
-message("")
diff --git a/Tests/CheckSourceTree/CMakeLists.txt b/Tests/CheckSourceTree/CMakeLists.txt
new file mode 100644
index 0000000000..d5019d229c
--- /dev/null
+++ b/Tests/CheckSourceTree/CMakeLists.txt
@@ -0,0 +1,6 @@
+add_test(NAME CMake.CheckSourceTree
+ COMMAND ${CMAKE_COMMAND} -D GIT_EXECUTABLE=${GIT_EXECUTABLE}
+ -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR}
+ -P ${CMAKE_CURRENT_LIST_DIR}/check.cmake
+ )
+set_property(TEST CMake.CheckSourceTree PROPERTY RUN_SERIAL 1)
diff --git a/Tests/CheckSourceTree/check.cmake b/Tests/CheckSourceTree/check.cmake
new file mode 100644
index 0000000000..c2e3529d65
--- /dev/null
+++ b/Tests/CheckSourceTree/check.cmake
@@ -0,0 +1,22 @@
+# Give Git access to the real home directory to get user's settings.
+if(DEFINED ENV{CTEST_REAL_HOME})
+ set(ENV{HOME} "$ENV{CTEST_REAL_HOME}")
+endif()
+
+execute_process(
+ COMMAND "${GIT_EXECUTABLE}" status
+ WORKING_DIRECTORY "${CMake_SOURCE_DIR}"
+ OUTPUT_VARIABLE output
+ ERROR_VARIABLE output
+ RESULT_VARIABLE result
+ )
+string(REPLACE "\n" "\n " output " ${output}")
+if(NOT result EQUAL 0)
+ message(FATAL_ERROR "'git status' failed (${result}):\n${output}")
+endif()
+
+if(output MATCHES "\n[ \t#]*(Changes |new file:|modified:|Untracked )")
+ message(FATAL_ERROR "The source tree is not clean. 'git status' reports:\n${output}")
+endif()
+
+message(STATUS "The source tree is clean.")
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake
index 276158ce07..bfb6f725e5 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake
@@ -1,33 +1,27 @@
enable_language (C)
-include(CheckCompilerFlag)
+include(CheckCCompilerFlag)
set(C 1) # test that this is tolerated
-# test that the check uses an isolated locale
-set(_env_LC_ALL "${LC_ALL}")
-set(ENV{LC_ALL} "BAD")
-
-check_compiler_flag(C "-_this_is_not_a_flag_" SHOULD_FAIL)
-if(SHOULD_FAIL)
- message(SEND_ERROR "invalid C compile flag didn't fail.")
+if(NOT CMAKE_C_COMPILER_ID STREQUAL "PathScale")
+ set(DD --)
endif()
-if(CMAKE_C_COMPILER_ID MATCHES "GNU|LCC|Clang" AND NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
- check_compiler_flag(C "-x c" SHOULD_WORK)
- if(NOT SHOULD_WORK)
- message(SEND_ERROR "${CMAKE_C_COMPILER_ID} compiler flag '-x c' check failed")
- endif()
+check_c_compiler_flag("${DD}-_this_is_not_a_flag_" C_BOGUS_FLAG)
+if(C_BOGUS_FLAG)
+ message(SEND_ERROR "CHECK_C_COMPILER_FLAG() succeeded, but should have failed")
endif()
-
-if(CMAKE_C_COMPILER_ID STREQUAL "GNU") # LCC C compiler silently ignore -frtti instead of failing, so skip it here.
- check_compiler_flag(C "-frtti" SHOULD_FAIL_RTTI)
- if(SHOULD_FAIL_RTTI)
- message(SEND_ERROR "${CMAKE_C_COMPILER_ID} compiler flag '-frtti' check passed but should have failed")
- endif()
+unset(C_BOGUS_FLAG CACHE)
+if(DEFINED C_BOGUS_FLAG)
+ # Verify that CHECK_C_COMPILER_FLAG didn't construct a normal variable
+ message(SEND_ERROR "CHECK_C_COMPILER_FLAG shouldn't construct C_BOGUS_FLAG as a normal variable")
endif()
-if(NOT "$ENV{LC_ALL}" STREQUAL "BAD")
- message(SEND_ERROR "ENV{LC_ALL} was not preserved by check_compiler_flag")
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "LCC")
+ unset(C_STRICT_PROTOTYPES CACHE)
+ CHECK_C_COMPILER_FLAG("-Werror;-Wstrict-prototypes" C_STRICT_PROTOTYPES)
+ if(NOT C_STRICT_PROTOTYPES)
+ message(SEND_ERROR "CHECK_C_COMPILER_FLAG failed -Werror -Wstrict-prototypes")
+ endif()
endif()
-set(ENV{LC_ALL} ${_env_LC_ALL})
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake
index dec31ec3ae..eb20eb4aa9 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake
@@ -1,26 +1,19 @@
enable_language (CXX)
-include(CheckCompilerFlag)
+include(CheckCXXCompilerFlag)
set(CXX 1) # test that this is tolerated
-# test that the check uses an isolated locale
-set(_env_LC_ALL "${LC_ALL}")
-set(ENV{LC_ALL} "BAD")
-
-check_compiler_flag(CXX "-_this_is_not_a_flag_" SHOULD_FAIL)
-if(SHOULD_FAIL)
- message(SEND_ERROR "invalid CXX compile flag didn't fail.")
+if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "PathScale")
+ set(DD --)
endif()
-if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|LCC|Clang" AND NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
- check_compiler_flag(CXX "-x c++" SHOULD_WORK)
- if(NOT SHOULD_WORK)
- message(SEND_ERROR "${CMAKE_CXX_COMPILER_ID} compiler flag '-x c++' check failed")
- endif()
+check_cxx_compiler_flag("${DD}-_this_is_not_a_flag_" CXX_BOGUS_FLAG)
+if(CXX_BOGUS_FLAG)
+ message(SEND_ERROR "CHECK_CXX_COMPILER_FLAG() succeeded, but should have failed")
endif()
-
-if(NOT "$ENV{LC_ALL}" STREQUAL "BAD")
- message(SEND_ERROR "ENV{LC_ALL} was not preserved by check_compiler_flag")
+unset(CXX_BOGUS_FLAG CACHE)
+if(DEFINED CXX_BOGUS_FLAG)
+ # Verify that CHECK_CXX_COMPILER_FLAG didn't construct a normal variable
+ message(SEND_ERROR "CHECK_CXX_COMPILER_FLAG shouldn't construct CXX_BOGUS_FLAG as a normal variable")
endif()
-set(ENV{LC_ALL} ${_env_LC_ALL})
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagC.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagC.cmake
new file mode 100644
index 0000000000..276158ce07
--- /dev/null
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagC.cmake
@@ -0,0 +1,33 @@
+
+enable_language (C)
+include(CheckCompilerFlag)
+
+set(C 1) # test that this is tolerated
+
+# test that the check uses an isolated locale
+set(_env_LC_ALL "${LC_ALL}")
+set(ENV{LC_ALL} "BAD")
+
+check_compiler_flag(C "-_this_is_not_a_flag_" SHOULD_FAIL)
+if(SHOULD_FAIL)
+ message(SEND_ERROR "invalid C compile flag didn't fail.")
+endif()
+
+if(CMAKE_C_COMPILER_ID MATCHES "GNU|LCC|Clang" AND NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
+ check_compiler_flag(C "-x c" SHOULD_WORK)
+ if(NOT SHOULD_WORK)
+ message(SEND_ERROR "${CMAKE_C_COMPILER_ID} compiler flag '-x c' check failed")
+ endif()
+endif()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU") # LCC C compiler silently ignore -frtti instead of failing, so skip it here.
+ check_compiler_flag(C "-frtti" SHOULD_FAIL_RTTI)
+ if(SHOULD_FAIL_RTTI)
+ message(SEND_ERROR "${CMAKE_C_COMPILER_ID} compiler flag '-frtti' check passed but should have failed")
+ endif()
+endif()
+
+if(NOT "$ENV{LC_ALL}" STREQUAL "BAD")
+ message(SEND_ERROR "ENV{LC_ALL} was not preserved by check_compiler_flag")
+endif()
+set(ENV{LC_ALL} ${_env_LC_ALL})
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagCUDA.cmake
index 681a5466c2..681a5466c2 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagCUDA.cmake
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagCXX.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagCXX.cmake
new file mode 100644
index 0000000000..dec31ec3ae
--- /dev/null
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagCXX.cmake
@@ -0,0 +1,26 @@
+
+enable_language (CXX)
+include(CheckCompilerFlag)
+
+set(CXX 1) # test that this is tolerated
+
+# test that the check uses an isolated locale
+set(_env_LC_ALL "${LC_ALL}")
+set(ENV{LC_ALL} "BAD")
+
+check_compiler_flag(CXX "-_this_is_not_a_flag_" SHOULD_FAIL)
+if(SHOULD_FAIL)
+ message(SEND_ERROR "invalid CXX compile flag didn't fail.")
+endif()
+
+if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|LCC|Clang" AND NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+ check_compiler_flag(CXX "-x c++" SHOULD_WORK)
+ if(NOT SHOULD_WORK)
+ message(SEND_ERROR "${CMAKE_CXX_COMPILER_ID} compiler flag '-x c++' check failed")
+ endif()
+endif()
+
+if(NOT "$ENV{LC_ALL}" STREQUAL "BAD")
+ message(SEND_ERROR "ENV{LC_ALL} was not preserved by check_compiler_flag")
+endif()
+set(ENV{LC_ALL} ${_env_LC_ALL})
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckFortranCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagFortran.cmake
index 236f37b544..236f37b544 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckFortranCompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagFortran.cmake
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckHIPCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagHIP.cmake
index 339ce1865b..339ce1865b 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckHIPCompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagHIP.cmake
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckISPCCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagISPC.cmake
index 662319ae62..662319ae62 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckISPCCompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagISPC.cmake
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckOBJCCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagOBJC.cmake
index f250f8d49d..f250f8d49d 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckOBJCCompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagOBJC.cmake
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckOBJCXXCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagOBJCXX.cmake
index bc940a6298..bc940a6298 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckOBJCXXCompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagOBJCXX.cmake
diff --git a/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake b/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake
index df2b667cc0..b0e025c4f6 100644
--- a/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake
@@ -5,28 +5,30 @@ run_cmake(NonExistentLanguage)
run_cmake(CheckCCompilerFlag)
run_cmake(CheckCXXCompilerFlag)
+run_cmake(CheckCompilerFlagC)
+run_cmake(CheckCompilerFlagCXX)
if (APPLE)
- run_cmake(CheckOBJCCompilerFlag)
- run_cmake(CheckOBJCXXCompilerFlag)
+ run_cmake(CheckCompilerFlagOBJC)
+ run_cmake(CheckCompilerFlagOBJCXX)
endif()
if (CMAKE_Fortran_COMPILER_ID)
- run_cmake(CheckFortranCompilerFlag)
+ run_cmake(CheckCompilerFlagFortran)
endif()
if (CMake_TEST_CUDA)
- run_cmake(CheckCUDACompilerFlag)
+ run_cmake(CheckCompilerFlagCUDA)
endif()
if(CMake_TEST_ISPC)
- run_cmake(CheckISPCCompilerFlag)
+ run_cmake(CheckCompilerFlagISPC)
endif()
if(CMake_TEST_HIP)
- run_cmake(CheckHIPCompilerFlag)
+ run_cmake(CheckCompilerFlagHIP)
endif()
if(APPLE)
- run_cmake_with_options(HeaderpadWorkaround --debug-trycompile)
+ run_cmake(HeaderpadWorkaround)
endif()
diff --git a/Tests/RunCMake/CheckLinkerFlag/CheckCLinkerFlag.cmake b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagC.cmake
index c8e87a4744..c8e87a4744 100644
--- a/Tests/RunCMake/CheckLinkerFlag/CheckCLinkerFlag.cmake
+++ b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagC.cmake
diff --git a/Tests/RunCMake/CheckLinkerFlag/CheckCUDALinkerFlag.cmake b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagCUDA.cmake
index 84d6dd92b9..84d6dd92b9 100644
--- a/Tests/RunCMake/CheckLinkerFlag/CheckCUDALinkerFlag.cmake
+++ b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagCUDA.cmake
diff --git a/Tests/RunCMake/CheckLinkerFlag/CheckCXXLinkerFlag.cmake b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagCXX.cmake
index 4e299b989b..4e299b989b 100644
--- a/Tests/RunCMake/CheckLinkerFlag/CheckCXXLinkerFlag.cmake
+++ b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagCXX.cmake
diff --git a/Tests/RunCMake/CheckLinkerFlag/CheckFortranLinkerFlag.cmake b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagFortran.cmake
index bca288ea06..bca288ea06 100644
--- a/Tests/RunCMake/CheckLinkerFlag/CheckFortranLinkerFlag.cmake
+++ b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagFortran.cmake
diff --git a/Tests/RunCMake/CheckLinkerFlag/CheckHIPLinkerFlag.cmake b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagHIP.cmake
index 3bf3b3051e..3bf3b3051e 100644
--- a/Tests/RunCMake/CheckLinkerFlag/CheckHIPLinkerFlag.cmake
+++ b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagHIP.cmake
diff --git a/Tests/RunCMake/CheckLinkerFlag/CheckOBJCLinkerFlag.cmake b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagOBJC.cmake
index fa1d18e38b..fa1d18e38b 100644
--- a/Tests/RunCMake/CheckLinkerFlag/CheckOBJCLinkerFlag.cmake
+++ b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagOBJC.cmake
diff --git a/Tests/RunCMake/CheckLinkerFlag/CheckOBJCXXLinkerFlag.cmake b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagOBJCXX.cmake
index 414efb8ccb..414efb8ccb 100644
--- a/Tests/RunCMake/CheckLinkerFlag/CheckOBJCXXLinkerFlag.cmake
+++ b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagOBJCXX.cmake
diff --git a/Tests/RunCMake/CheckLinkerFlag/RunCMakeTest.cmake b/Tests/RunCMake/CheckLinkerFlag/RunCMakeTest.cmake
index 39fc430972..5915ba1ac8 100644
--- a/Tests/RunCMake/CheckLinkerFlag/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CheckLinkerFlag/RunCMakeTest.cmake
@@ -1,22 +1,22 @@
include(RunCMake)
if (CMAKE_C_COMPILER_ID MATCHES "Clang|GNU|LCC")
- run_cmake(CheckCLinkerFlag)
- run_cmake(CheckCXXLinkerFlag)
+ run_cmake(CheckLinkerFlagC)
+ run_cmake(CheckLinkerFlagCXX)
if (APPLE)
- run_cmake(CheckOBJCLinkerFlag)
- run_cmake(CheckOBJCXXLinkerFlag)
+ run_cmake(CheckLinkerFlagOBJC)
+ run_cmake(CheckLinkerFlagOBJCXX)
endif()
endif()
if (CMAKE_Fortran_COMPILER_ID MATCHES "GNU|LCC")
- run_cmake(CheckFortranLinkerFlag)
+ run_cmake(CheckLinkerFlagFortran)
endif()
if (CMake_TEST_CUDA)
- run_cmake(CheckCUDALinkerFlag)
+ run_cmake(CheckLinkerFlagCUDA)
endif()
if (CMake_TEST_HIP)
- run_cmake(CheckHIPLinkerFlag)
+ run_cmake(CheckLinkerFlagHIP)
endif()
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake
index 4f7362254f..7104650cc4 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake
@@ -1,15 +1,15 @@
enable_language (C)
-include(CheckSourceCompiles)
+include(CheckCSourceCompiles)
set(C 1) # test that this is tolerated
-check_source_compiles(C "I don't build" SHOULD_FAIL)
+check_c_source_compiles("I don't build" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid C source didn't fail.")
endif()
-check_source_compiles(C "int main() {return 0;}" SHOULD_BUILD)
+check_c_source_compiles("int main() {return 0;}" SHOULD_BUILD)
if(NOT SHOULD_BUILD)
message(SEND_ERROR "Test fail for valid C source.")
endif()
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake
index 97c9c30f5d..7c9830abc1 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake
@@ -1,15 +1,15 @@
enable_language (CXX)
-include(CheckSourceCompiles)
+include(CheckCXXSourceCompiles)
set(CXX 1) # test that this is tolerated
-check_source_compiles(CXX "I don't build" SHOULD_FAIL)
+check_cxx_source_compiles("I don't build" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid CXX source didn't fail.")
endif()
-check_source_compiles(CXX [=[
+check_cxx_source_compiles([=[
#include <vector>
int main() {
return 0;
@@ -20,8 +20,8 @@ if(NOT SHOULD_BUILD)
message(SEND_ERROR "Test fail for valid CXX source.")
endif()
-check_source_compiles(CXX "void l(char const (&x)[2]){}; int main() { l(\"\\n\"); return 0;}"
- SHOULD_BUILD_COMPLEX)
+CHECK_CXX_SOURCE_COMPILES("void l(char const (&x)[2]){}; int main() { l(\"\\\\n\"); return 0;}"
+ SHOULD_BUILD_COMPLEX)
if(NOT SHOULD_BUILD_COMPLEX)
message(SEND_ERROR "Test fail for valid CXX complex source.")
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake
index 76a5009565..ac43a1ee5a 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake
@@ -1,9 +1,14 @@
enable_language (OBJC)
-include(CheckSourceCompiles)
+include(CheckOBJCSourceCompiles)
set(OBJC 1) # test that this is tolerated
-check_source_compiles(OBJC [[
+check_objc_source_compiles("I don't build in Objective-C" SHOULD_FAIL)
+if(SHOULD_FAIL)
+ message(SEND_ERROR "invalid OBJC source didn't fail.")
+endif()
+
+check_objc_source_compiles([[
#import <Foundation/Foundation.h>
int main() {
NSObject *foo;
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake
index 814237ecca..0088956054 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake
@@ -1,9 +1,14 @@
enable_language (OBJCXX)
-include(CheckSourceCompiles)
+include(CheckOBJCXXSourceCompiles)
set(OBJCXX 1) # test that this is tolerated
-check_source_compiles(OBJCXX [[
+check_objcxx_source_compiles("I don't build in Objective-C++" SHOULD_FAIL)
+if(SHOULD_FAIL)
+ message(SEND_ERROR "invalid OBJCXX source didn't fail.")
+endif()
+
+check_objcxx_source_compiles([[
#include <vector>
#import <Foundation/Foundation.h>
int main() {
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesC.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesC.cmake
new file mode 100644
index 0000000000..4f7362254f
--- /dev/null
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesC.cmake
@@ -0,0 +1,15 @@
+
+enable_language (C)
+include(CheckSourceCompiles)
+
+set(C 1) # test that this is tolerated
+
+check_source_compiles(C "I don't build" SHOULD_FAIL)
+if(SHOULD_FAIL)
+ message(SEND_ERROR "invalid C source didn't fail.")
+endif()
+
+check_source_compiles(C "int main() {return 0;}" SHOULD_BUILD)
+if(NOT SHOULD_BUILD)
+ message(SEND_ERROR "Test fail for valid C source.")
+endif()
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckCUDASourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesCUDA.cmake
index 21906499eb..21906499eb 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckCUDASourceCompiles.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesCUDA.cmake
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesCXX.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesCXX.cmake
new file mode 100644
index 0000000000..97c9c30f5d
--- /dev/null
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesCXX.cmake
@@ -0,0 +1,28 @@
+
+enable_language (CXX)
+include(CheckSourceCompiles)
+
+set(CXX 1) # test that this is tolerated
+
+check_source_compiles(CXX "I don't build" SHOULD_FAIL)
+if(SHOULD_FAIL)
+ message(SEND_ERROR "invalid CXX source didn't fail.")
+endif()
+
+check_source_compiles(CXX [=[
+ #include <vector>
+ int main() {
+ return 0;
+ }
+]=]
+ SHOULD_BUILD)
+if(NOT SHOULD_BUILD)
+ message(SEND_ERROR "Test fail for valid CXX source.")
+endif()
+
+check_source_compiles(CXX "void l(char const (&x)[2]){}; int main() { l(\"\\n\"); return 0;}"
+ SHOULD_BUILD_COMPLEX)
+
+if(NOT SHOULD_BUILD_COMPLEX)
+ message(SEND_ERROR "Test fail for valid CXX complex source.")
+endif()
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckFortranSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesFortran.cmake
index 48dc5255d0..48dc5255d0 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckFortranSourceCompiles.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesFortran.cmake
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckHIPSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesHIP.cmake
index 911a0d7b9b..911a0d7b9b 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckHIPSourceCompiles.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesHIP.cmake
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckISPCSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesISPC.cmake
index 74b83c083a..74b83c083a 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckISPCSourceCompiles.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesISPC.cmake
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesOBJC.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesOBJC.cmake
new file mode 100644
index 0000000000..76a5009565
--- /dev/null
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesOBJC.cmake
@@ -0,0 +1,16 @@
+enable_language (OBJC)
+include(CheckSourceCompiles)
+
+set(OBJC 1) # test that this is tolerated
+
+check_source_compiles(OBJC [[
+ #import <Foundation/Foundation.h>
+ int main() {
+ NSObject *foo;
+ return 0;
+ }
+]] SHOULD_BUILD)
+
+if(NOT SHOULD_BUILD)
+ message(SEND_ERROR "Test fail for valid OBJC source.")
+endif()
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesOBJCXX.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesOBJCXX.cmake
new file mode 100644
index 0000000000..814237ecca
--- /dev/null
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesOBJCXX.cmake
@@ -0,0 +1,19 @@
+enable_language (OBJCXX)
+include(CheckSourceCompiles)
+
+set(OBJCXX 1) # test that this is tolerated
+
+check_source_compiles(OBJCXX [[
+ #include <vector>
+ #import <Foundation/Foundation.h>
+ int main() {
+ std::vector<int> v;
+ NSObject *foo;
+ return 0;
+ }
+]] SHOULD_BUILD)
+
+
+if(NOT SHOULD_BUILD)
+ message(SEND_ERROR "Test fail for OBJCXX source.")
+endif()
diff --git a/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake b/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake
index 530f133da0..df77d3d09d 100644
--- a/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake
@@ -6,24 +6,28 @@ run_cmake(UnknownArgument)
run_cmake(CheckCSourceCompiles)
run_cmake(CheckCXXSourceCompiles)
+run_cmake(CheckSourceCompilesC)
+run_cmake(CheckSourceCompilesCXX)
if (APPLE)
run_cmake(CheckOBJCSourceCompiles)
run_cmake(CheckOBJCXXSourceCompiles)
+ run_cmake(CheckSourceCompilesOBJC)
+ run_cmake(CheckSourceCompilesOBJCXX)
endif()
if (CMAKE_Fortran_COMPILER_ID)
- run_cmake(CheckFortranSourceCompiles)
+ run_cmake(CheckSourceCompilesFortran)
endif()
if (CMake_TEST_CUDA)
- run_cmake(CheckCUDASourceCompiles)
+ run_cmake(CheckSourceCompilesCUDA)
endif()
if(CMake_TEST_ISPC)
- run_cmake(CheckISPCSourceCompiles)
+ run_cmake(CheckSourceCompilesISPC)
endif()
if(CMake_TEST_HIP)
- run_cmake(CheckHIPSourceCompiles)
+ run_cmake(CheckSourceCompilesHIP)
endif()
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake
index 96a10274cb..c0f9463362 100644
--- a/Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake
@@ -1,15 +1,15 @@
enable_language (C)
-include(CheckSourceRuns)
+include(CheckCSourceRuns)
set(C 1) # test that this is tolerated
-check_source_runs(C "int main() {return 2;}" SHOULD_FAIL)
+check_c_source_runs("int main() {return 2;}" SHOULD_FAIL)
if(SHOULD_FAIL)
- message(SEND_ERROR "C check_source_runs succeeded, but should have failed.")
+ message(SEND_ERROR "check_c_source_runs succeeded, but should have failed.")
endif()
-check_source_runs(C "int main() {return 0;}" SHOULD_RUN)
+check_c_source_runs("int main() {return 0;}" SHOULD_RUN)
if(NOT SHOULD_RUN)
- message(SEND_ERROR "C check_source_runs failed for valid C executable.")
+ message(SEND_ERROR "check_c_source_runs failed for valid C executable.")
endif()
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake
index c4bef6e949..c4c9026c01 100644
--- a/Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake
@@ -1,15 +1,15 @@
enable_language (CXX)
-include(CheckSourceRuns)
+include(CheckCXXSourceRuns)
set(CXX 1) # test that this is tolerated
-check_source_runs(CXX "int main() {return 2;}" SHOULD_FAIL)
+check_cxx_source_runs("int main() {return 2;}" SHOULD_FAIL)
if(SHOULD_FAIL)
- message(SEND_ERROR "CXX check_source_runs succeeded, but should have failed.")
+ message(SEND_ERROR "check_cxx_source_runs succeeded, but should have failed.")
endif()
-check_source_runs(CXX
+check_cxx_source_runs(
[=[
#include <vector>
int main() {
@@ -18,5 +18,5 @@ check_source_runs(CXX
]=]
SHOULD_RUN)
if(NOT SHOULD_RUN)
- message(SEND_ERROR "CXX check_source_runs failed for valid C executable.")
+ message(SEND_ERROR "check_cxx_source_runs failed for valid C executable.")
endif()
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake
index b8283523d7..604b2a1e45 100644
--- a/Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake
@@ -1,9 +1,14 @@
enable_language (OBJC)
-include(CheckSourceRuns)
+include(CheckOBJCSourceRuns)
set(OBJC 1) # test that this is tolerated
-check_source_runs(OBJC [[
+check_objc_source_runs("int main() {return 2;}" SHOULD_FAIL)
+if(SHOULD_FAIL)
+ message(SEND_ERROR "check_objc_source_runs succeeded, but should have failed.")
+endif()
+
+check_objc_source_runs([[
#import <Foundation/Foundation.h>
int main() {
NSObject *foo;
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake
index 8a56f139b8..b220166665 100644
--- a/Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake
@@ -1,9 +1,14 @@
enable_language (OBJCXX)
-include(CheckSourceRuns)
+include(CheckOBJCXXSourceRuns)
set(OBJCXX 1) # test that this is tolerated
-check_source_runs(OBJCXX [[
+check_objcxx_source_runs("int main() {return 2;}" SHOULD_FAIL)
+if(SHOULD_FAIL)
+ message(SEND_ERROR "check_objcxx_source_runs succeeded, but should have failed.")
+endif()
+
+check_objcxx_source_runs([[
#include <vector>
#import <Foundation/Foundation.h>
int main() {
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsC.cmake b/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsC.cmake
new file mode 100644
index 0000000000..96a10274cb
--- /dev/null
+++ b/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsC.cmake
@@ -0,0 +1,15 @@
+
+enable_language (C)
+include(CheckSourceRuns)
+
+set(C 1) # test that this is tolerated
+
+check_source_runs(C "int main() {return 2;}" SHOULD_FAIL)
+if(SHOULD_FAIL)
+ message(SEND_ERROR "C check_source_runs succeeded, but should have failed.")
+endif()
+
+check_source_runs(C "int main() {return 0;}" SHOULD_RUN)
+if(NOT SHOULD_RUN)
+ message(SEND_ERROR "C check_source_runs failed for valid C executable.")
+endif()
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckCUDASourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsCUDA.cmake
index ea5f4f9754..ea5f4f9754 100644
--- a/Tests/RunCMake/CheckSourceRuns/CheckCUDASourceRuns.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsCUDA.cmake
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsCXX.cmake b/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsCXX.cmake
new file mode 100644
index 0000000000..c4bef6e949
--- /dev/null
+++ b/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsCXX.cmake
@@ -0,0 +1,22 @@
+
+enable_language (CXX)
+include(CheckSourceRuns)
+
+set(CXX 1) # test that this is tolerated
+
+check_source_runs(CXX "int main() {return 2;}" SHOULD_FAIL)
+if(SHOULD_FAIL)
+ message(SEND_ERROR "CXX check_source_runs succeeded, but should have failed.")
+endif()
+
+check_source_runs(CXX
+[=[
+ #include <vector>
+ int main() {
+ return 0;
+ }
+]=]
+ SHOULD_RUN)
+if(NOT SHOULD_RUN)
+ message(SEND_ERROR "CXX check_source_runs failed for valid C executable.")
+endif()
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckFortranSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsFortran.cmake
index 50e8ec85f9..50e8ec85f9 100644
--- a/Tests/RunCMake/CheckSourceRuns/CheckFortranSourceRuns.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsFortran.cmake
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckHIPSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsHIP.cmake
index d9fb8c22a6..d9fb8c22a6 100644
--- a/Tests/RunCMake/CheckSourceRuns/CheckHIPSourceRuns.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsHIP.cmake
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsOBJC.cmake b/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsOBJC.cmake
new file mode 100644
index 0000000000..b8283523d7
--- /dev/null
+++ b/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsOBJC.cmake
@@ -0,0 +1,16 @@
+enable_language (OBJC)
+include(CheckSourceRuns)
+
+set(OBJC 1) # test that this is tolerated
+
+check_source_runs(OBJC [[
+ #import <Foundation/Foundation.h>
+ int main() {
+ NSObject *foo;
+ return 0;
+ }
+]] SHOULD_BUILD)
+
+if(NOT SHOULD_BUILD)
+ message(SEND_ERROR "Test fail for valid OBJC source.")
+endif()
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsOBJCXX.cmake b/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsOBJCXX.cmake
new file mode 100644
index 0000000000..8a56f139b8
--- /dev/null
+++ b/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsOBJCXX.cmake
@@ -0,0 +1,19 @@
+enable_language (OBJCXX)
+include(CheckSourceRuns)
+
+set(OBJCXX 1) # test that this is tolerated
+
+check_source_runs(OBJCXX [[
+ #include <vector>
+ #import <Foundation/Foundation.h>
+ int main() {
+ std::vector<int> v;
+ NSObject *foo;
+ return 0;
+ }
+]] SHOULD_BUILD)
+
+
+if(NOT SHOULD_BUILD)
+ message(SEND_ERROR "Test fail for OBJCXX source.")
+endif()
diff --git a/Tests/RunCMake/CheckSourceRuns/RunCMakeTest.cmake b/Tests/RunCMake/CheckSourceRuns/RunCMakeTest.cmake
index 4784103370..64cecfc0e5 100644
--- a/Tests/RunCMake/CheckSourceRuns/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/RunCMakeTest.cmake
@@ -6,20 +6,24 @@ run_cmake(UnknownArgument)
run_cmake(CheckCSourceRuns)
run_cmake(CheckCXXSourceRuns)
+run_cmake(CheckSourceRunsC)
+run_cmake(CheckSourceRunsCXX)
if (APPLE)
run_cmake(CheckOBJCSourceRuns)
run_cmake(CheckOBJCXXSourceRuns)
+ run_cmake(CheckSourceRunsOBJC)
+ run_cmake(CheckSourceRunsOBJCXX)
endif()
if (CMAKE_Fortran_COMPILER_ID)
- run_cmake(CheckFortranSourceRuns)
+ run_cmake(CheckSourceRunsFortran)
endif()
if (CMake_TEST_CUDA)
- run_cmake(CheckCUDASourceRuns)
+ run_cmake(CheckSourceRunsCUDA)
endif()
if (CMake_TEST_HIP)
- run_cmake(CheckHIPSourceRuns)
+ run_cmake(CheckSourceRunsHIP)
endif()
diff --git a/Tests/RunCMake/CommandLine/debug-trycompile-stderr.txt b/Tests/RunCMake/CommandLine/debug-trycompile-stderr.txt
new file mode 100644
index 0000000000..e98730063d
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/debug-trycompile-stderr.txt
@@ -0,0 +1,11 @@
+^CMake Debug Log at [^
+]*/Modules/CMakeDetermineCompilerABI.cmake:[0-9]+ \(try_compile\):
+ Executing try_compile \(CMAKE_C_ABI_COMPILED\) in:
+
+ [^
+]*/Tests/RunCMake/CommandLine/debug-trycompile-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+
+Call Stack \(most recent call first\):
+ [^
+]*/Modules/CMakeTestCCompiler.cmake:[0-9]+ \(CMAKE_DETERMINE_COMPILER_ABI\)
+ debug-trycompile.cmake:[0-9]+ \(enable_language\)
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/Ninja/QtAutoMocSkipPch.cmake b/Tests/RunCMake/Ninja/QtAutoMocSkipPch.cmake
new file mode 100644
index 0000000000..059b91741f
--- /dev/null
+++ b/Tests/RunCMake/Ninja/QtAutoMocSkipPch.cmake
@@ -0,0 +1,17 @@
+enable_language(CXX)
+
+set(QtX Qt${with_qt_version})
+
+find_package(${QtX} REQUIRED COMPONENTS Core)
+
+set(CMAKE_AUTOMOC ON)
+
+add_library(simple_lib SHARED simple_lib.cpp)
+add_executable(app_with_qt app.cpp app_qt.cpp)
+
+target_link_libraries(app_with_qt PRIVATE simple_lib ${QtX}::Core)
+
+set_source_files_properties(app.cpp app_qt.cpp
+ PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
+
+target_precompile_headers(app_with_qt PRIVATE [["QObject"]])
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 2a5b556201..9f078e6d2f 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -357,6 +357,22 @@ function(run_QtAutoMocDeps)
run_ninja("${RunCMake_TEST_BINARY_DIR}")
endif()
endfunction()
+
+function(run_QtAutoMocSkipPch)
+ set(QtX Qt${CMake_TEST_Qt_version})
+ if(CMake_TEST_${QtX}Core_Version VERSION_GREATER_EQUAL 5.15.0)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/QtAutoMocSkipPch-build)
+ run_cmake_with_options(QtAutoMocSkipPch
+ "-Dwith_qt_version=${CMake_TEST_Qt_version}"
+ "-D${QtX}_DIR=${${QtX}_DIR}"
+ "-D${QtX}Core_DIR=${${QtX}Core_DIR}"
+ "-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}"
+ )
+ # Build the project.
+ run_ninja("${RunCMake_TEST_BINARY_DIR}")
+ endif()
+endfunction()
if(CMake_TEST_Qt_version)
run_QtAutoMocDeps()
+ run_QtAutoMocSkipPch()
endif()
diff --git a/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-result.txt b/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stderr.txt b/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stderr.txt
new file mode 100644
index 0000000000..d082b8a129
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at cmake_install.cmake:[0-9]+ \(file\):
+ file INSTALL cannot duplicate symlink
+
+ [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/new/dir
+
+ at
+
+ [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/dir
+
+ because: A directory already exists at that location
diff --git a/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt b/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt
new file mode 100644
index 0000000000..db8ca1086a
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt
@@ -0,0 +1,12 @@
+-- Installing: [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/dir
+-- Installing: [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/dir/file
+-- Installing: [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/lnk
+-- Installing: [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/lnk
+-- Up-to-date: [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/lnk/file
+-- Installing: [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/dir
diff --git a/Tests/RunCMake/install/DIRECTORY-symlink-clobber.cmake b/Tests/RunCMake/install/DIRECTORY-symlink-clobber.cmake
new file mode 100644
index 0000000000..ac7a2cf4a3
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-symlink-clobber.cmake
@@ -0,0 +1,11 @@
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/old/dir)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/old/dir/file "")
+file(CREATE_LINK dir ${CMAKE_CURRENT_BINARY_DIR}/old/lnk SYMBOLIC)
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/old/dir DESTINATION dest)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/old/lnk DESTINATION dest)
+
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/new/lnk)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/new/lnk/file "")
+file(CREATE_LINK lnk ${CMAKE_CURRENT_BINARY_DIR}/new/dir SYMBOLIC)
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/new/lnk DESTINATION dest)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/new/dir DESTINATION dest)
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index 7c12d4a315..477ffe06ca 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -175,6 +175,10 @@ run_install_test(FILES-PERMISSIONS)
run_install_test(TARGETS-RPATH)
run_install_test(InstallRequiredSystemLibraries)
+if(UNIX)
+ run_install_test(DIRECTORY-symlink-clobber)
+endif()
+
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
run_cmake(TARGETS-RUNTIME_DEPENDENCIES-macos-two-bundle)
run_cmake(TARGETS-RUNTIME_DEPENDENCIES-macos-no-framework)
diff --git a/Tests/RunCMake/try_compile/PlatformVariables-stderr.txt b/Tests/RunCMake/try_compile/PlatformVariables-stderr.txt
new file mode 100644
index 0000000000..4a42b2d5bf
--- /dev/null
+++ b/Tests/RunCMake/try_compile/PlatformVariables-stderr.txt
@@ -0,0 +1,11 @@
+^CMake Debug Log at [^
+]*/Modules/CMakeDetermineCompilerABI.cmake:[0-9]+ \(try_compile\):
+ Executing try_compile \(CMAKE_C_ABI_COMPILED\) in:
+
+ [^
+]*/Tests/RunCMake/try_compile/PlatformVariables-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+
+Call Stack \(most recent call first\):
+ [^
+]*/Modules/CMakeTestCCompiler.cmake:[0-9]+ \(CMAKE_DETERMINE_COMPILER_ABI\)
+ PlatformVariables.cmake:[0-9]+ \(enable_language\)
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/try_compile/WarnDeprecated-stderr.txt b/Tests/RunCMake/try_compile/WarnDeprecated-stderr.txt
new file mode 100644
index 0000000000..6474990517
--- /dev/null
+++ b/Tests/RunCMake/try_compile/WarnDeprecated-stderr.txt
@@ -0,0 +1,11 @@
+^CMake Debug Log at [^
+]*/Modules/CMakeDetermineCompilerABI.cmake:[0-9]+ \(try_compile\):
+ Executing try_compile \(CMAKE_C_ABI_COMPILED\) in:
+
+ [^
+]*/Tests/RunCMake/try_compile/WarnDeprecated-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+
+Call Stack \(most recent call first\):
+ [^
+]*/Modules/CMakeTestCCompiler.cmake:[0-9]+ \(CMAKE_DETERMINE_COMPILER_ABI\)
+ WarnDeprecated.cmake:[0-9]+ \(enable_language\)
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index 5f540e9e27..3e46ed5010 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -34,30 +34,6 @@ macro(TEST_ASSERT value msg)
endif ()
endmacro()
-macro(TEST_FAIL value msg)
- if (${value})
- message (SEND_ERROR "Failing test succeeded:" ${msg} )
- endif ()
-endmacro()
-
-macro(TEST_EXPECT_EXACT command expected)
- if(NOT "x${result}" STREQUAL "x${expected}")
- message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"")
- endif()
-endmacro()
-
-macro(TEST_EXPECT_CONTAINS command expected)
- if(NOT "${result}" MATCHES "${expected}")
- message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"")
- endif()
-endmacro()
-
-if (APPLE)
- enable_language(OBJC)
- enable_language(OBJCXX)
-endif()
-
-
# run old signature tests
set(try_compile_bindir_or_SOURCES ${TryCompile_BINARY_DIR})
set(try_compile_redundant_SOURCES SOURCES)
@@ -138,126 +114,6 @@ add_executable(TryCompile pass.c)
#######################################################################
#
-# also test that the CHECK_C_SOURCE_COMPILES, CHECK_CXX_SOURCE_COMPILES
-# CHECK_C_SOURCE_RUNS and CHECK_CXX_SOURCE_RUNS macros work
-
-include(CheckCSourceCompiles)
-include(CheckCXXSourceCompiles)
-include(CheckCSourceRuns)
-include(CheckCXXSourceRuns)
-
-CHECK_C_SOURCE_COMPILES("I don't build" C_BUILD_SHOULD_FAIL)
-CHECK_C_SOURCE_COMPILES("int main() {return 0;}" C_BUILD_SHOULD_WORK)
-CHECK_C_SOURCE_RUNS("int main() {return 1;}" C_RUN_SHOULD_FAIL)
-CHECK_C_SOURCE_RUNS("int main() {return 0;}" C_RUN_SHOULD_WORK)
-
-TEST_FAIL(C_BUILD_SHOULD_FAIL "CHECK_C_SOURCE_COMPILES() succeeded, but should have failed")
-TEST_ASSERT(C_BUILD_SHOULD_WORK "CHECK_C_SOURCE_COMPILES() failed")
-TEST_FAIL(C_RUN_SHOULD_FAIL "CHECK_C_SOURCE_RUNS() succeeded, but should have failed")
-TEST_ASSERT(C_RUN_SHOULD_WORK "CHECK_C_SOURCE_RUNS() failed")
-
-CHECK_CXX_SOURCE_COMPILES("I don't build" CXX_BUILD_SHOULD_FAIL)
-CHECK_CXX_SOURCE_COMPILES("int main() {return 0;}" CXX_BUILD_SHOULD_WORK)
-CHECK_CXX_SOURCE_COMPILES("void l(char const (&x)[2]){}; int main() { l(\"\\\\n\"); return 0;}"
- CXX_BUILD_SHOULD_WORK_COMPLEX)
-
-CHECK_CXX_SOURCE_RUNS("int main() {return 2;}" CXX_RUN_SHOULD_FAIL)
-CHECK_CXX_SOURCE_RUNS("int main() {return 0;}" CXX_RUN_SHOULD_WORK)
-
-TEST_FAIL(CXX_BUILD_SHOULD_FAIL "CHECK_CXX_SOURCE_COMPILES() succeeded, but should have failed")
-TEST_ASSERT(CXX_BUILD_SHOULD_WORK "CHECK_CXX_SOURCE_COMPILES() failed")
-TEST_ASSERT(CXX_BUILD_SHOULD_WORK_COMPLEX "CHECK_CXX_SOURCE_COMPILES() failed")
-TEST_FAIL(CXX_RUN_SHOULD_FAIL "CHECK_CXX_SOURCE_RUNS() succeeded, but should have failed")
-TEST_ASSERT(CXX_RUN_SHOULD_WORK "CHECK_CXX_SOURCE_RUNS() failed")
-
-foreach(lang C CXX)
- if(NOT CMAKE_${lang}_COMPILER_ID STREQUAL "PathScale")
- set(${lang}_DD --)
- endif()
-endforeach()
-
-unset(C_BOGUS_FLAG CACHE)
-include(CheckCCompilerFlag)
-CHECK_C_COMPILER_FLAG(${C_DD}-_this_is_not_a_flag_ C_BOGUS_FLAG)
-TEST_FAIL(C_BOGUS_FLAG "CHECK_C_COMPILER_FLAG() succeeded, but should have failed")
-unset(C_BOGUS_FLAG CACHE)
-if(DEFINED C_BOGUS_FLAG)
- # Verify that CHECK_C_COMPILER_FLAG didn't construct a normal variable
- message(SEND_ERROR "CHECK_C_COMPILER_FLAG shouldn't construct C_BOGUS_FLAG as a normal variable")
-endif()
-
-unset(CXX_BOGUS_FLAG CACHE)
-include(CheckCXXCompilerFlag)
-CHECK_CXX_COMPILER_FLAG(${CXX_DD}-_this_is_not_a_flag_ CXX_BOGUS_FLAG)
-TEST_FAIL(CXX_BOGUS_FLAG "CHECK_CXX_COMPILER_FLAG() succeeded, but should have failed")
-unset(CXX_BOGUS_FLAG CACHE)
-if(DEFINED CXX_BOGUS_FLAG)
- # Verify that CHECK_C_COMPILER_FLAG didn't construct a normal variable
- message(SEND_ERROR "CHECK_CXX_COMPILER_FLAG shouldn't construct CXX_BOGUS_FLAG as a normal variable")
-endif()
-
-if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "LCC")
- unset(C_STRICT_PROTOTYPES CACHE)
- CHECK_C_COMPILER_FLAG("-Werror;-Wstrict-prototypes" C_STRICT_PROTOTYPES)
- TEST_ASSERT(C_STRICT_PROTOTYPES "CHECK_C_COMPILER_FLAG failed -Werror -Wstrict-prototypes")
-endif()
-
-#########################################################################
-#
-# Test that the CHECK_OBJCC_SOURCE_COMPILES, CHECK_OBJCXX_SOURCE_COMPILES
-# CHECK_OBJC_SOURCE_RUNS and CHECK_OBJCXX_SOURCE_RUNS macros work
-
-if (APPLE)
- enable_language(OBJC)
- enable_language(OBJCXX)
-
- include(CheckOBJCSourceCompiles)
- include(CheckOBJCXXSourceCompiles)
- include(CheckOBJCSourceRuns)
- include(CheckOBJCXXSourceRuns)
-
- CHECK_OBJC_SOURCE_COMPILES("I don't build in Objective-C" OBJC_BUILD_SHOULD_FAIL)
- CHECK_OBJC_SOURCE_COMPILES("int main() { return 0; }" SIMPLE_OBJC_BUILD_SHOULD_WORK)
-
- TEST_FAIL(OBJC_BUILD_SHOULD_FAIL "CHECK_OBJC_SOURCE_COMPILES() succeeded, but should have failed")
- TEST_ASSERT(SIMPLE_OBJC_BUILD_SHOULD_WORK "CHECK_OBJC_SOURCE_COMPILES() failed, but should have succeeded")
-
- set(CMAKE_REQUIRED_LIBRARIES "-framework Foundation")
-
- CHECK_OBJC_SOURCE_COMPILES("#import <Foundation/Foundation.h>\nint main()\n{\nNSObject *foo;\nreturn 0;\n}\n" OBJC_BUILD_SHOULD_WORK)
- CHECK_OBJC_SOURCE_RUNS("int main() { return 2; }" SIMPLE_OBJC_RUN_SHOULD_FAIL)
- CHECK_OBJC_SOURCE_RUNS("int main() { return 0; }" SIMPLE_OBJC_RUN_SHOULD_WORK)
- CHECK_OBJC_SOURCE_RUNS("#import <Foundation/Foundation.h>\nint main()\n{\nNSObject *foo;\nreturn 2;\n}\n" OBJC_RUN_SHOULD_FAIL)
- CHECK_OBJC_SOURCE_RUNS("#import <Foundation/Foundation.h>\nint main()\n{\nNSObject *foo;\nreturn 0;\n}\n" OBJC_RUN_SHOULD_WORK)
-
- TEST_ASSERT(OBJC_BUILD_SHOULD_WORK "CHECK_OBJC_SOURCE_COMPILES() failed, but should have succeeded")
- TEST_FAIL(SIMPLE_OBJC_RUN_SHOULD_FAIL "CHECK_OBJC_SOURC_RUNS() succeeds, but should have failed")
- TEST_ASSERT(SIMPLE_OBJC_RUN_SHOULD_WORK "CHECK_OBJC_SOURCE_RUNS() failed, but should have succeeded")
- TEST_FAIL(OBJC_RUN_SHOULD_FAIL "CHECK_OBJC_SOURCE_RUNS() succeeds, but should have failed")
- TEST_ASSERT(OBJC_RUN_SHOULD_WORK "CHECK_OBJC_SOURCE_RUNS() failed, but should have succeeded")
-
-
- CHECK_OBJCXX_SOURCE_COMPILES("I don't build in Objective-C++" OBJCXX_BUILD_SHOULD_FAIL)
- CHECK_OBJCXX_SOURCE_COMPILES("int main() { return 0; }" SIMPLE_OBJCXX_BUILD_SHOULD_WORK)
-
- TEST_FAIL(OBJCXX_BUILD_SHOULD_FAIL "CHECK_OBJCXX_SOURCE_COMPILES() succeeded, but should have failed")
- TEST_ASSERT(SIMPLE_OBJCXX_BUILD_SHOULD_WORK "CHECK_OBJCXX_SOURCE_COMPILES() failed, but should have succeeded")
-
- CHECK_OBJCXX_SOURCE_COMPILES("#import <Foundation/Foundation.h>\n#include <iostream>\nint main()\n{\nNSObject *foo;\nstd::cout << \"Hello\" << std::endl;\nreturn 0;\n}\n" OBJCXX_BUILD_SHOULD_WORK)
- CHECK_OBJCXX_SOURCE_RUNS("int main() { return 2; }" SIMPLE_OBJCXX_RUN_SHOULD_FAIL)
- CHECK_OBJCXX_SOURCE_RUNS("int main() { return 0; }" SIMPLE_OBJCXX_RUN_SHOULD_WORK)
- CHECK_OBJCXX_SOURCE_RUNS("#import <Foundation/Foundation.h>\n#include <vector>\nint main()\n{\nNSObject *foo;\nstd::vector<int> bar;\nreturn 2;\n}\n" OBJCXX_RUN_SHOULD_FAIL)
- CHECK_OBJCXX_SOURCE_RUNS("#import <Foundation/Foundation.h>\n#include <vector>\nint main()\n{\nNSObject *foo;\nstd::vector<int> bar;\nreturn 0;\n}\n" OBJCXX_RUN_SHOULD_WORK)
-
- TEST_ASSERT(OBJCXX_BUILD_SHOULD_WORK "CHECK_OBJCXX_SOURCE_COMPILES() failed, but should have succeeded")
- TEST_FAIL(SIMPLE_OBJCXX_RUN_SHOULD_FAIL "CHECK_OBJCXX_SOURC_RUNS() succeeds, but should have failed")
- TEST_ASSERT(SIMPLE_OBJCXX_RUN_SHOULD_WORK "CHECK_OBJCXX_SOURCE_RUNS() failed, but should have succeeded")
- TEST_FAIL(OBJCXX_RUN_SHOULD_FAIL "CHECK_OBJCXX_SOURCE_RUNS() succeeds, but should have failed")
- TEST_ASSERT(OBJCXX_RUN_SHOULD_WORK "CHECK_OBJCXX_SOURCE_RUNS() failed, but should have succeeded")
-endif()
-
-#######################################################################
-#
# also test that the check_prototype_definition macro works
include(CheckPrototypeDefinition)