Merge branch 'FindBoost-1.71' into release-3.15

Merge-request: !3763
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 51a1d8b..e60b6c5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -511,7 +511,7 @@
   #---------------------------------------------------------------------
   # Build or use system libarchive for CMake and CTest.
   if(CMAKE_USE_SYSTEM_LIBARCHIVE)
-    find_package(LibArchive 3.1.0)
+    find_package(LibArchive 3.3.3)
     if(NOT LibArchive_FOUND)
       message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
     endif()
diff --git a/Help/release/3.15.rst b/Help/release/3.15.rst
index b0365ba..48f3aa4 100644
--- a/Help/release/3.15.rst
+++ b/Help/release/3.15.rst
@@ -369,3 +369,10 @@
 * In CMake 3.15.0 and 3.15.1 the :variable:`CMAKE_FIND_PACKAGE_PREFER_CONFIG`
   variable caused the :command:`find_package` command to fail on a missing
   package even without the ``REQUIRED`` option.  This has been fixed.
+
+3.15.3
+------
+
+* ``CrayPrgEnv`` compiler wrapper support has been updated for the 19.06
+  release of the Cray Programming Environment for which the default linking
+  mode on XC Cray systems is now dynamic instead of static.
diff --git a/Modules/Compiler/CrayPrgEnv.cmake b/Modules/Compiler/CrayPrgEnv.cmake
index e55e587..f6e46ac 100644
--- a/Modules/Compiler/CrayPrgEnv.cmake
+++ b/Modules/Compiler/CrayPrgEnv.cmake
@@ -69,13 +69,27 @@
 # note that cmake applies both CMAKE_${lang}_FLAGS and CMAKE_EXE_LINKER_FLAGS
 # (in that order) to the linking command, so -dynamic can appear in either
 # variable.
+#
+# Note: As of CrayPE v19.06 (which translates to the craype/2.6.0 module)
+# the default has changed and is now dynamic by default.  This is handled
+# accordingly
 function(__cmake_craype_linktype lang rv)
   # start with ENV, but allow flags to override
-  if("$ENV{CRAYPE_LINK_TYPE}" STREQUAL "dynamic")
-    set(linktype dynamic)
+  if(("$ENV{CRAYPE_VERSION}" STREQUAL "") OR
+     ("$ENV{CRAYPE_VERSION}" VERSION_LESS "2.6"))
+    if("$ENV{CRAYPE_LINK_TYPE}" STREQUAL "dynamic")
+      set(linktype dynamic)
+    else()
+      set(linktype static)
+    endif()
   else()
-    set(linktype static)
+    if("$ENV{CRAYPE_LINK_TYPE}" STREQUAL "static")
+      set(linktype static)
+    else()
+      set(linktype dynamic)
+    endif()
   endif()
