diff options
author | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2023-06-09 11:58:26 +0100 |
---|---|---|
committer | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2023-06-09 12:02:11 +0100 |
commit | 36b5b13797bb2c87aa92bd3cfe255cb462fbdf5f (patch) | |
tree | 4c05261dead74dcd8a5a0b2bf2a5d0cc5fea429a /scripts | |
parent | 4c431d77902dc3c47e92a4ad3a3a58ac3e4cc806 (diff) | |
download | ml-embedded-evaluation-kit-36b5b13797bb2c87aa92bd3cfe255cb462fbdf5f.tar.gz |
MLECO-4065: Revising scripts to use Python3.923.05
Revising documentation and scripts to use Python3.9 explicitly
to remove the need for installing it system-wide that might
break a distro's desktop and pacakge manager utilities.
Change-Id: I683b55dd0243d0a726dc94eba2431005d4897c8c
Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/cmake/source_gen_utils.cmake | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/scripts/cmake/source_gen_utils.cmake b/scripts/cmake/source_gen_utils.cmake index 95b3ba4..6287cb6 100644 --- a/scripts/cmake/source_gen_utils.cmake +++ b/scripts/cmake/source_gen_utils.cmake @@ -284,14 +284,26 @@ function(setup_source_generator) return() endif () + # If environment is not found, find the required Python version + # and create it. + find_package(Python3 3.9 + COMPONENTS Interpreter + REQUIRED) + + if (NOT Python3_FOUND) + message(FATAL_ERROR "Required version of Python3 not found!") + else() + message(STATUS "Python3 (v${Python3_VERSION}) found: ${Python3_EXECUTABLE}") + endif() + message(STATUS "Configuring python environment at ${PYTHON}") execute_process( - COMMAND ${PY_EXEC} -m venv ${DEFAULT_VENV_DIR} + COMMAND ${Python3_EXECUTABLE} -m venv ${DEFAULT_VENV_DIR} RESULT_VARIABLE return_code ) if (NOT return_code STREQUAL "0") - message(FATAL_ERROR "Failed to setup python3 environment. Return code: ${return_code}") + message(FATAL_ERROR "Failed to setup Python3 environment. Return code: ${return_code}") endif () execute_process( |