summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPythonInterp.cmake13
-rw-r--r--Modules/FindPythonLibs.cmake13
2 files changed, 26 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)
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 43a84dd..06004ee 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -5,6 +5,9 @@
FindPythonLibs
--------------
+.. 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.
@@ -45,6 +48,16 @@ get the currently active Python version by default with a consistent version
of PYTHON_LIBRARIES.
#]=======================================================================]
+cmake_policy(GET CMP0148 _FindPythonLibs_CMP0148)
+if(_FindPythonLibs_CMP0148 STREQUAL "NEW")
+ message(FATAL_ERROR "The FindPythonLibs module has been removed by policy CMP0148.")
+endif()
+
+if(_FindPythonLibs_testing)
+ set(_FindPythonLibs_included TRUE)
+ return()
+endif()
+
# Use the executable's path as a hint
set(_Python_LIBRARY_PATH_HINT)
if(IS_ABSOLUTE "${PYTHON_EXECUTABLE}")