diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2019-06-05 11:08:52 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2019-06-24 10:00:21 (GMT) |
commit | 9201908ca5c10a6142c0558401445320773f1f1e (patch) | |
tree | 8f1889628d8c87e50d259931b08a40596bbd92a0 /Modules/FindPython.cmake | |
parent | 512013e276e66551c19c12af01336f96c26965a5 (diff) | |
download | CMake-9201908ca5c10a6142c0558401445320773f1f1e.zip CMake-9201908ca5c10a6142c0558401445320773f1f1e.tar.gz CMake-9201908ca5c10a6142c0558401445320773f1f1e.tar.bz2 |
FindPython: add Python_FIND_ABI hint.
This variable will enable to specify will ABIs will be searched.
Diffstat (limited to 'Modules/FindPython.cmake')
-rw-r--r-- | Modules/FindPython.cmake | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake index e2f3bf3..6a9decb 100644 --- a/Modules/FindPython.cmake +++ b/Modules/FindPython.cmake @@ -137,6 +137,51 @@ Hints * If set to TRUE, search **only** for static libraries. * If set to FALSE, search **only** for shared libraries. +``Python_FIND_ABI`` + This variable defines which ABIs, as defined in + `PEP 3149 <https://www.python.org/dev/peps/pep-3149/>`_, should be searched. + + .. note:: + + This hint will be honored only when searched for ``Python`` version 3. + + .. note:: + + If ``Python_FIND_ABI`` is not defined, any ABI will be searched. + + The ``Python_FIND_ABI`` variable is a 3-tuple specifying, in that order, + ``pydebug`` (``d``), ``pymalloc`` (``m``) and ``unicode`` (``u``) flags. + Each element can be set to one of the following: + + * ``ON``: Corresponding flag is selected. + * ``OFF``: Corresponding flag is not selected. + * ``ANY``: The two posibilties (``ON`` and ``OFF``) will be searched. + + From this 3-tuple, various ABIs will be searched starting from the most + specialized to the most general. Moreover, ``debug`` versions will be + searched **after** ``non-debug`` ones. + + For example, if we have:: + + set (Python_FIND_ABI "ON" "ANY" "ANY") + + The following flags combinations will be appended, in that order, to the + artifact names: ``dmu``, ``dm``, ``du``, and ``d``. + + And to search any possible ABIs:: + + set (Python_FIND_ABI "ANY" "ANY" "ANY") + + The following combinations, in that order, will be used: ``mu``, ``m``, + ``u``, ``<empty>``, ``dmu``, ``dm``, ``du`` and ``d``. + + .. note:: + + This hint is useful only on ``POSIX`` systems. So, on ``Windows`` systems, + when ``Python_FIND_ABI`` is defined, ``Python`` distributions from + `python.org <https://www.python.org/>`_ will be found only if value for + each flag is ``OFF`` or ``ANY``. + ``Python_FIND_STRATEGY`` This variable defines how lookup will be done. The ``Python_FIND_STRATEGY`` variable can be set to empty or one of the |