Skip to content
Commit 94de3e9f authored by Torsten Rasmussen's avatar Torsten Rasmussen Committed by Anas Nashif
Browse files

cmake: FindPython3: Adjust python3 program search



Fixes: #24340

Using find_package(Python3 3.6) will select the highest available
python3.

This means that in case user has:
/usr/bin/python  --> python2.7
/usr/bin/python3 --> python3.6
/usr/bin/python3.6
/usr/bin/python3.8

then CMake will choose python 3.8.
This commit changes that behavior, so that in the above scenario, then
Python 3.6 will be preferred.

It also adds the following, python will be preferred over python3, if
both meets the minimum requirement.
For example:
/usr/bin/python  --> python3.6
/usr/bin/python3 --> python3.7
then Python 3.6 is prefered.

It further introduces PYTHON_PREFER variable, which can be used to
further control the behavior.
As example -DPYTHON_PREFER=python3.7 will choose Python 3.7 if
installed.

Signed-off-by: default avatarTorsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
parent 9aefdaff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment