Просмотр исходного кода

Merge topic 'remove-old-compatibility'

785523a136 Remove compatibility with CMake versions older than 2.8.0
35282387ea CMP0014: Remove support for OLD behavior
fad9c55b8b CMP0013: Remove support for OLD behavior
98a59ba8ad CMP0012: Remove support for OLD behavior
3c0dbb66f5 CMP0011: Remove support for OLD behavior
cf832e75bc CMP0010: Remove support for OLD behavior
77f8c374f3 CMP0009: Remove support for OLD behavior
43ef139567 CMP0008: Remove support for OLD behavior
...

Acked-by: Kitware Robot <[email protected]>
Tested-by: buildbot <[email protected]>
Merge-request: !10188
Brad King 1 год назад
Родитель
Сommit
8ef1b4001b
100 измененных файлов с 238 добавлено и 1269 удалено
  1. 8 0
      Help/command/DEPRECATED_POLICY_VERSIONS.txt
  2. 5 4
      Help/policy/CMP0000.rst
  3. 6 5
      Help/policy/CMP0001.rst
  4. 5 4
      Help/policy/CMP0002.rst
  5. 5 4
      Help/policy/CMP0003.rst
  6. 5 4
      Help/policy/CMP0004.rst
  7. 5 4
      Help/policy/CMP0005.rst
  8. 5 4
      Help/policy/CMP0006.rst
  9. 5 4
      Help/policy/CMP0007.rst
  10. 5 4
      Help/policy/CMP0008.rst
  11. 5 4
      Help/policy/CMP0009.rst
  12. 5 4
      Help/policy/CMP0010.rst
  13. 5 4
      Help/policy/CMP0011.rst
  14. 5 4
      Help/policy/CMP0012.rst
  15. 5 4
      Help/policy/CMP0013.rst
  16. 5 4
      Help/policy/CMP0014.rst
  17. 4 0
      Help/policy/REMOVED_EPILOGUE.txt
  18. 5 0
      Help/policy/REMOVED_PROLOGUE.txt
  19. 10 0
      Help/release/dev/remove-old-compatibility.rst
  20. 1 1
      Help/variable/CMAKE_BACKWARDS_COMPATIBILITY.rst
  21. 0 5
      Modules/CMakeIOSInstallCombined.cmake
  22. 0 3
      Modules/ExternalData.cmake
  23. 0 4
      Modules/FindCUDA/run_nvcc.cmake
  24. 0 3
      Modules/FindEnvModules.cmake
  25. 0 1
      Modules/FindLua.cmake
  26. 0 1
      Modules/FindOpenMP.cmake
  27. 0 2
      Modules/FindPackageHandleStandardArgs.cmake
  28. 0 2
      Modules/FindPython.cmake
  29. 0 4
      Modules/FindPython/Support.cmake
  30. 0 6
      Modules/FortranCInterface.cmake
  31. 0 2
      Modules/UseSWIG.cmake
  32. 0 17
      Source/cmCMakePolicyCommand.cxx
  33. 0 30
      Source/cmComputeLinkDepends.cxx
  34. 0 9
      Source/cmComputeLinkDepends.h
  35. 4 232
      Source/cmComputeLinkInformation.cxx
  36. 1 10
      Source/cmComputeLinkInformation.h
  37. 8 73
      Source/cmConditionEvaluator.cxx
  38. 0 9
      Source/cmConditionEvaluator.h
  39. 1 39
      Source/cmFileCommand.cxx
  40. 2 2
      Source/cmFindPackageCommand.cxx
  41. 5 21
      Source/cmGeneratorTarget.cxx
  42. 0 1
      Source/cmGeneratorTarget.h
  43. 4 11
      Source/cmGeneratorTarget_Link.cxx
  44. 0 2
      Source/cmGlobVerificationManager.cxx
  45. 0 26
      Source/cmInstallCommand.cxx
  46. 0 8
      Source/cmLinkItem.h
  47. 0 23
      Source/cmListCommand.cxx
  48. 6 64
      Source/cmLocalGenerator.cxx
  49. 0 22
      Source/cmLocalGenerator.h
  50. 21 206
      Source/cmMakefile.cxx
  51. 16 21
      Source/cmPolicies.cxx
  52. 15 16
      Source/cmPolicies.h
  53. 0 5
      Source/cmStateSnapshot.cxx
  54. 0 1
      Source/cmStateSnapshot.h
  55. 0 21
      Source/cmake.cxx
  56. 0 3
      Tests/CMakeLists.txt
  57. 0 54
      Tests/CMakeTests/IfTest.cmake.in
  58. 7 30
      Tests/CMakeTests/ListTest.cmake.in
  59. 0 10
      Tests/Complex/CMakeLists.txt
  60. 0 10
      Tests/ComplexOneConfig/CMakeLists.txt
  61. 0 1
      Tests/Policy0002/A/CMakeLists.txt
  62. 0 5
      Tests/Policy0002/CMakeLists.txt
  63. 0 4
      Tests/Policy0002/policy0002.c
  64. 0 3
      Tests/PolicyScope/Bar.cmake
  65. 2 17
      Tests/PolicyScope/CMakeLists.txt
  66. 0 2
      Tests/PolicyScope/FindFoo.cmake
  67. 0 1
      Tests/RunCMake/AppleTextStubs/LibraryWithVersions.cmake
  68. 0 2
      Tests/RunCMake/CMP0004/CMP0004-OLD-stderr.txt
  69. 0 18
      Tests/RunCMake/CMP0004/CMP0004-OLD.cmake
  70. 0 1
      Tests/RunCMake/CMP0004/RunCMakeTest.cmake
  71. 1 6
      Tests/RunCMake/CPack/DEB/Helpers.cmake
  72. 16 45
      Tests/RunCMake/GenEx-LIST/INSERT.cmake.in
  73. 1 1
      Tests/RunCMake/Syntax/CMakeLists.txt
  74. 0 1
      Tests/RunCMake/Syntax/RunCMakeTest.cmake
  75. 0 0
      Tests/RunCMake/Syntax/UnterminatedBrace1-result.txt
  76. 2 3
      Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt
  77. 1 1
      Tests/RunCMake/Syntax/UnterminatedBrace1.cmake
  78. 0 12
      Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt
  79. 0 3
      Tests/RunCMake/Syntax/UnterminatedBrace2.cmake
  80. 0 2
      Tests/RunCMake/VS10Project/SourceGroupFileSet-check.cmake
  81. 0 2
      Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake
  82. 0 5
      Tests/RunCMake/cmake_minimum_required/Before24-stderr.txt
  83. 0 1
      Tests/RunCMake/cmake_minimum_required/Before24.cmake
  84. 1 11
      Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated-stderr.txt
  85. 0 1
      Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated.cmake
  86. 0 0
      Tests/RunCMake/cmake_minimum_required/BeforeVersionRemoved-result.txt
  87. 8 0
      Tests/RunCMake/cmake_minimum_required/BeforeVersionRemoved-stderr.txt
  88. 1 0
      Tests/RunCMake/cmake_minimum_required/BeforeVersionRemoved.cmake
  89. 0 15
      Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt
  90. 0 2
      Tests/RunCMake/cmake_minimum_required/CompatBefore24.cmake
  91. 0 1
      Tests/RunCMake/cmake_minimum_required/PolicyBefore24-result.txt
  92. 0 6
      Tests/RunCMake/cmake_minimum_required/PolicyBefore24-stderr.txt
  93. 0 2
      Tests/RunCMake/cmake_minimum_required/PolicyBefore24.cmake
  94. 0 0
      Tests/RunCMake/cmake_minimum_required/PolicyBeforeVersionRemoved-result.txt
  95. 8 0
      Tests/RunCMake/cmake_minimum_required/PolicyBeforeVersionRemoved-stderr.txt
  96. 1 0
      Tests/RunCMake/cmake_minimum_required/PolicyBeforeVersionRemoved.cmake
  97. 2 3
      Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake
  98. 0 1
      Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake.cmake
  99. 0 2
      Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION.cmake
  100. 0 18
      Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt

+ 8 - 0
Help/command/DEPRECATED_POLICY_VERSIONS.txt

@@ -1,3 +1,11 @@
+.. versionchanged:: 4.0
+
+  Compatibility with versions of CMake older than 2.8.0 is removed.
+  Calls to :command:`cmake_minimum_required(VERSION)` or
+  :command:`cmake_policy(VERSION)` that do not specify at least
+  2.8.0 as their policy version (optionally via ``...<max>``)
+  will produce an error in CMake 4.0 and above.
+
 .. versionchanged:: 3.31
 .. versionchanged:: 3.31
 
 
   Compatibility with versions of CMake older than 3.10 is deprecated.
   Compatibility with versions of CMake older than 3.10 is deprecated.

+ 5 - 4
Help/policy/CMP0000.rst

@@ -1,6 +1,9 @@
 CMP0000
 CMP0000
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 A minimum required CMake version must be specified.
 A minimum required CMake version must be specified.
 
 
 CMake requires that projects specify the version of CMake to which
 CMake requires that projects specify the version of CMake to which
@@ -26,7 +29,5 @@ behavior was to silently ignore the missing invocation.  The ``NEW``
 behavior is to issue an error instead of a warning.
 behavior is to issue an error instead of a warning.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 6 - 5
Help/policy/CMP0001.rst

@@ -1,11 +1,14 @@
 CMP0001
 CMP0001
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 ``CMAKE_BACKWARDS_COMPATIBILITY`` should no longer be used.
 ``CMAKE_BACKWARDS_COMPATIBILITY`` should no longer be used.
 
 
 The behavior is to check ``CMAKE_BACKWARDS_COMPATIBILITY`` and present
 The behavior is to check ``CMAKE_BACKWARDS_COMPATIBILITY`` and present
 it to the user.  The ``NEW`` behavior is to ignore
 it to the user.  The ``NEW`` behavior is to ignore
-CMAKE_BACKWARDS_COMPATIBILITY completely.
+``CMAKE_BACKWARDS_COMPATIBILITY`` completely.
 
 
 In CMake 2.4 and below the variable ``CMAKE_BACKWARDS_COMPATIBILITY`` was
 In CMake 2.4 and below the variable ``CMAKE_BACKWARDS_COMPATIBILITY`` was
 used to request compatibility with earlier versions of CMake.  In
 used to request compatibility with earlier versions of CMake.  In
@@ -15,7 +18,5 @@ and the :command:`cmake_policy` command.  However, CMake must still check
 below.
 below.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 5 - 4
Help/policy/CMP0002.rst

@@ -1,6 +1,9 @@
 CMP0002
 CMP0002
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 Logical target names must be globally unique.
 Logical target names must be globally unique.
 
 
 Targets names created with :command:`add_executable`, :command:`add_library`, or
 Targets names created with :command:`add_executable`, :command:`add_library`, or
@@ -22,7 +25,5 @@ must simply have globally unique names (unless one uses the global
 property :prop_gbl:`ALLOW_DUPLICATE_CUSTOM_TARGETS` with a Makefiles generator).
 property :prop_gbl:`ALLOW_DUPLICATE_CUSTOM_TARGETS` with a Makefiles generator).
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 5 - 4
Help/policy/CMP0003.rst

@@ -1,6 +1,9 @@
 CMP0003
 CMP0003
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 Libraries linked via full path no longer produce linker search paths.
 Libraries linked via full path no longer produce linker search paths.
 
 
 This policy affects how libraries whose full paths are NOT known are
 This policy affects how libraries whose full paths are NOT known are
@@ -98,7 +101,5 @@ target.  This avoids flooding users with messages for every target
 when setting the policy once will probably fix all targets.
 when setting the policy once will probably fix all targets.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 5 - 4
Help/policy/CMP0004.rst

@@ -1,6 +1,9 @@
 CMP0004
 CMP0004
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 Libraries linked may not have leading or trailing whitespace.
 Libraries linked may not have leading or trailing whitespace.
 
 
 CMake versions 2.4 and below silently removed leading and trailing
 CMake versions 2.4 and below silently removed leading and trailing
@@ -20,7 +23,5 @@ target is created by an :command:`add_executable` or :command:`add_library`
 command.
 command.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 5 - 4
Help/policy/CMP0005.rst

@@ -1,6 +1,9 @@
 CMP0005
 CMP0005
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 Preprocessor definition values are now escaped automatically.
 Preprocessor definition values are now escaped automatically.
 
 
 This policy determines whether or not CMake should generate escaped
 This policy determines whether or not CMake should generate escaped
@@ -20,7 +23,5 @@ See documentation of the ``COMPILE_DEFINITIONS`` target property for
 limitations of the escaping implementation.
 limitations of the escaping implementation.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 5 - 4
Help/policy/CMP0006.rst

@@ -1,6 +1,9 @@
 CMP0006
 CMP0006
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 Installing :prop_tgt:`MACOSX_BUNDLE` targets requires a ``BUNDLE DESTINATION``.
 Installing :prop_tgt:`MACOSX_BUNDLE` targets requires a ``BUNDLE DESTINATION``.
 
 
 This policy determines whether the :command:`install(TARGETS)` command must be
 This policy determines whether the :command:`install(TARGETS)` command must be
@@ -18,7 +21,5 @@ behavior for this policy is to produce an error if a bundle target is installed
 without a ``BUNDLE DESTINATION``.
 without a ``BUNDLE DESTINATION``.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 5 - 4
Help/policy/CMP0007.rst

@@ -1,6 +1,9 @@
 CMP0007
 CMP0007
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 list command no longer ignores empty elements.
 list command no longer ignores empty elements.
 
 
 This policy determines whether the list command will ignore empty
 This policy determines whether the list command will ignore empty
@@ -11,7 +14,5 @@ elements.  The ``NEW`` behavior for this policy is to correctly count
 empty elements in a list.
 empty elements in a list.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 5 - 4
Help/policy/CMP0008.rst

@@ -1,6 +1,9 @@
 CMP0008
 CMP0008
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 Libraries linked by full-path must have a valid library file name.
 Libraries linked by full-path must have a valid library file name.
 
 
 In CMake 2.4 and below it is possible to write code like
 In CMake 2.4 and below it is possible to write code like
@@ -29,7 +32,5 @@ it.  The ``NEW`` behavior for this policy is to trust the given path and
 pass it directly to the native build tool unchanged.
 pass it directly to the native build tool unchanged.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.1
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.1
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 5 - 4
Help/policy/CMP0009.rst

@@ -1,6 +1,9 @@
 CMP0009
 CMP0009
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 FILE GLOB_RECURSE calls should not follow symlinks by default.
 FILE GLOB_RECURSE calls should not follow symlinks by default.
 
 
 In CMake 2.6.1 and below, :command:`file(GLOB_RECURSE)` calls would follow
 In CMake 2.6.1 and below, :command:`file(GLOB_RECURSE)` calls would follow
@@ -15,7 +18,5 @@ to follow the symlinks by default, but only if ``FOLLOW_SYMLINKS`` is given
 as an additional argument to the ``FILE`` command.
 as an additional argument to the ``FILE`` command.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.2
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.2
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 5 - 4
Help/policy/CMP0010.rst

@@ -1,6 +1,9 @@
 CMP0010
 CMP0010
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 Bad variable reference syntax is an error.
 Bad variable reference syntax is an error.
 
 
 In CMake 2.6.2 and below, incorrect variable reference syntax such as
 In CMake 2.6.2 and below, incorrect variable reference syntax such as
@@ -14,7 +17,5 @@ If :policy:`CMP0053` is set to ``NEW``, this policy has no effect
 and is treated as always being ``NEW``.
 and is treated as always being ``NEW``.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.3
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.3
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 5 - 4
Help/policy/CMP0011.rst

@@ -1,6 +1,9 @@
 CMP0011
 CMP0011
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 Included scripts do automatic :command:`cmake_policy` PUSH and POP.
 Included scripts do automatic :command:`cmake_policy` PUSH and POP.
 
 
 In CMake 2.6.2 and below, CMake Policy settings in scripts loaded by
 In CMake 2.6.2 and below, CMake Policy settings in scripts loaded by
@@ -19,7 +22,5 @@ The ``NEW`` behavior for this policy is to allow the commands to do
 their default cmake_policy ``PUSH`` and ``POP``.
 their default cmake_policy ``PUSH`` and ``POP``.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.3
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.3
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 5 - 4
Help/policy/CMP0012.rst

@@ -1,6 +1,9 @@
 CMP0012
 CMP0012
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 :command:`if` recognizes numbers and boolean constants.
 :command:`if` recognizes numbers and boolean constants.
 
 
 In CMake versions 2.6.4 and lower the :command:`if` command implicitly
 In CMake versions 2.6.4 and lower the :command:`if` command implicitly
@@ -22,7 +25,5 @@ for this policy is to recognize numbers and boolean constants without
 dereferencing variables with such names.
 dereferencing variables with such names.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 5 - 4
Help/policy/CMP0013.rst

@@ -1,6 +1,9 @@
 CMP0013
 CMP0013
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 Duplicate binary directories are not allowed.
 Duplicate binary directories are not allowed.
 
 
 CMake 2.6.3 and below silently permitted add_subdirectory() calls to
 CMake 2.6.3 and below silently permitted add_subdirectory() calls to
@@ -15,7 +18,5 @@ behavior for this policy is to disallow duplicate binary directories
 with an error.
 with an error.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 5 - 4
Help/policy/CMP0014.rst

