Merge branch 'bootstrap_system_libuv_option' into release-3.11

Merge-request: !1971
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6623959..3ab679e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -546,7 +546,7 @@
   #---------------------------------------------------------------------
   # Build libuv library.
   if(CMAKE_USE_SYSTEM_LIBUV)
-    find_package(LibUV 1.0.0)
+    find_package(LibUV 1.10.0)
     if(NOT LIBUV_FOUND)
       message(FATAL_ERROR
         "CMAKE_USE_SYSTEM_LIBUV is ON but a libuv is not found!")
diff --git a/Help/release/3.11.rst b/Help/release/3.11.rst
index b57ac29..dbaa8af 100644
--- a/Help/release/3.11.rst
+++ b/Help/release/3.11.rst
@@ -127,15 +127,6 @@
 Modules
 -------
 
-* The :module:`CheckIncludeFile` module ``check_include_file`` macro
-  learned to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable.
-
-* The :module:`CheckIncludeFileCXX` module ``check_include_file_cxx`` macro
-  learned to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable.
-
-* The :module:`CheckIncludeFiles` module ``check_include_files`` macro
-  learned to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable.
-
 * The :module:`CheckIncludeFiles` module :command:`CHECK_INCLUDE_FILES`
   command gained a ``LANGUAGE`` option to specify whether to check using the
   ``C`` or ``CXX`` compiler.
@@ -276,3 +267,19 @@
   values containing newlines are now truncated before writing to the file.
   In addition, a warning comment is written to the cache file, and a warning
   message is displayed to the user on the console.
+
+Updates
+=======
+
+Changes made since CMake 3.11.0 include the following.
+
+3.11.1
+------
+
+* The :module:`CheckIncludeFile` module ``check_include_file`` macro,
+  :module:`CheckIncludeFileCXX` module ``check_include_file_cxx`` macro,
+  and :module:`CheckIncludeFiles` module ``check_include_files`` macro
+  were taught to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable in
+  CMake 3.11.0.  This has been reverted due to changing behavior of
+  checks for existing projects.  It may be restored in the future
+  with a policy for compatibility.
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index 63d18ab..935f92d 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -142,7 +142,7 @@
   # We remove items that are not language-specific.
   set(implicit_libs "")
   foreach(lib IN LISTS implicit_libs_tmp)
-    if("x${lib}" MATCHES "^x(crt.*\\.o|gcc_eh.*|System.*|.*libclang_rt.*|msvcrt.*|libvcruntime.*|libucrt.*|libcmt.*)$")
+    if("x${lib}" MATCHES "^x(crt.*\\.o|gcc_eh.*|.*libgcc_eh.*|System.*|.*libclang_rt.*|msvcrt.*|libvcruntime.*|libucrt.*|libcmt.*)$")
       string(APPEND log "  remove lib [${lib}]\n")
     elseif(IS_ABSOLUTE "${lib}")
       get_filename_component(abs "${lib}" ABSOLUTE)
diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake
index 501fc9a..e5554c4 100644
--- a/Modules/CheckIncludeFile.cmake
+++ b/Modules/CheckIncludeFile.cmake
@@ -27,8 +27,6 @@
 #   list of macros to define (-DFOO=bar)
 # ``CMAKE_REQUIRED_INCLUDES``
 #   list of include directories
-# ``CMAKE_REQUIRED_LIBRARIES``
-#   list of libraries to link
 # ``CMAKE_REQUIRED_QUIET``
 #   execute quietly without messages
 #
@@ -61,7 +59,6 @@
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-      LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
       CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
       "${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}"
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake
index cdb25fb..7948bab 100644
--- a/Modules/CheckIncludeFileCXX.cmake
+++ b/Modules/CheckIncludeFileCXX.cmake
@@ -27,8 +27,6 @@
 #   list of macros to define (-DFOO=bar)
 # ``CMAKE_REQUIRED_INCLUDES``
 #   list of include directories
-# ``CMAKE_REQUIRED_LIBRARIES``
-#   list of libraries to link
 # ``CMAKE_REQUIRED_QUIET``
 #   execute quietly without messages
 #
@@ -60,7 +58,6 @@
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-      LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
       CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
       "${CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS}"
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index 14db68c..59afdab 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -33,8 +33,6 @@
 #   list of macros to define (-DFOO=bar)
 # ``CMAKE_REQUIRED_INCLUDES``
 #   list of include directories
-# ``CMAKE_REQUIRED_LIBRARIES``
-#   list of libraries to link
 # ``CMAKE_REQUIRED_QUIET``
 #   execute quietly without messages
 #
@@ -104,7 +102,6 @@
       ${CMAKE_BINARY_DIR}
       ${src}
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-      LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
       CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS}
       "${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"
diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
index 5969586..9c604f2 100644
--- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
@@ -1,15 +1,20 @@
-
-# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx
-# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx
-# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx
-# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx
-# http://blogs.msdn.com/b/vcblog/archive/2015/04/29/c-11-14-17-features-in-vs-2015-rc.aspx
-# http://blogs.msdn.com/b/vcblog/archive/2015/06/19/c-11-14-17-features-in-vs-2015-rtm.aspx
-
+# Reference: https://docs.microsoft.com/en-us/cpp/visual-cpp-language-conformance
+# https://blogs.msdn.microsoft.com/vcblog/2015/06/19/c111417-features-in-vs-2015-rtm/
+# https://blogs.msdn.microsoft.com/vcblog/2013/12/02/c1114-core-language-features-in-vs-2013-and-the-nov-2013-ctp/
+# https://blogs.msdn.microsoft.com/vcblog/2011/09/12/c11-features-in-visual-c-11/
 
 set(_cmake_oldestSupported "_MSC_VER >= 1600")
 
-# VS version 15 (not 2015) introduces support for aggregate initializers.
+# VS 2017 v15.3 fixes support for incomplete decltypes
+# https://docs.microsoft.com/en-us/cpp/cpp-conformance-improvements-2017#update_153
+set(_cmake_feature_test_cxx_decltype_incomplete_return_types "_MSC_VER >= 1911")
+
+set(MSVC_2017 "_MSC_VER >= 1910")
+# VS 2017 introduces support for "N3652 Extended constexpr"
+# but as of v15.6 there are still bugs in the implementation
+#set(_cmake_feature_test_cxx_relaxed_constexpr "${MSVC_2017}")
+
+# VS 2017 Preview introduces support for aggregate initializers.
 set(_cmake_feature_test_cxx_aggregate_default_initializers "_MSC_FULL_VER >= 190024406")
 
 # VS 2015 Update 2 introduces support for variable templates.
@@ -48,7 +53,6 @@
 # lists this as 'partial' in 2013
 set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2015}")
 
-set(MSVC_2013_v30723 "_MSC_FULL_VER >= 180030723")
 # http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx
 # Note 1. While previous version of VisualStudio said they supported these
 # they silently produced bad code, and are now marked as having partial
@@ -56,7 +60,7 @@
 # in MSVC 2015, so support the feature for that version, assuming that is true.
 # The blog post also says that VS 2013 Update 3 generates an error in cases
 # that previously produced bad code.
-set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013_v30723}")
+set(_cmake_feature_test_cxx_generalized_initializers "_MSC_FULL_VER >= 180030723")
 
 set(MSVC_2013 "_MSC_VER >= 1800")
 set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}")
@@ -98,20 +102,10 @@
 set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}")
 set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}")
 
-# Currently unsupported:
-# set(_cmake_feature_test_cxx_relaxed_constexpr )
-# 'NSDMIs for aggregates'
-# set(_cmake_feature_test_cxx_aggregate_default_initializers )
-
-# In theory decltype incomplete return types was added in 2012
-# but without support for decltype_auto and return type deduction this
-# feature is unusable.  This remains so as of VS 2015 Preview.
-# set(_cmake_feature_test_cxx_decltype_incomplete_return_types )
-
 # Unset all the variables that we don't need exposed.
 # _cmake_oldestSupported is required by WriteCompilerDetectionHeader
+set(MSVC_2017)
 set(MSVC_2015)
-set(MSVC_2013_v30723)
 set(MSVC_2013)
 set(MSVC_2012)
 set(MSVC_2010)
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index ced092e..1bf589d 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -240,19 +240,10 @@
         endforeach()
         set("${OPENMP_LIB_NAMES_VAR}" "${_OPENMP_LIB_NAMES}" PARENT_SCOPE)
       else()
