From 6dedf50341f55127ae770d2f202c61bed957451a Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 16 Sep 2021 23:41:38 +0200 Subject: [PATCH 1/3] Use python interpreter instead of hardcode python3 Signed-off-by: Jose Luis Rivero --- src/python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt index 0df5117cd..2e6577daf 100644 --- a/src/python/CMakeLists.txt +++ b/src/python/CMakeLists.txt @@ -110,7 +110,7 @@ if (PYTHONLIBS_FOUND) foreach (test ${python_tests}) add_test(NAME ${test}.py COMMAND - python3 ${CMAKE_SOURCE_DIR}/src/python/${test}.py) + "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/src/python/${test}.py") set(_env_vars) list(APPEND _env_vars "PYTHONPATH=${FAKE_INSTALL_PREFIX}/lib/python/") From a443ee848ed0da1c7f6f1dd0af6fac78a27dce64 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Fri, 17 Sep 2021 12:30:11 +0200 Subject: [PATCH 2/3] Use previous PythonInterp instead of Python3 Signed-off-by: Jose Luis Rivero --- CMakeLists.txt | 1 + src/python/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2e302868..0add9fd89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,7 @@ if (SWIG_FOUND) ######################################## # Include python + find_package(PythonInterp REQUIRED) # change to Python3 when Bionic is EOL find_package(PythonLibs QUIET) if (NOT PYTHONLIBS_FOUND) message (STATUS "Searching for Python - not found.") diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt index 2e6577daf..89ab41e86 100644 --- a/src/python/CMakeLists.txt +++ b/src/python/CMakeLists.txt @@ -110,7 +110,7 @@ if (PYTHONLIBS_FOUND) foreach (test ${python_tests}) add_test(NAME ${test}.py COMMAND - "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/src/python/${test}.py") + "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/src/python/${test}.py") set(_env_vars) list(APPEND _env_vars "PYTHONPATH=${FAKE_INSTALL_PREFIX}/lib/python/") From 1ea1e6da8ea8648f9dd3efe16ab07e7e90ec299c Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Fri, 17 Sep 2021 22:18:18 -0700 Subject: [PATCH 3/3] find python version 3 Signed-off-by: Steve Peters --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0add9fd89..51af9b6ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,7 +69,7 @@ if (SWIG_FOUND) ######################################## # Include python - find_package(PythonInterp REQUIRED) # change to Python3 when Bionic is EOL + find_package(PythonInterp 3 REQUIRED) # change to Python3 when Bionic is EOL find_package(PythonLibs QUIET) if (NOT PYTHONLIBS_FOUND) message (STATUS "Searching for Python - not found.")