@@ -1,6 +1,9 @@
 CMP0014
 CMP0014
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 Input directories must have ``CMakeLists.txt``.
 Input directories must have ``CMakeLists.txt``.
 
 
 CMake versions before 2.8 silently ignored missing ``CMakeLists.txt``
 CMake versions before 2.8 silently ignored missing ``CMakeLists.txt``
@@ -11,7 +14,5 @@ The ``OLD`` behavior for this policy is to silently ignore the problem.
 The ``NEW`` behavior for this policy is to report an error.
 The ``NEW`` behavior for this policy is to report an error.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 4 - 0
Help/policy/REMOVED_EPILOGUE.txt

@@ -0,0 +1,4 @@
+This policy was introduced in CMake version |INTRODUCED_IN_CMAKE_VERSION|.
+Prior to removal in CMake version |REMOVED_IN_CMAKE_VERSION|, it could be
+set by :command:`cmake_policy` or :command:`cmake_minimum_required`.
+If it was not set, CMake |WARNED_OR_DID_NOT_WARN|, and used ``OLD`` behavior.

+ 5 - 0
Help/policy/REMOVED_PROLOGUE.txt

@@ -0,0 +1,5 @@
+.. warning::
+  The ``OLD`` behavior of this policy was removed
+  in CMake version |REMOVED_IN_CMAKE_VERSION|.
+  This policy must be set to ``NEW`` by a call to
+  :command:`cmake_minimum_required` or :command:`cmake_policy`.

+ 10 - 0
Help/release/dev/remove-old-compatibility.rst

@@ -0,0 +1,10 @@
+remove-old-compatibility
+------------------------
+
+* Compatibility with versions of CMake older than 2.8.0 has been removed.
+  Calls to :command:`cmake_minimum_required` or :command:`cmake_policy`
+  that set the policy version to an older value now issue an error.
+  Note that calls to those commands can still support older versions of
+  CMake by using their ``VERSION`` arguments' ``<min>...<max>`` syntax.
+  This requires only the ``<min>`` version of CMake, but when running a
+  newer version, sets policies up to the ``<max>`` version.

+ 1 - 1
Help/variable/CMAKE_BACKWARDS_COMPATIBILITY.rst

@@ -1,4 +1,4 @@
 CMAKE_BACKWARDS_COMPATIBILITY
 CMAKE_BACKWARDS_COMPATIBILITY
 -----------------------------
 -----------------------------
 
 
-Deprecated.  See CMake Policy :policy:`CMP0001` documentation.
+Removed.  See policy :policy:`CMP0001`.

+ 0 - 5
Modules/CMakeIOSInstallCombined.cmake

@@ -60,9 +60,6 @@ endfunction()
 
 
 # Get architectures of given SDK (iphonesimulator/iphoneos)
 # Get architectures of given SDK (iphonesimulator/iphoneos)
 function(_ios_install_combined_get_valid_archs sdk resultvar)
 function(_ios_install_combined_get_valid_archs sdk resultvar)
-  cmake_policy(PUSH)
-  cmake_policy(SET CMP0007 NEW)
-
   if("${resultvar}" STREQUAL "")
   if("${resultvar}" STREQUAL "")
     message(FATAL_ERROR "`resultvar` is empty")
     message(FATAL_ERROR "`resultvar` is empty")
   endif()
   endif()
@@ -77,8 +74,6 @@ function(_ios_install_combined_get_valid_archs sdk resultvar)
   _ios_install_combined_message("Architectures (${sdk}): ${printable}")
   _ios_install_combined_message("Architectures (${sdk}): ${printable}")
 
 
   set("${resultvar}" "${valid_archs}" PARENT_SCOPE)
   set("${resultvar}" "${valid_archs}" PARENT_SCOPE)
-
-  cmake_policy(POP)
 endfunction()
 endfunction()
 
 
 # Make both arch lists a disjoint set by preferring the current SDK
 # Make both arch lists a disjoint set by preferring the current SDK

+ 0 - 3
Modules/ExternalData.cmake

@@ -869,10 +869,7 @@ macro(_ExternalData_arg_series)
 endmacro()
 endmacro()
 
 
 function(_ExternalData_arg_find_files glob pattern regex)
 function(_ExternalData_arg_find_files glob pattern regex)
-  cmake_policy(PUSH)
-  cmake_policy(SET CMP0009 NEW)
   file(${glob} globbed RELATIVE "${top_src}" "${top_src}/${pattern}*")
   file(${glob} globbed RELATIVE "${top_src}" "${top_src}/${pattern}*")
-  cmake_policy(POP)
   set(externals_count -1)
   set(externals_count -1)
   foreach(entry IN LISTS globbed)
   foreach(entry IN LISTS globbed)
     if("x${entry}" MATCHES "^x(.*)(\\.(${_ExternalData_REGEX_EXT}))$")
     if("x${entry}" MATCHES "^x(.*)(\\.(${_ExternalData_REGEX_EXT}))$")

+ 0 - 4
Modules/FindCUDA/run_nvcc.cmake

@@ -50,8 +50,6 @@
 # generated_cubin_file:STRING=<> File to generate.  This argument must be passed
 # generated_cubin_file:STRING=<> File to generate.  This argument must be passed
 #                                                   in if build_cubin is true.
 #                                                   in if build_cubin is true.
 
 
-cmake_policy(PUSH)
-cmake_policy(SET CMP0007 NEW)
 if(NOT generated_file)
 if(NOT generated_file)
   message(FATAL_ERROR "You must specify generated_file on the command line")
   message(FATAL_ERROR "You must specify generated_file on the command line")
 endif()
 endif()
@@ -302,5 +300,3 @@ if( build_cubin )
     )
     )
 
 
 endif()
 endif()
-
-cmake_policy(POP)

+ 0 - 3
Modules/FindEnvModules.cmake

@@ -268,7 +268,6 @@ endfunction()
 
 
 #------------------------------------------------------------------------------
 #------------------------------------------------------------------------------
 function(env_module_list out_var)
 function(env_module_list out_var)
-  cmake_policy(SET CMP0007 NEW)
   env_module(COMMAND -t list OUTPUT_VARIABLE tmp_out)
   env_module(COMMAND -t list OUTPUT_VARIABLE tmp_out)
 
 
   # Convert output into a CMake list
   # Convert output into a CMake list
@@ -286,8 +285,6 @@ endfunction()
 
 
 #------------------------------------------------------------------------------
 #------------------------------------------------------------------------------
 function(env_module_avail)
 function(env_module_avail)
-  cmake_policy(SET CMP0007 NEW)
-
   if(ARGC EQUAL 1)
   if(ARGC EQUAL 1)
     set(mod_prefix)
     set(mod_prefix)
     set(out_var ${ARGV0})
     set(out_var ${ARGV0})

+ 0 - 1
Modules/FindLua.cmake

@@ -44,7 +44,6 @@ locations other than lua/
 #]=======================================================================]
 #]=======================================================================]
 
 
 cmake_policy(PUSH)  # Policies apply to functions at definition-time
 cmake_policy(PUSH)  # Policies apply to functions at definition-time
-cmake_policy(SET CMP0012 NEW)  # For while(TRUE)
 cmake_policy(SET CMP0159 NEW)  # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
 cmake_policy(SET CMP0159 NEW)  # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
 
 
 unset(_lua_include_subdirs)
 unset(_lua_include_subdirs)

+ 0 - 1
Modules/FindOpenMP.cmake

@@ -111,7 +111,6 @@ to know what include directories are needed.
 #]=======================================================================]
 #]=======================================================================]
 
 
 cmake_policy(PUSH)
 cmake_policy(PUSH)
-cmake_policy(SET CMP0012 NEW) # if() recognizes numbers and booleans
 cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
 cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
 cmake_policy(SET CMP0057 NEW) # if IN_LIST
 cmake_policy(SET CMP0057 NEW) # if IN_LIST
 cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
 cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>

+ 0 - 2
Modules/FindPackageHandleStandardArgs.cmake

@@ -215,8 +215,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake)
 
 
 
 
 cmake_policy(PUSH)
 cmake_policy(PUSH)
-# numbers and boolean constants
-cmake_policy(SET CMP0012 NEW)
 # IN_LIST operator
 # IN_LIST operator
 cmake_policy(SET CMP0057 NEW)
 cmake_policy(SET CMP0057 NEW)
 
 

+ 0 - 2
Modules/FindPython.cmake

@@ -623,8 +623,6 @@ If the library type is not specified, ``MODULE`` is assumed.
 
 
 
 
 cmake_policy(PUSH)
 cmake_policy(PUSH)
-# numbers and boolean constants
-cmake_policy (SET CMP0012 NEW)
 # foreach loop variable scope
 # foreach loop variable scope
 cmake_policy (SET CMP0124 NEW)
 cmake_policy (SET CMP0124 NEW)
 
 

+ 0 - 4
Modules/FindPython/Support.cmake

@@ -10,10 +10,6 @@
 #
 #
 
 
 cmake_policy(PUSH)
 cmake_policy(PUSH)
-# list supports empty elements
-cmake_policy (SET CMP0007 NEW)
-# numbers and boolean constants
-cmake_policy (SET CMP0012 NEW)
 # IN_LIST operator
 # IN_LIST operator
 cmake_policy (SET CMP0057 NEW)
 cmake_policy (SET CMP0057 NEW)
 # foreach loop variable scope
 # foreach loop variable scope

+ 0 - 6
Modules/FortranCInterface.cmake

@@ -195,9 +195,6 @@ if(FortranCInterface_SOURCE_DIR)
   return()
   return()
 endif()
 endif()
 
 
-cmake_policy(PUSH)
-cmake_policy(SET CMP0007 NEW)
-
 #-----------------------------------------------------------------------------
 #-----------------------------------------------------------------------------
 # Verify that C and Fortran are available.
 # Verify that C and Fortran are available.
 foreach(lang C Fortran)
 foreach(lang C Fortran)
@@ -402,6 +399,3 @@ function(FortranCInterface_VERIFY)
       "The output was:\n  ${_output}")
       "The output was:\n  ${_output}")
   endif()
   endif()
 endfunction()
 endfunction()
-
-# Restore including context policies.
-cmake_policy(POP)

+ 0 - 2
Modules/UseSWIG.cmake

@@ -394,8 +394,6 @@ Deprecated Commands
 #]=======================================================================]
 #]=======================================================================]
 
 
 cmake_policy(PUSH)
 cmake_policy(PUSH)
-# numbers and boolean constants
-cmake_policy (SET CMP0012 NEW)
 # IN_LIST operator
 # IN_LIST operator
 cmake_policy (SET CMP0057 NEW)
 cmake_policy (SET CMP0057 NEW)
 # Ninja generator normalizes custom command depfile paths
 # Ninja generator normalizes custom command depfile paths

+ 0 - 17
Source/cmCMakePolicyCommand.cxx

@@ -5,10 +5,7 @@
 #include "cmExecutionStatus.h"
 #include "cmExecutionStatus.h"
 #include "cmMakefile.h"
 #include "cmMakefile.h"
 #include "cmPolicies.h"
 #include "cmPolicies.h"
-#include "cmState.h"
-#include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
 #include "cmStringAlgorithms.h"
-#include "cmValue.h"
 
 
 namespace {
 namespace {
 bool HandleSetMode(std::vector<std::string> const& args,
 bool HandleSetMode(std::vector<std::string> const& args,
@@ -88,20 +85,6 @@ bool HandleSetMode(std::vector<std::string> const& args,
     status.SetError("SET failed to set policy.");
     status.SetError("SET failed to set policy.");
     return false;
     return false;
   }
   }
-  if (args[1] == "CMP0001" &&
-      (policyStatus == cmPolicies::WARN || policyStatus == cmPolicies::OLD)) {
-    if (!(status.GetMakefile().GetState()->GetInitializedCacheValue(
-          "CMAKE_BACKWARDS_COMPATIBILITY"))) {
-      // Set it to 2.4 because that is the last version where the
-      // variable had meaning.
-      status.GetMakefile().AddCacheDefinition(
-        "CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
-        "For backwards compatibility, what version of CMake "
-        "commands and "
-        "syntax should this version of CMake try to support.",
-        cmStateEnums::STRING);
-    }
-  }
   return true;
   return true;
 }
 }
 
 

+ 0 - 30
Source/cmComputeLinkDepends.cxx

@@ -671,11 +671,6 @@ cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target,
 
 
 cmComputeLinkDepends::~cmComputeLinkDepends() = default;
 cmComputeLinkDepends::~cmComputeLinkDepends() = default;
 
 
-void cmComputeLinkDepends::SetOldLinkDirMode(bool b)
-{
-  this->OldLinkDirMode = b;
-}
-
 std::vector<cmComputeLinkDepends::LinkEntry> const&
 std::vector<cmComputeLinkDepends::LinkEntry> const&
 cmComputeLinkDepends::Compute()
 cmComputeLinkDepends::Compute()
 {
 {
@@ -884,11 +879,6 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry qe)
 
 
       // Handle dependent shared libraries.
       // Handle dependent shared libraries.
       this->FollowSharedDeps(depender_index, iface);
       this->FollowSharedDeps(depender_index, iface);
-
-      // Support for CMP0003.
-      for (cmLinkItem const& oi : iface->WrongConfigLibraries) {
-        this->CheckWrongConfigItem(oi);
-      }
     }
     }
   } else {
   } else {
     // Follow the old-style dependency list.
     // Follow the old-style dependency list.
@@ -999,9 +989,6 @@ void cmComputeLinkDepends::AddVarLinkEntries(
       // If the library is meant for this link type then use it.
       // If the library is meant for this link type then use it.
       if (llt == GENERAL_LibraryType || llt == this->LinkType) {
       if (llt == GENERAL_LibraryType || llt == this->LinkType) {
         actual_libs.emplace_back(this->ResolveLinkItem(depender_index, d));
         actual_libs.emplace_back(this->ResolveLinkItem(depender_index, d));
-      } else if (this->OldLinkDirMode) {
-        cmLinkItem item = this->ResolveLinkItem(depender_index, d);
-        this->CheckWrongConfigItem(item);
       }
       }
 
 
       // Reset the link type until another explicit type is given.
       // Reset the link type until another explicit type is given.
@@ -1028,9 +1015,6 @@ void cmComputeLinkDepends::AddDirectLinkEntries()
       this->AddLinkEntries(cm::nullopt, runtimeEntries->second);
       this->AddLinkEntries(cm::nullopt, runtimeEntries->second);
     }
     }
   }
   }
-  for (cmLinkItem const& wi : impl->WrongConfigLibraries) {
-    this->CheckWrongConfigItem(wi);
-  }
 }
 }
 
 
 template <typename T>
 template <typename T>
@@ -1736,17 +1720,3 @@ void cmComputeLinkDepends::DisplayFinalEntries()
   }
   }
   fprintf(stderr, "\n");
   fprintf(stderr, "\n");
 }
 }
-
-void cmComputeLinkDepends::CheckWrongConfigItem(cmLinkItem const& item)
-{
-  if (!this->OldLinkDirMode) {
-    return;
-  }
-
-  // For CMake 2.4 bug-compatibility we need to consider the output
-  // directories of targets linked in another configuration as link
-  // directories.
-  if (item.Target && !item.Target->IsImported()) {
-    this->OldWrongConfigItems.insert(item.Target);
-  }
-}

+ 0 - 9
Source/cmComputeLinkDepends.h

@@ -85,12 +85,6 @@ public:
   using EntryVector = std::vector<LinkEntry>;
   using EntryVector = std::vector<LinkEntry>;
   EntryVector const& Compute();
   EntryVector const& Compute();
 
 
-  void SetOldLinkDirMode(bool b);
-  std::set<cmGeneratorTarget const*> const& GetOldWrongConfigItems() const
-  {
-    return this->OldWrongConfigItems;
-  }
-
 private:
 private:
   // Context information.
   // Context information.
   cmGeneratorTarget const* Target = nullptr;
   cmGeneratorTarget const* Target = nullptr;
@@ -212,12 +206,9 @@ private:
 
 
   // Record of the original link line.
   // Record of the original link line.
   std::vector<size_t> OriginalEntries;
   std::vector<size_t> OriginalEntries;
-  std::set<cmGeneratorTarget const*> OldWrongConfigItems;
-  void CheckWrongConfigItem(cmLinkItem const& item);
 
 
   // Record of explicitly linked object files.
   // Record of explicitly linked object files.
   std::vector<size_t> ObjectEntries;
   std::vector<size_t> ObjectEntries;
 
 
   size_t ComponentOrderId;
   size_t ComponentOrderId;
-  bool OldLinkDirMode = false;
 };
 };

+ 4 - 232
Source/cmComputeLinkInformation.cxx

@@ -422,25 +422,6 @@ cmComputeLinkInformation::cmComputeLinkInformation(
     this->OrderDependentRPath->AddLanguageDirectories(this->RuntimeLinkDirs);
     this->OrderDependentRPath->AddLanguageDirectories(this->RuntimeLinkDirs);
   }
   }
 
 
