FindPython: On Windows, Enhance python debug version support

Add the following variables:
* Python_EXECUTABLE_DEBUG
* Python_INTERPRETER
* Python_DEBUG_POSTFIX

and target Python::InterpreterDebug.

python_add_library() command Manage DEBUG_POSTFIX target property based
on the value of Python_DEBUG_POSTFIX variable.

Fixes: #25874
This commit is contained in:
Marc Chevrier
2024-04-27 17:16:52 +02:00
parent 648a7fb9b9
commit c164404b2e
43 changed files with 279 additions and 62 deletions

View File

@@ -78,9 +78,25 @@ This module defines the following :ref:`Imported Targets <Imported Targets>`:
:prop_gbl:`CMAKE_ROLE` is ``PROJECT``.
``Python3::Interpreter``
Python 3 interpreter. Target defined if component ``Interpreter`` is found.
Python 3 interpreter. This target is defined only if the ``Interpreter``
component is found.
``Python3::InterpreterDebug``
.. versionadded:: 3.30
Python 3 debug interpreter. This target is defined only if the
``Interpreter`` component is found and the ``Python3_EXECUTABLE_DEBUG``
variable is defined. The target is only defined on the ``Windows`` platform.
``Python3::InterpreterMultiConfig``
.. versionadded:: 3.30
Python 3 interpreter. The release or debug version of the interpreter will be
used, based on the context (platform, configuration).
This target is defined only if the ``Interpreter`` component is found
``Python3::Compiler``
Python 3 compiler. Target defined if component ``Compiler`` is found.
Python 3 compiler. This target is defined only if the ``Compiler`` component
is found.
``Python3::Module``
.. versionadded:: 3.15
@@ -115,6 +131,20 @@ This module will set the following variables in your project
System has the Python 3 interpreter.
``Python3_EXECUTABLE``
Path to the Python 3 interpreter.
``Python3_EXECUTABLE_DEBUG``
.. versionadded:: 3.30
Path to the debug Python 3 interpreter. It is only defined on ``Windows``
platform.
``Python3_INTERPRETER``
.. versionadded:: 3.30
Path to the Python 3 interpreter, defined as a
:manual:`generator expression <cmake-generator-expressions(7)>` selecting
the ``Python3_EXECUTABLE`` or ``Python3_EXECUTABLE_DEBUG`` variable based on
the context (platform, configuration).
``Python3_INTERPRETER_ID``
A short string unique to the interpreter. Possible values include:
* Python
@@ -196,6 +226,12 @@ This module will set the following variables in your project
The Python 3 include directories.
``Python3_DEBUG_POSTFIX``
.. versionadded.. 3.30
Postfix of debug python module. This variable can be used to define the
:prop_tgt:`DEBUG_POSTFIX` target property.
``Python3_LINK_OPTIONS``
.. versionadded:: 3.19
@@ -535,6 +571,10 @@ If the library type is not specified, ``MODULE`` is assumed.
When option ``WITH_SOABI`` is also specified, the module suffix will include
the ``Python3_SOSABI`` value, if any.
.. versionadded:: 3.30
For ``MODULE`` type, the :prop_tgt:`DEBUG_POSTFIX` target property is
initialized with the value of ``Python3_DEBUG_POSTFIX`` variable if defined.
#]=======================================================================]