summaryrefslogtreecommitdiff
path: root/swig/python/CMakeLists.txt
diff options
context:
space:
mode:
authorwang biao <biao716.wang@samsung.com>2023-05-23 16:12:41 +0800
committerJinWang An <jinwang.an@samsung.com>2023-08-09 08:14:07 +0000
commitf91759036f80e42b794f0fde0e56f36169de5a07 (patch)
tree343287f07b038197595a4c60db018429e9c20e54 /swig/python/CMakeLists.txt
parentb7d6e97665e9daa8c501ccfa02b7eaff383ca36a (diff)
downloadlibzypp-bindings-f91759036f80e42b794f0fde0e56f36169de5a07.tar.gz
libzypp-bindings-f91759036f80e42b794f0fde0e56f36169de5a07.tar.bz2
libzypp-bindings-f91759036f80e42b794f0fde0e56f36169de5a07.zip
change python version to 3.x
Change-Id: If1771c313a788982ad6a53973280de000383721c Signed-off-by: wang biao <biao716.wang@samsung.com> (cherry picked from commit b34d5de51cc9f3b16c9508b2e43fd5171e1e6164)
Diffstat (limited to 'swig/python/CMakeLists.txt')
-rw-r--r--swig/python/CMakeLists.txt12
1 files changed, 6 insertions, 6 deletions
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})