Skip to content

Commit ba39f19

Browse files
henryiiijcfr
andcommitted
feat: Add Cython::Cython imported target
Co-authored-by: Jean-Christophe Fillion-Robin <[email protected]>
1 parent 6b991c3 commit ba39f19

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/cython_cmake/cmake/FindCython.cmake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
# ``CYTHON_FOUND``
1414
# true if the program was found
1515
#
16+
# And the following target:
17+
#
18+
# ``Cython::Cython``
19+
# The Cython executable
20+
#
1621
# For more information on the Cython project, see https://cython.org/.
1722
#
1823
# *Cython is a language that makes writing C extensions for the Python language
@@ -84,6 +89,15 @@ find_package_handle_standard_args(Cython
8489
VERSION_VAR ${CYTHON_VERSION}
8590
)
8691

92+
if(CYTHON_FOUND)
93+
if(NOT DEFINED Cython::Cython)
94+
add_executable(Cython::Cython IMPORTED)
95+
set_target_properties(Cython::Cython PROPERTIES
96+
IMPORTED_LOCATION "${CYTHON_EXECUTABLE}"
97+
)
98+
endif()
99+
endif()
100+
87101
mark_as_advanced(CYTHON_EXECUTABLE)
88102

89103
include(UseCython)

0 commit comments

Comments
 (0)