Fixed cmake so that it really defines CYTHON_EXECUTABLE (instead of just threatening to do so). This has the side-benefit that compilation now works from within eclipse.

release/4.3a0
dellaert 2017-08-05 16:30:20 -07:00
parent 17c4c2ff19
commit 81bb1d445a
2 changed files with 13 additions and 2 deletions

View File

@ -4,8 +4,9 @@
#
# This code sets the following variables:
#
# CYTHON_EXECUTABLE
# CYTHON_FOUND
# CYTHON_PATH
# CYTHON_EXECUTABLE
# CYTHON_VERSION
#
# See also UseCython.cmake
@ -38,6 +39,15 @@ if ( PYTHONINTERP_FOUND )
)
endif ()
# RESULT=0 means ok
if ( NOT RESULT )
get_filename_component( _python_path ${PYTHON_EXECUTABLE} PATH )
find_program( CYTHON_EXECUTABLE
NAMES cython cython.bat cython3
HINTS ${_python_path}
)
endif ()
# RESULT=0 means ok
if ( NOT RESULT )
execute_process( COMMAND "${PYTHON_EXECUTABLE}" "-c"
@ -59,6 +69,7 @@ find_package_handle_standard_args( Cython
CYTHON_FOUND
REQUIRED_VARS
CYTHON_PATH
CYTHON_EXECUTABLE
VERSION_VAR
CYTHON_VERSION
)

View File

@ -52,7 +52,7 @@ function(pyx_to_cpp target pyx_file generated_cpp include_dirs)
add_custom_command(
OUTPUT ${generated_cpp}
COMMAND
cython -v --cplus ${includes_for_cython} ${pyx_file} -o ${generated_cpp}
${CYTHON_EXECUTABLE} -a -v --cplus ${includes_for_cython} ${pyx_file} -o ${generated_cpp}
VERBATIM)
add_custom_target(${target} ALL DEPENDS ${generated_cpp})
endfunction()