From 5ff40313f9e595eb7da1bbee72a98bad4977911b Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Fri, 12 Aug 2016 12:27:34 +0300 Subject: [PATCH] cmake: Move Python detection back outside of pybind Signed-off-by: Oleh Prypin --- src/CMakeLists.txt | 6 ++++++ src/pybind/CMakeLists.txt | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9cc74d6a34938..b63b88a4325ad 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -277,6 +277,12 @@ if(WITH_CEPHFS_JAVA) add_subdirectory(java) endif() +# Python stuff +find_package(PythonInterp 2 REQUIRED) +find_package(PythonLibs 2 REQUIRED) +find_package(Python3Interp 3 REQUIRED) +find_package(Python3Libs 3 REQUIRED) + if(HAVE_XIO) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${XIO_INCLUDE_DIR}") list(APPEND EXTRALIBS ${XIO_LIBRARY} pthread rt) diff --git a/src/pybind/CMakeLists.txt b/src/pybind/CMakeLists.txt index 0a2a22b471ccc..3d22acd9cfee8 100644 --- a/src/pybind/CMakeLists.txt +++ b/src/pybind/CMakeLists.txt @@ -9,9 +9,6 @@ foreach(python_version 3 2) # Keep the default version last set(PYTHON_VERSION ${python_version}) endif(${python_version} EQUAL 2) - find_package(Python${PYTHON_VERSION}Interp ${python_version} REQUIRED) - find_package(Python${PYTHON_VERSION}Libs ${python_version} REQUIRED) - find_package(Cython REQUIRED) add_subdirectory(rados rados${PYTHON_VERSION}) -- 2.39.5