Document optional possibility to hardcode a Python directory
With the update to Python3.cmake -DPYTHON_DIR is used as a HINT to search for a suitable Python3 version.
Sometimes just hinting towards a location is not enough and you would like to hardcode that and let the process fail miserably if nothing is found.
To keep the hinting behaviour of -DPYTHON_DIR=<path> we should add -DFORCE_PYTHON_DIR=TRUE that will switch from hinting => enforcing the search in PYTHON_DIR and nowhere else.
The whole processing in packaged CMake runs in an extra file from Python3.cmake kept in FindPython/Support.cmake that we would need to adopt to buildsystem/modules/FindPython/Support.cmake to let it be used by CMake and overwrite default behaviour.
Be aware, that we are limited to the 3.12.x version and functionality of CMake as this is our minimum version requirement, there are newer version of the files and It would make sense to test how far we can update that with the usage of our CMake 3.12.x minimum requirement. In the newer version there is a find virtual environment handling included that could be interesting for example.
Python3_FIND_VIRTUALENVThis variable defines the handling of virtual environments. It is meaningfull only when a virtual environment is active (i.e. theactivatescript has been evaluated). In this case, it takes precedence overPython3_FIND_REGISTRYandCMAKE_FIND_FRAMEWORKvariables.
Will be fixed with #1263 version bump of CMake to 3.16.3.
Artifacts Specification
^^^^^^^^^^^^^^^^^^^^^^^
To solve special cases, it is possible to specify directly the artifacts by
setting the following variables:
``Python3_EXECUTABLE``
The path to the interpreter.
``Python3_COMPILER``
The path to the compiler.
``Python3_LIBRARY``
The path to the library. It will be used to compute the
variables ``Python3_LIBRARIES``, ``Python3_LIBRAY_DIRS`` and
``Python3_RUNTIME_LIBRARY_DIRS``.
.. note::
When an artifact is specified, all ``HINTS`` will be ignored and no search
will be performed for this artifact.
If more than one artifact is specified, it is the user's responsability to
ensure the consistency of the various artifacts.
@TheJJ Python3_EXECUTABLE flag needs documentation though, I feel.