cmake: Fix finding python in virtualenv
When running cmake directly (without west, as twister does) on nix the CMake environment paths are set and thus it does not find the virtualenv'ed python. Fix this by ignoring the cmake environment variables nix sets. Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
This commit is contained in:
parent
dafb532da3
commit
8c4c180575
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ if(NOT Python3_EXECUTABLE)
|
|||
# cause just using find_program directly could result in a python2.7 as python,
|
||||
# and not finding a valid python3.
|
||||
foreach(candidate "python" "python3")
|
||||
find_program(Python3_EXECUTABLE ${candidate} PATHS ENV VIRTUAL_ENV NO_CMAKE_PATH)
|
||||
find_program(Python3_EXECUTABLE ${candidate} PATHS ENV VIRTUAL_ENV NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH)
|
||||
if(Python3_EXECUTABLE)
|
||||
execute_process (COMMAND "${Python3_EXECUTABLE}" -c
|
||||
"import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:2]]))"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue