Browse Source

Merge topic 'make-GENERATED-visible-from-any-scope'

573d51201a GENERATED prop: Set CMP0118 to NEW for some (unrelated) tests
6624b65b3f GENERATED prop: Add implementation for policy CMP0118 being set to NEW
b14fe704f8 GENERATED prop: Simplify determining the language of a source file
ca4ce458a3 GENERATED prop: Check CMP0118 policy and warn in certain situations
0eb30f175e GENERATED prop: Introducing policy CMP0118 and its documentation
78c8d95605 GENERATED prop: Add some tests before introducing changes with CMP0118
e01527619f Simplify code by calling a function directly instead of duplicating it
75cb8615e9 Fix typo in function name

Acked-by: Kitware Robot <[email protected]>
Merge-request: !5308
Brad King 4 years ago
parent
commit
0173cdcc01
100 changed files with 2849 additions and 56 deletions
  1. 5 0
      Help/command/get_property.rst
  2. 5 0
      Help/command/get_source_file_property.rst
  3. 5 0
      Help/command/set_property.rst
  4. 5 0
      Help/command/set_source_files_properties.rst
  5. 1 0
      Help/manual/cmake-policies.7.rst
  6. 17 0
      Help/policy/CMP0118.rst
  7. 11 0
      Help/prop_sf/GENERATED.rst
  8. 7 0
      Help/release/dev/make-GENERATED-visible-from-any-scope.rst
  9. 5 0
      Source/cmCPluginAPI.cxx
  10. 1 6
      Source/cmGeneratorExpressionEvaluationFile.cxx
  11. 1 1
      Source/cmGetPropertyCommand.cxx
  12. 1 1
      Source/cmGetSourceFilePropertyCommand.cxx
  13. 11 0
      Source/cmGlobalGenerator.cxx
  14. 8 0
      Source/cmGlobalGenerator.h
  15. 2 6
      Source/cmMakefile.cxx
  16. 5 1
      Source/cmPolicies.h
  17. 1 1
      Source/cmQtAutoGenInitializer.cxx
  18. 102 3
      Source/cmSetPropertyCommand.cxx
  19. 14 1
      Source/cmSetPropertyCommand.h
  20. 9 2
      Source/cmSetSourceFilesPropertiesCommand.cxx
  21. 53 24
      Source/cmSourceFile.cxx
  22. 28 8
      Source/cmSourceFile.h
  23. 1 1
      Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake
  24. 1 1
      Tests/RunCMake/CMP0026/clear-cached-information.cmake
  25. 14 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Helper.cmake
  26. 9 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test1.cmake
  27. 65 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test10.cmake
  28. 65 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test11.cmake
  29. 65 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test12.cmake
  30. 65 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test13.cmake
  31. 65 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test14.cmake
  32. 65 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test15.cmake
  33. 12 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test2.cmake
  34. 66 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake
  35. 66 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake
  36. 66 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake
  37. 66 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake
  38. 78 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake
  39. 44 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test6.cmake
  40. 44 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test7.cmake
  41. 50 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake
  42. 50 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake
  43. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-result.txt
  44. 16 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-stderr.txt
  45. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test1.cmake
  46. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-result.txt
  47. 57 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-stderr.txt
  48. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test10.cmake
  49. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-result.txt
  50. 86 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-stderr.txt
  51. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test11.cmake
  52. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-result.txt
  53. 51 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-stderr.txt
  54. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test12.cmake
  55. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test13-result.txt
  56. 64 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test13-stderr.txt
  57. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test13.cmake
  58. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-result.txt
  59. 57 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-stderr.txt
  60. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test14.cmake
  61. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-result.txt
  62. 86 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-stderr.txt
  63. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test15.cmake
  64. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test2-stderr.txt
  65. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test2.cmake
  66. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-result.txt
  67. 93 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt
  68. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test3.cmake
  69. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-result.txt
  70. 93 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt
  71. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b.cmake
  72. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-result.txt
  73. 173 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-stderr.txt
  74. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test4.cmake
  75. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-result.txt
  76. 173 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-stderr.txt
  77. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b.cmake
  78. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-result.txt
  79. 180 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt
  80. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test5.cmake
  81. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-result.txt
  82. 51 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-stderr.txt
  83. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test6.cmake
  84. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-result.txt
  85. 80 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-stderr.txt
  86. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test7.cmake
  87. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-result.txt
  88. 51 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-stderr.txt
  89. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test8.cmake
  90. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-result.txt
  91. 80 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-stderr.txt
  92. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test9.cmake
  93. 1 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-result.txt
  94. 16 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt
  95. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test1.cmake
  96. 1 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-result.txt
  97. 57 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt
  98. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test10.cmake
  99. 1 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-result.txt
  100. 73 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt

+ 5 - 0
Help/command/get_property.rst

@@ -94,3 +94,8 @@ If ``BRIEF_DOCS`` or ``FULL_DOCS`` is given then the variable is set to a
 string containing documentation for the requested property.  If
 documentation is requested for a property that has not been defined
 ``NOTFOUND`` is returned.
+
+.. note::
+
+  The :prop_sf:`GENERATED` source file property may be globally visible.
+  See its documentation for details.

+ 5 - 0
Help/command/get_source_file_property.rst

@@ -40,3 +40,8 @@ file properties usually control how the file is built. One property that is
 always there is :prop_sf:`LOCATION`.
 
 See also the more general :command:`get_property` command.
+
+.. note::
+
+  The :prop_sf:`GENERATED` source file property may be globally visible.
+  See its documentation for details.

+ 5 - 0
Help/command/set_property.rst

@@ -105,3 +105,8 @@ directly set in the nominated scope, the command will behave as though
 
 See the :manual:`cmake-properties(7)` manual for a list of properties
 in each scope.
+
+.. note::
+
+  The :prop_sf:`GENERATED` source file property may be globally visible.
+  See its documentation for details.

+ 5 - 0
Help/command/set_source_files_properties.rst

@@ -36,3 +36,8 @@ See also the :command:`set_property(SOURCE)` command.
 
 See :ref:`Source File Properties` for the list of properties known
 to CMake.
+
+.. note::
+
+  The :prop_sf:`GENERATED` source file property may be globally visible.
+  See its documentation for details.

+ 1 - 0
Help/manual/cmake-policies.7.rst

@@ -57,6 +57,7 @@ Policies Introduced by CMake 3.20
 .. toctree::
    :maxdepth: 1
 
+   CMP0118: The GENERATED source file property is now visible in all directories. </policy/CMP0118>
    CMP0117: MSVC RTTI flag /GR is not added to CMAKE_CXX_FLAGS by default. </policy/CMP0117>
    CMP0116: Ninja generators transform DEPFILEs from add_custom_command(). </policy/CMP0116>
    CMP0115: Source file extensions must be explicit. </policy/CMP0115>

+ 17 - 0
Help/policy/CMP0118.rst

@@ -0,0 +1,17 @@
+CMP0118
+-------
+
+The :prop_sf:`GENERATED` source file property is now visible in all directories.
+
+Whether or not a source file is generated is an all-or-nothing global
+property of the source.  Consequently, the associated ``GENERATED``
+property is now visible from any directory scope, not only from the scope
+for which it was set.
+
+The ``OLD`` behavior of this policy is to only allow ``GENERATED`` to be
+visible from the directory scope for which it was set.  The ``NEW``
+behavior on the other hand allows it to be visible from any scope.
+
+This policy was introduced in CMake version 3.20.  CMake version |release|
+warns when the policy is not set and uses ``OLD`` behavior. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.

+ 11 - 0
Help/prop_sf/GENERATED.rst

@@ -3,6 +3,9 @@ GENERATED
 
 Is this source file generated as part of the build or CMake process.
 
+.. versionchanged:: 3.20
+  The GENERATED source file property is now visible in all directories.
+
 Tells the internal CMake engine that a source file is generated by an outside
 process such as another build step, or the execution of CMake itself.
 This information is then used to exempt the file from any existence or
@@ -34,3 +37,11 @@ or :prop_tgt:`AUTORCC` functionality, the :prop_gbl:`AUTOGEN_SOURCE_GROUP`,
 :prop_gbl:`AUTOMOC_SOURCE_GROUP` and :prop_gbl:`AUTORCC_SOURCE_GROUP` target
 properties may influence where the generated sources are grouped in the project's
 file lists.
+
+.. note::
+
+  Starting with CMake 3.20 the ``GENERATED`` source file property can be set
+  and retrieved from any directory scope. It is an all-or-nothing property.
+  It also can no longer be removed or unset if it was set to ``TRUE``. Policy
+  :policy:`CMP0118` was introduced to allow supporting the ``OLD`` behavior
+  for some time.

+ 7 - 0
Help/release/dev/make-GENERATED-visible-from-any-scope.rst

@@ -0,0 +1,7 @@
+make-GENERATED-visible-from-any-scope
+-------------------------------------
+
+* The :prop_sf:`GENERATED` source-file property is now visible
+  from any directory scope, regardles in which scope or for what
+  scope it was set.
+  See policy :policy:`CMP0118`.

+ 5 - 0
Source/cmCPluginAPI.cxx

@@ -550,6 +550,11 @@ void* CCONV cmAddSource(void* arg, void* arg2)
   // Create the real cmSourceFile instance and copy over saved information.
   cmSourceFile* rsf = mf->GetOrCreateSource(osf->FullPath);
   rsf->SetProperties(osf->Properties);
+  // In case the properties contain the GENERATED property,
+  // mark the real cmSourceFile as generated.
+  if (rsf->GetIsGenerated()) {
+    rsf->MarkAsGenerated();
+  }
   for (std::string const& d : osf->Depends) {
     rsf->AddDepend(d);
   }

+ 1 - 6
Source/cmGeneratorExpressionEvaluationFile.cxx

@@ -15,7 +15,6 @@
 #include "cmMakefile.h"
 #include "cmMessageType.h"
 #include "cmSourceFile.h"
