File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,16 @@ function(Cython_compile_pyx)
7777 ${ARGN}
7878 )
7979
80+ if (DEFINED CYTHON_EXECUTABLE)
81+ set (_cython_command "${CYTHON_EXECUTABLE} " )
82+ elseif (DEFINED Python_EXECUTABLE)
83+ set (_cython_command "${Python_EXECUTABLE} " -m cython)
84+ elseif (DEFINED Python3_EXECUTABLE)
85+ set (_cython_command "${Python3_EXECUTABLE} " -m cython)
86+ else ()
87+ message (FATAL_ERROR "Cython executable not found" )
88+ endif ()
89+
8090 # Get source file location
8191 set (_source_files ${_args_UNPARSED_ARGUMENTS} )
8292
@@ -125,7 +135,8 @@ function(Cython_compile_pyx)
125135 # Add the command to run the compiler.
126136 add_custom_command (
127137 OUTPUT ${generated_file}
128- COMMAND ${CYTHON_EXECUTABLE}
138+ COMMAND
139+ ${_cython_command}
129140 ARGS
130141 ${_language_arg}
131142 ${_args_CYTHON_ARGS}
You can’t perform that action at this time.
0 commit comments