11#[[ Generate common python virtual enviornment ]]
2- # NOTE find_package try to use at least python3.8 as follows depending on platform version
3- # Ubuntu18.04; explictly installed python3.8 (default is python3.6)
4- # Ubuntu20.04; default python3.8
2+ # NOTE find_package try to use at least python3.10 as follows depending on platform version
3+ # Ubuntu20.04; explictly installed python3.10 (default is python3.8)
54# Ubuntu22.04; default python3.10
65# Ubuntu24.04; default python3.12
76# refer https://github.com/Samsung/ONE/issues/9962
8- # find python 3.8 or above
9- find_package (Python 3.8 EXACT COMPONENTS Interpreter QUIET )
7+ # refer https://github.com/Samsung/ONE/issues/15226
8+ # find python 3.10 or above
9+ find_package (Python 3.10 EXACT COMPONENTS Interpreter QUIET )
1010if (NOT Python_FOUND)
11- find_package (Python 3.8 COMPONENTS Interpreter QUIET )
11+ find_package (Python 3.10 COMPONENTS Interpreter QUIET )
1212endif ()
1313
1414if (NOT Python_Interpreter_FOUND)
1515 message (STATUS "Build common-artifacts: FAILED (Python3 is missing)" )
1616 return ()
1717endif ()
1818
19- # NOTE assume only use 3.8.x or 3.10.x or 3.12.x
20- if ((Python_VERSION VERSION_GREATER_EQUAL 3.8) AND (Python_VERSION VERSION_LESS 3.9))
21- set (PYTHON_VERSION_MINOR 8)
22- elseif ((Python_VERSION VERSION_GREATER_EQUAL 3.10) AND (Python_VERSION VERSION_LESS 3.11))
19+ # NOTE assume only use 3.10.x or 3.12.x
20+ if ((Python_VERSION VERSION_GREATER_EQUAL 3.10) AND (Python_VERSION VERSION_LESS 3.11))
2321 set (PYTHON_VERSION_MINOR 10)
2422elseif ((Python_VERSION VERSION_GREATER_EQUAL 3.12) AND (Python_VERSION VERSION_LESS 3.13))
2523 set (PYTHON_VERSION_MINOR 12)
@@ -29,6 +27,10 @@ else()
2927 return ()
3028endif ()
3129
30+ # NOTE ONE_PYTHON_VERSION_MINOR is to provide current python3.x minor version
31+ # number to modules that use common artifacts.
32+ set (ONE_PYTHON_VERSION_MINOR ${PYTHON_VERSION_MINOR} PARENT_SCOPE)
33+
3234set (PYTHON_EXECUTABLE ${Python_EXECUTABLE} )
3335
3436# Create python virtual environment
@@ -44,8 +46,8 @@ set(REQUIREMENTS_FILE "requirements.txt")
4446set (REQUIREMENTS_OVERLAY_PATH "${VIRTUALENV_OVERLAY} /${REQUIREMENTS_FILE} " )
4547
4648set (PYTHON_OVERLAY python3)
47- if (PYTHON_EXECUTABLE MATCHES python3.8 )
48- set (PYTHON_OVERLAY python3.8 )
49+ if (PYTHON_EXECUTABLE MATCHES python3.10 )
50+ set (PYTHON_OVERLAY python3.10 )
4951endif ()
5052
5153# NOTE when using behind proxy with self signed certificate, need to set '--trusted-host' options
0 commit comments