-        # The Intel compiler on windows has no verbose mode, so we need to treat it explicitly
-        if("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "Intel" AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
-          set("${OPENMP_LIB_NAMES_VAR}" "libiomp5md" PARENT_SCOPE)
-          find_library(OpenMP_libiomp5md_LIBRARY
-            NAMES "libiomp5md"
-            HINTS ${CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES}
-            CMAKE_FIND_ROOT_PATH_BOTH
-            NO_DEFAULT_PATH
-          )
-          mark_as_advanced(OpenMP_libiomp5md_LIBRARY)
-        else()
-          set("${OPENMP_LIB_NAMES_VAR}" "" PARENT_SCOPE)
-        endif()
+        # We do not know how to extract implicit OpenMP libraries for this compiler.
+        # Assume that it handles them automatically, e.g. the Intel Compiler on
+        # Windows should put the dependency in its object files.
+        set("${OPENMP_LIB_NAMES_VAR}" "" PARENT_SCOPE)
       endif()
       break()
     endif()
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 507a10c..b6ff38b 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -350,16 +350,16 @@
         }
         if (parsed) {
           cpackGenerator = generators.NewGenerator(gen);
-          if (!cpackGenerator) {
+          if (cpackGenerator) {
+            cpackGenerator->SetTrace(trace);
+            cpackGenerator->SetTraceExpand(traceExpand);
+          } else {
             cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
                         "Cannot initialize CPack generator: " << gen
                                                               << std::endl);
             parsed = 0;
           }
 
-          cpackGenerator->SetTrace(trace);
-          cpackGenerator->SetTraceExpand(traceExpand);
-
           if (parsed && !cpackGenerator->Initialize(gen, mf)) {
             cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
                         "Cannot initialize the generator " << gen
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index bf314bd..ccb4f88 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -101,10 +101,11 @@
     // not been "cleared"/initialized with a set(foo ) call
     if (this->WarnUninitialized && !this->Makefile->VariableInitialized(var)) {
       if (this->CheckSystemVars ||
-          cmSystemTools::IsSubDirectory(this->FileName,
-                                        this->Makefile->GetHomeDirectory()) ||
-          cmSystemTools::IsSubDirectory(
-            this->FileName, this->Makefile->GetHomeOutputDirectory())) {
+          (this->FileName &&
+           (cmSystemTools::IsSubDirectory(
+              this->FileName, this->Makefile->GetHomeDirectory()) ||
+            cmSystemTools::IsSubDirectory(
+              this->FileName, this->Makefile->GetHomeOutputDirectory())))) {
         std::ostringstream msg;
         msg << "uninitialized variable \'" << var << "\'";
         this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, msg.str());
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 8f61071..2008a0b 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -821,6 +821,19 @@
   return buildFile;
 }
 
+void cmGlobalXCodeGenerator::AddXCodeProjBuildRule(
+  cmGeneratorTarget* target, std::vector<cmSourceFile*>& sources) const
+{
+  std::string listfile =
+    target->GetLocalGenerator()->GetCurrentSourceDirectory();
+  listfile += "/CMakeLists.txt";
+  cmSourceFile* srcCMakeLists = target->Makefile->GetOrCreateSource(listfile);
+  if (std::find(sources.begin(), sources.end(), srcCMakeLists) ==
+      sources.end()) {
+    sources.push_back(srcCMakeLists);
+  }
+}
+
 std::string GetSourcecodeValueFromFileExtension(const std::string& _ext,
                                                 const std::string& lang,
                                                 bool& keepLastKnownFileType)
@@ -1043,10 +1056,7 @@
     }
 
     // Add CMakeLists.txt file for user convenience.
-    std::string listfile =
-      gtgt->GetLocalGenerator()->GetCurrentSourceDirectory();
-    listfile += "/CMakeLists.txt";
-    classes.push_back(gtgt->Makefile->GetOrCreateSource(listfile));
+    this->AddXCodeProjBuildRule(gtgt, classes);
 
     std::sort(classes.begin(), classes.end(), cmSourceFilePathCompare());
 
@@ -2343,10 +2353,7 @@
     }
 
     // Add CMakeLists.txt file for user convenience.
-    std::string listfile =
-      gtgt->GetLocalGenerator()->GetCurrentSourceDirectory();
-    listfile += "/CMakeLists.txt";
-    sources.push_back(gtgt->Makefile->GetOrCreateSource(listfile));
+    this->AddXCodeProjBuildRule(gtgt, sources);
 
     for (auto sourceFile : sources) {
       if (!sourceFile->GetPropertyAsBool("GENERATED")) {
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index b45887e..7c51177 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -198,6 +198,8 @@
                                           cmGeneratorTarget* target);
   cmXCodeObject* CreateXCodeSourceFile(cmLocalGenerator* gen, cmSourceFile* sf,
                                        cmGeneratorTarget* gtgt);
+  void AddXCodeProjBuildRule(cmGeneratorTarget* target,
+                             std::vector<cmSourceFile*>& sources) const;
   bool CreateXCodeTargets(cmLocalGenerator* gen, std::vector<cmXCodeObject*>&);
   bool IsHeaderFile(cmSourceFile*);
   void AddDependTarget(cmXCodeObject* target, cmXCodeObject* dependTarget);
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 98b1c44..13503ad 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1347,7 +1347,18 @@
       for (size_t ci = 0; ci < configs.size(); ++ci) {
         acs.Configs.push_back(ci);
       }
-      sources.Sources.emplace_back(std::move(acs));
+      bool haveCMakeLists = false;
+      for (cmGeneratorTarget::AllConfigSource& si : sources.Sources) {
+        if (si.Source == sf) {
+          haveCMakeLists = true;
+          // Replace the explicit source reference with our generated one.
+          si = acs;
+          break;
+        }
+      }
+      if (!haveCMakeLists) {
+        sources.Sources.emplace_back(std::move(acs));
+      }
     }
   }
 
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index b468208..71359a2 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2679,10 +2679,11 @@
             if (this->GetCMakeInstance()->GetWarnUninitialized() &&
                 !this->VariableInitialized(lookup)) {
               if (this->CheckSystemVars ||
-                  cmSystemTools::IsSubDirectory(filename,
-                                                this->GetHomeDirectory()) ||
-                  cmSystemTools::IsSubDirectory(
-                    filename, this->GetHomeOutputDirectory())) {
+                  (filename &&
+                   (cmSystemTools::IsSubDirectory(filename,
+                                                  this->GetHomeDirectory()) ||
+                    cmSystemTools::IsSubDirectory(
+                      filename, this->GetHomeOutputDirectory())))) {
                 std::ostringstream msg;
                 msg << "uninitialized variable \'" << lookup << "\'";
                 this->IssueMessage(cmake::AUTHOR_WARNING, msg.str());
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index 1939bd4..4aa1b1f 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -146,19 +146,93 @@
   }
 }
 
