ソースを参照

CMP0118: Fix some tests and add more tests

Deniz Bahadir 1 年間 前
コミット
d2f5b79795
84 ファイル変更908 行追加179 行削除
  1. 38 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test16.cmake
  2. 9 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test1b.cmake
  3. 12 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test2b.cmake
  4. 12 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test2c.cmake
  5. 12 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test2d.cmake
  6. 2 2
      Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake
  7. 2 2
      Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake
  8. 2 2
      Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake
  9. 2 2
      Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake
  10. 2 2
      Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake
  11. 1 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake
  12. 51 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test8b.cmake
  13. 1 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake
  14. 51 0
      Tests/RunCMake/CMP0118/CMP0118-Common-Test9b.cmake
  15. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test16-result.txt
  16. 27 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test16-stderr.txt
  17. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test16.cmake
  18. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-result.txt
  19. 10 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-stderr.txt
  20. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b.cmake
  21. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test2b-stderr.txt
  22. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test2b.cmake
  23. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test2c-stderr.txt
  24. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test2c.cmake
  25. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test2d-stderr.txt
  26. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test2d.cmake
  27. 11 19
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt
  28. 11 19
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt
  29. 10 18
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt
  30. 36 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test8b-stderr.txt
  31. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test8b.cmake
  32. 1 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-result.txt
  33. 61 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-stderr.txt
  34. 2 0
      Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b.cmake
  35. 1 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test16-result.txt
  36. 38 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test16-stderr.txt
  37. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test16.cmake
  38. 1 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-result.txt
  39. 21 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-stderr.txt
  40. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b.cmake
  41. 12 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test2b-stderr.txt
  42. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test2b.cmake
  43. 12 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test2c-stderr.txt
  44. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test2c.cmake
  45. 12 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test2d-stderr.txt
  46. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test2d.cmake
  47. 11 19
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt
  48. 11 19
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt
  49. 10 18
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt
  50. 1 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-result.txt
  51. 56 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-stderr.txt
  52. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b.cmake
  53. 1 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-result.txt
  54. 72 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-stderr.txt
  55. 2 0
      Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b.cmake
  56. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test16-result.txt
  57. 27 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test16-stderr.txt
  58. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test16.cmake
  59. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-result.txt
  60. 10 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-stderr.txt
  61. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b.cmake
  62. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test2b-stderr.txt
  63. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test2b.cmake
  64. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test2c-stderr.txt
  65. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test2c.cmake
  66. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test2d-stderr.txt
  67. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test2d.cmake
  68. 11 19
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-stderr.txt
  69. 11 19
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-stderr.txt
  70. 10 18
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-stderr.txt
  71. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-result.txt
  72. 45 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-stderr.txt
  73. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b.cmake
  74. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-result.txt
  75. 61 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-stderr.txt
  76. 1 0
      Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b.cmake
  77. 1 1
      Tests/RunCMake/CMP0118/CMakeLists.txt
  78. 21 0
      Tests/RunCMake/CMP0118/RunCMakeTest.cmake
  79. 3 0
      Tests/RunCMake/CMP0118/subdir-Common-Test13/CMakeLists.txt
  80. 10 0
      Tests/RunCMake/CMP0118/subdir-Common-Test16/CMakeLists.txt
  81. 1 0
      Tests/RunCMake/CMP0118/subdir-Common-Test8/CMakeLists.txt
  82. 13 0
      Tests/RunCMake/CMP0118/subdir-Common-Test8b/CMakeLists.txt
  83. 1 0
      Tests/RunCMake/CMP0118/subdir-Common-Test9/CMakeLists.txt
  84. 13 0
      Tests/RunCMake/CMP0118/subdir-Common-Test9b/CMakeLists.txt

+ 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)

+ 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\)

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

@@ -102,12 +102,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\):
   Policy CMP0118 is not set: The GENERATED source file property is now
   Policy CMP0118 is not set: The GENERATED source file property is now
   visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
   visible in all directories\.  Run "cmake --help-policy CMP0118" for policy
@@ -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\)

+ 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)

+ 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(); }"
+)