@@ -77,9 +77,25 @@ This module defines the following :ref:`Imported Targets <Imported Targets>`:
77
77
:prop_gbl:`CMAKE_ROLE` is ``PROJECT``.
78
78
79
79
``Python::Interpreter``
80
- Python interpreter. Target defined if component ``Interpreter`` is found.
80
+ Python interpreter. This target is defined only if the ``Interpreter``
81
+ component is found.
82
+ ``Python::InterpreterDebug``
83
+ .. versionadded:: 3.30
84
+
85
+ Python debug interpreter. This target is defined only if the ``Interpreter``
86
+ component is found and the ``Python_EXECUTABLE_DEBUG`` variable is defined.
87
+ The target is only defined on the ``Windows`` platform.
88
+
89
+ ``Python::InterpreterMultiConfig``
90
+ .. versionadded:: 3.30
91
+
92
+ Python interpreter. The release or debug version of the interpreter will be
93
+ used, based on the context (platform, configuration).
94
+ This target is defined only if the ``Interpreter`` component is found
95
+
81
96
``Python::Compiler``
82
- Python compiler. Target defined if component ``Compiler`` is found.
97
+ Python compiler. This target is defined only if the ``Compiler`` component is
98
+ found.
83
99
84
100
``Python::Module``
85
101
.. versionadded:: 3.15
@@ -114,6 +130,20 @@ This module will set the following variables in your project
114
130
System has the Python interpreter.
115
131
``Python_EXECUTABLE``
116
132
Path to the Python interpreter.
133
+ ``Python_EXECUTABLE_DEBUG``
134
+ .. versionadded:: 3.30
135
+
136
+ Path to the debug Python interpreter. It is only defined on the ``Windows``
137
+ platform.
138
+
139
+ ``Python_INTERPRETER``
140
+ .. versionadded:: 3.30
141
+
142
+ Path to the Python interpreter, defined as a
143
+ :manual:`generator expression <cmake-generator-expressions(7)>` selecting
144
+ the ``Python_EXECUTABLE`` or ``Python_EXECUTABLE_DEBUG`` variable based on
145
+ the context (platform, configuration).
146
+
117
147
``Python_INTERPRETER_ID``
118
148
A short string unique to the interpreter. Possible values include:
119
149
* Python
@@ -125,38 +155,28 @@ This module will set the following variables in your project
125
155
``Python_STDLIB``
126
156
Standard platform independent installation directory.
127
157
128
- Information returned by
129
- ``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=True)``
130
- or else ``sysconfig.get_path('stdlib')``.
158
+ Information returned by ``sysconfig.get_path('stdlib')``.
131
159
``Python_STDARCH``
132
160
Standard platform dependent installation directory.
133
161
134
- Information returned by
135
- ``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=True)``
136
- or else ``sysconfig.get_path('platstdlib')``.
162
+ Information returned by ``sysconfig.get_path('platstdlib')``.
137
163
``Python_SITELIB``
138
164
Third-party platform independent installation directory.
139
165
140
- Information returned by
141
- ``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=False)``
142
- or else ``sysconfig.get_path('purelib')``.
166
+ Information returned by ``sysconfig.get_path('purelib')``.
143
167
``Python_SITEARCH``
144
168
Third-party platform dependent installation directory.
145
169
146
- Information returned by
147
- ``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=False)``
148
- or else ``sysconfig.get_path('platlib')``.
170
+ Information returned by ``sysconfig.get_path('platlib')``.
149
171
150
172
``Python_SOABI``
151
173
.. versionadded:: 3.17
152
174
153
175
Extension suffix for modules.
154
176
155
- Information computed from ``distutils.sysconfig.get_config_var('EXT_SUFFIX')``
156
- or ``distutils.sysconfig.get_config_var('SOABI')`` or
157
- ``python3-config --extension-suffix``. If package ``distutils.sysconfig`` is
158
- not available, ``sysconfig.get_config_var('EXT_SUFFIX')`` or
159
- ``sysconfig.get_config_var('SOABI')`` are used.
177
+ Information computed from ``sysconfig.get_config_var('EXT_SUFFIX')`` or
178
+ ``sysconfig.get_config_var('SOABI')`` or
179
+ ``python3-config --extension-suffix``.
160
180
161
181
``Python_SOSABI``
162
182
.. versionadded:: 3.26
@@ -204,6 +224,17 @@ This module will set the following variables in your project
204
224
205
225
The Python include directories.
206
226
227
+ ``Python_DEFINITIONS``
228
+ .. versionadded:: 3.30.3
229
+
230
+ The Python preprocessor definitions.
231
+
232
+ ``Python_DEBUG_POSTFIX``
233
+ .. versionadded:: 3.30
234
+
235
+ Postfix of debug python module. This variable can be used to define the
236
+ :prop_tgt:`DEBUG_POSTFIX` target property.
237
+
207
238
``Python_LINK_OPTIONS``
208
239
.. versionadded:: 3.19
209
240
@@ -284,42 +315,54 @@ Hints
284
315
285
316
This hint will be honored only when searched for ``Python`` version 3.
286
317
287
- .. note::
318
+ The ``Python_FIND_ABI`` variable is a 4-tuple specifying, in that order,
319
+ ``pydebug`` (``d``), ``pymalloc`` (``m``), ``unicode`` (``u``) and
320
+ ``gil_disabled`` (``t``) flags.
288
321
289
- If ``Python_FIND_ABI`` is not defined, any ABI will be searched.
322
+ .. versionadded:: 3.30
323
+ A fourth element, specifying the ``gil_disabled`` flag (i.e. free
324
+ threaded python), is added and is optional. If not specified, the value is
325
+ ``OFF``.
290
326
291
- The ``Python_FIND_ABI`` variable is a 3-tuple specifying, in that order,
292
- ``pydebug`` (``d``), ``pymalloc`` (``m``) and ``unicode`` (``u``) flags.
293
327
Each element can be set to one of the following:
294
328
295
329
* ``ON``: Corresponding flag is selected.
296
330
* ``OFF``: Corresponding flag is not selected.
297
331
* ``ANY``: The two possibilities (``ON`` and ``OFF``) will be searched.
298
332
299
- From this 3-tuple, various ABIs will be searched starting from the most
300
- specialized to the most general. Moreover, ``debug`` versions will be
301
- searched **after** ``non-debug`` ones.
333
+ .. note::
334
+
335
+ If ``Python3_FIND_ABI`` is not defined, any ABI, excluding the
336
+ ``gil_disabled`` flag, will be searched.
337
+
338
+ From this 4-tuple, various ABIs will be searched starting from the most
339
+ specialized to the most general. Moreover, when ``ANY`` is specified for
340
+ ``pydebug`` and ``gil_disabled``, ``debug`` and ``free threaded`` versions
341
+ will be searched **after** ``non-debug`` and ``non-gil-disabled`` ones.
302
342
303
343
For example, if we have::
304
344
305
- set (Python_FIND_ABI "ON" "ANY" "ANY")
345
+ set (Python_FIND_ABI "ON" "ANY" "ANY" "ON" )
306
346
307
347
The following flags combinations will be appended, in that order, to the
308
- artifact names: ``dmu ``, ``dm ``, ``du ``, and ``d ``.
348
+ artifact names: ``tdmu ``, ``tdm ``, ``tdu ``, and ``td ``.
309
349
310
350
And to search any possible ABIs::
311
351
312
- set (Python_FIND_ABI "ANY" "ANY" "ANY")
352
+ set (Python_FIND_ABI "ANY" "ANY" "ANY" "ANY" )
313
353
314
354
The following combinations, in that order, will be used: ``mu``, ``m``,
315
- ``u``, ``<empty>``, ``dmu``, ``dm``, ``du`` and ``d``.
355
+ ``u``, ``<empty>``, ``dmu``, ``dm``, ``du``, ``d``, ``tmu``, ``tm``, ``tu``,
356
+ ``t``, ``tdmu``, ``tdm``, ``tdu``, and ``td``.
316
357
317
358
.. note::
318
359
319
- This hint is useful only on ``POSIX`` systems. So, on ``Windows`` systems,
360
+ This hint is useful only on ``POSIX`` systems except for the
361
+ ``gil_disabled`` flag. So, on ``Windows`` systems,
320
362
when ``Python_FIND_ABI`` is defined, ``Python`` distributions from
321
- `python.org <https://www.python.org/>`_ will be found only if value for
322
- each flag is ``OFF`` or ``ANY``.
363
+ `python.org <https://www.python.org/>`_ will be found only if the value for
364
+ each flag is ``OFF`` or ``ANY`` except for the fourth one
365
+ (``gil_disabled``).
323
366
324
367
``Python_FIND_STRATEGY``
325
368
.. versionadded:: 3.15
@@ -335,6 +378,8 @@ Hints
335
378
constraints is founded.
336
379
This is the default if policy :policy:`CMP0094` is set to ``NEW``.
337
380
381
+ See also ``Python_FIND_UNVERSIONED_NAMES``.
382
+
338
383
``Python_FIND_REGISTRY``
339
384
.. versionadded:: 3.13
340
385
@@ -406,7 +451,7 @@ Hints
406
451
See `IronPython <https://ironpython.net>`_.
407
452
* ``PyPy``: This implementation use ``RPython`` language and
408
453
``RPython translation toolchain`` to produce the python interpreter.
409
- See `PyPy <https://www. pypy.org>`_.
454
+ See `PyPy <https://pypy.org>`_.
410
455
411
456
The default value is:
412
457
@@ -442,6 +487,8 @@ Hints
442
487
This is the default.
443
488
* ``NEVER``: The generic name are not searched at all.
444
489
490
+ See also ``Python_FIND_STRATEGY``.
491
+
445
492
Artifacts Specification
446
493
^^^^^^^^^^^^^^^^^^^^^^^
447
494
@@ -543,6 +590,10 @@ If the library type is not specified, ``MODULE`` is assumed.
543
590
544
591
When option ``WITH_SOABI`` is also specified, the module suffix will include
545
592
the ``Python_SOSABI`` value, if any.
593
+
594
+ .. versionadded:: 3.30
595
+ For ``MODULE`` type, the :prop_tgt:`DEBUG_POSTFIX` target property is
596
+ initialized with the value of ``Python_DEBUG_POSTFIX`` variable if defined.
546
597
#]=======================================================================]
547
598
548
599
0 commit comments