-  // Decide whether to enable compatible library search path mode.
-  // There exists code that effectively does
-  //
-  //    /path/to/libA.so -lB
-  //
-  // where -lB is meant to link to /path/to/libB.so.  This is broken
-  // because it specified -lB without specifying a link directory (-L)
-  // in which to search for B.  This worked in CMake 2.4 and below
-  // because -L/path/to would be added by the -L/-l split for A.  In
-  // order to support such projects we need to add the directories
-  // containing libraries linked with a full path to the -L path.
-  this->OldLinkDirMode =
-    this->Target->GetPolicyStatusCMP0003() != cmPolicies::NEW;
-  if (this->OldLinkDirMode) {
-    // Construct a mask to not bother with this behavior for link
-    // directories already specified by the user.
-    this->OldLinkDirMask.insert(directories.begin(), directories.end());
-  }
-
   this->CMP0060Warn = this->Makefile->PolicyOptionalWarningEnabled(
   this->CMP0060Warn = this->Makefile->PolicyOptionalWarningEnabled(
     "CMAKE_POLICY_WARNING_CMP0060");
     "CMAKE_POLICY_WARNING_CMP0060");
 }
 }
@@ -587,7 +568,6 @@ bool cmComputeLinkInformation::Compute()
   // Compute the ordered link line items.
   // Compute the ordered link line items.
   cmComputeLinkDepends cld(this->Target, this->Config, this->LinkLanguage,
   cmComputeLinkDepends cld(this->Target, this->Config, this->LinkLanguage,
                            strategy);
                            strategy);
-  cld.SetOldLinkDirMode(this->OldLinkDirMode);
   cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
   cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
   FeatureDescriptor const* currentFeature = nullptr;
   FeatureDescriptor const* currentFeature = nullptr;
 
 
@@ -667,27 +647,6 @@ bool cmComputeLinkInformation::Compute()
     this->SetCurrentLinkType(this->StartLinkType);
     this->SetCurrentLinkType(this->StartLinkType);
   }
   }
 
 
-  // Finish listing compatibility paths.
-  if (this->OldLinkDirMode) {
-    // For CMake 2.4 bug-compatibility we need to consider the output
-    // directories of targets linked in another configuration as link
-    // directories.
-    std::set<cmGeneratorTarget const*> const& wrongItems =
-      cld.GetOldWrongConfigItems();
-    for (cmGeneratorTarget const* tgt : wrongItems) {
-      cmStateEnums::ArtifactType artifact = tgt->HasImportLibrary(this->Config)
-        ? cmStateEnums::ImportLibraryArtifact
-        : cmStateEnums::RuntimeBinaryArtifact;
-      this->OldLinkDirItems.push_back(
-        tgt->GetFullPath(this->Config, artifact, true));
-    }
-  }
-
-  // Finish setting up linker search directories.
-  if (!this->FinishLinkerSearchDirectories()) {
-    return false;
-  }
-
   // Add implicit language runtime libraries and directories.
   // Add implicit language runtime libraries and directories.
   this->AddImplicitLinkInfo();
   this->AddImplicitLinkInfo();
 
 
@@ -1301,7 +1260,7 @@ void cmComputeLinkInformation::AddItem(LinkEntry const& entry)
       }
       }
     } else if (entry.Kind != cmComputeLinkDepends::LinkEntry::Object) {
     } else if (entry.Kind != cmComputeLinkDepends::LinkEntry::Object) {
       // This is a library or option specified by the user.
       // This is a library or option specified by the user.
-      this->AddUserItem(entry, true);
+      this->AddUserItem(entry);
     }
     }
   }
   }
 }
 }
@@ -1674,14 +1633,6 @@ void cmComputeLinkInformation::AddTargetItem(LinkEntry const& entry)
     return;
     return;
   }
   }
 
 
-  // For compatibility with CMake 2.4 include the item's directory in
-  // the linker search path.
-  if (this->OldLinkDirMode && !target->IsFrameworkOnApple() &&
-      !cm::contains(this->OldLinkDirMask,
-                    cmSystemTools::GetFilenamePath(item.Value))) {
-    this->OldLinkDirItems.push_back(item.Value);
-  }
-
   const bool isImportedFrameworkFolderOnApple =
   const bool isImportedFrameworkFolderOnApple =
     target->IsImportedFrameworkFolderOnApple(this->Config);
     target->IsImportedFrameworkFolderOnApple(this->Config);
   if (target->IsFrameworkOnApple() || isImportedFrameworkFolderOnApple) {
   if (target->IsFrameworkOnApple() || isImportedFrameworkFolderOnApple) {
@@ -1760,19 +1711,6 @@ void cmComputeLinkInformation::AddFullItem(LinkEntry const& entry)
     return;
     return;
   }
   }
 
 
-  // Full path libraries should specify a valid library file name.
-  // See documentation of CMP0008.
-  std::string generator = this->GlobalGenerator->GetName();
-  if (this->Target->GetPolicyStatusCMP0008() != cmPolicies::NEW &&
-      (generator.find("Visual Studio") != std::string::npos ||
-       generator.find("Xcode") != std::string::npos)) {
-    std::string file = cmSystemTools::GetFilenameName(item.Value);
-    if (!this->ExtractAnyLibraryName.find(file)) {
-      this->HandleBadFullItem(entry, file);
-      return;
-    }
-  }
-
   // This is called to handle a link item that is a full path.
   // This is called to handle a link item that is a full path.
   // If the target is not a static library make sure the link type is
   // If the target is not a static library make sure the link type is
   // shared.  This is because dynamic-mode linking can handle both
   // shared.  This is because dynamic-mode linking can handle both
@@ -1790,14 +1728,6 @@ void cmComputeLinkInformation::AddFullItem(LinkEntry const& entry)
     }
     }
   }
   }
 
 
-  // For compatibility with CMake 2.4 include the item's directory in
-  // the linker search path.
-  if (this->OldLinkDirMode &&
-      !cm::contains(this->OldLinkDirMask,
-                    cmSystemTools::GetFilenamePath(item.Value))) {
-    this->OldLinkDirItems.push_back(item.Value);
-  }
-
   // Now add the full path to the library.
   // Now add the full path to the library.
   this->Items.emplace_back(
   this->Items.emplace_back(
     item, ItemIsPath::Yes, nullptr, entry.ObjectSource,
     item, ItemIsPath::Yes, nullptr, entry.ObjectSource,
@@ -1862,7 +1792,7 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(LinkEntry const& entry)
   // library for the architecture at link time.
   // library for the architecture at link time.
   LinkEntry fileEntry{ entry };
   LinkEntry fileEntry{ entry };
   fileEntry.Item = file;
   fileEntry.Item = file;
-  this->AddUserItem(fileEntry, false);
+  this->AddUserItem(fileEntry);
 
 
   // Make sure the link directory ordering will find the library.
   // Make sure the link directory ordering will find the library.
   this->OrderLinkerSearchPath->AddLinkLibrary(item.Value);
   this->OrderLinkerSearchPath->AddLinkLibrary(item.Value);
@@ -1870,8 +1800,7 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(LinkEntry const& entry)
   return true;
   return true;
 }
 }
 
 
-void cmComputeLinkInformation::AddUserItem(LinkEntry const& entry,
-                                           bool pathNotKnown)
+void cmComputeLinkInformation::AddUserItem(LinkEntry const& entry)
 {
 {
   // This is called to handle a link item that does not match a CMake
   // This is called to handle a link item that does not match a CMake
   // target and is not a full path.  We check here if it looks like a
   // target and is not a full path.  We check here if it looks like a
@@ -1886,15 +1815,6 @@ void cmComputeLinkInformation::AddUserItem(LinkEntry const& entry,
 
 
   if (item.Value[0] == '-' || item.Value[0] == '$' || item.Value[0] == '`') {
   if (item.Value[0] == '-' || item.Value[0] == '$' || item.Value[0] == '`') {
     // Pass flags through untouched.
     // Pass flags through untouched.
-    // if this is a -l option then we might need to warn about
-    // CMP0003 so put it in OldUserFlagItems, if it is not a -l
-    // or -Wl,-l (-framework -pthread), then allow it without a
-    // CMP0003 as -L will not affect those other linker flags
-    if (cmHasLiteralPrefix(item.Value, "-l") ||
-        cmHasLiteralPrefix(item.Value, "-Wl,-l")) {
-      // This is a linker option provided by the user.
-      this->OldUserFlagItems.push_back(item.Value);
-    }
 
 
     // Restore the target link type since this item does not specify
     // Restore the target link type since this item does not specify
     // one.
     // one.
@@ -1964,11 +1884,6 @@ void cmComputeLinkInformation::AddUserItem(LinkEntry const& entry,
     // Use just the library name so the linker will search.
     // Use just the library name so the linker will search.
     lib = this->ExtractAnyLibraryName.match(2);
     lib = this->ExtractAnyLibraryName.match(2);
   } else {
   } else {
-    // This is a name specified by the user.
-    if (pathNotKnown) {
-      this->OldUserFlagItems.push_back(item.Value);
-    }
-
     // We must ask the linker to search for a library with this name.
     // We must ask the linker to search for a library with this name.
     // Restore the target link type since this item does not specify
     // Restore the target link type since this item does not specify
     // one.
     // one.
@@ -2154,155 +2069,12 @@ void cmComputeLinkInformation::AddSharedLibNoSOName(LinkEntry const& entry)
   // path instead of just the name.
   // path instead of just the name.
   LinkEntry fileEntry{ entry };
   LinkEntry fileEntry{ entry };
   fileEntry.Item = cmSystemTools::GetFilenameName(entry.Item.Value);
   fileEntry.Item = cmSystemTools::GetFilenameName(entry.Item.Value);
-  this->AddUserItem(fileEntry, false);
+  this->AddUserItem(fileEntry);
 
 
   // Make sure the link directory ordering will find the library.
   // Make sure the link directory ordering will find the library.
   this->OrderLinkerSearchPath->AddLinkLibrary(entry.Item.Value);
   this->OrderLinkerSearchPath->AddLinkLibrary(entry.Item.Value);
 }
 }
 
 
-void cmComputeLinkInformation::HandleBadFullItem(LinkEntry const& entry,
-                                                 std::string const& file)
-{
-  std::string const& item = entry.Item.Value;
-  // Do not depend on things that do not exist.
-  auto i = std::find(this->Depends.begin(), this->Depends.end(), item);
-  if (i != this->Depends.end()) {
-    this->Depends.erase(i);
-  }
-
-  // Tell the linker to search for the item and provide the proper
-  // path for it.  Do not contribute to any CMP0003 warning (do not
-  // put in OldLinkDirItems or OldUserFlagItems).
-  LinkEntry fileEntry{ entry };
-  fileEntry.Item = file;
-  this->AddUserItem(fileEntry, false);
-  this->OrderLinkerSearchPath->AddLinkLibrary(item);
-
-  // Produce any needed message.
-  switch (this->Target->GetPolicyStatusCMP0008()) {
-    case cmPolicies::WARN: {
-      // Print the warning at most once for this item.
-      std::string wid = cmStrCat("CMP0008-WARNING-GIVEN-", item);
-      if (!this->CMakeInstance->GetState()->GetGlobalPropertyAsBool(wid)) {
-        this->CMakeInstance->GetState()->SetGlobalProperty(wid, "1");
-        std::ostringstream w;
-        /* clang-format off */
-        w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0008) << "\n"
-             "Target \"" << this->Target->GetName() << "\" links to item\n"
-             "  " << item << "\n"
-             "which is a full-path but not a valid library file name.";
-        /* clang-format on */
-        this->CMakeInstance->IssueMessage(MessageType::AUTHOR_WARNING, w.str(),
-                                          this->Target->GetBacktrace());
-      }
-    }
-      CM_FALLTHROUGH;
-    case cmPolicies::OLD: // NOLINT(bugprone-branch-clone)
-      // OLD behavior does not warn.
-      break;
-    case cmPolicies::NEW:
-      // NEW behavior will not get here.
-      break;
-  }
-}
-
-bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
-{
-  // Support broken projects if necessary.
-  if (this->OldLinkDirItems.empty() || this->OldUserFlagItems.empty() ||
-      !this->OldLinkDirMode) {
-    return true;
-  }
-
-  // Enforce policy constraints.
-  switch (this->Target->GetPolicyStatusCMP0003()) {
-    case cmPolicies::WARN:
-      if (!this->CMakeInstance->GetState()->GetGlobalPropertyAsBool(
-            "CMP0003-WARNING-GIVEN")) {
-        this->CMakeInstance->GetState()->SetGlobalProperty(
-          "CMP0003-WARNING-GIVEN", "1");
-        std::ostringstream w;
-        this->PrintLinkPolicyDiagnosis(w);
-        this->CMakeInstance->IssueMessage(MessageType::AUTHOR_WARNING, w.str(),
-                                          this->Target->GetBacktrace());
-      }
-      CM_FALLTHROUGH;
-    case cmPolicies::OLD:
-      // OLD behavior is to add the paths containing libraries with
-      // known full paths as link directories.
-      break;
-    case cmPolicies::NEW:
-      // Should never happen due to assignment of OldLinkDirMode
-      return true;
-  }
-
-  // Add the link directories for full path items.
-  for (std::string const& i : this->OldLinkDirItems) {
-    this->OrderLinkerSearchPath->AddLinkLibrary(i);
-  }
-  return true;
-}
-
-void cmComputeLinkInformation::PrintLinkPolicyDiagnosis(std::ostream& os)
-{
-  // Tell the user what to do.
-  /* clang-format off */
-  os << "Policy CMP0003 should be set before this line.  "
-        "Add code such as\n"
-        "  if(COMMAND cmake_policy)\n"
-        "    cmake_policy(SET CMP0003 NEW)\n"
-        "  endif(COMMAND cmake_policy)\n"
-        "as early as possible but after the most recent call to "
-        "cmake_minimum_required or cmake_policy(VERSION).  ";
-  /* clang-format on */
-
-  // List the items that might need the old-style paths.
-  os << "This warning appears because target \"" << this->Target->GetName()
-     << "\" links to some libraries for which the linker must search:\n";
-  {
-    // Format the list of unknown items to be as short as possible while
-    // still fitting in the allowed width (a true solution would be the
-    // bin packing problem if we were allowed to change the order).
-    std::string::size_type max_size = 76;
-    std::string line;
-    const char* sep = "  ";
-    for (std::string const& i : this->OldUserFlagItems) {
-      // If the addition of another item will exceed the limit then
-      // output the current line and reset it.  Note that the separator
-      // is either " " or ", " which is always 2 characters.
-      if (!line.empty() && (line.size() + i.size() + 2) > max_size) {
-        os << line << '\n';
-        sep = "  ";
-        line.clear();
-      }
-      line += sep;
-      line += i;
-      // Convert to the other separator.
-      sep = ", ";
-    }
-    if (!line.empty()) {
-      os << line << '\n';
-    }
-  }
-
-  // List the paths old behavior is adding.
-  os << "and other libraries with known full path:\n";
-  std::set<std::string> emitted;
-  for (std::string const& i : this->OldLinkDirItems) {
-    if (emitted.insert(cmSystemTools::GetFilenamePath(i)).second) {
-      os << "  " << i << '\n';
-    }
-  }
-
-  // Explain.
-  os << "CMake is adding directories in the second list to the linker "
-        "search path in case they are needed to find libraries from the "
-        "first list (for backwards compatibility with CMake 2.4).  "
-        "Set policy CMP0003 to OLD or NEW to enable or disable this "
-        "behavior explicitly.  "
-        "Run \"cmake --help-policy CMP0003\" for more information.";
-}
-
 void cmComputeLinkInformation::LoadImplicitLinkInfo()
 void cmComputeLinkInformation::LoadImplicitLinkInfo()
 {
 {
   // Get platform-wide implicit directories.
   // Get platform-wide implicit directories.

+ 1 - 10
Source/cmComputeLinkInformation.h

@@ -4,7 +4,6 @@
 
 
 #include "cmConfigure.h" // IWYU pragma: keep
 #include "cmConfigure.h" // IWYU pragma: keep
 
 
-#include <iosfwd>
 #include <map>
 #include <map>
 #include <memory>
 #include <memory>
 #include <set>
 #include <set>
@@ -210,13 +209,12 @@ private:
   void AddTargetItem(LinkEntry const& entry);
   void AddTargetItem(LinkEntry const& entry);
   void AddFullItem(LinkEntry const& entry);
   void AddFullItem(LinkEntry const& entry);
   bool CheckImplicitDirItem(LinkEntry const& entry);
   bool CheckImplicitDirItem(LinkEntry const& entry);
-  void AddUserItem(LinkEntry const& entry, bool pathNotKnown);
+  void AddUserItem(LinkEntry const& entry);
   void AddFrameworkItem(LinkEntry const& entry);
   void AddFrameworkItem(LinkEntry const& entry);
   void AddXcFrameworkItem(LinkEntry const& entry);
   void AddXcFrameworkItem(LinkEntry const& entry);
   void DropDirectoryItem(BT<std::string> const& item);
   void DropDirectoryItem(BT<std::string> const& item);
   bool CheckSharedLibNoSOName(LinkEntry const& entry);
   bool CheckSharedLibNoSOName(LinkEntry const& entry);
   void AddSharedLibNoSOName(LinkEntry const& entry);
   void AddSharedLibNoSOName(LinkEntry const& entry);
-  void HandleBadFullItem(LinkEntry const& entry, std::string const& file);
 
 
   // Framework info.
   // Framework info.
   void ComputeFrameworkInfo();
   void ComputeFrameworkInfo();
@@ -227,8 +225,6 @@ private:
 
 
   // Linker search path computation.
   // Linker search path computation.
   std::unique_ptr<cmOrderDirectories> OrderLinkerSearchPath;
   std::unique_ptr<cmOrderDirectories> OrderLinkerSearchPath;
-  bool FinishLinkerSearchDirectories();
-  void PrintLinkPolicyDiagnosis(std::ostream&);
 
 
   void AddExternalObjectTargets();
   void AddExternalObjectTargets();
 
 
@@ -243,17 +239,12 @@ private:
   // Additional paths configured by the runtime linker
   // Additional paths configured by the runtime linker
   std::vector<std::string> RuntimeLinkDirs;
   std::vector<std::string> RuntimeLinkDirs;
 
 
-  // Linker search path compatibility mode.
-  std::set<std::string> OldLinkDirMask;
-  std::vector<std::string> OldLinkDirItems;
-  std::vector<std::string> OldUserFlagItems;
   std::set<std::string> CMP0060WarnItems;
   std::set<std::string> CMP0060WarnItems;
   // Dependent library path computation.
   // Dependent library path computation.
   std::unique_ptr<cmOrderDirectories> OrderDependentRPath;
   std::unique_ptr<cmOrderDirectories> OrderDependentRPath;
   // Runtime path computation.
   // Runtime path computation.
   std::unique_ptr<cmOrderDirectories> OrderRuntimeSearchPath;
   std::unique_ptr<cmOrderDirectories> OrderRuntimeSearchPath;
 
 
-  bool OldLinkDirMode;
   bool IsOpenBSD;
   bool IsOpenBSD;
   bool LinkDependsNoShared;
   bool LinkDependsNoShared;
   bool RuntimeUseChrpath;
   bool RuntimeUseChrpath;

+ 8 - 73
Source/cmConditionEvaluator.cxx

@@ -219,7 +219,6 @@ cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile,
                                            cmListFileBacktrace bt)
                                            cmListFileBacktrace bt)
   : Makefile(makefile)
   : Makefile(makefile)
   , Backtrace(std::move(bt))
   , Backtrace(std::move(bt))
-  , Policy12Status(makefile.GetPolicyStatus(cmPolicies::CMP0012))
   , Policy54Status(makefile.GetPolicyStatus(cmPolicies::CMP0054))
   , Policy54Status(makefile.GetPolicyStatus(cmPolicies::CMP0054))
   , Policy57Status(makefile.GetPolicyStatus(cmPolicies::CMP0057))
   , Policy57Status(makefile.GetPolicyStatus(cmPolicies::CMP0057))
   , Policy64Status(makefile.GetPolicyStatus(cmPolicies::CMP0064))
   , Policy64Status(makefile.GetPolicyStatus(cmPolicies::CMP0064))
@@ -292,8 +291,7 @@ bool cmConditionEvaluator::IsTrue(
     return false;
     return false;
   }
   }
 
 
-  return this->GetBooleanValueWithAutoDereference(newArgs.front(), errorString,
-                                                  status, true);
+  return this->GetBooleanValue(newArgs.front());
 }
 }
 
 
 //=========================================================================
 //=========================================================================