-#include "cmSourceFileLocationKind.h"
 #include "cmSystemTools.h"
 
 cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile(
@@ -99,11 +98,7 @@ void cmGeneratorExpressionEvaluationFile::CreateOutputFile(
 
   for (std::string const& le : enabledLanguages) {
     std::string const name = this->GetOutputFileName(lg, target, config, le);
-    cmSourceFile* sf = lg->GetMakefile()->GetOrCreateSource(
-      name, false, cmSourceFileLocationKind::Known);
-    // Tell TraceDependencies that the file is not expected to exist
-    // on disk yet.  We generate it after that runs.
-    sf->SetProperty("GENERATED", "1");
+    cmSourceFile* sf = lg->GetMakefile()->GetOrCreateGeneratedSource(name);
 
     // Tell the build system generators that there is no build rule
     // to generate the file.

+ 1 - 1
Source/cmGetPropertyCommand.cxx

@@ -172,7 +172,7 @@ bool cmGetPropertyCommand(std::vector<std::string> const& args,
 
   std::vector<cmMakefile*> source_file_directory_makefiles;
   bool file_scopes_handled =
-    SetPropertyCommand::HandleAndValidateSourceFileDirectortoryScopes(
+    SetPropertyCommand::HandleAndValidateSourceFileDirectoryScopes(
       status, source_file_directory_option_enabled,
       source_file_target_option_enabled, source_file_directories,
       source_file_target_directories, source_file_directory_makefiles);

+ 1 - 1
Source/cmGetSourceFilePropertyCommand.cxx

@@ -35,7 +35,7 @@ bool cmGetSourceFilePropertyCommand(std::vector<std::string> const& args,
 
   std::vector<cmMakefile*> source_file_directory_makefiles;
   bool file_scopes_handled =
-    SetPropertyCommand::HandleAndValidateSourceFileDirectortoryScopes(
+    SetPropertyCommand::HandleAndValidateSourceFileDirectoryScopes(
       status, source_file_directory_option_enabled,
       source_file_target_option_enabled, source_file_directories,
       source_file_target_directories, source_file_directory_makefiles);

+ 11 - 0
Source/cmGlobalGenerator.cxx

@@ -1821,6 +1821,7 @@ void cmGlobalGenerator::ClearGeneratorMembers()
   this->RuleHashes.clear();
   this->DirectoryContentMap.clear();
   this->BinaryDirectories.clear();
+  this->GeneratedFiles.clear();
 }
 
 void cmGlobalGenerator::ComputeTargetObjectDirectory(
@@ -2146,6 +2147,16 @@ void cmGlobalGenerator::AddInstallComponent(const std::string& component)
   }
 }
 
+void cmGlobalGenerator::MarkAsGeneratedFile(const std::string& filepath)
+{
+  this->GeneratedFiles.insert(filepath);
+}
+
+bool cmGlobalGenerator::IsGeneratedFile(const std::string& filepath)
+{
+  return this->GeneratedFiles.find(filepath) != this->GeneratedFiles.end();
+}
+
 void cmGlobalGenerator::EnableInstallTarget()
 {
   this->InstallTargetEnabled = true;

+ 8 - 0
Source/cmGlobalGenerator.h

@@ -11,6 +11,7 @@
 #include <set>
 #include <string>
 #include <unordered_map>
+#include <unordered_set>
 #include <utility>
 #include <vector>
 
@@ -290,6 +291,11 @@ public:
 
   void AddInstallComponent(const std::string& component);
 
+  /** Mark the (absolute path to a) file as generated.  */
+  void MarkAsGeneratedFile(const std::string& filepath);
+  /** Determine if the absolute filepath belongs to a generated file.  */
+  bool IsGeneratedFile(const std::string& filepath);
+
   const std::set<std::string>* GetInstallComponents() const
   {
     return &this->InstallComponents;
@@ -733,6 +739,8 @@ private:
 
   std::map<std::string, std::string> RealPaths;
 
+  std::unordered_set<std::string> GeneratedFiles;
+
 #if !defined(CMAKE_BOOTSTRAP)
   // Pool of file locks
   cmFileLockPool FileLockPool;

+ 2 - 6
Source/cmMakefile.cxx

@@ -3406,11 +3406,7 @@ cmSourceFile* cmMakefile::CreateSource(const std::string& sourceName,
                                        bool generated,
                                        cmSourceFileLocationKind kind)
 {
-  auto sf = cm::make_unique<cmSourceFile>(this, sourceName, kind);
-  if (generated) {
-    sf->SetProperty("GENERATED", "1");
-  }
-
+  auto sf = cm::make_unique<cmSourceFile>(this, sourceName, generated, kind);
   auto name =
     this->GetCMakeInstance()->StripExtension(sf->GetLocation().GetName());
 #if defined(_WIN32) || defined(__APPLE__)
@@ -3442,7 +3438,7 @@ cmSourceFile* cmMakefile::GetOrCreateGeneratedSource(
 {
   cmSourceFile* sf =
     this->GetOrCreateSource(sourceName, true, cmSourceFileLocationKind::Known);
-  sf->SetProperty("GENERATED", "1");
+  sf->MarkAsGenerated(); // In case we did not create the source file.
   return sf;
 }
 

+ 5 - 1
Source/cmPolicies.h

@@ -348,7 +348,11 @@ class cmMakefile;
          20, 0, cmPolicies::WARN)                                             \
   SELECT(POLICY, CMP0117,                                                     \
          "MSVC RTTI flag /GR is not added to CMAKE_CXX_FLAGS by default.", 3, \
-         20, 0, cmPolicies::WARN)
+         20, 0, cmPolicies::WARN)                                             \
+  SELECT(                                                                     \
+    POLICY, CMP0118,                                                          \
+    "The GENERATED source file property is now visible in all directories.",  \
+    3, 20, 0, cmPolicies::WARN)
 
 #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
 #define CM_FOR_EACH_POLICY_ID(POLICY)                                         \

+ 1 - 1
Source/cmQtAutoGenInitializer.cxx

@@ -1624,7 +1624,7 @@ cmSourceFile* cmQtAutoGenInitializer::RegisterGeneratedSource(
   std::string const& filename)
 {
   cmSourceFile* gFile = this->Makefile->GetOrCreateSource(filename, true);
-  gFile->SetProperty("GENERATED", "1");
+  gFile->MarkAsGenerated();
   gFile->SetProperty("SKIP_AUTOGEN", "1");
   return gFile;
 }

+ 102 - 3
Source/cmSetPropertyCommand.cxx

@@ -10,9 +10,12 @@
 #include "cmGlobalGenerator.h"
 #include "cmInstalledFile.h"
 #include "cmMakefile.h"
+#include "cmMessageType.h"
+#include "cmPolicies.h"
 #include "cmProperty.h"
 #include "cmRange.h"
 #include "cmSourceFile.h"
+#include "cmSourceFileLocation.h"
 #include "cmState.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
@@ -157,7 +160,7 @@ bool HandleSourceFileDirectoryScopeValidation(
   return true;
 }
 
-bool HandleAndValidateSourceFileDirectortoryScopes(
+bool HandleAndValidateSourceFileDirectoryScopes(
   cmExecutionStatus& status, bool source_file_directory_option_enabled,
   bool source_file_target_option_enabled,
   std::vector<std::string>& source_file_directories,
@@ -216,8 +219,92 @@ void MakeSourceFilePathsAbsoluteIfNeeded(
     source_files_absolute_paths.push_back(absolute_file_path);
   }
 }
+
+bool HandleAndValidateSourceFilePropertyGENERATED(
+  cmSourceFile* sf, std::string const& propertyValue, PropertyOp op)
+{
+  auto& mf = *sf->GetLocation().GetMakefile();
+  auto policyStatus = mf.GetPolicyStatus(cmPolicies::CMP0118);
+
+  const bool policyWARN = policyStatus == cmPolicies::WARN;
+  const bool policyNEW = policyStatus != cmPolicies::OLD && !policyWARN;
+
+  if (policyWARN) {
+    if (!cmIsOn(propertyValue) && !cmIsOff(propertyValue)) {
+      mf.IssueMessage(
+        MessageType::AUTHOR_WARNING,
+        cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0118),
+                 "\nAttempt to set property 'GENERATED' with the following "
+                 "non-boolean value (which will be interpreted as \"0\"):\n",
+                 propertyValue,
+                 "\nThat exact value will not be retrievable. A value of "
+                 "\"0\" will be returned instead.\n"
+                 "This will be an error under policy CMP0118.\n"));
+    }
+    if (cmIsOff(propertyValue)) {
+      mf.IssueMessage(
+        MessageType::AUTHOR_WARNING,
+        cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0118),
+                 "\nUnsetting property 'GENERATED' will not be allowed under "
+                 "policy CMP0118!\n"));
+    }
+    if (op == PropertyOp::Append || op == PropertyOp::AppendAsString) {
+      mf.IssueMessage(
+        MessageType::AUTHOR_WARNING,
+        cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0118),
+                 "\nAppending to property 'GENERATED' will not be allowed "
+                 "under policy CMP0118!\n"));
+    }
+  } else if (policyNEW) {
+    if (!cmIsOn(propertyValue) && !cmIsOff(propertyValue)) {
+      mf.IssueMessage(
+        MessageType::AUTHOR_ERROR,
+        cmStrCat(
+          "Policy CMP0118 is set to NEW and the following non-boolean value "
+          "given for property 'GENERATED' is therefore not allowed:\n",
+          propertyValue, "\nReplace it with a boolean value!\n"));
+      return true;
+    }
+    if (cmIsOff(propertyValue)) {
+      mf.IssueMessage(
+        MessageType::AUTHOR_ERROR,
+        "Unsetting the 'GENERATED' property is not allowed under CMP0118!\n");
+      return true;
+    }
+    if (op == PropertyOp::Append || op == PropertyOp::AppendAsString) {
+      mf.IssueMessage(MessageType::AUTHOR_ERROR,
+                      "Policy CMP0118 is set to NEW and appending to the "
+                      "'GENERATED' property is therefore not allowed. Only "
+                      "setting it to \"1\" is allowed!\n");
+      return true;
+    }
+  }
+
+  // Set property.
+  if (!policyNEW) {
+    // Do it the traditional way.
+    switch (op) {
+      case PropertyOp::Append:
+        sf->AppendProperty("GENERATED", propertyValue, false);
+        break;
+      case PropertyOp::AppendAsString:
+        sf->AppendProperty("GENERATED", propertyValue, true);
+        break;
+      case PropertyOp::Remove:
+        sf->SetProperty("GENERATED", nullptr);
+        break;
+      case PropertyOp::Set:
+        sf->SetProperty("GENERATED", propertyValue.c_str());
+        break;
+    }
+  } else {
+    sf->MarkAsGenerated();
+  }
+  return true;
 }
 
+} // END: namespace SetPropertyCommand
+
 bool cmSetPropertyCommand(std::vector<std::string> const& args,
                           cmExecutionStatus& status)
 {
@@ -324,7 +411,7 @@ bool cmSetPropertyCommand(std::vector<std::string> const& args,
 
   std::vector<cmMakefile*> source_file_directory_makefiles;
   bool file_scopes_handled =
-    SetPropertyCommand::HandleAndValidateSourceFileDirectortoryScopes(
+    SetPropertyCommand::HandleAndValidateSourceFileDirectoryScopes(
       status, source_file_directory_option_enabled,
       source_file_target_option_enabled, source_file_directories,
       source_file_target_directories, source_file_directory_makefiles);
@@ -367,7 +454,7 @@ bool cmSetPropertyCommand(std::vector<std::string> const& args,
   return true;
 }
 
-namespace {
+namespace /* anonymous */ {
 bool HandleGlobalMode(cmExecutionStatus& status,
                       const std::set<std::string>& names,
                       const std::string& propertyName,
@@ -525,6 +612,18 @@ bool HandleSource(cmSourceFile* sf, const std::string& propertyName,
                   const std::string& propertyValue, bool appendAsString,
                   bool appendMode, bool remove)
 {
+  // Special validation and handling of GENERATED flag?
+  if (propertyName == "GENERATED") {
+    SetPropertyCommand::PropertyOp op = (remove)
+      ? SetPropertyCommand::PropertyOp::Remove
+      : (appendAsString)
+        ? SetPropertyCommand::PropertyOp::AppendAsString
+        : (appendMode) ? SetPropertyCommand::PropertyOp::Append
+                       : SetPropertyCommand::PropertyOp::Set;
+    return SetPropertyCommand::HandleAndValidateSourceFilePropertyGENERATED(
+      sf, propertyValue, op);
+  }
+
   // Set or append the property.
   if (appendMode) {
     sf->AppendProperty(propertyName, propertyValue, appendAsString);

+ 14 - 1
Source/cmSetPropertyCommand.h

@@ -9,6 +9,7 @@
 
 class cmMakefile;
 class cmExecutionStatus;
+class cmSourceFile;
 
 bool cmSetPropertyCommand(std::vector<std::string> const& args,
                           cmExecutionStatus& status);
@@ -25,7 +26,7 @@ bool HandleSourceFileDirectoryScopeValidation(
   std::vector<std::string>& source_file_directories,
   std::vector<std::string>& source_file_target_directories);
 
-bool HandleAndValidateSourceFileDirectortoryScopes(
+bool HandleAndValidateSourceFileDirectoryScopes(
   cmExecutionStatus& status, bool source_directories_option_encountered,
   bool source_target_directories_option_encountered,
   std::vector<std::string>& source_directories,
@@ -39,4 +40,16 @@ void MakeSourceFilePathsAbsoluteIfNeeded(
   std::vector<std::string>& source_files_absolute_paths,
   std::vector<std::string>::const_iterator files_it_begin,
   std::vector<std::string>::const_iterator files_it_end, bool needed);
+
+enum class PropertyOp
+{
+  Remove,
+  Set,
+  Append,
+  AppendAsString
+};
+
+bool HandleAndValidateSourceFilePropertyGENERATED(
+  cmSourceFile* sf, std::string const& propertyValue,
+  PropertyOp op = PropertyOp::Set);
 }

+ 9 - 2
Source/cmSetSourceFilesPropertiesCommand.cxx

@@ -7,6 +7,7 @@
 
 #include <cm/string_view>
 #include <cmext/algorithm>
+#include <cmext/string_view>
 
 #include "cmExecutionStatus.h"
 #include "cmMakefile.h"
@@ -82,7 +83,7 @@ bool cmSetSourceFilesPropertiesCommand(std::vector<std::string> const& args,
   const auto props_begin = options_it;
 
   bool file_scopes_handled =
-    SetPropertyCommand::HandleAndValidateSourceFileDirectortoryScopes(
+    SetPropertyCommand::HandleAndValidateSourceFileDirectoryScopes(
       status, source_file_directory_option_enabled,
       source_file_target_option_enabled, source_file_directories,
       source_file_target_directories, source_file_directory_makefiles);
@@ -167,7 +168,13 @@ static bool RunCommandForScope(
     if (cmSourceFile* sf = mf->GetOrCreateSource(sfname)) {
       // loop through the props and set them
       for (auto k = propertyPairs.begin(); k != propertyPairs.end(); k += 2) {
-        sf->SetProperty(*k, (k + 1)->c_str());
+        // Special handling for GENERATED property?
+        if (*k == "GENERATED"_s) {
+          SetPropertyCommand::HandleAndValidateSourceFilePropertyGENERATED(
+            sf, *(k + 1));
+        } else {
+          sf->SetProperty(*k, (k + 1)->c_str());
+        }
       }
     }
   }

+ 53 - 24
Source/cmSourceFile.cxx

@@ -16,9 +16,12 @@
 #include "cmake.h"
 
 cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name,
-                           cmSourceFileLocationKind kind)
-  : Location(mf, name, kind)
+                           bool generated, cmSourceFileLocationKind kind)
+  : Location(mf, name, (!generated) ? kind : cmSourceFileLocationKind::Known)
 {
+  if (generated) {
+    this->MarkAsGenerated();
+  }
 }
 
 std::string const& cmSourceFile::GetExtension() const
@@ -26,6 +29,8 @@ std::string const& cmSourceFile::GetExtension() const
   return this->Extension;
 }
 
+const std::string propTRUE = "1";
+const std::string propFALSE = "0";
 const std::string cmSourceFile::propLANGUAGE = "LANGUAGE";
 const std::string cmSourceFile::propLOCATION = "LOCATION";
 const std::string cmSourceFile::propGENERATED = "GENERATED";
@@ -55,16 +60,14 @@ std::string const& cmSourceFile::GetOrDetermineLanguage()
   }
 
   // Perform computation needed to get the language if necessary.
-  if (this->FullPath.empty() && this->Language.empty()) {
-    // If a known extension is given or a known full path is given
-    // then trust that the current extension is sufficient to
-    // determine the language.  This will fail only if the user
-    // specifies a full path to the source but leaves off the
-    // extension, which is kind of weird.
-    if (this->Location.ExtensionIsAmbiguous() &&
+  if (this->Language.empty()) {
+    // If a known extension is given or a known full path is given then trust
+    // that the current extension is sufficient to determine the language. This
+    // will fail only if the user specifies a full path to the source but
+    // leaves off the extension, which is kind of weird.
+    if (this->FullPath.empty() && this->Location.ExtensionIsAmbiguous() &&
         this->Location.DirectoryIsAmbiguous()) {
-      // Finalize the file location to get the extension and set the
-      // language.
+      // Finalize the file location to get the extension and set the language.
       this->ResolveFullPath();
     } else {
       // Use the known extension to get the language if possible.
@@ -114,11 +117,14 @@ bool cmSourceFile::FindFullPath(std::string* error,
                                 std::string* cmp0115Warning)
 {
   // If the file is generated compute the location without checking on disk.
-  if (this->GetIsGenerated()) {
+  // Note: We also check for a locally set GENERATED property, because
+  //       it might have been set before policy CMP0118 was set to NEW.
+  if (this->GetIsGenerated(CheckScope::GlobalAndLocal)) {
     // The file is either already a full path or is relative to the
     // build directory for the target.
     this->Location.DirectoryUseBinary();
     this->FullPath = this->Location.GetFullPath();
+    this->FindFullPathFailed = false;
     return true;
   }
 
@@ -275,11 +281,6 @@ void cmSourceFile::SetProperty(const std::string& prop, const char* value)
   } else {
     this->Properties.SetProperty(prop, value);
   }
-
-  // Update IsGenerated flag
-  if (prop == propGENERATED) {
-    this->IsGenerated = cmIsOn(value);
-  }
 }
 
 void cmSourceFile::AppendProperty(const std::string& prop,
@@ -303,11 +304,6 @@ void cmSourceFile::AppendProperty(const std::string& prop,
   } else {
     this->Properties.AppendProperty(prop, value, asString);
   }
-
-  // Update IsGenerated flag
-  if (prop == propGENERATED) {
-    this->IsGenerated = this->GetPropertyAsBool(propGENERATED);
-  }
 }
 
 cmProp cmSourceFile::GetPropertyForUser(const std::string& prop)
@@ -338,6 +334,21 @@ cmProp cmSourceFile::GetPropertyForUser(const std::string& prop)
     return &this->GetOrDetermineLanguage();
   }
 
+  // Special handling for GENERATED property.
+  if (prop == propGENERATED) {
+    // We need to check policy CMP0118 in order to determine if we need to
+    // possibly consider the value of a locally set GENERATED property, too.
+    auto policyStatus =
+      this->Location.GetMakefile()->GetPolicyStatus(cmPolicies::CMP0118);
+    if (this->GetIsGenerated(
+          (policyStatus == cmPolicies::WARN || policyStatus == cmPolicies::OLD)
+            ? CheckScope::GlobalAndLocal
+            : CheckScope::Global)) {
+      return &propTRUE;
+    }
+    return &propFALSE;
+  }
+
   // Perform the normal property lookup.
   return this->GetProperty(prop);
 }
@@ -413,11 +424,29 @@ bool cmSourceFile::GetPropertyAsBool(const std::string& prop) const
   return cmIsOn(this->GetProperty(prop));
 }
 
+void cmSourceFile::MarkAsGenerated()
+{
+  this->IsGenerated = true;
+  auto& mf = *this->Location.GetMakefile();
+  mf.GetGlobalGenerator()->MarkAsGeneratedFile(this->ResolveFullPath());
+}
+
+bool cmSourceFile::GetIsGenerated(CheckScope checkScope) const
+{
+  if (this->IsGenerated) {
+    // Globally marked as generated!
+    return true;
+  }
+  if (checkScope == CheckScope::GlobalAndLocal) {
+    // Check locally stored properties.
+    return this->GetPropertyAsBool(propGENERATED);
+  }
+  return false;
+}
+
 void cmSourceFile::SetProperties(cmPropertyMap properties)
 {
   this->Properties = std::move(properties);
-
-  this->IsGenerated = this->GetPropertyAsBool(propGENERATED);
 }
 
 cmCustomCommand* cmSourceFile::GetCustomCommand() const

+ 28 - 8
Source/cmSourceFile.h

@@ -20,18 +20,18 @@ class cmMakefile;
 /** \class cmSourceFile
  * \brief Represent a class loaded from a makefile.
  *
- * cmSourceFile is represents a class loaded from
- * a makefile.
+ * cmSourceFile represents a class loaded from a makefile.
  */
 class cmSourceFile
 {
 public:
   /**
-   * Construct with the makefile storing the source and the initial
-   * name referencing it.
+   * Construct with the makefile storing the source and the initial name
+   * referencing it. If it shall be marked as generated, this source file's
+   * kind is assumed to be known, regardless of the given value.
    */
   cmSourceFile(
-    cmMakefile* mf, const std::string& name,
+    cmMakefile* mf, const std::string& name, bool generated,
     cmSourceFileLocationKind kind = cmSourceFileLocationKind::Ambiguous);
 
   /**
@@ -54,9 +54,29 @@ public:
       command like get_property or get_source_file_property.  */
   cmProp GetPropertyForUser(const std::string& prop);
 
-  //! Checks is the GENERATED property is set and true
-  /// @return Equivalent to GetPropertyAsBool("GENERATED")
-  bool GetIsGenerated() const { return this->IsGenerated; }
+  /// Marks this file as generated
+  /**
+   * This stores this file's path in the global table for all generated source
+   * files.
+   */
+  void MarkAsGenerated();
+  enum class CheckScope
+  {
+    Global,
+    GlobalAndLocal
+  };
+  /// Determines if this source file is marked as generated.
+  /**
+   * This will check if this file's path is stored in the global table of all
+   * generated source files. If that is not the case and checkScope is set to
+   * GlobalAndLocal the value of the possibly existing local GENERATED property
+   * is returned instead.
+   * @param checkScope Determines if alternatively for backwards-compatibility
+   * a local GENERATED property should be considered, too.
+   * @return true if this source file is marked as generated, otherwise false.
+   */
+  bool GetIsGenerated(
+    CheckScope checkScope = CheckScope::GlobalAndLocal) const;
 
   const std::vector<BT<std::string>>& GetCompileOptions() const
   {

+ 1 - 1
Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake

@@ -1,4 +1,4 @@
-
+cmake_policy(SET CMP0118 NEW)
 enable_language(CXX)
 
 add_library(foo OBJECT empty.cpp)

+ 1 - 1
Tests/RunCMake/CMP0026/clear-cached-information.cmake

@@ -1,4 +1,4 @@
-
+cmake_policy(SET CMP0118 NEW)
 enable_language(C)
 
 cmake_policy(SET CMP0026 OLD)

+ 14 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Helper.cmake

@@ -0,0 +1,14 @@
+macro(get_and_print_GENERATED_property filename)
+  get_property(prop SOURCE      "${CMAKE_CURRENT_BINARY_DIR}/${filename}" PROPERTY GENERATED)
+  message(NOTICE "${filename}: # 1a # GENERATED = `${prop}`")
+  get_source_file_property(prop "${CMAKE_CURRENT_BINARY_DIR}/${filename}" GENERATED)
+  message(NOTICE "${filename}: # 1b # GENERATED = `${prop}`")
+  get_property(prop SOURCE      "${filename}"                             PROPERTY GENERATED)
+  message(NOTICE "${filename}: # 2a # GENERATED = `${prop}`")
+  get_source_file_property(prop "${filename}"                             GENERATED)
+  message(NOTICE "${filename}: # 2b # GENERATED = `${prop}`")
+  get_property(prop SOURCE      "${CMAKE_CURRENT_SOURCE_DIR}/${filename}" PROPERTY GENERATED)
+  message(NOTICE "${filename}: # 3a # GENERATED = `${prop}`")
+  get_source_file_property(prop "${CMAKE_CURRENT_SOURCE_DIR}/${filename}" GENERATED)
+  message(NOTICE "${filename}: # 3b # GENERATED = `${prop}`")
+endmacro()

+ 9 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test1.cmake

@@ -0,0 +1,9 @@
+add_executable(executable)
+target_sources(executable PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.cpp"
+)
+
+get_property(prop SOURCE
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.cpp"
+  PROPERTY GENERATED)
+message(NOTICE "prop: `${prop}`")

+ 65 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test10.cmake

@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+# The sources of executable0 will not be modified by set_property!
+add_executable(executable0)
+target_sources(executable0 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+# The sources of executable[1-6] will (tried to) be modified by set_property!
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+add_custom_command(
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+add_custom_command(
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_custom_command(
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_custom_command(
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+
+add_subdirectory(subdir-Common-Test10)
+
+get_and_print_GENERATED_property("Generated_source0.cpp")
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")

+ 65 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test11.cmake

@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+# The sources of executable0 will not be modified by set_property!
+add_executable(executable0)
+target_sources(executable0 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+# The sources of executable[1-6] will (tried to) be modified by set_property!
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+add_custom_command(
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+add_custom_command(
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_custom_command(
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_custom_command(
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+
+add_subdirectory(subdir-Common-Test11)
+
+get_and_print_GENERATED_property("Generated_source0.cpp")
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")

+ 65 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test12.cmake

@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+# The sources of executable0 will not be modified by set_property!
+add_executable(executable0)
+target_sources(executable0 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+# The sources of executable[1-6] will (tried to) be modified by set_property!
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+add_custom_command(TARGET executable0 PRE_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+add_custom_command(TARGET executable1 PRE_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_custom_command(TARGET executable2 PRE_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_custom_command(TARGET executable3 PRE_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+
+add_subdirectory(subdir-Common-Test12)
+
+get_and_print_GENERATED_property("Generated_source0.cpp")
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")

+ 65 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test13.cmake

@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+# The sources of executable0 will not be modified by set_property!
+add_executable(executable0)
+target_sources(executable0 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+# The sources of executable[1-6] will (tried to) be modified by set_property!
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+add_custom_command(TARGET executable0 PRE_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+add_custom_command(TARGET executable1 PRE_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_custom_command(TARGET executable2 PRE_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_custom_command(TARGET executable3 PRE_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+
+add_subdirectory(subdir-Common-Test13)
+
+get_and_print_GENERATED_property("Generated_source0.cpp")
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")

+ 65 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test14.cmake

@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+# The sources of executable0 will not be modified by set_property!
+add_executable(executable0)
+target_sources(executable0 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+# The sources of executable[1-6] will (tried to) be modified by set_property!
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+add_custom_target(executable0_source_generator ALL
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+add_custom_target(executable1_source_generator ALL
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_custom_target(executable2_source_generator ALL
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_custom_target(executable3_source_generator ALL
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+
+add_subdirectory(subdir-Common-Test14)
+
+get_and_print_GENERATED_property("Generated_source0.cpp")
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")

+ 65 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test15.cmake

@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+# The sources of executable0 will not be modified by set_property!
+add_executable(executable0)
+target_sources(executable0 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+# The sources of executable[1-6] will (tried to) be modified by set_property!
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+add_custom_target(executable0_source_generator ALL
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+add_custom_target(executable1_source_generator ALL
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_custom_target(executable2_source_generator ALL
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_custom_target(executable3_source_generator ALL
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+
+add_subdirectory(subdir-Common-Test15)
+
+get_and_print_GENERATED_property("Generated_source0.cpp")
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")

+ 12 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test2.cmake

@@ -0,0 +1,12 @@
+add_executable(executable)
+target_sources(executable PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.cpp"
+)
+
+set_property(SOURCE
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.cpp"
+  PROPERTY GENERATED "1")
+get_property(prop SOURCE
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.cpp"
+  PROPERTY GENERATED)
+message(NOTICE "prop: `${prop}`")

+ 66 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake

@@ -0,0 +1,66 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.cpp"
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "Generated_with_relative_path1.cpp"
+  "Generated_with_relative_path2.cpp"
+  "Generated_with_relative_path3.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_path2.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path1.cpp")
+
+set_property(SOURCE "Generated_with_relative_path2.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path2.cpp")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_source_path2.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.cpp")

+ 66 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake

@@ -0,0 +1,66 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_path2.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path1.cpp")
+
+set_property(SOURCE "Generated_with_relative_path2.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path2.cpp")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_source_path2.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.cpp"
+  PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.cpp")
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.cpp"
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "Generated_with_relative_path1.cpp"
+  "Generated_with_relative_path2.cpp"
+  "Generated_with_relative_path3.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.cpp"
+)

+ 66 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake

@@ -0,0 +1,66 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.cpp"
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "Generated_with_relative_path1.cpp"
+  "Generated_with_relative_path2.cpp"
+  "Generated_with_relative_path3.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_path2.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path1.cpp")
+
+set_property(SOURCE "Generated_with_relative_path2.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path2.cpp")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_source_path2.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.cpp")

+ 66 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake

@@ -0,0 +1,66 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_path2.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path1.cpp")
+
+set_property(SOURCE "Generated_with_relative_path2.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path2.cpp")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_source_path2.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.cpp"
+  PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.cpp")
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.cpp"
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "Generated_with_relative_path1.cpp"
+  "Generated_with_relative_path2.cpp"
+  "Generated_with_relative_path3.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.cpp"
+)

+ 78 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake

@@ -0,0 +1,78 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "Generated_with_relative_path1.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "Generated_with_relative_path2.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+  "Generated_with_relative_path3.cpp"
+)
+add_executable(executable7)
+target_sources(executable7 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.cpp"
+)
+add_executable(executable8)
+target_sources(executable8 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.cpp"
+)
+add_executable(executable9)
+target_sources(executable9 PRIVATE
+  "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+  PROPERTY GENERATED "tRue")
+get_and_print_GENERATED_property("Generated_with_full_path1.cpp")
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.cpp"
+  PROPERTY GENERATED "SomeVar-NOTFOUND")
+get_and_print_GENERATED_property("Generated_with_full_path2.cpp")
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.cpp"
+  PROPERTY GENERATED "Junk-value")
+get_and_print_GENERATED_property("Generated_with_full_path3.cpp")
+
+
+set_property(SOURCE "Generated_with_relative_path1.cpp"
+  PROPERTY GENERATED "tRue")
+get_and_print_GENERATED_property("Generated_with_relative_path1.cpp")
+
+set_property(SOURCE "Generated_with_relative_path2.cpp"
+  PROPERTY GENERATED "SomeVar-NOTFOUND")
+get_and_print_GENERATED_property("Generated_with_relative_path2.cpp")
+
+set_property(SOURCE "Generated_with_relative_path3.cpp"
+  PROPERTY GENERATED "Junk-value")
+get_and_print_GENERATED_property("Generated_with_relative_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.cpp"
+  PROPERTY GENERATED "tRue")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.cpp")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.cpp"
+  PROPERTY GENERATED "SomeVar-NOTFOUND")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.cpp"
+  PROPERTY GENERATED "Junk-value")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.cpp")

+ 44 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test6.cmake

@@ -0,0 +1,44 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+  PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+  PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+  PROPERTY GENERATED "1")
+
+add_subdirectory(subdir-Common-Test6)
+
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")

+ 44 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test7.cmake

@@ -0,0 +1,44 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+  PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+  PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+  PROPERTY GENERATED "1")
+
+add_subdirectory(subdir-Common-Test7)
+
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")

+ 50 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake

@@ -0,0 +1,50 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+
+add_subdirectory(subdir-Common-Test8)
+
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")

+ 50 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake

@@ -0,0 +1,50 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+
+add_subdirectory(subdir-Common-Test9)
+
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-result.txt

@@ -0,0 +1 @@
+1

+ 16 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-stderr.txt

@@ -0,0 +1,16 @@
+^prop: `0`
+CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-build/GeneratedMain\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test1\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test1\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test1.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test1.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-result.txt

@@ -0,0 +1 @@
+1

+ 57 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-stderr.txt

@@ -0,0 +1,57 @@
+^Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test10\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test10\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test10\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test10\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test10.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test10.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-result.txt

@@ -0,0 +1 @@
+1

+ 86 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-stderr.txt

@@ -0,0 +1,86 @@
+^(CMake Warning \(dev\) at subdir-Common-Test11/CMakeLists\.txt:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_subdirectory\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test11\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test11\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test11\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test11\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test11\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test11.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test11.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-result.txt

@@ -0,0 +1 @@
+1

+ 51 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-stderr.txt

@@ -0,0 +1,51 @@
+^CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+  TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+  TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+  TARGET 'executable[4-6]' was not created in this directory\.
++
+Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test12.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test12.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test13-result.txt

@@ -0,0 +1 @@
+1

+ 64 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test13-stderr.txt

@@ -0,0 +1,64 @@
+^CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+  TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+  TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+  TARGET 'executable[4-6]' was not created in this directory\.
++
+(CMake Warning \(dev\) at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0118-Common-Test13\.cmake:[0-9]+ \(add_subdirectory\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test13\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test13.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test13.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-result.txt

@@ -0,0 +1 @@
+1

+ 57 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-stderr.txt

@@ -0,0 +1,57 @@
+^Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test14\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test14\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test14\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test14\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test14.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test14.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-result.txt

@@ -0,0 +1 @@
+1

+ 86 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-stderr.txt

@@ -0,0 +1,86 @@
+^(CMake Warning \(dev\) at subdir-Common-Test15/CMakeLists\.txt:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_subdirectory\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test15\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test15\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test15\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test15\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test15\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test15.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test15.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test2-stderr.txt

@@ -0,0 +1 @@
+^prop: `1`$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test2.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test2.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-result.txt

@@ -0,0 +1 @@
+1

+ 93 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt

@@ -0,0 +1,93 @@
+^Generated_with_full_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable[13-5]
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test3.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test3.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-result.txt

@@ -0,0 +1 @@
+1

+ 93 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt

@@ -0,0 +1,93 @@
+^Generated_with_full_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable[13-5]
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test3b.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-result.txt

@@ -0,0 +1 @@
+1

+ 173 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-stderr.txt

@@ -0,0 +1,173 @@
+^CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable[1-5]
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test4.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test4.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-result.txt

@@ -0,0 +1 @@
+1

+ 173 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-stderr.txt

@@ -0,0 +1,173 @@
+^CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable[1-5]
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test4b.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-result.txt

@@ -0,0 +1 @@
+1

+ 180 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt

@@ -0,0 +1,180 @@
+^Generated_with_full_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+  Policy CMP0118 is set to NEW and the following non-boolean value given for
+  property 'GENERATED' is therefore not allowed:
+
+  Junk-value
+
+  Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+  Policy CMP0118 is set to NEW and the following non-boolean value given for
+  property 'GENERATED' is therefore not allowed:
+
+  Junk-value
+
+  Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+  Policy CMP0118 is set to NEW and the following non-boolean value given for
+  property 'GENERATED' is therefore not allowed:
+
+  Junk-value
+
+  Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable[235-9]
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test5.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test5.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-result.txt

@@ -0,0 +1 @@
+1

+ 51 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-stderr.txt

@@ -0,0 +1,51 @@
+^Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test6\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test6\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test6\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test6\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test6.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test6.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-result.txt

@@ -0,0 +1 @@
+1

+ 80 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-stderr.txt

@@ -0,0 +1,80 @@
+^(CMake Warning \(dev\) at subdir-Common-Test7/CMakeLists\.txt:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_subdirectory\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test7\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test7\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test7\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test7\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test7\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test7.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test7.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-result.txt

@@ -0,0 +1 @@
+1

+ 51 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-stderr.txt

@@ -0,0 +1,51 @@
+^Generated_source1\.cpp: # 1a # GENERATED = `0`
+Generated_source1\.cpp: # 1b # GENERATED = `0`
+Generated_source1\.cpp: # 2a # GENERATED = `0`
+Generated_source1\.cpp: # 2b # GENERATED = `0`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test8\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test8\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test8\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test8\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test8.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test8.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-result.txt

@@ -0,0 +1 @@
+1

+ 80 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-stderr.txt

@@ -0,0 +1,80 @@
+^(CMake Warning \(dev\) at subdir-Common-Test9/CMakeLists\.txt:[0-9]+ \(set_property\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_subdirectory\):
+  Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test9\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.cpp: # 1a # GENERATED = `0`
+Generated_source1\.cpp: # 1b # GENERATED = `0`
+Generated_source1\.cpp: # 2a # GENERATED = `0`
+Generated_source1\.cpp: # 2b # GENERATED = `0`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `0`
+Generated_source2\.cpp: # 1b # GENERATED = `0`
+Generated_source2\.cpp: # 2a # GENERATED = `0`
+Generated_source2\.cpp: # 2b # GENERATED = `0`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `0`
+Generated_source3\.cpp: # 1b # GENERATED = `0`
+Generated_source3\.cpp: # 2a # GENERATED = `0`
+Generated_source3\.cpp: # 2b # GENERATED = `0`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test9\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test9\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test9\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test9\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test9.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test9.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-result.txt

@@ -0,0 +1 @@
+1

+ 16 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt

@@ -0,0 +1,16 @@
+^prop: `0`
+CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-build/GeneratedMain\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-OLD-Test1\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable
+Call Stack \(most recent call first\):
+  CMP0118-OLD-Test1\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test1.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test1.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-result.txt

@@ -0,0 +1 @@
+1

+ 57 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt

@@ -0,0 +1,57 @@
+^Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test10\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-OLD-Test10\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test10\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+  CMP0118-OLD-Test10\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 2 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test10.cmake

@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test10.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-result.txt

@@ -0,0 +1 @@
+1

+ 73 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt

@@ -0,0 +1,73 @@
+^Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-OLD-Test11\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-OLD-Test11\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+  CMP0118-OLD-Test11\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+  No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+  CMP0118-OLD-Test11\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

Some files were not shown because too many files changed in this diff