From f91759036f80e42b794f0fde0e56f36169de5a07 Mon Sep 17 00:00:00 2001 From: wang biao Date: Tue, 23 May 2023 16:12:41 +0800 Subject: change python version to 3.x Change-Id: If1771c313a788982ad6a53973280de000383721c Signed-off-by: wang biao (cherry picked from commit b34d5de51cc9f3b16c9508b2e43fd5171e1e6164) --- swig/python/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'swig/python/CMakeLists.txt') diff --git a/swig/python/CMakeLists.txt b/swig/python/CMakeLists.txt index 284bcb0..3abf313 100644 --- a/swig/python/CMakeLists.txt +++ b/swig/python/CMakeLists.txt @@ -15,13 +15,13 @@ ADD_SUBDIRECTORY(tests) SET( SWIG_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libzypp_python.cc" ) FIND_PACKAGE(PythonInterp REQUIRED) -IF (NOT PYTHON_SITEDIR) - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(1))" OUTPUT_VARIABLE PYTHON_SITEDIR) -ENDIF (NOT PYTHON_SITEDIR) +IF (NOT PYTHON3_SITEDIR) + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; import sysconfig; stdout.write(sysconfig.get_path('platlib'))" OUTPUT_VARIABLE PYTHON3_SITEDIR) +ENDIF (NOT PYTHON3_SITEDIR) MESSAGE(STATUS "Python executable: ${PYTHON_EXECUTABLE}") MESSAGE(STATUS "Python include path: ${PYTHON_INCLUDE_PATH}") -MESSAGE(STATUS "Python site dir: ${PYTHON_SITEDIR}") +MESSAGE(STATUS "Python site dir: ${PYTHON3_SITEDIR}") ADD_CUSTOM_COMMAND ( OUTPUT ${SWIG_OUTPUT} @@ -44,5 +44,5 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/swig ) INCLUDE_DIRECTORIES( ${ZYPP_INCLUDE_DIR} ) TARGET_LINK_LIBRARIES( zypp_python ${ZYPP_LIBRARY} ) -INSTALL(TARGETS zypp_python LIBRARY DESTINATION ${PYTHON_SITEDIR}) -INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/zypp.py DESTINATION ${PYTHON_SITEDIR}) +INSTALL(TARGETS zypp_python LIBRARY DESTINATION ${PYTHON3_SITEDIR}) +INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/zypp.py DESTINATION ${PYTHON3_SITEDIR}) -- cgit v1.2.3