@@ -402,64 +400,6 @@ bool cmConditionEvaluator::GetBooleanValue(
   return !def.IsOff();
   return !def.IsOff();
 }
 }
 
 
-//=========================================================================
-// Boolean value behavior from CMake 2.6.4 and below.
-bool cmConditionEvaluator::GetBooleanValueOld(
-  cmExpandedCommandArgument const& arg, bool const one) const
-{
-  if (one) {
-    // Old IsTrue behavior for single argument.
-    if (arg == "0") {
-      return false;
-    }
-    if (arg == "1") {
-      return true;
-    }
-    cmValue def = this->GetDefinitionIfUnquoted(arg);
-    return !def.IsOff();
-  }
-  // Old GetVariableOrNumber behavior.
-  cmValue def = this->GetDefinitionIfUnquoted(arg);
-  if (!def && std::atoi(arg.GetValue().c_str())) {
-    def = cmValue(arg.GetValue());
-  }
-  return !def.IsOff();
-}
-
-//=========================================================================
-// returns the resulting boolean value
-bool cmConditionEvaluator::GetBooleanValueWithAutoDereference(
-  cmExpandedCommandArgument& newArg, std::string& errorString,
-  MessageType& status, bool const oneArg) const
-{
-  // Use the policy if it is set.
-  if (this->Policy12Status == cmPolicies::NEW) {
-    return this->GetBooleanValue(newArg);
-  }
-  if (this->Policy12Status == cmPolicies::OLD) {
-    return this->GetBooleanValueOld(newArg, oneArg);
-  }
-
-  // Check policy only if old and new results differ.
-  const auto newResult = this->GetBooleanValue(newArg);
-  const auto oldResult = this->GetBooleanValueOld(newArg, oneArg);
-  if (newResult != oldResult) {
-    switch (this->Policy12Status) {
-      case cmPolicies::WARN:
-        errorString = "An argument named \"" + newArg.GetValue() +
-          "\" appears in a conditional statement.  " +
-          cmPolicies::GetPolicyWarning(cmPolicies::CMP0012);
-        status = MessageType::AUTHOR_WARNING;
-        CM_FALLTHROUGH;
-      case cmPolicies::OLD:
-        return oldResult;
-      case cmPolicies::NEW:
-        break;
-    }
-  }
-  return newResult;
-}
-
 template <int N>
 template <int N>
 inline int cmConditionEvaluator::matchKeysImpl(
 inline int cmConditionEvaluator::matchKeysImpl(
   const cmExpandedCommandArgument&)
   const cmExpandedCommandArgument&)
@@ -823,15 +763,13 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
 
 
 //=========================================================================
 //=========================================================================
 // level 3 handles NOT
 // level 3 handles NOT