+
   # combine flags and convert to a list so we can apply the flags in order
   set(linkflags "${CMAKE_${lang}_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
   string(REPLACE " " ";" linkflags "${linkflags}")
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 9471be8..2b9b20c 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -1698,7 +1698,7 @@
     set(MPI_${LANG}_INCLUDE_PATH "${MPI_${LANG}_INCLUDE_DIRS}")
     unset(MPI_${LANG}_COMPILE_FLAGS)
     if(MPI_${LANG}_COMPILE_OPTIONS)
-      list(JOIN MPI_${LANG}_COMPILE_FLAGS " " MPI_${LANG}_COMPILE_OPTIONS)
+      list(JOIN MPI_${LANG}_COMPILE_OPTIONS " " MPI_${LANG}_COMPILE_FLAGS)
     endif()
     if(MPI_${LANG}_COMPILE_DEFINITIONS)
       foreach(_MPI_DEF IN LISTS MPI_${LANG}_COMPILE_DEFINITIONS)
diff --git a/Modules/Platform/Windows-Flang-Fortran.cmake b/Modules/Platform/Windows-Flang-Fortran.cmake
index a4b1cf1..c4420f7 100644
--- a/Modules/Platform/Windows-Flang-Fortran.cmake
+++ b/Modules/Platform/Windows-Flang-Fortran.cmake
@@ -1,3 +1,8 @@
 include(Platform/Windows-MSVC)
 __windows_compiler_msvc(Fortran)
 set(CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> ${_COMPILE_Fortran} <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded         -Xclang --dependent-lib=libcmt)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL      -Xclang --dependent-lib=msvcrt)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug    -Xclang --dependent-lib=libcmtd)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -Xclang --dependent-lib=msvcrtd)
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index ef63073..1b71f2a 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -855,8 +855,8 @@
       DumpCTestProperty("PROCESSORS", testProperties.Processors));
   }
   if (!testProperties.RequiredFiles.empty()) {
-    properties["REQUIRED_FILES"] =
-      DumpToJsonArray(testProperties.RequiredFiles);
+    properties.append(DumpCTestProperty(
+      "REQUIRED_FILES", DumpToJsonArray(testProperties.RequiredFiles)));
   }
   if (!testProperties.LockedResources.empty()) {
     properties.append(DumpCTestProperty(
diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx
index a8c4933..eb773ad 100644
--- a/Source/CursesDialog/cmCursesOptionsWidget.cxx
+++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx
@@ -23,6 +23,9 @@
 bool cmCursesOptionsWidget::HandleInput(int& key, cmCursesMainForm* /*fm*/,
                                         WINDOW* w)
 {
+  if (this->Options.empty()) {
+    return false;
+  }
   switch (key) {
     case 10: // 10 == enter
     case KEY_ENTER:
diff --git a/Source/cmAffinity.cxx b/Source/cmAffinity.cxx
index 588b2f2..09b0298 100644
--- a/Source/cmAffinity.cxx
+++ b/Source/cmAffinity.cxx
@@ -12,6 +12,8 @@
 #    define CM_HAVE_CPU_AFFINITY
 #    include <pthread.h>
 #    include <sched.h>
+// On some platforms CPU_ZERO needs memset but sched.h forgets string.h
+#    include <string.h> // IWYU pragma: keep
 #    if defined(__FreeBSD__)
 #      include <pthread_np.h>
 #      include <sys/cpuset.h>
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx
index 6025025..fecbf63 100644
--- a/Source/cmFileAPICodemodel.cxx
+++ b/Source/cmFileAPICodemodel.cxx
@@ -502,6 +502,12 @@
 {
   Target t(gt, this->Config);
   std::string prefix = "target-" + gt->GetName();
+  for (char& c : prefix) {
+    // CMP0037 OLD behavior allows slashes in target names.  Remove them.
+    if (c == '/' || c == '\\') {
+      c = '_';
+    }
+  }
   if (!this->Config.empty()) {
     prefix += "-" + this->Config;
   }
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index e590802..42aff04 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -141,7 +141,7 @@
 
   // look for old style
   // FIND_*(VAR name path1 path2 ...)
-  if (!newStyle) {
+  if (!newStyle && !this->Names.empty()) {
     // All the short-hand arguments have been recorded as names.
     std::vector<std::string> shortArgs = this->Names;
     this->Names.clear(); // clear out any values in Names
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 9afc15a..6b001f2 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -924,12 +924,9 @@
   cmMakefile* mf, std::string const& lang) const
 {
   std::string compilerIdVar = "CMAKE_" + lang + "_COMPILER_ID";
-  const char* compilerId = mf->GetDefinition(compilerIdVar);
-  if (!compilerId) {
-    return;
-  }
+  std::string const compilerId = mf->GetSafeDefinition(compilerIdVar);
 
-  if (strcmp(compilerId, "AppleClang") == 0) {
+  if (compilerId == "AppleClang") {
     switch (mf->GetPolicyStatus(cmPolicies::CMP0025)) {
       case cmPolicies::WARN:
         if (!this->CMakeInstance->GetIsInTryCompile() &&
@@ -959,7 +956,7 @@
     }
   }
 
-  if (strcmp(compilerId, "QCC") == 0) {
+  if (compilerId == "QCC") {
     switch (mf->GetPolicyStatus(cmPolicies::CMP0047)) {
       case cmPolicies::WARN:
         if (!this->CMakeInstance->GetIsInTryCompile() &&
@@ -995,7 +992,7 @@
     }
   }
 
-  if (strcmp(compilerId, "XLClang") == 0) {
+  if (compilerId == "XLClang") {
     switch (mf->GetPolicyStatus(cmPolicies::CMP0089)) {
       case cmPolicies::WARN:
         if (!this->CMakeInstance->GetIsInTryCompile() &&
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index f65abc8..b7b822a 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -85,6 +85,7 @@
     this->WriteLinkStatement();
   }
 
+  // Find ADDITIONAL_CLEAN_FILES
   this->AdditionalCleanFiles();
 }
 
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 1225cbd..e774b53 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -135,6 +135,9 @@
     gg->WriteBuild(this->GetBuildFileStream(), phonyBuild);
   }
 
+  // Find ADDITIONAL_CLEAN_FILES
+  this->AdditionalCleanFiles();
+
   // Add an alias for the logical target name regardless of what directory
   // contains it.  Skip this for GLOBAL_TARGET because they are meant to
   // be per-directory and have one at the top-level anyway.
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index 889f47d..641d8aa 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -982,7 +982,7 @@
 }
 
 bool cmQtAutoMocUic::JobEvaluateT::UicEvalFile(
-  SourceFileHandleT sourceFileHandle)
+  SourceFileHandleT const& sourceFileHandle)
 {
   SourceFileT const& sourceFile = *sourceFileHandle;
   auto const& Include = sourceFile.ParseData->Uic.Include;
@@ -1000,7 +1000,7 @@
     }
     // Register mapping
     if (!UicRegisterMapping(incKey.Key, std::move(uiFileHandle),
-                            std::move(sourceFileHandle))) {
+                            sourceFileHandle)) {
       return false;
     }
   }
diff --git a/Source/cmQtAutoMocUic.h b/Source/cmQtAutoMocUic.h
index 8061c13..81546cc 100644
--- a/Source/cmQtAutoMocUic.h
+++ b/Source/cmQtAutoMocUic.h
@@ -439,7 +439,7 @@
 
     // -- Uic
     bool UicEval(SourceFileMapT const& fileMap);
-    bool UicEvalFile(SourceFileHandleT sourceFileHandle);
+    bool UicEvalFile(SourceFileHandleT const& sourceFileHandle);
     SourceFileHandleT UicFindIncludedUi(std::string const& sourceFile,
                                         std::string const& sourceDir,
                                         IncludeKeyT const& incKey) const;
diff --git a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
index 169ba07..27838a4 100644
--- a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
+++ b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
@@ -6,9 +6,17 @@
   foreach(dbg "" Debug)
     foreach(dll "" DLL)
       set(var "CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_${t}${dbg}${dll}")
-      # ifort does not actually define these, so inject them
-      string(REPLACE "-threads" "-threads;-D_MT" "${var}" "${${var}}")
-      string(REPLACE "-dbglibs" "-dbglibs;-D_DEBUG" "${var}" "${${var}}")
+      if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
+        # ifort does not actually define these, so inject them
+        string(REPLACE "-threads" "-threads;-D_MT" "${var}" "${${var}}")
+        string(REPLACE "-dbglibs" "-dbglibs;-D_DEBUG" "${var}" "${${var}}")
+      elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Flang")
+        # flang does not actually define these, so inject them
+        string(REPLACE ";--dependent-lib=libcmt;" ";--dependent-lib=libcmt;-D_MT;" "${var}" ";${${var}};")
+        string(REPLACE ";--dependent-lib=msvcrt;" ";--dependent-lib=msvcrt;-D_MT;-D_DLL;" "${var}" ";${${var}};")
+        string(REPLACE ";--dependent-lib=libcmtd;" ";--dependent-lib=libcmtd;-D_MT;-D_DEBUG;" "${var}" ";${${var}};")
+        string(REPLACE ";--dependent-lib=msvcrtd;" ";--dependent-lib=msvcrtd;-D_MT;-D_DEBUG;-D_DLL;" "${var}" ";${${var}};")
+      endif()
     endforeach()
   endforeach()
 endforeach()
@@ -45,6 +53,6 @@
 verify(Fortran verify.F90)
 # Intel Fortran for Windows supports single-threaded RTL but it is
 # not implemented by the Visual Studio integration.
-if(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
   verify_combinations(SingleThreaded Fortran verify.F90)
 endif()
diff --git a/Tests/MakeClean/ToClean/CMakeLists.txt b/Tests/MakeClean/ToClean/CMakeLists.txt
index 6f16d12..a05c38b 100644
--- a/Tests/MakeClean/ToClean/CMakeLists.txt
+++ b/Tests/MakeClean/ToClean/CMakeLists.txt
@@ -15,42 +15,45 @@
   file(WRITE "${FILENAME}" ${CLEAN_FILE_CONTENT})
 endfunction()
 
+set(DUMMY_CONTENT_FILE ${CSD}/toclean.cxx)
+
 # Build a simple project whose compiled objects should be cleaned.
 add_executable(toclean toclean.cxx)
-addCleanFile("${CBD}${CMAKE_FILES_DIRECTORY}/toclean.dir/toclean.cxx${CMAKE_CXX_OUTPUT_EXTENSION}")
+addCleanFile(
+  "${CBD}${CMAKE_FILES_DIRECTORY}/toclean.dir/toclean.cxx${CMAKE_CXX_OUTPUT_EXTENSION}")
 
-# Create a post build custom command that copies the toclean output executable
+# Create a post build custom command that copies a dummy file
 # to a custom location
-function(addToCleanPostBuildCopy FILENAME)
-  add_custom_command(TARGET toclean POST_BUILD
+function(addPostBuildFile TARGET FILENAME)
+  add_custom_command(TARGET ${TARGET} POST_BUILD
     COMMAND ${CMAKE_COMMAND}
-    ARGS -E copy $<TARGET_FILE:toclean> ${FILENAME})
+    ARGS -E copy ${DUMMY_CONTENT_FILE} ${FILENAME})
 endfunction()
 
 # Create a custom command whose output should be cleaned.
 set(CustomCommandFile "${CBD}/CustomCommandFile.txt")
 add_custom_command(OUTPUT ${CustomCommandFile}
-  DEPENDS ${CSD}/toclean.cxx
+  DEPENDS ${DUMMY_CONTENT_FILE}
   COMMAND ${CMAKE_COMMAND}
-  ARGS -E copy ${CSD}/toclean.cxx ${CustomCommandFile})
-add_custom_target(generate ALL DEPENDS ${CustomCommandFile})
+  ARGS -E copy ${DUMMY_CONTENT_FILE} ${CustomCommandFile})
+add_custom_target(customTarget ALL DEPENDS ${CustomCommandFile})
 addCleanFile(${CustomCommandFile})
 
 
 ### Tests ADDITIONAL_MAKE_CLEAN_FILES directory property
 if("${CMAKE_GENERATOR}" MATCHES "Makefile")
   # Create a file that must be registered for cleaning.
-  set(MakeDirPropFile "${CBD}/MakeDirPropFile.txt")
-  writeCleanFile("${MakeDirPropFile}")
-  set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${MakeDirPropFile}")
-  addCleanFile(${MakeDirPropFile})
+  set(MakeDirPropFileAbs "${CBD}/MakeDirPropFile.txt")
+  writeCleanFile("${MakeDirPropFileAbs}")
+  set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${MakeDirPropFileAbs}")
+  addCleanFile(${MakeDirPropFileAbs})
 
   # Create a custom command whose output should be cleaned, but whose name
   # is not known until generate-time
   set(MakeDirPropExpFileRel "MakeDirProp_copy${CMAKE_EXECUTABLE_SUFFIX}")
-  set(MakeDirPropExpFile "$<TARGET_FILE_DIR:toclean>/${MakeDirPropExpFileRel}")
-  addToCleanPostBuildCopy("${MakeDirPropExpFile}")
-  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${MakeDirPropExpFile})
+  set(MakeDirPropExpFileAbs "$<TARGET_FILE_DIR:toclean>/${MakeDirPropExpFileRel}")
+  addPostBuildFile(toclean "${MakeDirPropExpFileAbs}")
+  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${MakeDirPropExpFileAbs})
   addCleanFile("${CBD}/${MakeDirPropExpFileRel}")
 endif()
 
@@ -72,34 +75,43 @@
 # Create a custom command whose output should be cleaned, but whose name
 # is not known until generate-time
 set(DirPropExpFileRel "DirProp_copy${CMAKE_EXECUTABLE_SUFFIX}")
-set(DirPropExpFile "$<TARGET_FILE_DIR:toclean>/${DirPropExpFileRel}")
-addToCleanPostBuildCopy("${DirPropExpFile}")
-set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${DirPropExpFile})
+set(DirPropExpFileAbs "$<TARGET_FILE_DIR:toclean>/${DirPropExpFileRel}")
+addPostBuildFile(toclean "${DirPropExpFileAbs}")
+set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${DirPropExpFileAbs})
 addCleanFile("${CBD}/${DirPropExpFileRel}")
 
 
 ### Tests ADDITIONAL_CLEAN_FILES target property
 
-# Register a file path relative to the build directory
-set(TgtPropFileRel "TargetPropFileRel.txt")
-writeCleanFile("${CBD}/${TgtPropFileRel}")
-set_target_properties(toclean PROPERTIES ADDITIONAL_CLEAN_FILES ${TgtPropFileRel})
-addCleanFile("${CBD}/${TgtPropFileRel}")
+function(test_target_property TARGET)
+    # Register a file path relative to the build directory
+    set(TgtPropFileRel "${TARGET}_TargetPropFileRel.txt")
+    writeCleanFile("${CBD}/${TgtPropFileRel}")
+    set_target_properties(${TARGET} PROPERTIES ADDITIONAL_CLEAN_FILES ${TgtPropFileRel})
+    addCleanFile("${CBD}/${TgtPropFileRel}")
 
-# Register an absolute file path
-set(TgtPropFileAbs "${CBD}/TargetPropFileAbs.txt")
-writeCleanFile("${TgtPropFileAbs}")
-set_property(TARGET toclean APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${TgtPropFileAbs})
-addCleanFile("${TgtPropFileAbs}")
+    # Register an absolute file path
+    set(TgtPropFileAbs "${CBD}/${TARGET}_TargetPropFileAbs.txt")
+    writeCleanFile("${TgtPropFileAbs}")
+    set_property(TARGET ${TARGET} APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${TgtPropFileAbs})
+    addCleanFile("${TgtPropFileAbs}")
 
-# Create a custom command whose output should be cleaned, but whose name
-# is not known until generate-time
-set(TgtPropExpFileRel "TgtProp_copy${CMAKE_EXECUTABLE_SUFFIX}")
-set(TgtPropExpFile "$<TARGET_FILE_DIR:toclean>/${TgtPropExpFileRel}")
-addToCleanPostBuildCopy("${TgtPropExpFile}")
-set_property(TARGET toclean APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${TgtPropExpFile})
-addCleanFile("${CBD}/${TgtPropExpFileRel}")
+    # Create a custom command whose output should be cleaned, but whose name
+    # is not known until generate-time
+    set(TgtPropExpFileRel "${TARGET}_TargetPropGenExp.txt")
+    set(TgtPropExpFileAbs "$<TARGET_FILE_DIR:toclean>/${TgtPropExpFileRel}")
+    addPostBuildFile(${TARGET} "${TgtPropExpFileAbs}")
+    set_property(TARGET ${TARGET} APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${TgtPropExpFileAbs})
+    addCleanFile("${CBD}/${TgtPropExpFileRel}")
+endfunction()
 
+# Test target property for various target types
+add_executable(acf_exec toclean.cxx)
+test_target_property(acf_exec)
+add_library(acf_lib toclean.cxx)
+test_target_property(acf_lib)
+add_custom_target(acf_custom ALL DEPENDS ${CustomCommandFile})
+test_target_property(acf_custom)
 
 # Process subdirectory without targets
 add_subdirectory(EmptySubDir)
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index d524f41..b7f9a37 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -200,7 +200,11 @@
   file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
   file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
     add_test(ShowOnly \"${CMAKE_COMMAND}\" -E echo)
-    set_tests_properties(ShowOnly PROPERTIES WILL_FAIL true _BACKTRACE_TRIPLES \"file1;1;add_test;file0;;\")
+    set_tests_properties(ShowOnly PROPERTIES
+      WILL_FAIL true
+      REQUIRED_FILES RequiredFileDoesNotExist
+      _BACKTRACE_TRIPLES \"file1;1;add_test;file0;;\"
+      )
     add_test(ShowOnlyNotAvailable NOT_AVAILABLE)
 ")
   run_cmake_command(show-only_human ${CMAKE_CTEST_COMMAND} --show-only=human)
diff --git a/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py b/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py
index 4dff90c..3ad5768 100644
--- a/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py
+++ b/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py
@@ -63,6 +63,15 @@
     assert is_string(c[2])
     assert c[2] == "echo"
 
+def check_reqfiles_property(p):
+    assert is_dict(p)
+    assert sorted(p.keys()) == ["name", "value"]
+    assert is_string(p["name"])
+    assert is_list(p["value"])
+    assert p["name"] == "REQUIRED_FILES"
+    assert len(p["value"]) == 1
+    assert p["value"][0] == "RequiredFileDoesNotExist"
+
 def check_willfail_property(p):
     assert is_dict(p)
     assert sorted(p.keys()) == ["name", "value"]
@@ -81,9 +90,10 @@
 
 def check_properties(p):
     assert is_list(p)
-    assert len(p) == 2
-    check_willfail_property(p[0])
-    check_workingdir_property(p[1])
+    assert len(p) == 3
+    check_reqfiles_property(p[0])
+    check_willfail_property(p[1])
+    check_workingdir_property(p[2])
 
 def check_tests(t):
     assert is_list(t)
diff --git a/Tests/RunCMake/find_path/EmptyOldStyle-stdout.txt b/Tests/RunCMake/find_path/EmptyOldStyle-stdout.txt
new file mode 100644
index 0000000..8f21eb8
--- /dev/null
+++ b/Tests/RunCMake/find_path/EmptyOldStyle-stdout.txt
@@ -0,0 +1 @@
+-- VAR-NOTFOUND
diff --git a/Tests/RunCMake/find_path/EmptyOldStyle.cmake b/Tests/RunCMake/find_path/EmptyOldStyle.cmake
new file mode 100644
index 0000000..d78bb65
--- /dev/null
+++ b/Tests/RunCMake/find_path/EmptyOldStyle.cmake
@@ -0,0 +1,2 @@
+find_path(VAR ONLY_CMAKE_FIND_ROOT_PATH)
+message(STATUS "${VAR}")
diff --git a/Tests/RunCMake/find_path/RunCMakeTest.cmake b/Tests/RunCMake/find_path/RunCMakeTest.cmake
index bf0fa89..3afbedc 100644
--- a/Tests/RunCMake/find_path/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_path/RunCMakeTest.cmake
@@ -1,5 +1,6 @@
 include(RunCMake)
 
+run_cmake(EmptyOldStyle)
 if(WIN32 OR CYGWIN)
   run_cmake(PrefixInPATH)
 endif()