From: Kefu Chai Date: Fri, 5 Apr 2019 17:54:15 +0000 (+0800) Subject: cmake: should PYTHON3_VERSION_STRING of libpython3 X-Git-Tag: v12.2.13~255^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=49afedb03f73aadc83ae4987c64f35854419cbe1;p=ceph.git cmake: should PYTHON3_VERSION_STRING of libpython3 and make sure the version matches exactly the requested one in future, we should use FindPython.cmake Signed-off-by: Kefu Chai (cherry picked from commit 7b15b682b1201929e0ba9efc332ebb8652be40a8) Conflicts: src/CMakeLists.txt: trivial resolution --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0f09f8160d8..f54bbd3dd8c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -245,7 +245,7 @@ endif() # Python stuff find_package(PythonInterp 2 REQUIRED) -find_package(PythonLibs 2 REQUIRED) +find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT REQUIRED) option(WITH_PYTHON3 "build python3 bindings" ON) if(WITH_PYTHON3) @@ -253,7 +253,7 @@ if(WITH_PYTHON3) set(WITH_PYTHON3 "3") endif() find_package(Python3Interp ${WITH_PYTHON3} REQUIRED) - find_package(Python3Libs ${PYTHON_VERSION_STRING} REQUIRED) + find_package(Python3Libs ${PYTHON3_VERSION_STRING} EXACT REQUIRED) endif() if(HAVE_XIO)