Merge topic 'doc-fixups-release-3.27' into release-3.27

78e7ea598d cmLocalGenerator: Fix trivial spelling error in code comment
1285fe27ff Help: Improve formatting and fix wording for ENABLE_EXPORTS
91336d061c Help: Improve formatting and cross-references for DEPENDS_EXPLICIT_ONLY
03208d9e18 Help: Fix indenting within TARGET_RUNTIME_DLLS genex docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8688
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index acb20d1..3125eb5 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -265,22 +265,6 @@
   auto new_end = std::unique(listFiles.begin(), listFiles.end());
   listFiles.erase(new_end, listFiles.end());
 
-  // Add all cmake input files which are used by the project
-  // so Visual Studio does not close them when reloading it.
-  for (const std::string& listFile : listFiles) {
-    if (listFile.find("/CMakeFiles/") != std::string::npos) {
-      continue;
-    }
-    if (!cmSystemTools::IsSubDirectory(listFile,
-                                       lg.GetMakefile()->GetHomeDirectory()) &&
-        !cmSystemTools::IsSubDirectory(
-          listFile, lg.GetMakefile()->GetHomeOutputDirectory())) {
-      continue;
-    }
-
-    tgt->AddSource(listFile);
-  }
-
   auto ptr = cm::make_unique<cmGeneratorTarget>(tgt, &lg);
   auto* gt = ptr.get();
   lg.AddGeneratorTarget(std::move(ptr));
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 8d6b024..b3699ae 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -9,7 +9,6 @@
 #include <set>
 #include <sstream>
 
-#include <cm/filesystem>
 #include <cm/memory>
 #include <cm/optional>
 #include <cm/string_view>
@@ -52,8 +51,6 @@
 #include "cmValue.h"
 #include "cmVisualStudioGeneratorOptions.h"
 
-const std::string kBuildSystemSources = "Buildsystem Input Files";
-
 struct cmIDEFlagTable;
 
 static void ConvertToWindowsSlash(std::string& s);
@@ -1954,13 +1951,7 @@
                  "http://schemas.microsoft.com/developer/msbuild/2003");
 
     for (auto const& ti : this->Tools) {
-      if ((this->GeneratorTarget->GetName() ==
-           CMAKE_CHECK_BUILD_SYSTEM_TARGET) &&
-          (ti.first == "None")) {
-        this->WriteBuildSystemSources(e0, ti.first, ti.second);
-      } else {
-        this->WriteGroupSources(e0, ti.first, ti.second, sourceGroups);
-      }
+      this->WriteGroupSources(e0, ti.first, ti.second, sourceGroups);
     }
 
     // Added files are images and the manifest.
@@ -2031,18 +2022,6 @@
                    "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;"
                    "gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms");
       }
-
-      if (this->GeneratorTarget->GetName() ==
-          CMAKE_CHECK_BUILD_SYSTEM_TARGET) {
-        for (const std::string& filter : this->BuildSystemSourcesFilters) {
-          std::string guidName = "SG_Filter_";
-          guidName += filter;
-          std::string guid = this->GlobalGenerator->GetGUID(guidName);
-          Elem e2(e1, "Filter");
-          e2.Attribute("Include", filter);
-          e2.Element("UniqueIdentifier", "{" + guid + "}");
-        }
-      }
     }
   }
   fout << '\n';
@@ -2109,39 +2088,6 @@
   }
 }
 
