فهرست منبع

Merge topic 'doc-CMP0118'

1dabbbb5e0 CMP0118: Revise documentation to describe actual behavior
d2f5b79795 CMP0118: Fix some tests and add more tests

Acked-by: Kitware Robot <[email protected]>
Tested-by: buildbot <[email protected]>
Merge-request: !9358
Brad King 1 سال پیش
والد
کامیت
cff8aefc6a
96فایلهای تغییر یافته به همراه1006 افزوده شده و 275 حذف شده
  1. 1 1
      Help/manual/cmake-policies.7.rst
  2. 17 12
      Help/policy/CMP0118.rst
  3. 5 9
      Help/prop_sf/GENERATED.rst
  4. 3 2
      Help/release/3.20.rst
  5. 4 4
      Source/cmPolicies.h
  6. 38 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test16.cmake
  7. 9 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test1b.cmake
  8. 12 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test2b.cmake
  9. 12 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test2c.cmake
  10. 12 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test2d.cmake
  11. 2 2
      Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake
  12. 2 2
      Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake
  13. 2 2
      Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake
  14. 2 2
      Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake
  15. 2 2
      Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake
  16. 1 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake
  17. 51 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test8b.cmake
  18. 1 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake
  19. 51 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test9b.cmake
  20. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test16-result.txt
  21. 27 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test16-stderr.txt
  22. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test16.cmake
  23. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-result.txt
  24. 10 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-stderr.txt
  25. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b.cmake
  26. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test2b-stderr.txt
  27. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test2b.cmake
  28. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test2c-stderr.txt
  29. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test2c.cmake
  30. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test2d-stderr.txt
  31. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test2d.cmake
  32. 11 19
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt
  33. 11 19
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt
  34. 10 18
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt
  35. 36 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test8b-stderr.txt
  36. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test8b.cmake
  37. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-result.txt
  38. 61 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-stderr.txt
  39. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b.cmake
  40. 1 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test16-result.txt
  41. 38 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test16-stderr.txt
  42. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test16.cmake
  43. 1 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-result.txt
  44. 21 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-stderr.txt
  45. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b.cmake
  46. 12 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test2b-stderr.txt
  47. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test2b.cmake
  48. 12 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test2c-stderr.txt
  49. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test2c.cmake
  50. 12 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test2d-stderr.txt
  51. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test2d.cmake
  52. 11 19
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt
  53. 11 19
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt
  54. 10 18
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt
  55. 1 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-result.txt
  56. 56 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-stderr.txt
  57. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b.cmake
  58. 1 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-result.txt
  59. 72 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-stderr.txt
  60. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b.cmake
  61. 4 4
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-stderr.txt
  62. 4 4
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-stderr.txt
  63. 4 4
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-stderr.txt
  64. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test16-result.txt
  65. 27 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test16-stderr.txt
  66. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test16.cmake
  67. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-result.txt
  68. 10 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-stderr.txt
  69. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b.cmake
  70. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test2b-stderr.txt
  71. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test2b.cmake
  72. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test2c-stderr.txt
  73. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test2c.cmake
  74. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test2d-stderr.txt
  75. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test2d.cmake
  76. 11 19
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-stderr.txt
  77. 11 19
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-stderr.txt
  78. 18 18
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-stderr.txt
  79. 18 18
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-stderr.txt
  80. 22 30
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-stderr.txt
  81. 4 4
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-stderr.txt
  82. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-result.txt
  83. 45 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-stderr.txt
  84. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b.cmake
  85. 4 4
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-stderr.txt
  86. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-result.txt
  87. 61 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-stderr.txt
  88. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b.cmake
  89. 1 1
      Tests/RunCMake/CMP0118/CMakeLists.txt
  90. 21 0
      Tests/RunCMake/CMP0118/RunCMakeTest.cmake
  91. 3 0
      Tests/RunCMake/CMP0118/subdir-Common-Test13/CMakeLists.txt
  92. 10 0
      Tests/RunCMake/CMP0118/subdir-Common-Test16/CMakeLists.txt
  93. 1 0
      Tests/RunCMake/CMP0118/subdir-Common-Test8/CMakeLists.txt
  94. 13 0
      Tests/RunCMake/CMP0118/subdir-Common-Test8b/CMakeLists.txt
  95. 1 0
      Tests/RunCMake/CMP0118/subdir-Common-Test9/CMakeLists.txt
  96. 13 0
      Tests/RunCMake/CMP0118/subdir-Common-Test9b/CMakeLists.txt

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

@@ -171,7 +171,7 @@ Policies Introduced by CMake 3.20
 
 
    CMP0120: The WriteCompilerDetectionHeader module is removed. </policy/CMP0120>
    CMP0120: The WriteCompilerDetectionHeader module is removed. </policy/CMP0120>
    CMP0119: LANGUAGE source file property explicitly compiles as language. </policy/CMP0119>
    CMP0119: LANGUAGE source file property explicitly compiles as language. </policy/CMP0119>
