diff --git a/src/cython_cmake/cmake/UseCython.cmake b/src/cython_cmake/cmake/UseCython.cmake index adc9e88..84aea57 100644 --- a/src/cython_cmake/cmake/UseCython.cmake +++ b/src/cython_cmake/cmake/UseCython.cmake @@ -20,7 +20,8 @@ # case, a C++ file is generated by default. # # ``CYTHON_ARGS `` -# Specify additional arguments for the cythonization process. +# Specify additional arguments for the cythonization process. Will default to +# the ``CYTHON_ARGS`` variable if not specified. # # ``OUTPUT_VARIABLE `` # Set the variable ```` in the parent scope to the path to the @@ -91,6 +92,11 @@ function(Cython_compile_pyx) message(FATAL_ERROR "Cython executable not found") endif() + # Default to CYTHON_ARGS if argument not specified + if(NOT _args_CYTHON_ARGS AND DEFINED CYTHON_ARGS) + set(_args_CYTHON_ARGS "${CYTHON_ARGS}") + endif() + # Get source file location set(_source_files ${_args_UNPARSED_ARGUMENTS})