From c8baadf3c09bc3628192048beef96c1fd6310f64 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 8 Feb 2018 23:26:22 +0800 Subject: [PATCH] cmake: depend on the right version of python bindings Signed-off-by: Kefu Chai --- src/CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9651c75041f81..aec0681ced3ed 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -274,6 +274,14 @@ if(WITH_PYTHON3) find_package(Python3Libs 3 REQUIRED) endif() +# the major version of the python bindings as a dependency of other +# targets +if(WITH_PYTHON2) + set(PY_BINDING_INFIX "") +else() + set(PY_BINDING_INFIX 3) +endif() + if(HAVE_XIO) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${XIO_INCLUDE_DIR}") list(APPEND EXTRALIBS ${XIO_LIBRARY} pthread) @@ -1089,13 +1097,12 @@ add_custom_target(vstart-base DEPENDS monmaptool crushtool rados - cython_rados - ) + cython${PY_BINDING_INFIX}_rados) add_custom_target(vstart DEPENDS vstart-base ceph-mds - cython_rbd) + cython${PY_BINDING_INFIX}_rbd) if(WITH_RADOSGW) add_dependencies(vstart radosgw radosgw-admin) endif(WITH_RADOSGW) @@ -1108,7 +1115,7 @@ endif(WITH_LTTNG) add_custom_target(cephfs_testing DEPENDS vstart rados - cython_modules + cython${PY_BINDING_INFIX}_modules cephfs cls_cephfs ceph-fuse -- 2.39.5