-bool cmConditionEvaluator::HandleLevel3(cmArgumentList& newArgs,
-                                        std::string& errorString,
-                                        MessageType& status)
+bool cmConditionEvaluator::HandleLevel3(cmArgumentList& newArgs, std::string&,
+                                        MessageType&)
 {
 {
   for (auto args = newArgs.make2ArgsIterator(); args.next != newArgs.end();
   for (auto args = newArgs.make2ArgsIterator(); args.next != newArgs.end();
        args.advance(newArgs)) {
        args.advance(newArgs)) {
     if (this->IsKeyword(keyNOT, *args.current)) {
     if (this->IsKeyword(keyNOT, *args.current)) {
-      const auto rhs = this->GetBooleanValueWithAutoDereference(
-        *args.next, errorString, status);
+      const auto rhs = this->GetBooleanValue(*args.next);
       newArgs.ReduceOneArg(!rhs, args);
       newArgs.ReduceOneArg(!rhs, args);
     }
     }
   }
   }
@@ -840,9 +778,8 @@ bool cmConditionEvaluator::HandleLevel3(cmArgumentList& newArgs,
 
 
 //=========================================================================
 //=========================================================================
 // level 4 handles AND OR
 // level 4 handles AND OR
-bool cmConditionEvaluator::HandleLevel4(cmArgumentList& newArgs,
-                                        std::string& errorString,
-                                        MessageType& status)
+bool cmConditionEvaluator::HandleLevel4(cmArgumentList& newArgs, std::string&,
+                                        MessageType&)
 {
 {
   for (auto args = newArgs.make3ArgsIterator(); args.nextnext != newArgs.end();
   for (auto args = newArgs.make3ArgsIterator(); args.nextnext != newArgs.end();
        args.advance(newArgs)) {
        args.advance(newArgs)) {
@@ -850,10 +787,8 @@ bool cmConditionEvaluator::HandleLevel4(cmArgumentList& newArgs,
     int matchNo;
     int matchNo;
 
 
     if ((matchNo = this->matchKeys(*args.next, keyAND, keyOR))) {
     if ((matchNo = this->matchKeys(*args.next, keyAND, keyOR))) {
-      const auto lhs = this->GetBooleanValueWithAutoDereference(
-        *args.current, errorString, status);
-      const auto rhs = this->GetBooleanValueWithAutoDereference(
-        *args.nextnext, errorString, status);
+      const auto lhs = this->GetBooleanValue(*args.current);
+      const auto rhs = this->GetBooleanValue(*args.nextnext);
       // clang-format off
       // clang-format off
       const auto result =
       const auto result =
         cmRt2CtSelector<
         cmRt2CtSelector<

+ 0 - 9
Source/cmConditionEvaluator.h

@@ -42,14 +42,6 @@ private:
 
 
   bool GetBooleanValue(cmExpandedCommandArgument& arg) const;
   bool GetBooleanValue(cmExpandedCommandArgument& arg) const;
 
 
-  bool GetBooleanValueOld(cmExpandedCommandArgument const& arg,
-                          bool one) const;
-
-  bool GetBooleanValueWithAutoDereference(cmExpandedCommandArgument& newArg,
-                                          std::string& errorString,
-                                          MessageType& status,
-                                          bool oneArg = false) const;
-
   template <int N>
   template <int N>
   int matchKeysImpl(const cmExpandedCommandArgument&);
   int matchKeysImpl(const cmExpandedCommandArgument&);
 
 
@@ -75,7 +67,6 @@ private:
 
 
   cmMakefile& Makefile;
   cmMakefile& Makefile;
   cmListFileBacktrace Backtrace;
   cmListFileBacktrace Backtrace;
-  cmPolicies::PolicyStatus Policy12Status;
   cmPolicies::PolicyStatus Policy54Status;
   cmPolicies::PolicyStatus Policy54Status;
   cmPolicies::PolicyStatus Policy57Status;
   cmPolicies::PolicyStatus Policy57Status;
   cmPolicies::PolicyStatus Policy64Status;
   cmPolicies::PolicyStatus Policy64Status;

+ 1 - 39
Source/cmFileCommand.cxx

@@ -677,28 +677,14 @@ bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse,
   i++;
   i++;
   cmsys::Glob g;
   cmsys::Glob g;
   g.SetRecurse(recurse);
   g.SetRecurse(recurse);
-
-  bool explicitFollowSymlinks = false;
-  cmPolicies::PolicyStatus policyStatus =
-    status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0009);
   if (recurse) {
   if (recurse) {
-    switch (policyStatus) {
-      case cmPolicies::NEW:
-        g.RecurseThroughSymlinksOff();
-        break;
-      case cmPolicies::WARN:
-        CM_FALLTHROUGH;
-      case cmPolicies::OLD:
-        g.RecurseThroughSymlinksOn();
-        break;
-    }
+    g.RecurseThroughSymlinksOff();
   }
   }
 
 
   cmake* cm = status.GetMakefile().GetCMakeInstance();
   cmake* cm = status.GetMakefile().GetCMakeInstance();
   std::vector<std::string> files;
   std::vector<std::string> files;
   bool configureDepends = false;
   bool configureDepends = false;
   bool warnConfigureLate = false;
   bool warnConfigureLate = false;
-  bool warnFollowedSymlinks = false;
   const cmake::WorkingMode workingMode = cm->GetWorkingMode();
   const cmake::WorkingMode workingMode = cm->GetWorkingMode();
   while (i != args.end()) {
   while (i != args.end()) {
     if (*i == "LIST_DIRECTORIES") {
     if (*i == "LIST_DIRECTORIES") {
@@ -722,7 +708,6 @@ bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse,
     } else if (*i == "FOLLOW_SYMLINKS") {
     } else if (*i == "FOLLOW_SYMLINKS") {
       ++i; // skip FOLLOW_SYMLINKS
       ++i; // skip FOLLOW_SYMLINKS
       if (recurse) {
       if (recurse) {
-        explicitFollowSymlinks = true;
         g.RecurseThroughSymlinksOn();
         g.RecurseThroughSymlinksOn();
         if (i == args.end()) {
         if (i == args.end()) {
           status.SetError(
           status.SetError(
@@ -805,11 +790,6 @@ bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse,
         }
         }
       }
       }
 
 
-      if (recurse && !explicitFollowSymlinks &&
-          g.GetFollowedSymlinkCount() != 0) {
-        warnFollowedSymlinks = true;
-      }
-
       std::vector<std::string>& foundFiles = g.GetFiles();
       std::vector<std::string>& foundFiles = g.GetFiles();
       cm::append(files, foundFiles);
       cm::append(files, foundFiles);
 
 
@@ -834,24 +814,6 @@ bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse,
     }
     }
   }
   }
 
 
-  switch (policyStatus) {
-    case cmPolicies::NEW:
-      // Correct behavior, yay!
-      break;
-    case cmPolicies::OLD:
-    // Probably not really the expected behavior, but the author explicitly
-    // asked for the old behavior... no warning.
-    case cmPolicies::WARN:
-      // Possibly unexpected old behavior *and* we actually traversed
-      // symlinks without being explicitly asked to: warn the author.
-      if (warnFollowedSymlinks) {
-        status.GetMakefile().IssueMessage(
-          MessageType::AUTHOR_WARNING,
-          cmPolicies::GetPolicyWarning(cmPolicies::CMP0009));
-      }
-      break;
-  }
-
   std::sort(files.begin(), files.end());
   std::sort(files.begin(), files.end());
   files.erase(std::unique(files.begin(), files.end()), files.end());
   files.erase(std::unique(files.begin(), files.end()), files.end());
   status.GetMakefile().AddDefinition(variable, cmList::to_string(files));
   status.GetMakefile().AddDefinition(variable, cmList::to_string(files));

+ 2 - 2
Source/cmFindPackageCommand.cxx

@@ -2789,8 +2789,8 @@ bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file,
                                   this->VersionRangeMax);
                                   this->VersionRangeMax);
   }
   }
 
 
-  // Load the version check file.  Pass NoPolicyScope because we do
-  // our own policy push/pop independent of CMP0011.
+  // Load the version check file.
+  // Pass NoPolicyScope because we do our own policy push/pop.
   bool suitable = false;
   bool suitable = false;
   if (this->ReadListFile(version_file, NoPolicyScope)) {
   if (this->ReadListFile(version_file, NoPolicyScope)) {
     // Check the output variables.
     // Check the output variables.

+ 5 - 21
Source/cmGeneratorTarget.cxx

@@ -4753,27 +4753,11 @@ std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const
   }
   }
   if (lib != item) {
   if (lib != item) {
     cmake* cm = this->LocalGenerator->GetCMakeInstance();
     cmake* cm = this->LocalGenerator->GetCMakeInstance();
-    switch (this->GetPolicyStatusCMP0004()) {
-      case cmPolicies::WARN: {
-        std::ostringstream w;
-        w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0004) << "\n"
-          << "Target \"" << this->GetName() << "\" links to item \"" << item
-          << "\" which has leading or trailing whitespace.";
-        cm->IssueMessage(MessageType::AUTHOR_WARNING, w.str(),
-                         this->GetBacktrace());
-      }
-        CM_FALLTHROUGH;
-      case cmPolicies::OLD:
-        break;
-      case cmPolicies::NEW: {
-        std::ostringstream e;
-        e << "Target \"" << this->GetName() << "\" links to item \"" << item
-          << "\" which has leading or trailing whitespace.  "
-          << "This is now an error according to policy CMP0004.";
-        cm->IssueMessage(MessageType::FATAL_ERROR, e.str(),
-                         this->GetBacktrace());
-      } break;
-    }
+    std::ostringstream e;
+    e << "Target \"" << this->GetName() << "\" links to item \"" << item
+      << "\" which has leading or trailing whitespace.  "
+      << "This is now an error according to policy CMP0004.";
+    cm->IssueMessage(MessageType::FATAL_ERROR, e.str(), this->GetBacktrace());
   }
   }
   return lib;
   return lib;
 }
 }

+ 0 - 1
Source/cmGeneratorTarget.h

@@ -1238,7 +1238,6 @@ private:
                                           bool secondPass) const;
                                           bool secondPass) const;
   void ComputeLinkInterface(const std::string& config,
   void ComputeLinkInterface(const std::string& config,
                             cmOptionalLinkInterface& iface,
                             cmOptionalLinkInterface& iface,
-                            const cmGeneratorTarget* head,
                             bool secondPass) const;
                             bool secondPass) const;
   cmLinkImplementation const* GetLinkImplementation(const std::string& config,
   cmLinkImplementation const* GetLinkImplementation(const std::string& config,
                                                     UseTo usage,
                                                     UseTo usage,

+ 4 - 11
Source/cmGeneratorTarget_Link.cxx

@@ -676,7 +676,7 @@ cmLinkInterface const* cmGeneratorTarget::GetLinkInterface(
   if (!iface.AllDone) {
   if (!iface.AllDone) {
     iface.AllDone = true;
     iface.AllDone = true;
     if (iface.Exists) {
     if (iface.Exists) {
-      this->ComputeLinkInterface(config, iface, head, secondPass);
+      this->ComputeLinkInterface(config, iface, secondPass);
       this->ComputeLinkInterfaceRuntimeLibraries(config, iface);
       this->ComputeLinkInterfaceRuntimeLibraries(config, iface);
     }
     }
   }
   }
@@ -684,9 +684,9 @@ cmLinkInterface const* cmGeneratorTarget::GetLinkInterface(
   return iface.Exists ? &iface : nullptr;
   return iface.Exists ? &iface : nullptr;
 }
 }
 
 
-void cmGeneratorTarget::ComputeLinkInterface(
-  const std::string& config, cmOptionalLinkInterface& iface,
-  cmGeneratorTarget const* headTarget, bool secondPass) const
+void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
+                                             cmOptionalLinkInterface& iface,
+                                             bool secondPass) const
 {
 {
   if (iface.Explicit) {
   if (iface.Explicit) {
     if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
     if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
@@ -721,11 +721,7 @@ void cmGeneratorTarget::ComputeLinkInterface(
   } else if (this->GetPolicyStatusCMP0022() == cmPolicies::WARN ||
   } else if (this->GetPolicyStatusCMP0022() == cmPolicies::WARN ||
              this->GetPolicyStatusCMP0022() == cmPolicies::OLD) {
              this->GetPolicyStatusCMP0022() == cmPolicies::OLD) {
     // The link implementation is the default link interface.
     // The link implementation is the default link interface.
-    cmLinkImplementationLibraries const* impl =
-      this->GetLinkImplementationLibrariesInternal(config, headTarget,
-                                                   UseTo::Link);
     iface.ImplementationIsInterface = true;
     iface.ImplementationIsInterface = true;
-    iface.WrongConfigLibraries = impl->WrongConfigLibraries;
   }
   }
 
 
   if (this->LinkLanguagePropagatesToDependents()) {
   if (this->LinkLanguagePropagatesToDependents()) {
@@ -1459,9 +1455,6 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
       if (name == this->GetName() || name.empty()) {
       if (name == this->GetName() || name.empty()) {
         continue;
         continue;
       }
       }
-      // Support OLD behavior for CMP0003.
-      impl.WrongConfigLibraries.push_back(
-        this->ResolveLinkItem(BT<std::string>(name), linkFeature));
     }
     }
   }
   }
 }
 }

+ 0 - 2
Source/cmGlobVerificationManager.cxx

@@ -42,8 +42,6 @@ bool cmGlobVerificationManager::SaveVerificationScript(const std::string& path,
                    << cmVersion::GetMajorVersion() << "."
                    << cmVersion::GetMajorVersion() << "."
                    << cmVersion::GetMinorVersion() << "\n";
                    << cmVersion::GetMinorVersion() << "\n";
 
 
-  verifyScriptFile << "cmake_policy(SET CMP0009 NEW)\n";
-
   for (auto const& i : this->Cache) {
   for (auto const& i : this->Cache) {
     CacheEntryKey k = std::get<0>(i);
     CacheEntryKey k = std::get<0>(i);
     CacheEntryValue v = std::get<1>(i);
     CacheEntryValue v = std::get<1>(i);

+ 0 - 26
Source/cmInstallCommand.cxx

@@ -105,7 +105,6 @@ public:
   bool MakeFilesFullPath(const char* modeName, const std::string& basePath,
   bool MakeFilesFullPath(const char* modeName, const std::string& basePath,
                          const std::vector<std::string>& relFiles,
                          const std::vector<std::string>& relFiles,
                          std::vector<std::string>& absFiles);
                          std::vector<std::string>& absFiles);
-  bool CheckCMP0006() const;
 
 
   std::string GetDestination(const cmInstallCommandArguments* args,
   std::string GetDestination(const cmInstallCommandArguments* args,
                              const std::string& varName,
                              const std::string& varName,
@@ -1017,13 +1016,6 @@ bool HandleTargetsMode(std::vector<std::string> const& args,
           if (!bundleArgs.GetDestination().empty()) {
           if (!bundleArgs.GetDestination().empty()) {
             bundleGenerator = CreateInstallTargetGenerator(
             bundleGenerator = CreateInstallTargetGenerator(
               target, bundleArgs, false, helper.Makefile->GetBacktrace());
               target, bundleArgs, false, helper.Makefile->GetBacktrace());
-          } else if (!runtimeArgs.GetDestination().empty()) {
-            if (helper.CheckCMP0006()) {
-              // For CMake 2.4 compatibility fallback to the RUNTIME
-              // properties.
-              bundleGenerator = CreateInstallTargetGenerator(
-                target, runtimeArgs, false, helper.Makefile->GetBacktrace());
-            }
           }
           }
           if (!bundleGenerator) {
           if (!bundleGenerator) {
             status.SetError(cmStrCat("TARGETS given no BUNDLE DESTINATION for "
             status.SetError(cmStrCat("TARGETS given no BUNDLE DESTINATION for "
@@ -2482,24 +2474,6 @@ bool Helper::MakeFilesFullPath(const char* modeName,
   return true;
   return true;
 }
 }
 
 
-bool Helper::CheckCMP0006() const
-{
-  switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0006)) {
-    case cmPolicies::WARN:
-      this->Makefile->IssueMessage(
-        MessageType::AUTHOR_WARNING,
-        cmPolicies::GetPolicyWarning(cmPolicies::CMP0006));
-      CM_FALLTHROUGH;
-    case cmPolicies::OLD:
-      // OLD behavior is to allow compatibility
-      return true;
-    case cmPolicies::NEW:
-      // NEW behavior is to disallow compatibility
-      break;
-  }
-  return false;
-}
-
 std::string Helper::GetDestination(const cmInstallCommandArguments* args,
 std::string Helper::GetDestination(const cmInstallCommandArguments* args,
                                    const std::string& varName,
                                    const std::string& varName,
                                    const std::string& guess) const
                                    const std::string& guess) const

+ 0 - 8
Source/cmLinkItem.h

@@ -65,10 +65,6 @@ struct cmLinkImplementationLibraries
   // Object files linked directly in this configuration.
   // Object files linked directly in this configuration.
   std::vector<cmLinkItem> Objects;
   std::vector<cmLinkItem> Objects;
 
 
-  // Libraries linked directly in other configurations.
-  // Needed only for OLD behavior of CMP0003.
-  std::vector<cmLinkItem> WrongConfigLibraries;
-
   // Whether the list depends on a genex referencing the configuration.
   // Whether the list depends on a genex referencing the configuration.
   bool HadContextSensitiveCondition = false;
   bool HadContextSensitiveCondition = false;
 };
 };
@@ -108,10 +104,6 @@ struct cmLinkInterface : public cmLinkInterfaceLibraries
   // or more static libraries.
   // or more static libraries.
   unsigned int Multiplicity = 0;
   unsigned int Multiplicity = 0;
 
 
-  // Libraries listed for other configurations.
-  // Needed only for OLD behavior of CMP0003.
-  std::vector<cmLinkItem> WrongConfigLibraries;
-
   bool ImplementationIsInterface = false;
   bool ImplementationIsInterface = false;
 
 
   // Whether the list depends on a link language genex.
   // Whether the list depends on a link language genex.

+ 0 - 23
Source/cmListCommand.cxx

@@ -89,29 +89,6 @@ cm::optional<cmList> GetList(const std::string& var,
   if (!cm::contains(*list, std::string())) {
   if (!cm::contains(*list, std::string())) {
     return list;
     return list;
   }
   }
-  // if we have empty elements we need to check policy CMP0007
-  switch (makefile.GetPolicyStatus(cmPolicies::CMP0007)) {
-    case cmPolicies::WARN: {
-      // Default is to warn and use old behavior
-      // OLD behavior is to allow compatibility, so recall
-      // ExpandListArgument without the true which will remove
-      // empty values
-      list->assign(listString);
-      std::string warn =
-        cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0007),
-                 " List has value = [", listString, "].");
-      makefile.IssueMessage(MessageType::AUTHOR_WARNING, warn);
-      return list;
-    }
-    case cmPolicies::OLD:
-      // OLD behavior is to allow compatibility, so recall
-      // ExpandListArgument without the true which will remove
-      // empty values
-      list->assign(listString);
-      return list;
-    case cmPolicies::NEW:
-      return list;
-  }
   return list;
   return list;
 }
 }
 
 

+ 6 - 64
Source/cmLocalGenerator.cxx

@@ -58,7 +58,6 @@
 #include "cmTarget.h"
 #include "cmTarget.h"
 #include "cmTestGenerator.h"
 #include "cmTestGenerator.h"
 #include "cmValue.h"
 #include "cmValue.h"
-#include "cmVersion.h"
 #include "cmake.h"
 #include "cmake.h"
 
 
 #if defined(__HAIKU__)
 #if defined(__HAIKU__)
@@ -102,8 +101,6 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg, cmMakefile* makefile)
   this->AliasTargets = makefile->GetAliasTargets();
   this->AliasTargets = makefile->GetAliasTargets();
 
 
   this->EmitUniversalBinaryFlags = true;
   this->EmitUniversalBinaryFlags = true;
-  this->BackwardsCompatibility = 0;
-  this->BackwardsCompatibilityFinal = false;
 
 
   this->ComputeObjectMaxPath();
   this->ComputeObjectMaxPath();
 
 
@@ -4327,15 +4324,12 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
   bool keptSourceExtension = true;
   bool keptSourceExtension = true;
   if (!source.GetPropertyAsBool("KEEP_EXTENSION")) {
   if (!source.GetPropertyAsBool("KEEP_EXTENSION")) {
     // Decide whether this language wants to replace the source
     // Decide whether this language wants to replace the source
-    // extension with the object extension.  For CMake 2.4
-    // compatibility do this by default.
-    bool replaceExt = this->NeedBackwardsCompatibility_2_4();
-    if (!replaceExt) {
-      std::string lang = source.GetLanguage();
-      if (!lang.empty()) {
-        replaceExt = this->Makefile->IsOn(
-          cmStrCat("CMAKE_", lang, "_OUTPUT_EXTENSION_REPLACE"));
-      }
+    // extension with the object extension.
+    bool replaceExt = false;
+    std::string lang = source.GetLanguage();
+    if (!lang.empty()) {
+      replaceExt = this->Makefile->IsOn(
+        cmStrCat("CMAKE_", lang, "_OUTPUT_EXTENSION_REPLACE"));
     }
     }
 
 
     // Remove the source extension if it is to be replaced.
     // Remove the source extension if it is to be replaced.
@@ -4400,58 +4394,6 @@ std::string cmLocalGenerator::GetTargetDirectory(
   return "";
   return "";
 }
 }
 
 
-KWIML_INT_uint64_t cmLocalGenerator::GetBackwardsCompatibility()
-{
-  // The computed version may change until the project is fully
-  // configured.
-  if (!this->BackwardsCompatibilityFinal) {
-    unsigned int major = 0;
-    unsigned int minor = 0;
-    unsigned int patch = 0;
-    if (cmValue value =
-          this->Makefile->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY")) {
-      switch (sscanf(value->c_str(), "%u.%u.%u", &major, &minor, &patch)) {
-        case 2:
-          patch = 0;
-          break;
-        case 1:
-          minor = 0;
-          patch = 0;
-          break;
-        default:
-          break;
-      }
-    }
-    this->BackwardsCompatibility = CMake_VERSION_ENCODE(major, minor, patch);
-    this->BackwardsCompatibilityFinal = true;
-  }
-
-  return this->BackwardsCompatibility;
-}
-
-bool cmLocalGenerator::NeedBackwardsCompatibility_2_4()
-{
-  // Check the policy to decide whether to pay attention to this
-  // variable.
-  switch (this->GetPolicyStatus(cmPolicies::CMP0001)) {
-    case cmPolicies::WARN:
-      // WARN is just OLD without warning because user code does not
-      // always affect whether this check is done.
-      CM_FALLTHROUGH;
-    case cmPolicies::OLD:
-      // Old behavior is to check the variable.
-      break;
-    case cmPolicies::NEW:
-      // New behavior is to ignore the variable.
-      return false;
-  }
-
-  // Compatibility is needed if CMAKE_BACKWARDS_COMPATIBILITY is set
-  // equal to or lower than the given version.
-  KWIML_INT_uint64_t actual_compat = this->GetBackwardsCompatibility();
-  return (actual_compat && actual_compat <= CMake_VERSION_ENCODE(2, 4, 255));
-}
-
 cmPolicies::PolicyStatus cmLocalGenerator::GetPolicyStatus(
 cmPolicies::PolicyStatus cmLocalGenerator::GetPolicyStatus(
   cmPolicies::PolicyID id) const
   cmPolicies::PolicyID id) const
 {
 {

+ 0 - 22
Source/cmLocalGenerator.h

@@ -16,8 +16,6 @@
 
 
 #include <cm/optional>
 #include <cm/optional>
 
 
-#include <cm3p/kwiml/int.h>
-
 #include "cmCustomCommandTypes.h"
 #include "cmCustomCommandTypes.h"
 #include "cmGeneratorOptions.h"
 #include "cmGeneratorOptions.h"
 #include "cmGeneratorTarget.h"
 #include "cmGeneratorTarget.h"
@@ -433,23 +431,6 @@ public:
   virtual std::string GetTargetDirectory(
   virtual std::string GetTargetDirectory(
     cmGeneratorTarget const* target) const;
     cmGeneratorTarget const* target) const;
 
 
-  /**
-   * Get the level of backwards compatibility requested by the project
-   * in this directory.  This is the value of the CMake variable
-   * CMAKE_BACKWARDS_COMPATIBILITY whose format is
-   * "major.minor[.patch]".  The returned integer is encoded as
-   *
-   *   CMake_VERSION_ENCODE(major, minor, patch)
-   *
-   * and is monotonically increasing with the CMake version.
-   */
-  KWIML_INT_uint64_t GetBackwardsCompatibility();
-
-  /**
-   * Test whether compatibility is set to a given version or lower.
-   */
-  bool NeedBackwardsCompatibility_2_4();
-
   cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id) const;
   cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id) const;
 
 
   cmake* GetCMakeInstance() const;
   cmake* GetCMakeInstance() const;
@@ -617,9 +598,6 @@ protected:
 
 
   bool EmitUniversalBinaryFlags;
   bool EmitUniversalBinaryFlags;
 
 
-  KWIML_INT_uint64_t BackwardsCompatibility;
-  bool BackwardsCompatibilityFinal;
-
 private:
 private:
   /**
   /**
    * See LinearGetSourceFileWithOutput for background information
    * See LinearGetSourceFileWithOutput for background information

+ 21 - 206
Source/cmMakefile.cxx

@@ -131,7 +131,7 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
   this->PushLoopBlockBarrier();
   this->PushLoopBlockBarrier();
 
 
   // By default the check is not done.  It is enabled by
   // By default the check is not done.  It is enabled by
-  // cmListFileCache in the top level if necessary.
+  // cmMakefile::Configure in the top level if necessary.
   this->CheckCMP0000 = false;
   this->CheckCMP0000 = false;
 
 
 #if !defined(CMAKE_BOOTSTRAP)
 #if !defined(CMAKE_BOOTSTRAP)
@@ -601,9 +601,7 @@ public:
 private:
 private:
   cmMakefile* Makefile;
   cmMakefile* Makefile;
   bool NoPolicyScope;
   bool NoPolicyScope;
-  bool CheckCMP0011 = false;
   bool ReportError = true;
   bool ReportError = true;
-  void EnforceCMP0011();
 };
 };
 
 
 cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
 cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
@@ -621,48 +619,15 @@ cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
     this->Makefile->GetState()->CreateIncludeFileSnapshot(
     this->Makefile->GetState()->CreateIncludeFileSnapshot(
       this->Makefile->StateSnapshot, filenametoread);
       this->Makefile->StateSnapshot, filenametoread);
   if (!this->NoPolicyScope) {
   if (!this->NoPolicyScope) {
-    // Check CMP0011 to determine the policy scope type.
-    switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0011)) {
-      case cmPolicies::WARN:
-        // We need to push a scope to detect whether the script sets
-        // any policies that would affect the includer and therefore
-        // requires a warning.  We use a weak scope to simulate OLD
-        // behavior by allowing policy changes to affect the includer.
-        this->Makefile->PushPolicy(true);
-        this->CheckCMP0011 = true;
-        break;
-      case cmPolicies::OLD:
-        // OLD behavior is to not push a scope at all.
-        this->NoPolicyScope = true;
-        break;
-      case cmPolicies::NEW:
-        // NEW behavior is to push a (strong) scope.
-        this->Makefile->PushPolicy();
-        break;
-    }
+    this->Makefile->PushPolicy();
   }
   }
 }
 }
 
 
 cmMakefile::IncludeScope::~IncludeScope()
 cmMakefile::IncludeScope::~IncludeScope()
 {
 {
   if (!this->NoPolicyScope) {
   if (!this->NoPolicyScope) {
-    // If we need to enforce policy CMP0011 then the top entry is the
-    // one we pushed above.  If the entry is empty, then the included
-    // script did not set any policies that might affect the includer so
-    // we do not need to enforce the policy.
-    if (this->CheckCMP0011 &&
-        !this->Makefile->StateSnapshot.HasDefinedPolicyCMP0011()) {
-      this->CheckCMP0011 = false;
-    }
-
     // Pop the scope we pushed for the script.
     // Pop the scope we pushed for the script.
     this->Makefile->PopPolicy();
     this->Makefile->PopPolicy();
-
-    // We enforce the policy after the script's policy stack entry has
-    // been removed.
-    if (this->CheckCMP0011) {
-      this->EnforceCMP0011();
-    }
   }
   }
   this->Makefile->PopSnapshot(this->ReportError);
   this->Makefile->PopSnapshot(this->ReportError);
 
 
@@ -671,36 +636,6 @@ cmMakefile::IncludeScope::~IncludeScope()
   this->Makefile->Backtrace = this->Makefile->Backtrace.Pop();
   this->Makefile->Backtrace = this->Makefile->Backtrace.Pop();
 }
 }
 
 
-void cmMakefile::IncludeScope::EnforceCMP0011()
-{
-  // We check the setting of this policy again because the included
-  // script might actually set this policy for its includer.
-  switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0011)) {
-    case cmPolicies::WARN:
-      // Warn because the user did not set this policy.
-      {
-        auto e = cmStrCat(
-          cmPolicies::GetPolicyWarning(cmPolicies::CMP0011),
-          "\n"
-          "The included script\n"
-          "  ",
-          this->Makefile->GetBacktrace().Top().FilePath,
-          "\n"
-          "affects policy settings.  "
-          "CMake is implying the NO_POLICY_SCOPE option for compatibility, "
-          "so the effects are applied to the including context.");
-        this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, e);
-      }
-      break;
-    case cmPolicies::OLD:
-    case cmPolicies::NEW:
-      // The script set this policy.  We assume the purpose of the
-      // script is to initialize policies for its includer, and since
-      // the policy is now set for later scripts, we do not warn.
-      break;
-  }
-}
-
 bool cmMakefile::ReadDependentFile(const std::string& filename,
 bool cmMakefile::ReadDependentFile(const std::string& filename,
                                    bool noPolicyScope)
                                    bool noPolicyScope)
 {
 {
@@ -986,24 +921,9 @@ void cmMakefile::EnforceDirectoryLevelRules() const
                "support older CMake versions for this project.  "
                "support older CMake versions for this project.  "
                "For more information run "
                "For more information run "
                "\"cmake --help-policy CMP0000\".");
                "\"cmake --help-policy CMP0000\".");
-    switch (this->GetPolicyStatus(cmPolicies::CMP0000)) {
-      case cmPolicies::WARN:
-        // Warn because the user did not provide a minimum required
-        // version.
-        this->GetCMakeInstance()->IssueMessage(MessageType::AUTHOR_WARNING, e,
-                                               this->Backtrace);
-        CM_FALLTHROUGH;
-      case cmPolicies::OLD:
-        // OLD behavior is to use policy version 2.4 set in
-        // cmListFileCache.
-        break;
-      case cmPolicies::NEW:
-        // NEW behavior is to issue an error.
-        this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e,
-                                               this->Backtrace);
-        cmSystemTools::SetFatalErrorOccurred();
-        break;
-    }
+    this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e,
+                                           this->Backtrace);
+    cmSystemTools::SetFatalErrorOccurred();
   }
   }
 }
 }
 
 
@@ -1538,27 +1458,6 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
     return false;
     return false;
   }
   }
 
 
-  // Definitions with non-trivial values require a policy check.
-  static cmsys::RegularExpression trivial(
-    "^[-/]D[A-Za-z_][A-Za-z0-9_]*(=[A-Za-z0-9_.]+)?$");
-  if (!trivial.find(def)) {
-    // This definition has a non-trivial value.
-    switch (this->GetPolicyStatus(cmPolicies::CMP0005)) {
-      case cmPolicies::WARN:
-        this->IssueMessage(MessageType::AUTHOR_WARNING,
-                           cmPolicies::GetPolicyWarning(cmPolicies::CMP0005));
-        CM_FALLTHROUGH;
-      case cmPolicies::OLD:
-        // OLD behavior is to not escape the value.  We should not
-        // convert the definition to use the property.
-        return false;
-      case cmPolicies::NEW:
-        // NEW behavior is to escape the value.  Proceed to convert it
-        // to an entry in the property.
-        break;
-    }
-  }
-
   // Get the definition part after the flag.
   // Get the definition part after the flag.
   const char* define = def.c_str() + 2;
   const char* define = def.c_str() + 2;
 
 
@@ -1845,7 +1744,7 @@ void cmMakefile::Configure()
         this->SetCheckCMP0000(true);
         this->SetCheckCMP0000(true);
 
 
         // Implicitly set the version for the user.
         // Implicitly set the version for the user.
-        cmPolicies::ApplyPolicyVersion(this, 2, 4, 0,
+        cmPolicies::ApplyPolicyVersion(this, 2, 8, 0,
                                        cmPolicies::WarnCompat::Off);
                                        cmPolicies::WarnCompat::Off);
       }
       }
     }
     }
@@ -1912,29 +1811,10 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf)
   std::string currentStartFile =
   std::string currentStartFile =
     this->GetCMakeInstance()->GetCMakeListFile(currentStart);
     this->GetCMakeInstance()->GetCMakeListFile(currentStart);
   if (!cmSystemTools::FileExists(currentStartFile, true)) {
   if (!cmSystemTools::FileExists(currentStartFile, true)) {
-    // The file is missing.  Check policy CMP0014.
-    auto e = cmStrCat("The source directory\n  ", currentStart,
-                      "\n"
-                      "does not contain a CMakeLists.txt file.");
-    /* clang-format on */
-    switch (this->GetPolicyStatus(cmPolicies::CMP0014)) {
-      case cmPolicies::WARN:
-        // Print the warning.
-        e += cmStrCat("\n"
-                      "CMake does not support this case but it used "
-                      "to work accidentally and is being allowed for "
-                      "compatibility.\n",
-                      cmPolicies::GetPolicyWarning(cmPolicies::CMP0014));
-        this->IssueMessage(MessageType::AUTHOR_WARNING, e);
-        CM_FALLTHROUGH;
-      case cmPolicies::OLD:
-        // OLD behavior does not warn.
-        break;
-      case cmPolicies::NEW:
-        // NEW behavior prints the error.
-        this->IssueMessage(MessageType::FATAL_ERROR, e);
-        break;
-    }
+    this->IssueMessage(MessageType::FATAL_ERROR,
+                       cmStrCat("The source directory\n  ", currentStart,
+                                "\n"
+                                "does not contain a CMakeLists.txt file."));
     return;
     return;
   }
   }
   // finally configure the subdir
   // finally configure the subdir
@@ -2916,30 +2796,7 @@ MessageType cmMakefile::ExpandVariablesInStringOld(
       error += cmStrCat("at\n  ", filename, ':', line, '\n');
       error += cmStrCat("at\n  ", filename, ':', line, '\n');
     }
     }
     error += cmStrCat("when parsing string\n  ", source, '\n', emsg);
     error += cmStrCat("when parsing string\n  ", source, '\n', emsg);
-
-    // If the parser failed ("res" is false) then this is a real
-    // argument parsing error, so the policy applies.  Otherwise the
-    // parser reported an error message without failing because the
-    // helper implementation is unhappy, which has always reported an
-    // error.
     mtype = MessageType::FATAL_ERROR;
     mtype = MessageType::FATAL_ERROR;
-    if (!res) {
-      // This is a real argument parsing error.  Use policy CMP0010 to
-      // decide whether it is an error.
-      switch (this->GetPolicyStatus(cmPolicies::CMP0010)) {
-        case cmPolicies::WARN:
-          error +=
-            cmStrCat('\n', cmPolicies::GetPolicyWarning(cmPolicies::CMP0010));
-          CM_FALLTHROUGH;
-        case cmPolicies::OLD:
-          // OLD behavior is to just warn and continue.
-          mtype = MessageType::AUTHOR_WARNING;
-          break;
-        case cmPolicies::NEW:
-          // NEW behavior is to report the error.
-          break;
-      }
-    }
     errorstr = std::move(error);
     errorstr = std::move(error);
   }
   }
   return mtype;
   return mtype;
@@ -3272,9 +3129,6 @@ MessageType cmMakefile::ExpandVariablesInStringNew(
 
 
   // Check for open variable references yet.
   // Check for open variable references yet.
   if (!error && !openstack.empty()) {
   if (!error && !openstack.empty()) {
-    // There's an open variable reference waiting.  Policy CMP0010 flags
-    // whether this is an error or not.  The new parser now enforces
-    // CMP0010 as well.
     errorstr += "There is an unterminated variable reference.";
     errorstr += "There is an unterminated variable reference.";
     error = true;
     error = true;
   }
   }
@@ -4411,17 +4265,6 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
         "\" because an imported target with the same name already exists.");
         "\" because an imported target with the same name already exists.");
       return false;
       return false;
     }
     }
