Skip to content

Commit b0cc61f

Browse files
henryiiijcfr
andcommitted
feat: Support finding range of Cython version
Co-authored-by: Jean-Christophe Fillion-Robin <[email protected]>
1 parent 0fa8330 commit b0cc61f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/cython_cmake/cmake/FindCython.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
# ``Cython::Cython``
1919
# The Cython executable
2020
#
21+
# A range of versions is supported on CMake 3.19+.
22+
#
2123
# For more information on the Cython project, see https://cython.org/.
2224
#
2325
# *Cython is a language that makes writing C extensions for the Python language
@@ -84,9 +86,17 @@ if(CYTHON_EXECUTABLE)
8486
endif()
8587

8688
include(FindPackageHandleStandardArgs)
89+
90+
if(CMAKE_VERSION VERSION_LESS 3.19)
91+
set(_handle_version_range)
92+
else()
93+
set(_handle_version_range HANDLE_VERSION_RANGE)
94+
endif()
95+
8796
find_package_handle_standard_args(Cython
8897
REQUIRED_VARS CYTHON_EXECUTABLE
8998
VERSION_VAR ${CYTHON_VERSION}
99+
${_handle_version_range}
90100
)
91101

92102
if(CYTHON_FOUND)

0 commit comments

Comments
 (0)