mirror of
https://github.com/ceph/ceph
synced 2024-12-11 05:57:05 +00:00
5e2bd7fc4d
use the ones shiped from the latest cmake. which * enables us to find the recent python intepreter and development files, * find intepreter and development in a single `find_pacakge()` command, simpler this way and less error prone. and to accomodate this change: * all `PYTHON${PYTHON_VERSION}_*` variables are renamed to `Python${PYTHON_VERSION}_*` if we use `find_package(Python2...)` or `find_package(Python3...)` to find python2 or python3 instead of using `find_package(Python...)`. * use "2" explicitly when using python2, as `Python_*` variables are not defined anymore * when compiling python support of ceph-mgr, continue using `Python_*` variables. because we find the python interpreter and development files using `find_pacakge(Python...)` for ceph-mgr. Signed-off-by: Kefu Chai <kchai@redhat.com>
17 lines
556 B
CMake
17 lines
556 B
CMake
#
|
|
# Cython
|
|
#
|
|
|
|
# Try to run Cython, to make sure it works:
|
|
execute_process(
|
|
COMMAND ${Python${PYTHON_VERSION}_EXECUTABLE} -m cython --version
|
|
RESULT_VARIABLE cython_result
|
|
ERROR_VARIABLE cython_output)
|
|
if(cython_result EQUAL 0)
|
|
string(REGEX REPLACE "^Cython version ([0-9]+\\.[0-9]+).*" "\\1" CYTHON_VERSION "${cython_output}")
|
|
else()
|
|
message(SEND_ERROR "Could not find cython${PYTHON_VERSION}: ${cython_output}")
|
|
endif()
|
|
include(FindPackageHandleStandardArgs)
|
|
find_package_handle_standard_args(Cython${PYTHON_VERSION} DEFAULT_MSG CYTHON_VERSION)
|