-    // target names must be globally unique
-    switch (this->GetPolicyStatus(cmPolicies::CMP0002)) {
-      case cmPolicies::WARN:
-        this->IssueMessage(MessageType::AUTHOR_WARNING,
-                           cmPolicies::GetPolicyWarning(cmPolicies::CMP0002));
-        CM_FALLTHROUGH;
-      case cmPolicies::OLD:
-        return true;
-      case cmPolicies::NEW:
-        break;
-    }
 
 
     // The conflict is with a non-imported target.
     // The conflict is with a non-imported target.
     // Allow this if the user has requested support.
     // Allow this if the user has requested support.
@@ -4479,45 +4322,17 @@ bool cmMakefile::EnforceUniqueDir(const std::string& srcPath,
   if (gg->BinaryDirectoryIsNew(binPath)) {
   if (gg->BinaryDirectoryIsNew(binPath)) {
     return true;
     return true;
   }
   }
-  std::string e;
-  switch (this->GetPolicyStatus(cmPolicies::CMP0013)) {
-    case cmPolicies::WARN:
-      // Print the warning.
-      e = cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0013),
-                   "\n"
-                   "The binary directory\n"
-                   "  ",
-                   binPath,
-                   "\n"
-                   "is already used to build a source directory.  "
-                   "This command uses it to build source directory\n"
-                   "  ",
-                   srcPath,
-                   "\n"
-                   "which can generate conflicting build files.  "
-                   "CMake does not support this use case but it used "
-                   "to work accidentally and is being allowed for "
-                   "compatibility.");
-      this->IssueMessage(MessageType::AUTHOR_WARNING, e);
-      CM_FALLTHROUGH;
-    case cmPolicies::OLD:
-      // OLD behavior does not warn.
-      return true;
-    case cmPolicies::NEW:
-      // NEW behavior prints the error.
-      e += cmStrCat("The binary directory\n"
-                    "  ",
-                    binPath,
-                    "\n"
-                    "is already used to build a source directory.  "
-                    "It cannot be used to build source directory\n"
-                    "  ",
-                    srcPath,
-                    "\n"
-                    "Specify a unique binary directory name.");
-      this->IssueMessage(MessageType::FATAL_ERROR, e);
-      break;
-  }
+  this->IssueMessage(MessageType::FATAL_ERROR,
+                     cmStrCat("The binary directory\n"
+                              "  ",
+                              binPath,
+                              "\n"
+                              "is already used to build a source directory.  "
+                              "It cannot be used to build source directory\n"
+                              "  ",
+                              srcPath,
+                              "\n"
+                              "Specify a unique binary directory name."));
 
 
   return false;
   return false;
 }
 }

+ 16 - 21
Source/cmPolicies.cxx

@@ -12,12 +12,9 @@
 #include "cmListFileCache.h"
 #include "cmListFileCache.h"
 #include "cmMakefile.h"
 #include "cmMakefile.h"
 #include "cmMessageType.h"
 #include "cmMessageType.h"
-#include "cmState.h"
 #include "cmStateSnapshot.h"
 #include "cmStateSnapshot.h"
-#include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 #include "cmSystemTools.h"
-#include "cmValue.h"
 #include "cmVersion.h"
 #include "cmVersion.h"
 
 
 static bool stringToId(const char* input, cmPolicies::PolicyID& pid)
 static bool stringToId(const char* input, cmPolicies::PolicyID& pid)
