|
|
|
@ -47,12 +47,16 @@ if(NOT ${found}) |
|
|
|
|
endforeach() |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
string(REGEX MATCH "^[0-9]+" _preferred_version_major ${preferred_version}) |
|
|
|
|
|
|
|
|
|
find_host_package(PythonInterp "${preferred_version}") |
|
|
|
|
if(NOT PYTHONINTERP_FOUND) |
|
|
|
|
find_host_package(PythonInterp "${min_version}") |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
if(PYTHONINTERP_FOUND) |
|
|
|
|
# Check if python major version is correct |
|
|
|
|
if(${_preferred_version_major} EQUAL ${PYTHON_VERSION_MAJOR}) |
|
|
|
|
# Copy outputs |
|
|
|
|
set(_found ${PYTHONINTERP_FOUND}) |
|
|
|
|
set(_executable ${PYTHON_EXECUTABLE}) |
|
|
|
@ -60,6 +64,7 @@ if(NOT ${found}) |
|
|
|
|
set(_version_major ${PYTHON_VERSION_MAJOR}) |
|
|
|
|
set(_version_minor ${PYTHON_VERSION_MINOR}) |
|
|
|
|
set(_version_patch ${PYTHON_VERSION_PATCH}) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
# Clear find_host_package side effects |
|
|
|
|
unset(PYTHONINTERP_FOUND) |
|
|
|
|