FindPython: Implement lookup strategies.

Configration variable Python_FIND_STRATEGY controls the lookup startegy.
Possible values are LOCATION and VERSION.

Fixes: #19159
This commit is contained in:
Marc Chevrier
2019-05-15 17:35:49 +02:00
parent 0bf5348329
commit 9f205acefe
5 changed files with 830 additions and 376 deletions

View File

@@ -138,6 +138,17 @@ Hints
* If set to TRUE, search **only** for static libraries.
* If set to FALSE, search **only** for shared libraries.
``Python3_FIND_STRATEGY``
This variable defines how lookup will be done.
The ``Python3_FIND_STRATEGY`` variable can be set to empty or one of the
following:
* ``VERSION``: Try to find the most recent version in all specified
locations.
This is the default.
* ``LOCATION``: Stops lookup as soon as a version satisfying version
constraints is founded.
``Python3_FIND_REGISTRY``
On Windows the ``Python3_FIND_REGISTRY`` variable determine the order
of preference between registry and environment variables.