-std::string cmQtAutoGenerator::FileSystem::RealPath(
+std::string cmQtAutoGenerator::FileSystem::GetRealPath(
   std::string const& filename)
 {
   std::lock_guard<std::mutex> lock(Mutex_);
   return cmSystemTools::GetRealPath(filename);
 }
 
+std::string cmQtAutoGenerator::FileSystem::CollapseCombinedPath(
+  std::string const& dir, std::string const& file)
+{
+  std::lock_guard<std::mutex> lock(Mutex_);
+  return cmSystemTools::CollapseCombinedPath(dir, file);
+}
+
+void cmQtAutoGenerator::FileSystem::SplitPath(
+  const std::string& p, std::vector<std::string>& components,
+  bool expand_home_dir)
+{
+  std::lock_guard<std::mutex> lock(Mutex_);
+  cmSystemTools::SplitPath(p, components, expand_home_dir);
+}
+
+std::string cmQtAutoGenerator::FileSystem::JoinPath(
+  const std::vector<std::string>& components)
+{
+  std::lock_guard<std::mutex> lock(Mutex_);
+  return cmSystemTools::JoinPath(components);
+}
+
+std::string cmQtAutoGenerator::FileSystem::JoinPath(
+  std::vector<std::string>::const_iterator first,
+  std::vector<std::string>::const_iterator last)
+{
+  std::lock_guard<std::mutex> lock(Mutex_);
+  return cmSystemTools::JoinPath(first, last);
+}
+
+std::string cmQtAutoGenerator::FileSystem::GetFilenameWithoutLastExtension(
+  const std::string& filename)
+{
+  std::lock_guard<std::mutex> lock(Mutex_);
+  return cmSystemTools::GetFilenameWithoutLastExtension(filename);
+}
+
+std::string cmQtAutoGenerator::FileSystem::SubDirPrefix(
+  std::string const& filename)
+{
+  std::lock_guard<std::mutex> lock(Mutex_);
+  return cmQtAutoGen::SubDirPrefix(filename);
+}
+
+void cmQtAutoGenerator::FileSystem::setupFilePathChecksum(
+  std::string const& currentSrcDir, std::string const& currentBinDir,
+  std::string const& projectSrcDir, std::string const& projectBinDir)
+{
+  std::lock_guard<std::mutex> lock(Mutex_);
+  FilePathChecksum_.setupParentDirs(currentSrcDir, currentBinDir,
+                                    projectSrcDir, projectBinDir);
+}
+
+std::string cmQtAutoGenerator::FileSystem::GetFilePathChecksum(
+  std::string const& filename)
+{
+  std::lock_guard<std::mutex> lock(Mutex_);
+  return FilePathChecksum_.getPart(filename);
+}
+
 bool cmQtAutoGenerator::FileSystem::FileExists(std::string const& filename)
 {
   std::lock_guard<std::mutex> lock(Mutex_);
   return cmSystemTools::FileExists(filename);
 }
 
+bool cmQtAutoGenerator::FileSystem::FileExists(std::string const& filename,
+                                               bool isFile)
+{
+  std::lock_guard<std::mutex> lock(Mutex_);
+  return cmSystemTools::FileExists(filename, isFile);
+}
+
+unsigned long cmQtAutoGenerator::FileSystem::FileLength(
+  std::string const& filename)
+{
+  std::lock_guard<std::mutex> lock(Mutex_);
+  return cmSystemTools::FileLength(filename);
+}
+
 bool cmQtAutoGenerator::FileSystem::FileIsOlderThan(
   std::string const& buildFile, std::string const& sourceFile,
   std::string* error)
@@ -188,35 +262,30 @@
                                              std::string* error)
 {
   bool success = false;
-  {
-    std::lock_guard<std::mutex> lock(Mutex_);
-    if (cmSystemTools::FileExists(filename, true)) {
-      std::size_t const length = cmSystemTools::FileLength(filename);
+  if (FileExists(filename, true)) {
+    unsigned long const length = FileLength(filename);
+    {
+      std::lock_guard<std::mutex> lock(Mutex_);
       cmsys::ifstream ifs(filename.c_str(), (std::ios::in | std::ios::binary));
       if (ifs) {
-        if (length > 0) {
-          content.resize(length);
-          ifs.read(&content.front(), content.size());
-          if (ifs) {
-            success = true;
-          } else {
-            content.clear();
-            if (error != nullptr) {
-              error->append("Reading from the file failed.");
-            }
-          }
-        } else {
-          // Readable but empty file
-          content.clear();
+        content.reserve(length);
+        content.assign(std::istreambuf_iterator<char>{ ifs },
+                       std::istreambuf_iterator<char>{});
+        if (ifs) {
           success = true;
+        } else {
+          content.clear();
+          if (error != nullptr) {
+            error->append("Reading from the file failed.");
+          }
         }
       } else if (error != nullptr) {
         error->append("Opening the file for reading failed.");
       }
-    } else if (error != nullptr) {
-      error->append(
-        "The file does not exist, is not readable or is a directory.");
     }
+  } else if (error != nullptr) {
+    error->append(
+      "The file does not exist, is not readable or is a directory.");
   }
   return success;
 }
diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h
index e029d8d..299e4c2 100644
--- a/Source/cmQtAutoGenerator.h
+++ b/Source/cmQtAutoGenerator.h
@@ -5,6 +5,7 @@
 
 #include "cmConfigure.h" // IWYU pragma: keep
 
+#include "cmFilePathChecksum.h"
 #include "cmQtAutoGen.h"
 #include "cmUVHandlePtr.h"
 #include "cmUVSignalHackRAII.h" // IWYU pragma: keep
@@ -68,9 +69,42 @@
     {
     }
 
+    /// @brief Logger
     Logger* Log() const { return Log_; }
-    std::string RealPath(std::string const& filename);
+
+    // -- Paths
+    /// @brief Wrapper for cmSystemTools::GetRealPath
+    std::string GetRealPath(std::string const& filename);
+    /// @brief Wrapper for cmSystemTools::CollapseCombinedPath
+    std::string CollapseCombinedPath(std::string const& dir,
+                                     std::string const& file);
+    /// @brief Wrapper for cmSystemTools::SplitPath
+    void SplitPath(const std::string& p, std::vector<std::string>& components,
+                   bool expand_home_dir = true);
+    /// @brief Wrapper for cmSystemTools::JoinPath
+    std::string JoinPath(const std::vector<std::string>& components);
+    /// @brief Wrapper for cmSystemTools::JoinPath
+    std::string JoinPath(std::vector<std::string>::const_iterator first,
+                         std::vector<std::string>::const_iterator last);
+    /// @brief Wrapper for cmSystemTools::GetFilenameWithoutLastExtension
+    std::string GetFilenameWithoutLastExtension(const std::string& filename);
+    /// @brief Wrapper for cmQtAutoGen::SubDirPrefix
+    std::string SubDirPrefix(std::string const& filename);
+    /// @brief Wrapper for cmFilePathChecksum::setupParentDirs
+    void setupFilePathChecksum(std::string const& currentSrcDir,
+                               std::string const& currentBinDir,
+                               std::string const& projectSrcDir,
+                               std::string const& projectBinDir);
+    /// @brief Wrapper for cmFilePathChecksum::getPart
+    std::string GetFilePathChecksum(std::string const& filename);
+
+    // -- File access
+    /// @brief Wrapper for cmSystemTools::FileExists
     bool FileExists(std::string const& filename);
+    /// @brief Wrapper for cmSystemTools::FileExists
+    bool FileExists(std::string const& filename, bool isFile);
+    /// @brief Wrapper for cmSystemTools::FileLength
+    unsigned long FileLength(std::string const& filename);
     bool FileIsOlderThan(std::string const& buildFile,
                          std::string const& sourceFile,
                          std::string* error = nullptr);
@@ -92,6 +126,7 @@
     bool FileRemove(std::string const& filename);
     bool Touch(std::string const& filename);
 
+    // -- Directory access
     bool MakeDirectory(std::string const& dirname);
     /// @brief Error logging version
     bool MakeDirectory(GeneratorT genType, std::string const& dirname);
@@ -102,6 +137,7 @@
 
   private:
     std::mutex Mutex_;
+    cmFilePathChecksum FilePathChecksum_;
     Logger* Log_;
   };
 
diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx
index 6be65ee..e2fd158 100644
--- a/Source/cmQtAutoGeneratorMocUic.cxx
+++ b/Source/cmQtAutoGeneratorMocUic.cxx
@@ -26,7 +26,7 @@
 std::string cmQtAutoGeneratorMocUic::BaseSettingsT::AbsoluteBuildPath(
   std::string const& relativePath) const
 {
-  return cmSystemTools::CollapseCombinedPath(AutogenBuildDir, relativePath);
+  return FileSys->CollapseCombinedPath(AutogenBuildDir, relativePath);
 }
 
 /**
@@ -106,7 +106,7 @@
     std::string testPath = sourcePath;
     testPath += includeString;
     if (FileSys->FileExists(testPath)) {
-      return FileSys->RealPath(testPath);
+      return FileSys->GetRealPath(testPath);
     }
   }
   // Search in include directories
@@ -115,7 +115,7 @@
     fullPath.push_back('/');
     fullPath += includeString;
     if (FileSys->FileExists(fullPath)) {
-      return FileSys->RealPath(fullPath);
+      return FileSys->GetRealPath(fullPath);
     }
   }
   // Return empty string
@@ -166,9 +166,9 @@
     MetaT meta;
     if (wrk.FileSys().FileRead(meta.Content, FileName, &error)) {
       if (!meta.Content.empty()) {
-        meta.FileDir = SubDirPrefix(FileName);
+        meta.FileDir = wrk.FileSys().SubDirPrefix(FileName);
         meta.FileBase =
-          cmSystemTools::GetFilenameWithoutLastExtension(FileName);
+          wrk.FileSys().GetFilenameWithoutLastExtension(FileName);
 
         bool success = true;
         if (AutoMoc) {
@@ -222,9 +222,9 @@
       cmsys::RegularExpressionMatch match;
       while (wrk.Moc().RegExpInclude.find(contentChars, match)) {
         std::string incString = match.match(2);
-        std::string incDir(SubDirPrefix(incString));
+        std::string incDir(wrk.FileSys().SubDirPrefix(incString));
         std::string incBase =
-          cmSystemTools::GetFilenameWithoutLastExtension(incString);
+          wrk.FileSys().GetFilenameWithoutLastExtension(incString);
         if (cmHasLiteralPrefix(incBase, "moc_")) {
           // moc_<BASE>.cxx
           // Remove the moc_ part from the base name
@@ -487,7 +487,7 @@
   }
   // Sanitize
   if (!header.empty()) {
-    header = wrk.FileSys().RealPath(header);
+    header = wrk.FileSys().GetRealPath(header);
   }
   return header;
 }
@@ -533,12 +533,12 @@
 {
   std::string res;
   std::string searchFile =
-    cmSystemTools::GetFilenameWithoutLastExtension(includeString).substr(3);
+    wrk.FileSys().GetFilenameWithoutLastExtension(includeString).substr(3);
   searchFile += ".ui";
   // Collect search paths list
   std::deque<std::string> testFiles;
   {
-    std::string const searchPath = SubDirPrefix(includeString);
+    std::string const searchPath = wrk.FileSys().SubDirPrefix(includeString);
 
     std::string searchFileFull;
     if (!searchPath.empty()) {
@@ -569,7 +569,7 @@
   // Search for the .ui file!
   for (std::string const& testFile : testFiles) {
     if (wrk.FileSys().FileExists(testFile)) {
-      res = wrk.FileSys().RealPath(testFile);
+      res = wrk.FileSys().GetRealPath(testFile);
       break;
     }
   }
@@ -676,9 +676,9 @@
     BuildFile += '/';
     BuildFile += IncludeString;
   } else {
-    std::string rel = wrk.Base().FilePathChecksum.getPart(SourceFile);
+    std::string rel = wrk.FileSys().GetFilePathChecksum(SourceFile);
     rel += "/moc_";
-    rel += cmSystemTools::GetFilenameWithoutLastExtension(SourceFile);
+    rel += wrk.FileSys().GetFilenameWithoutLastExtension(SourceFile);
     rel += ".cpp";
     // Register relative file path
     wrk.Gen().ParallelMocAutoRegister(rel);
@@ -798,7 +798,7 @@
     }
     // Check dependency timestamps
     std::string error;
-    std::string sourceDir = SubDirPrefix(SourceFile);
+    std::string sourceDir = wrk.FileSys().SubDirPrefix(SourceFile);
     for (std::string const& depFileRel : Depends) {
       std::string depFileAbs =
         wrk.Moc().FindIncludedFile(sourceDir, depFileRel);
@@ -853,8 +853,12 @@
     ProcessResultT result;
     if (wrk.RunProcess(GeneratorT::MOC, result, cmd)) {
       // Moc command success
+      // Print moc output
+      if (!result.StdOut.empty()) {
+        wrk.LogInfo(GeneratorT::MOC, result.StdOut);
+      }
+      // Notify the generator that a not included file changed (on demand)
       if (IncludeString.empty()) {
-        // Notify the generator that a not included file changed
         wrk.Gen().ParallelMocAutoUpdated();
       }
     } else {
@@ -963,9 +967,13 @@
 
     ProcessResultT result;
     if (wrk.RunProcess(GeneratorT::UIC, result, cmd)) {
-      // Success
+      // Uic command success
+      // Print uic output
+      if (!result.StdOut.empty()) {
+        wrk.LogInfo(GeneratorT::UIC, result.StdOut);
+      }
     } else {
-      // Command failed
+      // Uic command failed
       {
         std::string emsg = "The uic process failed to compile\n  ";
         emsg += Quoted(SourceFile);
@@ -1416,8 +1424,8 @@
         // Search for the default header file and a private header
         {
           std::array<std::string, 2> bases;
-          bases[0] = SubDirPrefix(src);
-          bases[0] += cmSystemTools::GetFilenameWithoutLastExtension(src);
+          bases[0] = FileSys().SubDirPrefix(src);
+          bases[0] += FileSys().GetFilenameWithoutLastExtension(src);
           bases[1] = bases[0];
           bases[1] += "_p";
           for (std::string const& headerBase : bases) {
@@ -1444,7 +1452,7 @@
   // ------------------------
 
   // Init file path checksum generator
-  Base_.FilePathChecksum.setupParentDirs(
+  FileSys().setupFilePathChecksum(
     Base().CurrentSourceDir, Base().CurrentBinaryDir, Base().ProjectSourceDir,
     Base().ProjectBinaryDir);
 
@@ -1503,8 +1511,8 @@
         if (cmHasLiteralSuffix(path, ".framework/Headers")) {
           // Go up twice to get to the framework root
           std::vector<std::string> pathComponents;
-          cmSystemTools::SplitPath(path, pathComponents);
-          std::string frameworkPath = cmSystemTools::JoinPath(
+          FileSys().SplitPath(path, pathComponents);
+          std::string frameworkPath = FileSys().JoinPath(
             pathComponents.begin(), pathComponents.end() - 2);
           frameworkPaths.insert(frameworkPath);
         }
diff --git a/Source/cmQtAutoGeneratorMocUic.h b/Source/cmQtAutoGeneratorMocUic.h
index 696d5bd..2226954 100644
--- a/Source/cmQtAutoGeneratorMocUic.h
+++ b/Source/cmQtAutoGeneratorMocUic.h
@@ -5,7 +5,6 @@
 
 #include "cmConfigure.h" // IWYU pragma: keep
 
-#include "cmFilePathChecksum.h"
 #include "cmQtAutoGen.h"
 #include "cmQtAutoGenerator.h"
 #include "cmUVHandlePtr.h"
@@ -95,7 +94,6 @@
     std::string AutogenBuildDir;
     std::string AutogenIncludeDir;
     // - Files
-    cmFilePathChecksum FilePathChecksum;
     std::vector<std::string> HeaderExtensions;
     // - File system
     FileSystem* FileSys;
diff --git a/Source/cmQtAutoGeneratorRcc.cxx b/Source/cmQtAutoGeneratorRcc.cxx
index 2bf00f7..84ec5e2 100644
--- a/Source/cmQtAutoGeneratorRcc.cxx
+++ b/Source/cmQtAutoGeneratorRcc.cxx
@@ -533,10 +533,14 @@
     if (Process_->IsFinished()) {
       // Process is finished
       if (!ProcessResult_.error()) {
-        // Process success
+        // Rcc process success
+        // Print rcc output
+        if (!ProcessResult_.StdOut.empty()) {
+          Log().Info(GeneratorT::RCC, ProcessResult_.StdOut);
+        }
         BuildFileChanged_ = true;
       } else {
-        // Process failed
+        // Rcc process failed
         {
           std::string emsg = "The rcc process failed to compile\n  ";
           emsg += Quoted(QrcFile_);
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index ec31bd6..8a9df8f 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1898,7 +1898,14 @@
   std::vector<cmGeneratorTarget::AllConfigSource> const& sources =
     this->GeneratorTarget->GetAllConfigSources();
 
+  cmSourceFile const* srcCMakeLists =
+    this->LocalGenerator->CreateVCProjBuildRule();
+
   for (cmGeneratorTarget::AllConfigSource const& si : sources) {
+    if (si.Source == srcCMakeLists) {
+      // Skip explicit reference to CMakeLists.txt source.
+      continue;
+    }
     std::string tool;
     switch (si.Kind) {
       case cmGeneratorTarget::SourceKindAppManifest:
diff --git a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
index 65487bb..9157c76 100644
--- a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
+++ b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
@@ -349,6 +349,12 @@
 set(aix_xlf90_64_dirs "/usr/lpp/xlf/lib")
 list(APPEND platforms aix_xlf90_64)
 
+# g++ dummy.c -v
+set(aix_g++_text " /prefix/libexec/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/collect2 -bpT:0x10000000 -bpD:0x20000000 -btextro /lib/crt0.o /prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/crtcxa.o /prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/crtdbase.o -L/prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0 -L/prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/../../.. /tmp//ccKROJ1f.o -lstdc++ -lm -lgcc_s /prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/libgcc.a -lc -lgcc_s /prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/libgcc.a")
+set(aix_g++_libs "stdc++;m;gcc_s;/prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/libgcc.a;c;gcc_s;/prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/libgcc.a")
+set(aix_g++_dirs "/prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0;/prefix/lib")
+list(APPEND platforms aix_g++)
+
 #-----------------------------------------------------------------------------
 # HP
 
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index d5bd297..c52f44e 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -335,6 +335,7 @@
 add_RunCMake_test(CommandLineTar)
 
 add_RunCMake_test(install)
+add_RunCMake_test(CPackCommandLine)
 add_RunCMake_test(CPackConfig)
 add_RunCMake_test(CPackInstallProperties)
 add_RunCMake_test(ExternalProject)
diff --git a/Tests/RunCMake/CPackCommandLine/NotAGenerator-result.txt b/Tests/RunCMake/CPackCommandLine/NotAGenerator-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CPackCommandLine/NotAGenerator-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CPackCommandLine/NotAGenerator-stderr.txt b/Tests/RunCMake/CPackCommandLine/NotAGenerator-stderr.txt
new file mode 100644
index 0000000..fe4e455
--- /dev/null
+++ b/Tests/RunCMake/CPackCommandLine/NotAGenerator-stderr.txt
@@ -0,0 +1 @@
+^CPack Error: Cannot initialize CPack generator: NotAGenerator
diff --git a/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake
new file mode 100644
index 0000000..991146c
--- /dev/null
+++ b/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake
@@ -0,0 +1,10 @@
+include(RunCMake)
+set(RunCMake_TEST_TIMEOUT 60)
+
+file(WRITE "${RunCMake_BINARY_DIR}/NotAGenerator-build/CPackConfig.cmake" [[
+set(CPACK_PACKAGE_NAME "Test")
+set(CPACK_PACKAGE_VERSION "1")
+]])
+set(RunCMake_TEST_NO_CLEAN 1)
+run_cmake_command(NotAGenerator ${CMAKE_CPACK_COMMAND} -G NotAGenerator)
+unset(RunCMake_TEST_NO_CLEAN)
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 55eac5e..120a472 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -294,6 +294,10 @@
 run_cmake(trace-expand)
 unset(RunCMake_TEST_OPTIONS)
 
+set(RunCMake_TEST_OPTIONS --trace-expand --warn-uninitialized)
+run_cmake(trace-expand-warn-uninitialized)
+unset(RunCMake_TEST_OPTIONS)
+
 set(RunCMake_TEST_OPTIONS --trace-source=trace-only-this-file.cmake)
 run_cmake(trace-source)
 unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized-stderr.txt b/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized-stderr.txt
new file mode 100644
index 0000000..74429b6
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized-stderr.txt
@@ -0,0 +1,2 @@
+^.*/Tests/RunCMake/CommandLine/CMakeLists.txt\(1\):  cmake_minimum_required\(VERSION 3.0 \)
+.*/Tests/RunCMake/CommandLine/CMakeLists.txt\(2\):  project\(trace-expand-warn-uninitialized NONE \)
diff --git a/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized.cmake b/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized.cmake
new file mode 100644
index 0000000..ec3e4d4
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0053 OLD)
+message(STATUS "'${uninitialized_variable}'")
+cmake_policy(SET CMP0053 NEW)
+message(STATUS "'${uninitialized_variable}'")
diff --git a/Tests/RunCMake/VS10Project/ExplicitCMakeLists-check.cmake b/Tests/RunCMake/VS10Project/ExplicitCMakeLists-check.cmake
new file mode 100644
index 0000000..b671e35
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/ExplicitCMakeLists-check.cmake
@@ -0,0 +1,25 @@
+set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
+if(NOT EXISTS "${vcProjectFile}")
+  set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
+  return()
+endif()
+
+set(foundCMakeLists 0)
+file(STRINGS "${vcProjectFile}" lines)
+foreach(line IN LISTS lines)
+  if(line MATCHES "<([A-Za-z0-9_]+) +Include=.*CMakeLists.txt")
+    set(rule "${CMAKE_MATCH_1}")
+    if(NOT rule STREQUAL "CustomBuild")
+      set(RunCMake_TEST_FAILED "CMakeLists.txt referenced as ${rule} instead of CustomBuild")
+      return()
+    endif()
+    if(foundCMakeLists)
+      set(RunCMake_TEST_FAILED "CMakeLists.txt referenced multiple times")
+      return()
+    endif()
+    set(foundCMakeLists 1)
+  endif()
+endforeach()
+if(NOT foundCMakeLists)
+  set(RunCMake_TEST_FAILED "CMakeLists.txt not referenced")
+endif()
diff --git a/Tests/RunCMake/VS10Project/ExplicitCMakeLists.cmake b/Tests/RunCMake/VS10Project/ExplicitCMakeLists.cmake
new file mode 100644
index 0000000..c9e4456
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/ExplicitCMakeLists.cmake
@@ -0,0 +1,3 @@
+set(CMAKE_CONFIGURATION_TYPES Debug)
+enable_language(CXX)
+add_executable(foo foo.cpp ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt)
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 7100b31..a8d806f 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -1,4 +1,7 @@
 include(RunCMake)
+
+run_cmake(ExplicitCMakeLists)
+
 run_cmake(VsConfigurationType)
 run_cmake(VsTargetsFileReferences)
 run_cmake(VsCustomProps)
diff --git a/Tests/RunCMake/XcodeProject/ExplicitCMakeLists-check.cmake b/Tests/RunCMake/XcodeProject/ExplicitCMakeLists-check.cmake
new file mode 100644
index 0000000..3073e0b
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/ExplicitCMakeLists-check.cmake
@@ -0,0 +1,20 @@
+set(xcProjectFile "${RunCMake_TEST_BINARY_DIR}/ExplicitCMakeLists.xcodeproj/project.pbxproj")
+if(NOT EXISTS "${xcProjectFile}")
+  set(RunCMake_TEST_FAILED "Project file ${xcProjectFile} does not exist.")
+  return()
+endif()
+
+set(foundCMakeLists 0)
+file(STRINGS "${xcProjectFile}" lines)
+foreach(line IN LISTS lines)
+  if(line MATCHES "PBXBuildFile.*fileRef.*CMakeLists.txt")
+    if(foundCMakeLists)
+      set(RunCMake_TEST_FAILED "CMakeLists.txt referenced multiple times")
+      return()
+    endif()
+    set(foundCMakeLists 1)
+  endif()
+endforeach()
+if(NOT foundCMakeLists)
+  set(RunCMake_TEST_FAILED "CMakeLists.txt not referenced")
+endif()
diff --git a/Tests/RunCMake/XcodeProject/ExplicitCMakeLists.cmake b/Tests/RunCMake/XcodeProject/ExplicitCMakeLists.cmake
new file mode 100644
index 0000000..678b0ea
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/ExplicitCMakeLists.cmake
@@ -0,0 +1,2 @@
+enable_language(CXX)
+add_executable(foo foo.cpp ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt)
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index 5eff6b9..1150666 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -4,6 +4,8 @@
   set(IOS_DEPLOYMENT_TARGET "-DCMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET=10")
 endif()
 
+run_cmake(ExplicitCMakeLists)
+
 run_cmake(XcodeFileType)
 run_cmake(XcodeAttributeLocation)
 run_cmake(XcodeAttributeGenex)