summaryrefslogtreecommitdiffstats
path: root/Modules/FindPythonInterp.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-30 14:13:07 (GMT)
committerBrad King <brad.king@kitware.com>2023-03-30 16:05:09 (GMT)
commita4c5b91f80003d007cddbb0de95032d65ec98ace (patch)
tree591d68a94107253b48f6398a3188e1c89169e0c8 /Modules/FindPythonInterp.cmake
parent4901fdb201bc6264e976e105780a490d9c0eba19 (diff)
downloadCMake-a4c5b91f80003d007cddbb0de95032d65ec98ace.zip
CMake-a4c5b91f80003d007cddbb0de95032d65ec98ace.tar.gz
CMake-a4c5b91f80003d007cddbb0de95032d65ec98ace.tar.bz2
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}`.
Diffstat (limited to 'Modules/FindPythonInterp.cmake')
-rw-r--r--Modules/FindPythonInterp.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 7ad3587..b5e759d 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -5,6 +5,9 @@
FindPythonInterp
----------------
+.. versionchanged:: 3.27
+ This module is available only if policy :policy:`CMP0148` is not set to ``NEW``.
+
.. deprecated:: 3.12
Use :module:`FindPython3`, :module:`FindPython2` or :module:`FindPython` instead.
@@ -50,6 +53,16 @@ of PYTHON_LIBRARIES.
#]=======================================================================]
+cmake_policy(GET CMP0148 _FindPythonInterp_CMP0148)
+if(_FindPythonInterp_CMP0148 STREQUAL "NEW")
+ message(FATAL_ERROR "The FindPythonInterp module has been removed by policy CMP0148.")
+endif()
+
+if(_FindPythonInterp_testing)
+ set(_FindPythonInterp_included TRUE)
+ return()
+endif()
+
unset(_Python_NAMES)
set(_PYTHON1_VERSIONS 1.6 1.5)