From 0b5cd18bee3aaba3bde463dff4546a266e2be0ec Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Thu, 4 Jul 2019 14:26:08 +0200 Subject: [PATCH] cmake: Add python-common Signed-off-by: Sebastian Wagner Co-authored-by: Kefu Chai --- src/CMakeLists.txt | 1 + src/python-common/CMakeLists.txt | 12 ++++++++++++ src/test/CMakeLists.txt | 5 +++++ 3 files changed, 18 insertions(+) create mode 100644 src/python-common/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f348fc9b8a0..64777679998 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -503,6 +503,7 @@ endif() add_subdirectory(pybind) add_subdirectory(ceph-volume) +add_subdirectory(python-common) # Monitor add_subdirectory(mon) diff --git a/src/python-common/CMakeLists.txt b/src/python-common/CMakeLists.txt new file mode 100644 index 00000000000..90d9eb4bad5 --- /dev/null +++ b/src/python-common/CMakeLists.txt @@ -0,0 +1,12 @@ +if(WITH_PYTHON3) + list(APPEND py_vers 3) +endif() +if(WITH_PYTHON2) + list(APPEND py_vers 2) +endif() + +include(Distutils) +foreach(python_version ${py_vers}) + distutils_install_module(ceph + PYTHON_VERSION ${python_version}) +endforeach() diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 0a532986540..04762e980e0 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -573,6 +573,11 @@ if(WITH_MGR) list(APPEND tox_tests run-tox-mgr-orchestrator_cli) set(MGR_ORCHESTRATOR_CLI_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/mgr-orchestrator_cli-virtualenv) list(APPEND env_vars_for_tox_tests MGR_ORCHESTRATOR_CLI_VIRTUALENV=${MGR_ORCHESTRATOR_CLI_VIRTUALENV}) + + add_test(NAME run-tox-python-common + COMMAND bash ${CMAKE_SOURCE_DIR}/src/script/run_tox.sh + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/python-common ) + list(APPEND tox_tests run-tox-python-common) endif() set_property( -- 2.39.5