-   CMP0118: The GENERATED source file property is now visible in all directories. </policy/CMP0118>
+   CMP0118: GENERATED sources may be used across directories without manual marking. </policy/CMP0118>
    CMP0117: MSVC RTTI flag /GR is not added to CMAKE_CXX_FLAGS by default. </policy/CMP0117>
    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>
    CMP0116: Ninja generators transform DEPFILEs from add_custom_command(). </policy/CMP0116>
    CMP0115: Source file extensions must be explicit. </policy/CMP0115>
    CMP0115: Source file extensions must be explicit. </policy/CMP0115>

+ 17 - 12
Help/policy/CMP0118.rst

@@ -3,25 +3,30 @@ CMP0118
 
 
 .. versionadded:: 3.20
 .. versionadded:: 3.20
 
 
-The :prop_sf:`GENERATED` source file property is now visible in all directories.
+:prop_sf:`GENERATED` sources may be used across directories without manual marking.
 
 
-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.
+In CMake 3.19 and below, the :prop_sf:`GENERATED` source file property,
+like other source file properties, was scoped in every directory separately.
+If a source file was generated in one directory, projects had to manually
+set the ``GENERATED`` property in another directory in order to use the file.
 
 
+Whether or not a source file is generated is an all-or-nothing global
+property of the source: a source is either generated or it is not.
+CMake 3.20 and above prefer to allow source files generated in one directory
+to be used in other directories without manually marking them as ``GENERATED``.
 Additionally, the ``GENERATED`` property may now be set only to boolean
 Additionally, the ``GENERATED`` property may now be set only to boolean
-values, and may not be turned off once turned on.
+values, and may not be turned off once turned on.  This policy provides
+compatibility for projects that have not been updated for this behavior.
 
 
-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.
+The ``OLD`` behavior of this policy is to allow generated files to be used
+only in directories in which their ``GENERATED`` property has been turned on.
+The ``NEW`` behavior of this policy is to allow generated files to be used
+in other directories without explicitly turning on the ``GENERATED`` property
+for those directories.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
 .. |WARNS_OR_DOES_NOT_WARN| replace::
 .. |WARNS_OR_DOES_NOT_WARN| replace::
-   does *not* warn with regard to visibility of the ``GENERATED``
-   property, but does warn about setting the ``GENERATED`` property
-   to a non-boolean value,
+   warns about setting the ``GENERATED`` property to a non-boolean value
 .. include:: STANDARD_ADVICE.txt
 .. include:: STANDARD_ADVICE.txt
 
 
 .. include:: DEPRECATED.txt
 .. include:: DEPRECATED.txt

+ 5 - 9
Help/prop_sf/GENERATED.rst

@@ -4,7 +4,11 @@ GENERATED
 Is this source file generated as part of the build or CMake process.
 Is this source file generated as part of the build or CMake process.
 
 
 .. versionchanged:: 3.20
 .. versionchanged:: 3.20
-  The GENERATED source file property is now visible in all directories.
+   Turning on the ``GENERATED`` source file property in one directory allows
+   the associated source file to be used across directories without the need
+   to manually setting that property for other directory scopes, too.
+   Additionally, it may now be set only to boolean values, and may not be
+   turned off once turned on.  See policy :policy:`CMP0118`.
 
 
 Tells the internal CMake engine that a source file is generated by an outside
 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.
 process such as another build step, or the execution of CMake itself.
@@ -38,11 +42,3 @@ be shown. For the special case of sources generated by CMake's :prop_tgt:`AUTOMO
 :prop_gbl:`AUTORCC_SOURCE_GROUP` and :prop_gbl:`AUTOUIC_SOURCE_GROUP` target
 :prop_gbl:`AUTORCC_SOURCE_GROUP` and :prop_gbl:`AUTOUIC_SOURCE_GROUP` target
 properties may influence where the generated sources are grouped in the project's
 properties may influence where the generated sources are grouped in the project's
 file lists.
 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.

+ 3 - 2
Help/release/3.20.rst

@@ -147,8 +147,9 @@ Properties
   for the associated :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` variable
   for the associated :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` variable
   to allow for configuration of exporting compile commands per target.
   to allow for configuration of exporting compile commands per target.
 
 
-* The :prop_sf:`GENERATED` source-file property is now visible
-  from any directory scope, regardless of the scope in which it is set.
+* Generated sources may be used across directories without manual marking.
+  Additionally, the :prop_sf:`GENERATED` source file property can no longer be
+  turned off once turned on, nor can it be set to other than boolean values.
   See policy :policy:`CMP0118`.
   See policy :policy:`CMP0118`.
 
 
 * The :prop_tgt:`UNITY_BUILD_UNIQUE_ID` target property
 * The :prop_tgt:`UNITY_BUILD_UNIQUE_ID` target property

+ 4 - 4
Source/cmPolicies.h

