]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: should PYTHON3_VERSION_STRING of libpython3 27407/head
authorKefu Chai <kchai@redhat.com>
Fri, 5 Apr 2019 17:54:15 +0000 (01:54 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 5 Apr 2019 17:59:36 +0000 (01:59 +0800)
and make sure the version matches exactly the requested one

in future, we should use FindPython.cmake

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/CMakeLists.txt

index d23874e5bdaf15bff1a90d479efc28a3ea8a76c4..0c5d02377bfe91185660212b50126b0f3c0e4bf4 100644 (file)
@@ -220,7 +220,7 @@ endif()
 option(WITH_PYTHON2 "build python2 bindings" ON)
 if(WITH_PYTHON2)
   find_package(PythonInterp 2 REQUIRED)
-  find_package(PythonLibs 2 REQUIRED)
+  find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT REQUIRED)
 endif()
 
 set(WITH_PYTHON3 "OFF" CACHE STRING "build python3 bindings with specified python3 version")
@@ -229,7 +229,7 @@ if(WITH_PYTHON3)
     set(WITH_PYTHON3 "3")
   endif()
   find_package(Python3Interp ${WITH_PYTHON3} REQUIRED)
-  find_package(Python3Libs ${PYTHON3_VERSION_MAJOR}.${PYTHON3_VERSION_MINOR} REQUIRED)
+  find_package(Python3Libs ${PYTHON3_VERSION_STRING} EXACT REQUIRED)
 endif()
 
 # the major version of the python bindings as a dependency of other