Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/cython_cmake/cmake/FindCython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
# ``CYTHON_FOUND``
# true if the program was found
#
# And the following target:
#
# ``Cython::Cython``
# The Cython executable
#
# For more information on the Cython project, see https://cython.org/.
#
# *Cython is a language that makes writing C extensions for the Python language
Expand Down Expand Up @@ -84,6 +89,15 @@ find_package_handle_standard_args(Cython
VERSION_VAR ${CYTHON_VERSION}
)

if(CYTHON_FOUND)
if(NOT DEFINED Cython::Cython)
add_executable(Cython::Cython IMPORTED)
set_target_properties(Cython::Cython PROPERTIES
IMPORTED_LOCATION "${CYTHON_EXECUTABLE}"
)
endif()
endif()

mark_as_advanced(CYTHON_EXECUTABLE)

include(UseCython)