@@ -297,12 +294,24 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, unsigned int majorVer,
                                     unsigned int patchVer,
                                     unsigned int patchVer,
                                     WarnCompat warnCompat)
                                     WarnCompat warnCompat)
 {
 {
-  // Warn about policy versions for which support will be removed.
-  if (warnCompat == WarnCompat::On &&
-      (majorVer < 3 || (majorVer == 3 && minorVer < 10)) &&
+  // Error on policy versions for which support has been removed.
+  if (majorVer < 2 || (majorVer == 2 && minorVer < 8)) {
+    if (IsFromLegacyInstallEXPORT(mf, majorVer, minorVer, patchVer)) {
       // Silently tolerate cmake_policy calls generated by install(EXPORT)
       // Silently tolerate cmake_policy calls generated by install(EXPORT)
       // in CMake versions prior to 3.18.
       // in CMake versions prior to 3.18.
-      !IsFromLegacyInstallEXPORT(mf, majorVer, minorVer, patchVer)) {
+      majorVer = 2;
+      minorVer = 8;
+      patchVer = 0;
+    } else {
+      mf->IssueMessage(MessageType::FATAL_ERROR,
+                       "Compatibility with CMake < 2.8.0 has been removed "
+                       "from CMake.\n" ADVICE_UPDATE_VERSION_ARGUMENT);
+      cmSystemTools::SetFatalErrorOccurred();
+      return false;
+    }
+  } else if ((majorVer < 3 || (majorVer == 3 && minorVer < 10)) &&
+             warnCompat == WarnCompat::On) {
+    // Warn about policy versions for which support will be removed.
     mf->IssueMessage(
     mf->IssueMessage(
       MessageType::DEPRECATION_WARNING,
       MessageType::DEPRECATION_WARNING,
       "Compatibility with CMake < 3.10 will be removed from "
       "Compatibility with CMake < 3.10 will be removed from "
@@ -322,20 +331,6 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, unsigned int majorVer,
             !mf->SetPolicy(pid, status)) {
             !mf->SetPolicy(pid, status)) {
           return false;
           return false;
         }
         }
-        if (pid == cmPolicies::CMP0001 &&
-            (status == cmPolicies::WARN || status == cmPolicies::OLD)) {
-          if (!(mf->GetState()->GetInitializedCacheValue(
-                "CMAKE_BACKWARDS_COMPATIBILITY"))) {
-            // Set it to 2.4 because that is the last version where the
-            // variable had meaning.
-            mf->AddCacheDefinition(
-              "CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
-              "For backwards compatibility, what version of CMake "
-              "commands and "
-              "syntax should this version of CMake try to support.",
-              cmStateEnums::STRING);
-          }
-        }
       }
       }
     } else {
     } else {
       if (!mf->SetPolicy(pid, cmPolicies::NEW)) {
       if (!mf->SetPolicy(pid, cmPolicies::NEW)) {

+ 15 - 16
Source/cmPolicies.h

@@ -15,46 +15,45 @@ class cmMakefile;
 
 
 #define CM_FOR_EACH_POLICY_TABLE(POLICY, SELECT)                              \
 #define CM_FOR_EACH_POLICY_TABLE(POLICY, SELECT)                              \
   SELECT(POLICY, CMP0000,                                                     \
   SELECT(POLICY, CMP0000,                                                     \
-         "A minimum required CMake version must be specified.", 2, 6, 0,      \
-         WARN)                                                                \
+         "A minimum required CMake version must be specified.", 2, 6, 0, NEW) \
   SELECT(POLICY, CMP0001,                                                     \
   SELECT(POLICY, CMP0001,                                                     \
          "CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.", 2, 6, 0,  \
          "CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.", 2, 6, 0,  \
-         WARN)                                                                \
+         NEW)                                                                 \
   SELECT(POLICY, CMP0002, "Logical target names must be globally unique.", 2, \
   SELECT(POLICY, CMP0002, "Logical target names must be globally unique.", 2, \
-         6, 0, WARN)                                                          \
+         6, 0, NEW)                                                           \
   SELECT(                                                                     \
   SELECT(                                                                     \
     POLICY, CMP0003,                                                          \
     POLICY, CMP0003,                                                          \
     "Libraries linked via full path no longer produce linker search paths.",  \
     "Libraries linked via full path no longer produce linker search paths.",  \
-    2, 6, 0, WARN)                                                            \
+    2, 6, 0, NEW)                                                             \
   SELECT(POLICY, CMP0004,                                                     \
   SELECT(POLICY, CMP0004,                                                     \
          "Libraries linked may not have leading or trailing whitespace.", 2,  \
          "Libraries linked may not have leading or trailing whitespace.", 2,  \
-         6, 0, WARN)                                                          \
+         6, 0, NEW)                                                           \
   SELECT(POLICY, CMP0005,                                                     \
   SELECT(POLICY, CMP0005,                                                     \
          "Preprocessor definition values are now escaped automatically.", 2,  \
          "Preprocessor definition values are now escaped automatically.", 2,  \
-         6, 0, WARN)                                                          \
+         6, 0, NEW)                                                           \
   SELECT(POLICY, CMP0006,                                                     \
   SELECT(POLICY, CMP0006,                                                     \
          "Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.",   \
          "Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.",   \
-         2, 6, 0, WARN)                                                       \
+         2, 6, 0, NEW)                                                        \
   SELECT(POLICY, CMP0007, "list command no longer ignores empty elements.",   \
   SELECT(POLICY, CMP0007, "list command no longer ignores empty elements.",   \
-         2, 6, 0, WARN)                                                       \
+         2, 6, 0, NEW)                                                        \
   SELECT(                                                                     \
   SELECT(                                                                     \
     POLICY, CMP0008,                                                          \
     POLICY, CMP0008,                                                          \
     "Libraries linked by full-path must have a valid library file name.", 2,  \
     "Libraries linked by full-path must have a valid library file name.", 2,  \
-    6, 1, WARN)                                                               \
+    6, 1, NEW)                                                                \
   SELECT(POLICY, CMP0009,                                                     \
   SELECT(POLICY, CMP0009,                                                     \
          "FILE GLOB_RECURSE calls should not follow symlinks by default.", 2, \
          "FILE GLOB_RECURSE calls should not follow symlinks by default.", 2, \
-         6, 2, WARN)                                                          \
+         6, 2, NEW)                                                           \
   SELECT(POLICY, CMP0010, "Bad variable reference syntax is an error.", 2, 6, \
   SELECT(POLICY, CMP0010, "Bad variable reference syntax is an error.", 2, 6, \
-         3, WARN)                                                             \
+         3, NEW)                                                              \
   SELECT(POLICY, CMP0011,                                                     \
   SELECT(POLICY, CMP0011,                                                     \
          "Included scripts do automatic cmake_policy PUSH and POP.", 2, 6, 3, \
          "Included scripts do automatic cmake_policy PUSH and POP.", 2, 6, 3, \
-         WARN)                                                                \
+         NEW)                                                                 \
   SELECT(POLICY, CMP0012, "if() recognizes numbers and boolean constants.",   \
   SELECT(POLICY, CMP0012, "if() recognizes numbers and boolean constants.",   \
-         2, 8, 0, WARN)                                                       \
+         2, 8, 0, NEW)                                                        \
   SELECT(POLICY, CMP0013, "Duplicate binary directories are not allowed.", 2, \
   SELECT(POLICY, CMP0013, "Duplicate binary directories are not allowed.", 2, \
-         8, 0, WARN)                                                          \
+         8, 0, NEW)                                                           \
   SELECT(POLICY, CMP0014, "Input directories must have CMakeLists.txt.", 2,   \
   SELECT(POLICY, CMP0014, "Input directories must have CMakeLists.txt.", 2,   \
-         8, 0, WARN)                                                          \
+         8, 0, NEW)                                                           \
   SELECT(POLICY, CMP0015,                                                     \
   SELECT(POLICY, CMP0015,                                                     \
          "link_directories() treats paths relative to the source dir.", 2, 8, \
          "link_directories() treats paths relative to the source dir.", 2, 8, \
          1, WARN)                                                             \
          1, WARN)                                                             \

+ 0 - 5
Source/cmStateSnapshot.cxx

@@ -200,11 +200,6 @@ cmPolicies::PolicyStatus cmStateSnapshot::GetPolicy(cmPolicies::PolicyID id,
   return status;
   return status;
 }
 }
 
 
-bool cmStateSnapshot::HasDefinedPolicyCMP0011()
-{
-  return !this->Position->Policies->IsEmpty();
-}
-
 cmValue cmStateSnapshot::GetDefinition(std::string const& name) const
 cmValue cmStateSnapshot::GetDefinition(std::string const& name) const
 {
 {
   assert(this->Position->Vars.IsValid());
   assert(this->Position->Vars.IsValid());

+ 0 - 1
Source/cmStateSnapshot.h

@@ -46,7 +46,6 @@ public:
   void SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
   void SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
   cmPolicies::PolicyStatus GetPolicy(cmPolicies::PolicyID id,
   cmPolicies::PolicyStatus GetPolicy(cmPolicies::PolicyID id,
                                      bool parent_scope = false) const;
                                      bool parent_scope = false) const;
-  bool HasDefinedPolicyCMP0011();
   void PushPolicy(cmPolicies::PolicyMap const& entry, bool weak);
   void PushPolicy(cmPolicies::PolicyMap const& entry, bool weak);
   bool PopPolicy();
   bool PopPolicy();
   bool CanPopPolicyScope();
   bool CanPopPolicyScope();

+ 0 - 21
Source/cmake.cxx

@@ -2650,27 +2650,6 @@ int cmake::ActualConfigure()
   // if the project did not define one of the entries below, add them now
   // if the project did not define one of the entries below, add them now
   // so users can edit the values in the cache:
   // so users can edit the values in the cache:
 
 
-  // We used to always present LIBRARY_OUTPUT_PATH and
-  // EXECUTABLE_OUTPUT_PATH.  They are now documented as old-style and
-  // should no longer be used.  Therefore we present them only if the
-  // project requires compatibility with CMake 2.4.  We detect this
-  // here by looking for the old CMAKE_BACKWARDS_COMPATIBILITY
-  // variable created when CMP0001 is not set to NEW.
-  if (this->State->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) {
-    if (!this->State->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) {
-      this->AddCacheEntry(
-        "LIBRARY_OUTPUT_PATH", "",
-        "Single output directory for building all libraries.",
-        cmStateEnums::PATH);
-    }
-    if (!this->State->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) {
-      this->AddCacheEntry(
-        "EXECUTABLE_OUTPUT_PATH", "",
-        "Single output directory for building all executables.",
-        cmStateEnums::PATH);
-    }
-  }
-
   const auto& mf = this->GlobalGenerator->GetMakefiles()[0];
   const auto& mf = this->GlobalGenerator->GetMakefiles()[0];
 
 
   if (mf->IsOn("CTEST_USE_LAUNCHERS") &&
   if (mf->IsOn("CTEST_USE_LAUNCHERS") &&

+ 0 - 3
Tests/CMakeLists.txt

@@ -545,9 +545,6 @@ if(BUILD_TESTING)
   ADD_TEST_MACRO(CrossCompile CrossCompile)
   ADD_TEST_MACRO(CrossCompile CrossCompile)
   set_tests_properties(CrossCompile PROPERTIES
   set_tests_properties(CrossCompile PROPERTIES
     PASS_REGULAR_EXPRESSION "try_run.. invoked in cross-compiling mode")
     PASS_REGULAR_EXPRESSION "try_run.. invoked in cross-compiling mode")
-  if("${CMAKE_GENERATOR}" MATCHES "Make")
-    ADD_TEST_MACRO(Policy0002 Policy0002)
-  endif()
   if(CMake_TEST_XCODE_VERSION)
   if(CMake_TEST_XCODE_VERSION)
     set(Architecture_BUILD_OPTIONS -DCMake_TEST_XCODE_VERSION=${CMake_TEST_XCODE_VERSION})
     set(Architecture_BUILD_OPTIONS -DCMake_TEST_XCODE_VERSION=${CMake_TEST_XCODE_VERSION})
     ADD_TEST_MACRO(Architecture Architecture)
     ADD_TEST_MACRO(Architecture Architecture)

+ 0 - 54
Tests/CMakeTests/IfTest.cmake.in

@@ -40,60 +40,6 @@ macro(test_vars _old)
 endmacro()
 endmacro()
 
 
 #-----------------------------------------------------------------------------
 #-----------------------------------------------------------------------------
-# Test the OLD behavior of CMP0012.
-cmake_policy(SET CMP0012 OLD)
-
-# False constants not recognized (still false).
-foreach(_false "" ${FALSE_NAMES})
-  if("${_false}")
-    message(FATAL_ERROR "OLD if(${_false}) is true!")
-  else()
-    message(STATUS "OLD if(${_false}) is false")
-  endif()
-
-  if(NOT "${_false}")
-    message(STATUS "OLD if(NOT ${_false}) is true")
-  else()
-    message(FATAL_ERROR "OLD if(NOT ${_false}) is false!")
-  endif()
-endforeach()
-
-# True constants not recognized.
-foreach(_false ${TRUE_NAMES})
-  if(${_false})
-    message(FATAL_ERROR "OLD if(${_false}) is true!")
-  else()
-    message(STATUS "OLD if(${_false}) is false")
-  endif()
-
-  if(NOT ${_false})
-    message(STATUS "OLD if(NOT ${_false}) is true")
-  else()
-    message(FATAL_ERROR "OLD if(NOT ${_false}) is false!")
-  endif()
-endforeach()
-
-# Numbers not recognized properly.
-foreach(_num 2 -2 2.0 -2.0 2x -2x)
-  if(${_num})
-    message(FATAL_ERROR "OLD if(${_num}) is true!")
-  else()
-    message(STATUS "OLD if(${_num}) is false")
-  endif()
-
-  if(NOT ${_num})
-    message(FATAL_ERROR "OLD if(NOT ${_num}) is true!")
-  else()
-    message(STATUS "OLD if(NOT ${_num}) is false")
-  endif()
-endforeach()
-
-test_vars("OLD ")
-
-#-----------------------------------------------------------------------------
-
-# Test the NEW behavior of CMP0012.
-cmake_policy(SET CMP0012 NEW)
 
 
 # Test false constants.
 # Test false constants.
 foreach(_false "" 0 ${FALSE_NAMES})
 foreach(_false "" 0 ${FALSE_NAMES})

+ 7 - 30
Tests/CMakeTests/ListTest.cmake.in

@@ -152,33 +152,10 @@ foreach(cmd IN ITEMS Find Get Insert Length Remove_At)
   check_cmake_test_single(List "${cmd}-List-Only" "${_test_file_name}")
   check_cmake_test_single(List "${cmd}-List-Only" "${_test_file_name}")
 endforeach()
 endforeach()
 
 
-set(thelist "" NEW OLD)
-
-foreach (_pol ${thelist})
-    cmake_policy(SET CMP0007 ${_pol})
-    list(GET thelist 1 thevalue)
-    if (NOT thevalue STREQUAL _pol)
-        message(SEND_ERROR "returned element '${thevalue}', but expected '${_pol}'")
-    endif()
-endforeach (_pol)
-
-block(SCOPE_FOR POLICIES)
-  cmake_policy(SET CMP0007 NEW)
-  set(result andy bill brad ken bob)
-  list(INSERT result 1 "")
-  TEST("INSERT result 1 \"\"" "andy;;bill;brad;ken;bob")
-  list(INSERT result 4 ";")
-  TEST("INSERT result 1 ;" "andy;;bill;brad;;;ken;bob")
-  list(INSERT result 0 "x")
-  TEST("INSERT result 1 x" "x;andy;;bill;brad;;;ken;bob")
-endblock()
-block(SCOPE_FOR POLICIES)
-  cmake_policy(SET CMP0007 OLD)
-  set(result andy bill brad ken bob)
-  list(INSERT result 1 "")
-  TEST("INSERT result 1 \"\"" "andy;;bill;brad;ken;bob")
-  list(INSERT result 4 ";")
-  TEST("INSERT result 1 ;" "andy;bill;brad;ken;;;bob")
-  list(INSERT result 0 "x")
-  TEST("INSERT result 1 x" "x;andy;bill;brad;ken;bob")
-endblock()
+set(result andy bill brad ken bob)
+list(INSERT result 1 "")
+TEST("INSERT result 1 \"\"" "andy;;bill;brad;ken;bob")
+list(INSERT result 4 ";")
+TEST("INSERT result 1 ;" "andy;;bill;brad;;;ken;bob")
+list(INSERT result 0 "x")
+TEST("INSERT result 1 x" "x;andy;;bill;brad;;;ken;bob")

+ 0 - 10
Tests/Complex/CMakeLists.txt

@@ -19,16 +19,6 @@ function(message)
 endfunction()
 endfunction()
 message("message")
 message("message")
 
 
-# Try setting a new policy.  The IF test is for coverage.
-if(POLICY CMP0003)
-  cmake_policy(SET CMP0003 NEW)
-
-  cmake_policy(GET CMP0003 P3)
-  if(NOT "${P3}" STREQUAL "NEW")
-    message(FATAL_ERROR "cmake_policy(GET) did not report NEW!")
-  endif()
-endif()
-
 # It is not recommended to set a policy to OLD, but this test
 # It is not recommended to set a policy to OLD, but this test
 # covers the OLD behavior of some policies.
 # covers the OLD behavior of some policies.
 foreach(p
 foreach(p

+ 0 - 10
Tests/ComplexOneConfig/CMakeLists.txt

@@ -12,16 +12,6 @@ string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " -DCOMPLEX_NDEBUG")
 string(APPEND CMAKE_C_FLAGS_MINSIZEREL " -DCOMPLEX_NDEBUG")
 string(APPEND CMAKE_C_FLAGS_MINSIZEREL " -DCOMPLEX_NDEBUG")
 string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL " -DCOMPLEX_NDEBUG")
 string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL " -DCOMPLEX_NDEBUG")
 
 
-# Try setting a new policy.  The IF test is for coverage.
-if(POLICY CMP0003)
-  cmake_policy(SET CMP0003 NEW)
-
-  cmake_policy(GET CMP0003 P3)
-  if(NOT "${P3}" STREQUAL "NEW")
-    message(FATAL_ERROR "cmake_policy(GET) did not report NEW!")
-  endif()
-endif()
-
 # It is not recommended to set a policy to OLD, but this test
 # It is not recommended to set a policy to OLD, but this test
 # covers the OLD behavior of some policies.
 # covers the OLD behavior of some policies.
 foreach(p
 foreach(p

+ 0 - 1
Tests/Policy0002/A/CMakeLists.txt

@@ -1 +0,0 @@
-add_executable(Policy0002 ../policy0002.c)

+ 0 - 5
Tests/Policy0002/CMakeLists.txt

@@ -1,5 +0,0 @@
-cmake_minimum_required(VERSION 3.10)
-project(Policy0002 C)
-cmake_policy(SET CMP0002 OLD)
-add_subdirectory(A)
-add_executable(Policy0002 policy0002.c)

+ 0 - 4
Tests/Policy0002/policy0002.c

@@ -1,4 +0,0 @@
-int main(void)
-{
-  return 0;
-}

+ 0 - 3
Tests/PolicyScope/Bar.cmake

@@ -3,6 +3,3 @@ cmake_minimum_required(VERSION 3.31)
 # Make sure a policy set differently by our includer is now correct.
 # Make sure a policy set differently by our includer is now correct.
 cmake_policy(GET CMP0180 cmp)
 cmake_policy(GET CMP0180 cmp)
 check(CMP0180 "NEW" "${cmp}")
 check(CMP0180 "NEW" "${cmp}")
-
-# Test allowing the top-level file to not have cmake_minimum_required.
-cmake_policy(SET CMP0000 OLD)

+ 2 - 17
Tests/PolicyScope/CMakeLists.txt

@@ -1,5 +1,5 @@
+cmake_minimum_required(VERSION 3.30)
 project(PolicyScope C)
 project(PolicyScope C)
-# No cmake_minimum_required(VERSION), it's in FindFoo.
 
 
 #-----------------------------------------------------------------------------
 #-----------------------------------------------------------------------------
 # Helper function to report results.
 # Helper function to report results.
@@ -10,28 +10,13 @@ function(check msg lhs rhs)
 endfunction()
 endfunction()
 
 
 #-----------------------------------------------------------------------------
 #-----------------------------------------------------------------------------
-# Test using a development framework that sets policies for us.
-
-cmake_policy(SET CMP0011 OLD)
-
 # Put the test modules in the search path.
 # Put the test modules in the search path.
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
 
 
-# The included file should set policies for us.
-find_package(Foo)
-
-# Check policies set by the package.
-cmake_policy(GET CMP0180 cmp)
-check(CMP0180 "OLD" "${cmp}")
-cmake_policy(GET CMP0179 cmp)
-check(CMP0179 "NEW" "${cmp}")
-cmake_policy(GET CMP0011 cmp)
-check(CMP0011 "NEW" "${cmp}")
-
 # Make sure an included file cannot change policies.
 # Make sure an included file cannot change policies.
 include(Bar)
 include(Bar)
 cmake_policy(GET CMP0180 cmp)
 cmake_policy(GET CMP0180 cmp)
-check(CMP0180 "OLD" "${cmp}")
+check(CMP0180 "" "${cmp}")
 
 
 # Allow the included file to change policies.
 # Allow the included file to change policies.
 include(Bar NO_POLICY_SCOPE)
 include(Bar NO_POLICY_SCOPE)

+ 0 - 2
Tests/PolicyScope/FindFoo.cmake

@@ -1,2 +0,0 @@
-cmake_minimum_required(VERSION 3.31)
-cmake_policy(SET CMP0180 OLD)

+ 0 - 1
Tests/RunCMake/AppleTextStubs/LibraryWithVersions.cmake

@@ -25,7 +25,6 @@ set (GENERATE_CONTENT "if (\"${CMAKE_TAPI}\")
 endif()\n\n")
 endif()\n\n")
 
 
 string (APPEND GENERATE_CONTENT [[
 string (APPEND GENERATE_CONTENT [[
-cmake_policy (SET CMP0011 NEW)
 cmake_policy (SET CMP0057 NEW)
 cmake_policy (SET CMP0057 NEW)
 
 
 macro (CHECK_FILE test_msg path)
 macro (CHECK_FILE test_msg path)

+ 0 - 2
Tests/RunCMake/CMP0004/CMP0004-OLD-stderr.txt

@@ -1,2 +0,0 @@
-  Target "bat" links to item " bar " which has leading or trailing
-  whitespace.  This is now an error according to policy CMP0004.

+ 0 - 18
Tests/RunCMake/CMP0004/CMP0004-OLD.cmake

@@ -1,18 +0,0 @@
-cmake_policy(SET CMP0004 OLD)
-
-add_library(foo SHARED empty.cpp)
-add_library(bar SHARED empty.cpp)
-add_library(bing SHARED empty.cpp)
-add_library(bung SHARED empty.cpp)
-
-cmake_policy(SET CMP0004 NEW)
-
-add_library(bat SHARED empty.cpp)
-
-target_link_libraries(foo "$<1: bar >")
-target_link_libraries(bing "$<$<NOT:$<TARGET_POLICY:CMP0004>>: bar >")
-target_link_libraries(bung "$<$<TARGET_POLICY:CMP0004>: bar >")
-
-# The line below causes the error because the policy is NEW when bat
-# is created.
-target_link_libraries(bat "$<1: bar >")

+ 0 - 1
Tests/RunCMake/CMP0004/RunCMakeTest.cmake

@@ -1,5 +1,4 @@
 include(RunCMake)
 include(RunCMake)
 
 
-run_cmake(CMP0004-OLD)
 run_cmake(CMP0004-NEW)
 run_cmake(CMP0004-NEW)
 run_cmake(CMP0004-policy-genex)
 run_cmake(CMP0004-policy-genex)

+ 1 - 6
Tests/RunCMake/CPack/DEB/Helpers.cmake

@@ -70,12 +70,7 @@ function(getMissingShlibsErrorExtra FILE RESULT_VAR)
     if(err_)
     if(err_)
       set(error_extra " Extra: Could not unpack package content: '${err}'")
       set(error_extra " Extra: Could not unpack package content: '${err}'")
     else()
     else()
-      cmake_policy(PUSH)
-        # Tell file(GLOB_RECURSE) not to follow directory symlinks
-        # even if the project does not set this policy to NEW.
-        cmake_policy(SET CMP0009 NEW)
-        file(GLOB_RECURSE FILE_PATHS_ LIST_DIRECTORIES false "${CMAKE_CURRENT_BINARY_DIR}/data_${PREFIX}/*")
-      cmake_policy(POP)
+      file(GLOB_RECURSE FILE_PATHS_ LIST_DIRECTORIES false "${CMAKE_CURRENT_BINARY_DIR}/data_${PREFIX}/*")
 
 
       # get file info so that we can determine if file is executable or not
       # get file info so that we can determine if file is executable or not
       foreach(FILE_ IN LISTS FILE_PATHS_)
       foreach(FILE_ IN LISTS FILE_PATHS_)

+ 16 - 45
Tests/RunCMake/GenEx-LIST/INSERT.cmake.in

@@ -46,52 +46,23 @@ if (NOT output STREQUAL listvar)
   list (APPEND errors "returns bad value: ${output}")
   list (APPEND errors "returns bad value: ${output}")
 endif()
 endif()
 
 
-block(SCOPE_FOR POLICIES)
-  cmake_policy(SET CMP0007 NEW)
-
-  set(listvar "0;1;2;3;4")
-  list(INSERT listvar 1 "")
-  set (output "$<LIST:INSERT,0;1;2;3;4,1,>")
-  if (NOT output STREQUAL listvar)
-    list (APPEND errors "returns bad value: ${output}")
-  endif()
-
-  list(INSERT listvar 4 ";")
-  set (output "$<LIST:INSERT,0;;1;2;3;4,4,;>")
-  if (NOT output STREQUAL listvar)
-    list (APPEND errors "returns bad value: ${output}")
-  endif()
-
-  list(INSERT listvar 0 "x")
-  set (output "$<LIST:INSERT,0;;1;2;;;3;4,0,x>")
-  if (NOT output STREQUAL listvar)
-    list (APPEND errors "returns bad value: ${output}")
-  endif()
-endblock()
-block(SCOPE_FOR POLICIES)
-  set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "")
-  cmake_policy(SET CMP0007 OLD)
-
-  set(listvar "0;1;2;3;4")
-  list(INSERT listvar 1 "")
-  set (output "$<LIST:INSERT,0;1;2;3;4,1,>")
-  if (NOT output STREQUAL listvar)
-    list (APPEND errors "returns bad value: ${output}")
-  endif()
-
-  list(INSERT listvar 4 ";")
-  set (output "$<LIST:INSERT,0;1;2;3;4,4,;>")
-  if (NOT output STREQUAL listvar)
-    list (APPEND errors "returns bad value: ${output}")
-  endif()
+set(listvar "0;1;2;3;4")
+list(INSERT listvar 1 "")
+set (output "$<LIST:INSERT,0;1;2;3;4,1,>")
+if (NOT output STREQUAL listvar)
+  list (APPEND errors "returns bad value: ${output}")
+endif()
 
 
-  list(INSERT listvar 0 "x")
-  set (output "$<LIST:INSERT,0;1;2;3;4,0,x>")
-  if (NOT output STREQUAL listvar)
-    list (APPEND errors "returns bad value: ${output}")
-  endif()
+list(INSERT listvar 4 ";")
+set (output "$<LIST:INSERT,0;;1;2;3;4,4,;>")
+if (NOT output STREQUAL listvar)
+  list (APPEND errors "returns bad value: ${output}")
+endif()
 
 
-  unset(CMAKE_WARN_DEPRECATED CACHE)
-endblock()
+list(INSERT listvar 0 "x")
+set (output "$<LIST:INSERT,0;;1;2;;;3;4,0,x>")
+if (NOT output STREQUAL listvar)
+  list (APPEND errors "returns bad value: ${output}")
+endif()
 
 
 check_errors("LIST:INSERT..." ${errors})
 check_errors("LIST:INSERT..." ${errors})

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

@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.0)
 project(${RunCMake_TEST} NONE)
 project(${RunCMake_TEST} NONE)
 include(${RunCMake_TEST}.cmake)
 include(${RunCMake_TEST}.cmake)

+ 0 - 1
Tests/RunCMake/Syntax/RunCMakeTest.cmake

@@ -71,7 +71,6 @@ run_cmake(UnterminatedCall2)
 run_cmake(UnterminatedString)
 run_cmake(UnterminatedString)
 run_cmake(UnterminatedBrace0)
 run_cmake(UnterminatedBrace0)
 run_cmake(UnterminatedBrace1)
 run_cmake(UnterminatedBrace1)
-run_cmake(UnterminatedBrace2)
 run_cmake(UnterminatedBracket0)
 run_cmake(UnterminatedBracket0)
 run_cmake(UnterminatedBracket1)
 run_cmake(UnterminatedBracket1)
 run_cmake(UnterminatedBracketComment)
 run_cmake(UnterminatedBracketComment)

+ 0 - 0
Tests/RunCMake/CMP0004/CMP0004-OLD-result.txt → Tests/RunCMake/Syntax/UnterminatedBrace1-result.txt


+ 2 - 3
Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt

@@ -1,4 +1,4 @@
-CMake Warning \(dev\) at UnterminatedBrace1.cmake:2 \(set\):
+CMake Error at UnterminatedBrace1.cmake:2 \(set\):
   Syntax error in cmake code at
   Syntax error in cmake code at
 
 
     .*/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake:2
     .*/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake:2
@@ -7,7 +7,6 @@ CMake Warning \(dev\) at UnterminatedBrace1.cmake:2 \(set\):
 
 
     \${
     \${
 
 
-  syntax error, unexpected end of file, expecting } \(3\)
+  There is an unterminated variable reference.
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
   CMakeLists.txt:3 \(include\)
-This warning is for project developers.  Use -Wno-dev to suppress it.

+ 1 - 1
Tests/RunCMake/Syntax/UnterminatedBrace1.cmake

@@ -1,2 +1,2 @@
-cmake_policy(SET CMP0010 OLD)
+cmake_policy(SET CMP0053 NEW)
 set(var "${")
 set(var "${")

+ 0 - 12
Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt

@@ -1,12 +0,0 @@
-CMake Error at UnterminatedBrace2.cmake:3 \(set\):
-  Syntax error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake:3
-
-  when parsing string
-
-    \${
-
-  There is an unterminated variable reference.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)

+ 0 - 3
Tests/RunCMake/Syntax/UnterminatedBrace2.cmake

@@ -1,3 +0,0 @@
-cmake_policy(SET CMP0010 OLD)
-cmake_policy(SET CMP0053 NEW)
-set(var "${")

+ 0 - 2
Tests/RunCMake/VS10Project/SourceGroupFileSet-check.cmake

@@ -1,5 +1,3 @@
-cmake_policy(SET CMP0011 NEW)
-
 set(vcFiltersFile "${RunCMake_TEST_BINARY_DIR}/SourceGroupFileSet.vcxproj.filters")
 set(vcFiltersFile "${RunCMake_TEST_BINARY_DIR}/SourceGroupFileSet.vcxproj.filters")
 if(NOT EXISTS "${vcFiltersFile}")
 if(NOT EXISTS "${vcFiltersFile}")
   set(RunCMake_TEST_FAILED "Filters file ${vcFiltersFile} does not exist.")
   set(RunCMake_TEST_FAILED "Filters file ${vcFiltersFile} does not exist.")

+ 0 - 2
Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake

@@ -1,5 +1,3 @@
-cmake_policy(SET CMP0011 NEW)
-
 set(vcFiltersFile "${RunCMake_TEST_BINARY_DIR}/SourceGroupTree.vcxproj.filters")
 set(vcFiltersFile "${RunCMake_TEST_BINARY_DIR}/SourceGroupTree.vcxproj.filters")
 if(NOT EXISTS "${vcFiltersFile}")
 if(NOT EXISTS "${vcFiltersFile}")
   set(RunCMake_TEST_FAILED "Filters file ${vcFiltersFile} does not exist.")
   set(RunCMake_TEST_FAILED "Filters file ${vcFiltersFile} does not exist.")

+ 0 - 5
Tests/RunCMake/cmake_minimum_required/Before24-stderr.txt

@@ -1,5 +0,0 @@
-CMake Warning \(dev\) at Before24.cmake:1 \(cmake_minimum_required\):
-  Compatibility with CMake < 2.4 is not supported by CMake >= 3.0.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-This warning is for project developers.  Use -Wno-dev to suppress it.

+ 0 - 1
Tests/RunCMake/cmake_minimum_required/Before24.cmake

@@ -1 +0,0 @@
-cmake_minimum_required(VERSION 2.2)

+ 1 - 11
Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated-stderr.txt

@@ -8,17 +8,7 @@
 Call Stack \(most recent call first\):
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
   CMakeLists.txt:3 \(include\)
 +
 +
-CMake Deprecation Warning at BeforeVersionDeprecated\.cmake:2 \(cmake_policy\):
-  Compatibility with CMake < 3\.10 will be removed from a future version of
-  CMake\.
-
-  Update the VERSION argument <min> value\.  Or, use the <min>\.\.\.<max> syntax
-  to tell CMake that the project requires at least <min> but has been updated
-  to work with policies introduced by <max> or earlier\.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-+
-CMake Deprecation Warning at BeforeVersionDeprecated\.cmake:6 \(cmake_policy\):
+CMake Deprecation Warning at BeforeVersionDeprecated\.cmake:5 \(cmake_policy\):
   Compatibility with CMake < 3\.10 will be removed from a future version of
   Compatibility with CMake < 3\.10 will be removed from a future version of
   CMake\.
   CMake\.
 
 

+ 0 - 1
Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated.cmake

@@ -1,5 +1,4 @@
 cmake_minimum_required(VERSION 3.9)
 cmake_minimum_required(VERSION 3.9)
-cmake_policy(VERSION 2.6)
 cmake_policy(PUSH)
 cmake_policy(PUSH)
 cmake_policy(VERSION 2.6) # simulate pre-3.18 install(EXPORT)-generated call
 cmake_policy(VERSION 2.6) # simulate pre-3.18 install(EXPORT)-generated call
 cmake_policy(POP)
 cmake_policy(POP)

+ 0 - 0
Tests/RunCMake/Syntax/UnterminatedBrace2-result.txt → Tests/RunCMake/cmake_minimum_required/BeforeVersionRemoved-result.txt


+ 8 - 0
Tests/RunCMake/cmake_minimum_required/BeforeVersionRemoved-stderr.txt

@@ -0,0 +1,8 @@
+^CMake Error at BeforeVersionRemoved\.cmake:1 \(cmake_minimum_required\):
+  Compatibility with CMake < 2\.8\.0 has been removed from CMake\.
+
+  Update the VERSION argument <min> value\.  Or, use the <min>\.\.\.<max> syntax
+  to tell CMake that the project requires at least <min> but has been updated
+  to work with policies introduced by <max> or earlier\.
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:[0-9]+ \(include\)$

+ 1 - 0
Tests/RunCMake/cmake_minimum_required/BeforeVersionRemoved.cmake

@@ -0,0 +1 @@
+cmake_minimum_required(VERSION 2.6.4)

+ 0 - 15
Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt

@@ -1,15 +0,0 @@
-^CMake Deprecation Warning at CompatBefore24\.cmake:1 \(cmake_minimum_required\):
-  Compatibility with CMake < 3\.10 will be removed from a future version of
-  CMake\.
-
-  Update the VERSION argument <min> value\.  Or, use the <min>\.\.\.<max> syntax
-  to tell CMake that the project requires at least <min> but has been updated
-  to work with policies introduced by <max> or earlier\.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-+
-CMake Error in CMakeLists.txt:
-  You have set CMAKE_BACKWARDS_COMPATIBILITY to a CMake version less than
-  2.4.  This version of CMake only supports backwards compatibility with
-  CMake 2.4 or later.  For compatibility with older versions please use any
-  CMake 2.8.x release or lower.

+ 0 - 2
Tests/RunCMake/cmake_minimum_required/CompatBefore24.cmake

@@ -1,2 +0,0 @@
-cmake_minimum_required(VERSION 2.4)
-set(CMAKE_BACKWARDS_COMPATIBILITY 2.2)

+ 0 - 1
Tests/RunCMake/cmake_minimum_required/PolicyBefore24-result.txt

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

+ 0 - 6
Tests/RunCMake/cmake_minimum_required/PolicyBefore24-stderr.txt

@@ -1,6 +0,0 @@
-CMake Error at PolicyBefore24.cmake:2 \(cmake_policy\):
-  Compatibility with CMake < 2.4 is not supported by CMake >= 3.0.  For
-  compatibility with older versions please use any CMake 2.8.x release or
-  lower.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)

+ 0 - 2
Tests/RunCMake/cmake_minimum_required/PolicyBefore24.cmake

@@ -1,2 +0,0 @@
-cmake_minimum_required(VERSION 2.4)
-cmake_policy(VERSION 2.2)

+ 0 - 0
Tests/RunCMake/cmake_minimum_required/CompatBefore24-result.txt → Tests/RunCMake/cmake_minimum_required/PolicyBeforeVersionRemoved-result.txt


+ 8 - 0
Tests/RunCMake/cmake_minimum_required/PolicyBeforeVersionRemoved-stderr.txt

@@ -0,0 +1,8 @@
+^CMake Error at PolicyBeforeVersionRemoved\.cmake:1 \(cmake_policy\):
+  Compatibility with CMake < 2\.8\.0 has been removed from CMake\.
+
+  Update the VERSION argument <min> value\.  Or, use the <min>\.\.\.<max> syntax
+  to tell CMake that the project requires at least <min> but has been updated
+  to work with policies introduced by <max> or earlier\.
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:[0-9]+ \(include\)$

+ 1 - 0
Tests/RunCMake/cmake_minimum_required/PolicyBeforeVersionRemoved.cmake

@@ -0,0 +1 @@
+cmake_policy(VERSION 2.6.4)

+ 2 - 3
Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake

@@ -1,9 +1,8 @@
 include(RunCMake)
 include(RunCMake)
 
 
-run_cmake(Before24)
-run_cmake(CompatBefore24)
+run_cmake(BeforeVersionRemoved)
+run_cmake(PolicyBeforeVersionRemoved)
 run_cmake(Future)
 run_cmake(Future)
-run_cmake(PolicyBefore24)
 run_cmake(BeforeVersionDeprecated)
 run_cmake(BeforeVersionDeprecated)
 run_cmake(Range)
 run_cmake(Range)
 run_cmake(RangeBad)
 run_cmake(RangeBad)

+ 0 - 1
Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake.cmake

@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0009 NEW)
 message(STATUS "Running CMake on GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake")
 message(STATUS "Running CMake on GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake")
 file(GLOB_RECURSE
 file(GLOB_RECURSE
   CONTENT_LIST
   CONTENT_LIST

+ 0 - 2
Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION.cmake

@@ -80,8 +80,6 @@ endfunction()
 
 
 calling_macro()
 calling_macro()
 
 
-cmake_policy(SET CMP0007 NEW)
-
 # ATTENTION `CMAKE_CURRENT_LIST_LINE` can't be used in `math()'
 # ATTENTION `CMAKE_CURRENT_LIST_LINE` can't be used in `math()'
 function(print_self)
 function(print_self)
     file(STRINGS "${CMAKE_CURRENT_FUNCTION_LIST_FILE}" _lines)
     file(STRINGS "${CMAKE_CURRENT_FUNCTION_LIST_FILE}" _lines)

+ 0 - 18
Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt

@@ -1,18 +0,0 @@
-^CMake Deprecation Warning at GET-CMP0007-WARN\.cmake:1 \(cmake_policy\):
-  Compatibility with CMake < 3\.10 will be removed from a future version of
-  CMake\.
-
-  Update the VERSION argument <min> value\.  Or, use the <min>\.\.\.<max> syntax
-  to tell CMake that the project requires at least <min> but has been updated
-  to work with policies introduced by <max> or earlier\.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-+
-CMake Warning \(dev\) at GET-CMP0007-WARN\.cmake:4 \(list\):
-  Policy CMP0007 is not set: list command no longer ignores empty elements.
-  Run "cmake --help-policy CMP0007" for policy details.  Use the cmake_policy
-  command to set the policy and suppress this warning.  List has value =
-  \[;NEW;OLD\].
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-This warning is for project developers.  Use -Wno-dev to suppress it.$

Некоторые файлы не были показаны из-за большого количества измененных файлов