mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 14:20:06 -06:00
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}`.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user