-void cmVisualStudio10TargetGenerator::WriteBuildSystemSources(
-  Elem& e0, std::string const& name, ToolSources const& sources)
-{
-  const std::string srcDir = this->Makefile->GetCurrentSourceDirectory();
-  const std::string::size_type srcDirLength = srcDir.length();
-
-  Elem e1(e0, "ItemGroup");
-  e1.SetHasElements();
-  for (ToolSource const& s : sources) {
-    cmSourceFile const* sf = s.SourceFile;
-    std::string const& source = sf->GetFullPath();
-
-    cm::filesystem::path sourcePath(source);
-    bool isInSrcDir = cmHasPrefix(source, srcDir);
-
-    std::string filter = kBuildSystemSources;
-    if (isInSrcDir) {
-      std::string parentPath = sourcePath.parent_path().string();
-      if (srcDir != parentPath) {
-        filter += parentPath.substr(srcDirLength);
-      }
-      ConvertToWindowsSlash(filter);
-      this->BuildSystemSourcesFilters.insert(filter);
-    }
-
-    std::string path = this->ConvertPath(source, s.RelativePath);
-    ConvertToWindowsSlash(path);
-    Elem e2(e1, name);
-    e2.Attribute("Include", path);
-    e2.Element("Filter", filter);
-  }
-}
-
 void cmVisualStudio10TargetGenerator::WriteHeaderSource(
   Elem& e1, cmSourceFile const* sf, ConfigToSettings const& toolSettings)
 {
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index ffab91f..2080e9e 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -194,9 +194,6 @@
   void WriteGroupSources(Elem& e0, std::string const& name,
                          ToolSources const& sources,
                          std::vector<cmSourceGroup>&);
-  void WriteBuildSystemSources(Elem& e0, std::string const& name,
-                               ToolSources const& sources);
-
   void AddMissingSourceGroups(std::set<cmSourceGroup const*>& groupsUsed,
                               const std::vector<cmSourceGroup>& allGroups);
   bool IsResxHeader(const std::string& headerFile);
@@ -247,7 +244,6 @@
   std::set<std::string> ASanEnabledConfigurations;
   std::set<std::string> FuzzerEnabledConfigurations;
   std::map<std::string, std::string> SpectreMitigation;
-  std::set<std::string> BuildSystemSourcesFilters;
   cmGlobalVisualStudio10Generator* const GlobalGenerator;
   cmLocalVisualStudio10Generator* const LocalGenerator;
   std::set<std::string> CSharpCustomCommandNames;
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index b669543..8911e18 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -897,216 +897,6 @@
                     # The json files have data for Xcode.  Substitute data for VS.
                     e["sources"] = [
                         {
-                            "path": "^CMakeLists\\.txt$",
-                            "isGenerated": None,
-                            "fileSetName": None,
-                            "sourceGroupName": "",
-                            "compileGroupLanguage": None,
-                            "backtrace": [
-                                {
-                                    "file": "^CMakeLists\\.txt$",
-                                    "line": None,
-                                    "command": None,
-                                    "hasParent": False,
-                                },
-                            ],
-                        },
-                        {
-                            "path": "^alias/CMakeLists\\.txt$",
-                            "isGenerated": None,
-                            "fileSetName": None,
-                            "sourceGroupName": "",
-                            "compileGroupLanguage": None,
-                            "backtrace": [
-                                {
-                                    "file": "^CMakeLists\\.txt$",
-                                    "line": None,
-                                    "command": None,
-                                    "hasParent": False,
-                                },
-                            ],
-                        },
-                        {
-                            "path": "^codemodel-v2\\.cmake$",
-                            "isGenerated": None,
-                            "fileSetName": None,
-                            "sourceGroupName": "",
-                            "compileGroupLanguage": None,
-                            "backtrace": [
-                                {
-                                    "file": "^CMakeLists\\.txt$",
-                                    "line": None,
-                                    "command": None,
-                                    "hasParent": False,
-                                },
-                            ],
-                        },
-                        {
-                            "path": "^custom/CMakeLists\\.txt$",
-                            "isGenerated": None,
-                            "fileSetName": None,
-                            "sourceGroupName": "",
-                            "compileGroupLanguage": None,
-                            "backtrace": [
-                                {
-                                    "file": "^CMakeLists\\.txt$",
-                                    "line": None,
-                                    "command": None,
-                                    "hasParent": False,
-                                },
-                            ],
-                        },
-                        {
-                            "path": "^cxx/CMakeLists\\.txt$",
-                            "isGenerated": None,
-                            "fileSetName": None,
-                            "sourceGroupName": "",
-                            "compileGroupLanguage": None,
-                            "backtrace": [
-                                {
-                                    "file": "^CMakeLists\\.txt$",
-                                    "line": None,
-                                    "command": None,
-                                    "hasParent": False,
-                                },
-                            ],
-                        },
-                        {
-                            "path": "^framework/CMakeLists\\.txt$",
-                            "isGenerated": None,
-                            "fileSetName": None,
-                            "sourceGroupName": "",
-                            "compileGroupLanguage": None,
-                            "backtrace": [
-                                {
-                                    "file": "^CMakeLists\\.txt$",
-                                    "line": None,
-                                    "command": None,
-                                    "hasParent": False,
-                                },
-                            ],
-                        },
-                        {
-                            "path": "^dir/CMakeLists\\.txt$",
-                            "isGenerated": None,
-                            "fileSetName": None,
-                            "sourceGroupName": "",
-                            "compileGroupLanguage": None,
-                            "backtrace": [
-                                {
-                                    "file": "^CMakeLists\\.txt$",
-                                    "line": None,
-                                    "command": None,
-                                    "hasParent": False,
-                                },
-                            ],
-                        },
-                        {
-                            "path": "^dir/dir/CMakeLists\\.txt$",
-                            "isGenerated": None,
-                            "fileSetName": None,
-                            "sourceGroupName": "",
-                            "compileGroupLanguage": None,
-                            "backtrace": [
-                                {
-                                    "file": "^CMakeLists\\.txt$",
-                                    "line": None,
-                                    "command": None,
-                                    "hasParent": False,
-                                },
-                            ],
-                        },
-                        {
-                            "path": "^fileset/CMakeLists\\.txt$",
-                            "isGenerated": None,
-                            "fileSetName": None,
-                            "sourceGroupName": "",
-                            "compileGroupLanguage": None,
-                            "backtrace": [
-                                {
-                                    "file": "^CMakeLists\\.txt$",
-                                    "line": None,
-                                    "command": None,
-                                    "hasParent": False,
-                                },
-                            ],
-                        },
-                        {
-                            "path": "^imported/CMakeLists\\.txt$",
-                            "isGenerated": None,
-                            "fileSetName": None,
-                            "sourceGroupName": "",
-                            "compileGroupLanguage": None,
-                            "backtrace": [
-                                {
-                                    "file": "^CMakeLists\\.txt$",
-                                    "line": None,
-                                    "command": None,
-                                    "hasParent": False,
-                                },
-                            ],
-                        },
-                        {
-                            "path": "^include_test\\.cmake$",
-                            "isGenerated": None,
-                            "fileSetName": None,
-                            "sourceGroupName": "",
-                            "compileGroupLanguage": None,
-                            "backtrace": [
-                                {
-                                    "file": "^CMakeLists\\.txt$",
-                                    "line": None,
-                                    "command": None,
-                                    "hasParent": False,
-                                },
-                            ],
-                        },
-                        {
-                            "path": "^interface/CMakeLists\\.txt$",
-                            "isGenerated": None,
-                            "fileSetName": None,
-                            "sourceGroupName": "",
-                            "compileGroupLanguage": None,
-                            "backtrace": [
-                                {
-                                    "file": "^CMakeLists\\.txt$",
-                                    "line": None,
-                                    "command": None,
-                                    "hasParent": False,
-                                },
-                            ],
-                        },
-                        {
-                            "path": "^object/CMakeLists\\.txt$",
-                            "isGenerated": None,
-                            "fileSetName": None,
-                            "sourceGroupName": "",
-                            "compileGroupLanguage": None,
-                            "backtrace": [
-                                {
-                                    "file": "^CMakeLists\\.txt$",
-                                    "line": None,
-                                    "command": None,
-                                    "hasParent": False,
-                                },
-                            ],
-                        },
-                        {
-                            "path": "^subdir/CMakeLists\\.txt$",
-                            "isGenerated": None,
-                            "fileSetName": None,
-                            "sourceGroupName": "",
-                            "compileGroupLanguage": None,
-                            "backtrace": [
-                                {
-                                    "file": "^CMakeLists\\.txt$",
-                                    "line": None,
-                                    "command": None,
-                                    "hasParent": False,
-                                },
-                            ],
-                        },
-                        {
                             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/([0-9a-f]+/)?generate\\.stamp\\.rule$",
                             "isGenerated": True,
                             "fileSetName": None,
@@ -1124,25 +914,6 @@
                     ]
                     e["sourceGroups"] = [
                         {
-                            "name": "",
-                            "sourcePaths": [
-                                "^CMakeLists\\.txt$",
-                                "^alias/CMakeLists\\.txt$",
-                                "^codemodel-v2\\.cmake$",
-                                "^custom/CMakeLists\\.txt$",
-                                "^cxx/CMakeLists\\.txt$",
-                                "^framework/CMakeLists\\.txt$",
-                                "^dir/CMakeLists\\.txt$",
-                                "^dir/dir/CMakeLists\\.txt$",
-                                "^fileset/CMakeLists\\.txt$",
-                                "^imported/CMakeLists\\.txt$",
-                                "^include_test\\.cmake$",
-                                "^interface/CMakeLists\\.txt$",
-                                "^object/CMakeLists\\.txt$",
-                                "^subdir/CMakeLists\\.txt$",
-                            ],
-                        },
-                        {
                             "name": "CMake Rules",
                             "sourcePaths": [
                                 "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/([0-9a-f]+/)?generate\\.stamp\\.rule$",
diff --git a/Tests/RunCMake/VS10Project/CMakeInputs-check.cmake b/Tests/RunCMake/VS10Project/CMakeInputs-check.cmake
deleted file mode 100644
index a125574..0000000
--- a/Tests/RunCMake/VS10Project/CMakeInputs-check.cmake
+++ /dev/null
@@ -1,25 +0,0 @@
-set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/ZERO_CHECK.vcxproj")
-if(NOT EXISTS "${vcProjectFile}")
-  set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
-  return()
-endif()
-
-set(found_CMakeInputs 0)
-file(STRINGS "${vcProjectFile}" lines)
-foreach(line IN LISTS lines)
-  if(line MATCHES "<([A-Za-z0-9_]+) +Include=.*CMakeInputs.cmake")
-    set(rule "${CMAKE_MATCH_1}")
-    if(NOT rule STREQUAL "None")
-      set(RunCMake_TEST_FAILED "CMakeInputs.cmake referenced as ${rule} instead of None")
-      return()
-    endif()
-    if(found_CMakeInputs)
-      set(RunCMake_TEST_FAILED "CMakeInputs.cmake referenced multiple times")
-      return()
-    endif()
-    set(found_CMakeInputs 1)
-  endif()
-endforeach()
-if(NOT found_CMakeInputs)
-  set(RunCMake_TEST_FAILED "CMakeInputs.cmake not referenced")
-endif()
diff --git a/Tests/RunCMake/VS10Project/CMakeInputs.cmake b/Tests/RunCMake/VS10Project/CMakeInputs.cmake
deleted file mode 100644
index e69de29..0000000
--- a/Tests/RunCMake/VS10Project/CMakeInputs.cmake
+++ /dev/null
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index cb1a5d5..669049a 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -7,7 +7,6 @@
   run_cmake(LanguageStandard)
 endif()
 
-run_cmake(CMakeInputs)
 run_cmake(CustomCommandGenex)
 if(NOT RunCMake_GENERATOR MATCHES "^Visual Studio 1[1-5] ")
   run_cmake(CustomCommandParallel)
diff --git a/Tests/RunCMake/add_custom_command/ConfigureFile.cmake b/Tests/RunCMake/add_custom_command/ConfigureFile.cmake
new file mode 100644
index 0000000..ca53a6c
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/ConfigureFile.cmake
@@ -0,0 +1,9 @@
+configure_file(ConfigureFile.in foo.txt @ONLY)
+add_custom_target(foo)
+add_custom_command(
+  OUTPUT bar.txt
+  MAIN_DEPENDENCY ConfigureFile.in # Attach to input of configure_file
+  DEPENDS foo
+  COMMAND ${CMAKE_COMMAND} -E copy foo.txt bar.txt
+  )
+add_custom_target(bar DEPENDS bar.txt)
diff --git a/Tests/RunCMake/add_custom_command/ConfigureFile.in b/Tests/RunCMake/add_custom_command/ConfigureFile.in
new file mode 100644
index 0000000..f89fc33
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/ConfigureFile.in
@@ -0,0 +1 @@
+# ConfigureFile case
diff --git a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
index 6c677c0..713b269 100644
--- a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
@@ -7,6 +7,7 @@
 run_cmake(BadByproduct)
 run_cmake(BadOutput)
 run_cmake(BadCommand)
+run_cmake(ConfigureFile)
 run_cmake(GeneratedProperty)
 run_cmake(LiteralQuotes)
 run_cmake(NoArguments)