From 93396525cb332881711fbeabaac5e94c1b039e5c Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 17 Jul 2024 11:00:42 -0400 Subject: [PATCH] feat: Add Cython::Cython imported target Co-authored-by: Jean-Christophe Fillion-Robin --- src/cython_cmake/cmake/FindCython.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/cython_cmake/cmake/FindCython.cmake b/src/cython_cmake/cmake/FindCython.cmake index ef80b9d..3998332 100644 --- a/src/cython_cmake/cmake/FindCython.cmake +++ b/src/cython_cmake/cmake/FindCython.cmake @@ -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 @@ -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)