explictly call find_package(PythonInterp) first to fix build err

this is an un-modified message from dev-util/cmake-3.7.1
/usr/share/cmake/Modules/FindPythonLibs.cmake

call ``find_package(PythonInterp)`` first to
 get the currently active Python version by default with a consistent
version  of PYTHON_LIBRARIES.

Signed-off-by: Yixun Lan <dlan@gentoo.org>

---
the detail error message we've met here

Found PythonInterp: python (found suitable version "2.7.12", minimum required is "2")
CMake Error at /usr/share/cmake/Modules/FindPythonLibs.cmake:54 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  src/CMakeLists.txt:209 (find_package)
This commit is contained in:
Yixun Lan 2016-12-08 15:25:14 +08:00
parent 96cf8a1b28
commit 4adb3c13b9
No known key found for this signature in database
GPG Key ID: 31AAEA47594DBBED
1 changed files with 1 additions and 0 deletions

View File

@ -348,6 +348,7 @@ option(WITH_CEPHFS "CephFS is enabled" ON)
option(WITH_MGR "ceph-mgr is enabled" ON)
if(WITH_MGR)
set(Python_ADDITIONAL_VERSIONS 2.7)
find_package(PythonInterp 2.7 REQUIRED)
find_package(PythonLibs 2.7 REQUIRED)
# Boost dependency check deferred to Boost section
endif(WITH_MGR)