@@ -349,10 +349,10 @@ class cmMakefile;
   SELECT(POLICY, CMP0117,                                                     \
   SELECT(POLICY, CMP0117,                                                     \
          "MSVC RTTI flag /GR is not added to CMAKE_CXX_FLAGS by default.", 3, \
          "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)                                               \
+  SELECT(POLICY, CMP0118,                                                     \
+         "GENERATED sources may be used across directories without manual "   \
+         "marking.",                                                          \
+         3, 20, 0, cmPolicies::WARN)                                          \
   SELECT(POLICY, CMP0119,                                                     \
   SELECT(POLICY, CMP0119,                                                     \
          "LANGUAGE source file property explicitly compiles as specified "    \
          "LANGUAGE source file property explicitly compiles as specified "    \
          "language.",                                                         \
          "language.",                                                         \

+ 38 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test16.cmake

@@ -0,0 +1,38 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+
+
+add_custom_command(
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_command(TARGET custom2 PRE_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+  BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+
+add_subdirectory(subdir-Common-Test16)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")

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

@@ -0,0 +1,9 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+get_source_file_property(prop
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+  GENERATED)
+message(NOTICE "prop: `${prop}`")

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

@@ -0,0 +1,12 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+set_source_files_properties(
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+  PROPERTIES GENERATED "1")
+get_source_file_property(prop
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+  GENERATED)
+message(NOTICE "prop: `${prop}`")

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

@@ -0,0 +1,12 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+set_property(SOURCE
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+  PROPERTY GENERATED "1")
+get_source_file_property(prop
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+  GENERATED)
+message(NOTICE "prop: `${prop}`")

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

@@ -0,0 +1,12 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+set_source_files_properties(
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+  PROPERTIES GENERATED "1")
+get_property(prop SOURCE
+  "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+  PROPERTY GENERATED)
+message(NOTICE "prop: `${prop}`")

+ 2 - 2
Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake

@@ -35,7 +35,7 @@ set_property(SOURCE "Generated_with_full_path2.txt"
   PROPERTY GENERATED "1")
   PROPERTY GENERATED "1")
 get_and_print_GENERATED_property("Generated_with_full_path2.txt")
 get_and_print_GENERATED_property("Generated_with_full_path2.txt")
 
 
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_path3.txt"
   PROPERTY GENERATED "1")
   PROPERTY GENERATED "1")
 get_and_print_GENERATED_property("Generated_with_full_path3.txt")
 get_and_print_GENERATED_property("Generated_with_full_path3.txt")
 
 
@@ -61,6 +61,6 @@ set_property(SOURCE "Generated_with_full_source_path2.txt"
   PROPERTY GENERATED "1")
   PROPERTY GENERATED "1")
 get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
 get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
 
 
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
   PROPERTY GENERATED "1")
   PROPERTY GENERATED "1")
 get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
 get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")

+ 2 - 2
Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake

@@ -9,7 +9,7 @@ set_property(SOURCE "Generated_with_full_path2.txt"
   PROPERTY GENERATED "1")
   PROPERTY GENERATED "1")
 get_and_print_GENERATED_property("Generated_with_full_path2.txt")
 get_and_print_GENERATED_property("Generated_with_full_path2.txt")
 
 
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_path3.txt"
   PROPERTY GENERATED "1")
   PROPERTY GENERATED "1")
 get_and_print_GENERATED_property("Generated_with_full_path3.txt")
 get_and_print_GENERATED_property("Generated_with_full_path3.txt")
 
 
@@ -35,7 +35,7 @@ set_property(SOURCE "Generated_with_full_source_path2.txt"
   PROPERTY GENERATED "1")
   PROPERTY GENERATED "1")
 get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
 get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
 
 
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
   PROPERTY GENERATED "1")
   PROPERTY GENERATED "1")
 get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
 get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
 
 

+ 2 - 2
Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake

@@ -35,7 +35,7 @@ set_property(SOURCE "Generated_with_full_path2.txt"
   PROPERTY GENERATED "0")
   PROPERTY GENERATED "0")
 get_and_print_GENERATED_property("Generated_with_full_path2.txt")
 get_and_print_GENERATED_property("Generated_with_full_path2.txt")
 
 
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_path3.txt"
   PROPERTY GENERATED "0")
   PROPERTY GENERATED "0")
 get_and_print_GENERATED_property("Generated_with_full_path3.txt")
 get_and_print_GENERATED_property("Generated_with_full_path3.txt")
 
 
@@ -61,6 +61,6 @@ set_property(SOURCE "Generated_with_full_source_path2.txt"
   PROPERTY GENERATED "0")
   PROPERTY GENERATED "0")
 get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
 get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
 
 
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
   PROPERTY GENERATED "0")
   PROPERTY GENERATED "0")
 get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
 get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")

+ 2 - 2
Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake

@@ -9,7 +9,7 @@ set_property(SOURCE "Generated_with_full_path2.txt"
   PROPERTY GENERATED "0")
   PROPERTY GENERATED "0")
 get_and_print_GENERATED_property("Generated_with_full_path2.txt")
 get_and_print_GENERATED_property("Generated_with_full_path2.txt")
 
 
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_path3.txt"
   PROPERTY GENERATED "0")
   PROPERTY GENERATED "0")
 get_and_print_GENERATED_property("Generated_with_full_path3.txt")
 get_and_print_GENERATED_property("Generated_with_full_path3.txt")
 
 
