From a4c5b91f80003d007cddbb0de95032d65ec98ace Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 30 Mar 2023 10:13:07 -0400 Subject: FindPython{Interp,Libs}: Add policy to remove these modules The `FindPythonInterp` and `FindPythonLibs` modules have been deprecated since CMake 3.12. Add a policy to pretend they do not exist in order to encourage projects to port to `FindPython` or `FindPython{2,3}`. --- Help/manual/cmake-policies.7.rst | 1 + Help/policy/CMP0148.rst | 29 ++++++++++++++++++++++ .../dev/remove-FindPythonInterp-FindPythonLibs.rst | 6 +++++ 3 files changed, 36 insertions(+) create mode 100644 Help/policy/CMP0148.rst create mode 100644 Help/release/dev/remove-FindPythonInterp-FindPythonLibs.rst (limited to 'Help') diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index a37a45c8c5..158bf62155 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -57,6 +57,7 @@ Policies Introduced by CMake 3.27 .. toctree:: :maxdepth: 1 + CMP0148: The FindPythonInterp and FindPythonLibs modules are removed. CMP0147: Visual Studio generators build custom commands in parallel. CMP0146: The FindCUDA module is removed. CMP0145: The Dart and FindDart modules are removed. diff --git a/Help/policy/CMP0148.rst b/Help/policy/CMP0148.rst new file mode 100644 index 0000000000..2f5c43d209 --- /dev/null +++ b/Help/policy/CMP0148.rst @@ -0,0 +1,29 @@ +CMP0148 +------- + +.. versionadded:: 3.27 + +The :module:`FindPythonInterp` and :module:`FindPythonLibs` modules are removed. + +These modules have been deprecated since CMake 3.12. +CMake 3.27 and above prefer to not provide the modules. +This policy provides compatibility for projects that have not been +ported away from them. + +Projects using the :module:`FindPythonInterp` and/or :module:`FindPythonLibs` +modules should be updated to use one of their replacements: + +* :module:`FindPython3` +* :module:`FindPython2` +* :module:`FindPython` + +The ``OLD`` behavior of this policy is for ``find_package(PythonInterp)`` +and ``find_package(PythonLibs)`` to load the deprecated modules. The ``NEW`` +behavior is for uses of the modules to fail as if they do not exist. + +This policy was introduced in CMake version 3.27. CMake version +|release| warns when the policy is not set and uses ``OLD`` behavior. +Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` +explicitly. + +.. include:: DEPRECATED.txt diff --git a/Help/release/dev/remove-FindPythonInterp-FindPythonLibs.rst b/Help/release/dev/remove-FindPythonInterp-FindPythonLibs.rst new file mode 100644 index 0000000000..426febb50c --- /dev/null +++ b/Help/release/dev/remove-FindPythonInterp-FindPythonLibs.rst @@ -0,0 +1,6 @@ +remove-FindPythonInterp-FindPythonLibs +-------------------------------------- + +* The :module:`FindPythonInterp` and :module:`FindPythonLibs` modules have + been fully deprecated via policy :policy:`CMP0148`. Port projects to + :module:`FindPython3`, :module:`FindPython2`, or :module:`FindPython`. -- cgit v1.2.1