Skip to content

Commit

Permalink
feat: Add Cython::Cython imported target
Browse files Browse the repository at this point in the history
Co-authored-by: Jean-Christophe Fillion-Robin <[email protected]>
  • Loading branch information
henryiii and jcfr committed Jul 17, 2024
1 parent 6b991c3 commit ba39f19
Showing 1 changed file with 14 additions and 0 deletions.
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)

0 comments on commit ba39f19

Please sign in to comment.