@@ -35,7 +35,7 @@ set_property(SOURCE "Generated_with_full_source_path2.txt"
   PROPERTY GENERATED "0")
   PROPERTY GENERATED "0")
 get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
 get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
 
 
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
   PROPERTY GENERATED "0")
   PROPERTY GENERATED "0")
 get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
 get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
 
 

+ 2 - 2
Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake

@@ -65,7 +65,7 @@ set_property(SOURCE "Generated_with_relative_path3.txt"
 get_and_print_GENERATED_property("Generated_with_relative_path3.txt")
 get_and_print_GENERATED_property("Generated_with_relative_path3.txt")
 
 
 
 
-set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.txt"
   PROPERTY GENERATED "tRue")
   PROPERTY GENERATED "tRue")
 get_and_print_GENERATED_property("Generated_with_full_source_path1.txt")
 get_and_print_GENERATED_property("Generated_with_full_source_path1.txt")
 
 
@@ -73,6 +73,6 @@ set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path
   PROPERTY GENERATED "SomeVar-NOTFOUND")
   PROPERTY GENERATED "SomeVar-NOTFOUND")
 get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
 get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
 
 
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
   PROPERTY GENERATED "Junk-value")
   PROPERTY GENERATED "Junk-value")
 get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
 get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")

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

@@ -27,6 +27,7 @@ target_sources(custom6 PRIVATE
 )
 )
 
 
 
 
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
 file(GENERATE
 file(GENERATE
   OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
   OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
   CONTENT "int func();\nint main(){ return func(); }"
   CONTENT "int func();\nint main(){ return func(); }"

+ 51 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test8b.cmake

@@ -0,0 +1,51 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+
+add_subdirectory(subdir-Common-Test8b)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")

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

@@ -27,6 +27,7 @@ target_sources(custom6 PRIVATE
 )
 )
 
 
 
 
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
 file(GENERATE
 file(GENERATE
   OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
   OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
   CONTENT "int func();\nint main(){ return func(); }"
   CONTENT "int func();\nint main(){ return func(); }"

+ 51 - 0
Tests/RunCMake/CMP0118/CMP0118-Common-Test9b.cmake

@@ -0,0 +1,51 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+
+add_subdirectory(subdir-Common-Test9b)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")

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

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

+ 27 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test16-stderr.txt

@@ -0,0 +1,27 @@
+^CMake Error at subdir-Common-Test16/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+  TARGET 'custom4' was not created in this directory\.
++
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`$

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

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

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

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

+ 10 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-stderr.txt

@@ -0,0 +1,10 @@
+^prop: `NOTFOUND`
+CMake Error at CMP0118-Common-Test1b\.cmake:[0-9]+ \(target_sources\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test1b\.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-Test1b.cmake

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

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

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

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

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

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

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

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

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

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

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

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

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

+ 11 - 19
Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt

@@ -12,10 +12,10 @@ Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
@@ -48,14 +48,14 @@ Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
   CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -63,7 +63,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
   CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -71,15 +71,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
-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]+ \(target_sources\):
-  Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
   CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)

+ 11 - 19
Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt

@@ -12,10 +12,10 @@ Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
@@ -48,14 +48,14 @@ Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[12]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
   CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -63,7 +63,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[12]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
   CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -71,15 +71,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
-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]+ \(target_sources\):
-  Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[12]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
   CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)

+ 10 - 18
Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt

@@ -76,12 +76,12 @@ Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
-Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
-Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
 Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
 Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
 Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
 Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
-Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `1`
 CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
   Unsetting the 'GENERATED' property is not allowed under CMP0118!
   Unsetting the 'GENERATED' property is not allowed under CMP0118!
 
 
@@ -118,7 +118,7 @@ Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -126,7 +126,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -134,7 +134,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -142,7 +142,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -150,7 +150,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -158,15 +158,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
-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]+ \(target_sources\):
-  Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)

+ 36 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test8b-stderr.txt

@@ -0,0 +1,36 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$

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

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

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

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

+ 61 - 0
Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-stderr.txt

@@ -0,0 +1,61 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test9b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test9b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+  CMP0118-NEW-Test9b\.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-Test9b.cmake

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

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

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

+ 38 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test16-stderr.txt

@@ -0,0 +1,38 @@
+^CMake Deprecation Warning at CMP0118-OLD-Test16\.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0118 will be removed from a future version
+  of CMake\.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances\.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at subdir-Common-Test16/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+  TARGET 'custom4' was not created in this directory\.
++
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`$

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

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

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

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

+ 21 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-stderr.txt

@@ -0,0 +1,21 @@
+^CMake Deprecation Warning at CMP0118-OLD-Test1b\.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0118 will be removed from a future version
+  of CMake\.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances\.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+prop: `NOTFOUND`
+CMake Error at CMP0118-Common-Test1b\.cmake:[0-9]+ \(target_sources\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+  CMP0118-OLD-Test1b\.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-Test1b.cmake

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

+ 12 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test2b-stderr.txt

@@ -0,0 +1,12 @@
+^CMake Deprecation Warning at CMP0118-OLD-Test2b\.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0118 will be removed from a future version
+  of CMake\.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances\.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+prop: `1`$

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

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

+ 12 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test2c-stderr.txt

@@ -0,0 +1,12 @@
+^CMake Deprecation Warning at CMP0118-OLD-Test2c\.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0118 will be removed from a future version
+  of CMake\.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances\.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+prop: `1`$

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

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

+ 12 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test2d-stderr.txt

@@ -0,0 +1,12 @@
+^CMake Deprecation Warning at CMP0118-OLD-Test2d\.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0118 will be removed from a future version
+  of CMake\.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances\.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+prop: `1`$

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

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

+ 11 - 19
Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt

@@ -23,10 +23,10 @@ Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
@@ -59,14 +59,14 @@ Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
   CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -74,7 +74,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
   CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -82,15 +82,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
-Call Stack \(most recent call first\):
-  CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
-  CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
-  Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
   CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)

+ 11 - 19
Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt

@@ -23,10 +23,10 @@ Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
@@ -59,14 +59,14 @@ Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
   CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -74,7 +74,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
   CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -82,15 +82,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
-Call Stack \(most recent call first\):
-  CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
-  CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
-  Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
   CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)

+ 10 - 18
Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt

@@ -45,12 +45,12 @@ Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
-Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
-Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
 Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
 Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
 Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
 Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
-Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `1`
 Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
@@ -66,7 +66,7 @@ Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -74,7 +74,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -82,7 +82,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -90,7 +90,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -98,7 +98,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -106,15 +106,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
-Call Stack \(most recent call first\):
-  CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
-  CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
-  Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)

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

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

+ 56 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-stderr.txt

@@ -0,0 +1,56 @@
+^CMake Deprecation Warning at CMP0118-OLD-Test8b\.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0118 will be removed from a future version
+  of CMake\.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances\.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test8b\.cmake:[0-9]+ \(target_sources\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+  CMP0118-OLD-Test8b\.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-Test8b.cmake

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

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

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

+ 72 - 0
Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-stderr.txt

@@ -0,0 +1,72 @@
+^CMake Deprecation Warning at CMP0118-OLD-Test9b\.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0118 will be removed from a future version
+  of CMake\.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances\.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+  CMP0118-OLD-Test9b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+  CMP0118-OLD-Test9b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+  CMP0118-OLD-Test9b\.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-Test9b.cmake

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

+ 4 - 4
Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-stderr.txt

@@ -1,6 +1,6 @@
 ^((CMake Warning \(dev\) at subdir-Common-Test11/CMakeLists\.txt:[0-9]+ \(set_property\):
 ^((CMake Warning \(dev\) at subdir-Common-Test11/CMakeLists\.txt:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -9,8 +9,8 @@
 This warning is for project developers\.  Use -Wno-dev to suppress it\.
 This warning is for project developers\.  Use -Wno-dev to suppress it\.
 +)+
 +)+
 (CMake Warning \(dev\) at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_subdirectory\):
 (CMake Warning \(dev\) at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_subdirectory\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 

+ 4 - 4
Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-stderr.txt

@@ -8,8 +8,8 @@ CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\
   TARGET 'custom[4-6]' was not created in this directory\.
   TARGET 'custom[4-6]' was not created in this directory\.
 +
 +
 ((CMake Warning \(dev\) at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(set_property\):
 ((CMake Warning \(dev\) at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -18,8 +18,8 @@ CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\
 This warning is for project developers\.  Use -Wno-dev to suppress it\.
 This warning is for project developers\.  Use -Wno-dev to suppress it\.
 +)+
 +)+
 (CMake Warning \(dev\) at CMP0118-Common-Test13\.cmake:[0-9]+ \(add_subdirectory\):
 (CMake Warning \(dev\) at CMP0118-Common-Test13\.cmake:[0-9]+ \(add_subdirectory\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 

+ 4 - 4
Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-stderr.txt

@@ -1,6 +1,6 @@
 ^((CMake Warning \(dev\) at subdir-Common-Test15/CMakeLists\.txt:[0-9]+ \(set_property\):
 ^((CMake Warning \(dev\) at subdir-Common-Test15/CMakeLists\.txt:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -9,8 +9,8 @@
 This warning is for project developers\.  Use -Wno-dev to suppress it\.
 This warning is for project developers\.  Use -Wno-dev to suppress it\.
 +)+
 +)+
 (CMake Warning \(dev\) at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_subdirectory\):
 (CMake Warning \(dev\) at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_subdirectory\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test16-result.txt

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

+ 27 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test16-stderr.txt

@@ -0,0 +1,27 @@
+^CMake Error at subdir-Common-Test16/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+  TARGET 'custom4' was not created in this directory\.
++
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`$

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test16.cmake

@@ -0,0 +1 @@
+include(CMP0118-Common-Test16.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-result.txt

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

+ 10 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-stderr.txt

@@ -0,0 +1,10 @@
+^prop: `NOTFOUND`
+CMake Error at CMP0118-Common-Test1b\.cmake:[0-9]+ \(target_sources\):
+  Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+  CMP0118-WARN-Test1b\.cmake:[0-9]+ \(include\)
+  CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\.  Build files cannot be regenerated correctly\.$

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b.cmake

@@ -0,0 +1 @@
+include(CMP0118-Common-Test1b.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test2b-stderr.txt

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

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test2b.cmake

@@ -0,0 +1 @@
+include(CMP0118-Common-Test2b.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test2c-stderr.txt

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

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test2c.cmake

@@ -0,0 +1 @@
+include(CMP0118-Common-Test2c.cmake)

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test2d-stderr.txt

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

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test2d.cmake

@@ -0,0 +1 @@
+include(CMP0118-Common-Test2d.cmake)

+ 11 - 19
Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-stderr.txt

@@ -12,10 +12,10 @@ Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
@@ -48,14 +48,14 @@ Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
   CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -63,7 +63,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
   CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -71,15 +71,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
-Call Stack \(most recent call first\):
-  CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
-  CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
-  Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
   CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)

+ 11 - 19
Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-stderr.txt

@@ -12,10 +12,10 @@ Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
@@ -48,14 +48,14 @@ Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
 Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[12]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
   CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -63,7 +63,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[12]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
   CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -71,15 +71,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
-Call Stack \(most recent call first\):
-  CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
-  CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
-  Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[12]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
   CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)

+ 18 - 18
Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-stderr.txt

@@ -1,6 +1,6 @@
 ^CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
 ^CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -18,8 +18,8 @@ Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
 Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -37,8 +37,8 @@ Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -56,8 +56,8 @@ Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -75,8 +75,8 @@ Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
 Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
 Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -94,8 +94,8 @@ Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
 Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -113,8 +113,8 @@ Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -132,8 +132,8 @@ Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
 Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -151,8 +151,8 @@ Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 

+ 18 - 18
Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-stderr.txt

@@ -1,6 +1,6 @@
 ^CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
 ^CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -18,8 +18,8 @@ Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
 Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -37,8 +37,8 @@ Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -56,8 +56,8 @@ Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -75,8 +75,8 @@ Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
 Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
 Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -94,8 +94,8 @@ Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
 Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -113,8 +113,8 @@ Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -132,8 +132,8 @@ Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
 Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -151,8 +151,8 @@ Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 

+ 22 - 30
Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-stderr.txt

@@ -5,8 +5,8 @@ Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
 Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -24,8 +24,8 @@ Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -57,8 +57,8 @@ Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
 Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
 Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -76,8 +76,8 @@ Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
 Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -102,15 +102,15 @@ Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
 Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
-Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
-Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
 Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
 Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
 Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
 Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
-Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `1`
 CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -128,8 +128,8 @@ Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
 CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
 CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -157,7 +157,7 @@ Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -165,7 +165,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -173,7 +173,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -181,7 +181,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -189,7 +189,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
@@ -197,15 +197,7 @@ Call Stack \(most recent call first\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
 CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
   Cannot find source file:
   Cannot find source file:
 
 
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
-Call Stack \(most recent call first\):
-  CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
-  CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
-  Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
   CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)
   CMakeLists\.txt:[0-9]+ \(include\)

+ 4 - 4
Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-stderr.txt

@@ -1,6 +1,6 @@
 ^((CMake Warning \(dev\) at subdir-Common-Test7/CMakeLists\.txt:[0-9]+ \(set_property\):
 ^((CMake Warning \(dev\) at subdir-Common-Test7/CMakeLists\.txt:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -9,8 +9,8 @@
 This warning is for project developers\.  Use -Wno-dev to suppress it\.
 This warning is for project developers\.  Use -Wno-dev to suppress it\.
 +)+
 +)+
 (CMake Warning \(dev\) at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_subdirectory\):
 (CMake Warning \(dev\) at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_subdirectory\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-result.txt

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

+ 45 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-stderr.txt

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

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b.cmake

@@ -0,0 +1 @@
+include(CMP0118-Common-Test8b.cmake)

+ 4 - 4
Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-stderr.txt

@@ -1,6 +1,6 @@
 ^((CMake Warning \(dev\) at subdir-Common-Test9/CMakeLists\.txt:[0-9]+ \(set_property\):
 ^((CMake Warning \(dev\) at subdir-Common-Test9/CMakeLists\.txt:[0-9]+ \(set_property\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 
@@ -9,8 +9,8 @@
 This warning is for project developers\.  Use -Wno-dev to suppress it\.
 This warning is for project developers\.  Use -Wno-dev to suppress it\.
 +)+
 +)+
 (CMake Warning \(dev\) at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_subdirectory\):
 (CMake Warning \(dev\) at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_subdirectory\):
-  Policy CMP0118 is not set: The GENERATED source file property is now
-  visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
+  Policy CMP0118 is not set: GENERATED sources may be used across directories
+  without manual marking\.  Run "cmake --help-policy CMP0118" for policy
   details\.  Use the cmake_policy command to set the policy and suppress this
   details\.  Use the cmake_policy command to set the policy and suppress this
   warning\.
   warning\.
 
 

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-result.txt

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

+ 61 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-stderr.txt

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

+ 1 - 0
Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b.cmake

@@ -0,0 +1 @@
+include(CMP0118-Common-Test9b.cmake)

+ 1 - 1
Tests/RunCMake/CMP0118/CMakeLists.txt

@@ -1,4 +1,4 @@
 cmake_minimum_required(VERSION 3.19)
 cmake_minimum_required(VERSION 3.19)
-cmake_policy(SET CMP0115 NEW)
+cmake_policy(SET CMP0115 NEW)  # CMP0115 is correct here (for reducing error-output)!
 project(${RunCMake_TEST} NONE)
 project(${RunCMake_TEST} NONE)
 include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
 include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)

+ 21 - 0
Tests/RunCMake/CMP0118/RunCMakeTest.cmake

@@ -5,7 +5,11 @@ run_cmake(GenInSubdir-WARN)
 run_cmake(GenInSubdir-NEW)
 run_cmake(GenInSubdir-NEW)
 
 
 run_cmake(CMP0118-OLD-Test1)
 run_cmake(CMP0118-OLD-Test1)
+run_cmake(CMP0118-OLD-Test1b)
 run_cmake(CMP0118-OLD-Test2)
 run_cmake(CMP0118-OLD-Test2)
+run_cmake(CMP0118-OLD-Test2b)
+run_cmake(CMP0118-OLD-Test2c)
+run_cmake(CMP0118-OLD-Test2d)
 run_cmake(CMP0118-OLD-Test3)
 run_cmake(CMP0118-OLD-Test3)
 run_cmake(CMP0118-OLD-Test3b)
 run_cmake(CMP0118-OLD-Test3b)
 run_cmake(CMP0118-OLD-Test4)
 run_cmake(CMP0118-OLD-Test4)
@@ -14,16 +18,23 @@ run_cmake(CMP0118-OLD-Test5)
 run_cmake(CMP0118-OLD-Test6)
 run_cmake(CMP0118-OLD-Test6)
 run_cmake(CMP0118-OLD-Test7)
 run_cmake(CMP0118-OLD-Test7)
 run_cmake(CMP0118-OLD-Test8)
 run_cmake(CMP0118-OLD-Test8)
+run_cmake(CMP0118-OLD-Test8b)
 run_cmake(CMP0118-OLD-Test9)
 run_cmake(CMP0118-OLD-Test9)
+run_cmake(CMP0118-OLD-Test9b)
 run_cmake(CMP0118-OLD-Test10)
 run_cmake(CMP0118-OLD-Test10)
 run_cmake(CMP0118-OLD-Test11)
 run_cmake(CMP0118-OLD-Test11)
 run_cmake(CMP0118-OLD-Test12)
 run_cmake(CMP0118-OLD-Test12)
 run_cmake(CMP0118-OLD-Test13)
 run_cmake(CMP0118-OLD-Test13)
 run_cmake(CMP0118-OLD-Test14)
 run_cmake(CMP0118-OLD-Test14)
 run_cmake(CMP0118-OLD-Test15)
 run_cmake(CMP0118-OLD-Test15)
+run_cmake(CMP0118-OLD-Test16)
 
 
 run_cmake(CMP0118-WARN-Test1)
 run_cmake(CMP0118-WARN-Test1)
+run_cmake(CMP0118-WARN-Test1b)
 run_cmake(CMP0118-WARN-Test2)
 run_cmake(CMP0118-WARN-Test2)
+run_cmake(CMP0118-WARN-Test2b)
+run_cmake(CMP0118-WARN-Test2c)
+run_cmake(CMP0118-WARN-Test2d)
 run_cmake(CMP0118-WARN-Test3)
 run_cmake(CMP0118-WARN-Test3)
 run_cmake(CMP0118-WARN-Test3b)
 run_cmake(CMP0118-WARN-Test3b)
 run_cmake(CMP0118-WARN-Test4)
 run_cmake(CMP0118-WARN-Test4)
@@ -32,16 +43,23 @@ run_cmake(CMP0118-WARN-Test5)
 run_cmake(CMP0118-WARN-Test6)
 run_cmake(CMP0118-WARN-Test6)
 run_cmake(CMP0118-WARN-Test7)
 run_cmake(CMP0118-WARN-Test7)
 run_cmake(CMP0118-WARN-Test8)
 run_cmake(CMP0118-WARN-Test8)
+run_cmake(CMP0118-WARN-Test8b)
 run_cmake(CMP0118-WARN-Test9)
 run_cmake(CMP0118-WARN-Test9)
+run_cmake(CMP0118-WARN-Test9b)
 run_cmake(CMP0118-WARN-Test10)
 run_cmake(CMP0118-WARN-Test10)
 run_cmake(CMP0118-WARN-Test11)
 run_cmake(CMP0118-WARN-Test11)
 run_cmake(CMP0118-WARN-Test12)
 run_cmake(CMP0118-WARN-Test12)
 run_cmake(CMP0118-WARN-Test13)
 run_cmake(CMP0118-WARN-Test13)
 run_cmake(CMP0118-WARN-Test14)
 run_cmake(CMP0118-WARN-Test14)
 run_cmake(CMP0118-WARN-Test15)
 run_cmake(CMP0118-WARN-Test15)
+run_cmake(CMP0118-WARN-Test16)
 
 
 run_cmake(CMP0118-NEW-Test1)
 run_cmake(CMP0118-NEW-Test1)
+run_cmake(CMP0118-NEW-Test1b)
 run_cmake(CMP0118-NEW-Test2)
 run_cmake(CMP0118-NEW-Test2)
+run_cmake(CMP0118-NEW-Test2b)
+run_cmake(CMP0118-NEW-Test2c)
+run_cmake(CMP0118-NEW-Test2d)
 run_cmake(CMP0118-NEW-Test3)
 run_cmake(CMP0118-NEW-Test3)
 run_cmake(CMP0118-NEW-Test3b)
 run_cmake(CMP0118-NEW-Test3b)
 run_cmake(CMP0118-NEW-Test4)
 run_cmake(CMP0118-NEW-Test4)
@@ -50,10 +68,13 @@ run_cmake(CMP0118-NEW-Test5)
 run_cmake(CMP0118-NEW-Test6)
 run_cmake(CMP0118-NEW-Test6)
 run_cmake(CMP0118-NEW-Test7)
 run_cmake(CMP0118-NEW-Test7)
 run_cmake(CMP0118-NEW-Test8)
 run_cmake(CMP0118-NEW-Test8)
+run_cmake(CMP0118-NEW-Test8b)
 run_cmake(CMP0118-NEW-Test9)
 run_cmake(CMP0118-NEW-Test9)
+run_cmake(CMP0118-NEW-Test9b)
 run_cmake(CMP0118-NEW-Test10)
 run_cmake(CMP0118-NEW-Test10)
 run_cmake(CMP0118-NEW-Test11)
 run_cmake(CMP0118-NEW-Test11)
 run_cmake(CMP0118-NEW-Test12)
 run_cmake(CMP0118-NEW-Test12)
 run_cmake(CMP0118-NEW-Test13)
 run_cmake(CMP0118-NEW-Test13)
 run_cmake(CMP0118-NEW-Test14)
 run_cmake(CMP0118-NEW-Test14)
 run_cmake(CMP0118-NEW-Test15)
 run_cmake(CMP0118-NEW-Test15)
+run_cmake(CMP0118-NEW-Test16)

+ 3 - 0
Tests/RunCMake/CMP0118/subdir-Common-Test13/CMakeLists.txt

@@ -1,13 +1,16 @@
+# Note: Target "custom4" was not created in this directory, so setting this build-event will fail!
 add_custom_command(TARGET custom4 PRE_BUILD
 add_custom_command(TARGET custom4 PRE_BUILD
   COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
   COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
                                    "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
                                    "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
   BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
   BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
 )
 )
+# Note: Target "custom5" was not created in this directory, so setting this build-event will fail!
 add_custom_command(TARGET custom5 PRE_BUILD
 add_custom_command(TARGET custom5 PRE_BUILD
   COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
   COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
                                    "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
                                    "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
   BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
   BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
 )
 )
+# Note: Target "custom6" was not created in this directory, so setting this build-event will fail!
 add_custom_command(TARGET custom6 PRE_BUILD
 add_custom_command(TARGET custom6 PRE_BUILD
   COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
   COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
                                    "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
                                    "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"

+ 10 - 0
Tests/RunCMake/CMP0118/subdir-Common-Test16/CMakeLists.txt

@@ -0,0 +1,10 @@
+add_custom_command(
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+)
+add_custom_command(TARGET custom4 PRE_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+                                   "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+  BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)

+ 1 - 0
Tests/RunCMake/CMP0118/subdir-Common-Test8/CMakeLists.txt

@@ -1,3 +1,4 @@
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
 file(GENERATE
 file(GENERATE
   OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
   OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
   CONTENT "int func();\nint main(){ return func(); }"
   CONTENT "int func();\nint main(){ return func(); }"

+ 13 - 0
Tests/RunCMake/CMP0118/subdir-Common-Test8b/CMakeLists.txt

@@ -0,0 +1,13 @@
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+  CONTENT "int func();\nint main(){ return func(); }"
+)

+ 1 - 0
Tests/RunCMake/CMP0118/subdir-Common-Test9/CMakeLists.txt

@@ -1,3 +1,4 @@
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
 file(GENERATE
 file(GENERATE
   OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
   OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
   CONTENT "int func();\nint main(){ return func(); }"
   CONTENT "int func();\nint main(){ return func(); }"

+ 13 - 0
Tests/RunCMake/CMP0118/subdir-Common-Test9b/CMakeLists.txt

@@ -0,0 +1,13 @@
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+  CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+  CONTENT "int func();\nint main(){ return func(); }"
+)