Skip to content

Commit

Permalink
Merge pull request #2371 from mkuron/patch-7
Browse files Browse the repository at this point in the history
Fix Cython detection on Fedora 29
  • Loading branch information
fweik authored Nov 12, 2018
2 parents 8a4db40 + e0b320e commit f80bd28
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cmake/FindCython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,21 @@ else()
endif()

# Check version
if(CYTHON_EXECUTABLE)
execute_process(COMMAND ${CYTHON_EXECUTABLE} -V
ERROR_VARIABLE CYTHON_OUTPUT OUTPUT_QUIET)
string(REGEX REPLACE "^Cython version ([0-9]+\\.[0-9]+).*" "\\1" CYTHON_VERSION "${CYTHON_OUTPUT}")
if(NOT CYTHON_EXECUTABLE)
set(CYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} -m cython)
endif()
execute_process(COMMAND ${CYTHON_EXECUTABLE} -V
ERROR_VARIABLE CYTHON_OUTPUT RESULT_VARIABLE CYTHON_STATUS OUTPUT_QUIET)
if(CYTHON_STATUS EQUAL 0)
string(REGEX REPLACE "^Cython version ([0-9]+\\.[0-9\\.]+).*" "\\1" CYTHON_VERSION "${CYTHON_OUTPUT}")

if(${CYTHON_VERSION} VERSION_LESS ${CYTHON_REQUIRED_VERSION})
message(FATAL_ERROR "Espresso needs at least Cython version ${CYTHON_REQUIRED_VERSION}, found verson ${CYTHON_VERSION}")
message(FATAL_ERROR "Espresso needs at least Cython version ${CYTHON_REQUIRED_VERSION}, found version ${CYTHON_VERSION}")
else()
message(STATUS "Found Cython version ${CYTHON_VERSION}")
endif()
else()
message(FATAL_ERROR "Espresso needs at least Cython version ${CYTHON_REQUIRED_VERSION}, but could not find it")
endif()

include( FindPackageHandleStandardArgs )
Expand Down

0 comments on commit f80bd28

Please sign in to comment.