File tree Expand file tree Collapse file tree 4 files changed +32
-16
lines changed Expand file tree Collapse file tree 4 files changed +32
-16
lines changed Original file line number Diff line number Diff line change 5151 - python-version : " 3.9"
5252 runs-on : ubuntu-latest
5353 cmake : " 3.20.x"
54+ - python-version : " 3.10"
55+ runs-on : ubuntu-latest
56+ cmake : " 3.15.x"
5457
5558 steps :
5659 - uses : actions/checkout@v4
Original file line number Diff line number Diff line change 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
3941# limitations under the License.
4042#=============================================================================
4143
42- if (CMAKE_VERSION VERSION_LESS "3.20" )
43- message (SEND_ERROR "CMake 3.20 required" )
44- endif ()
45-
4644# Use the Cython executable that lives next to the Python executable
4745# if it is a local installation.
4846if (Python_EXECUTABLE)
@@ -88,11 +86,19 @@ if(CYTHON_EXECUTABLE)
8886endif ()
8987
9088include (FindPackageHandleStandardArgs)
91- find_package_handle_standard_args(Cython
92- REQUIRED_VARS CYTHON_EXECUTABLE
93- VERSION_VAR ${CYTHON_VERSION}
94- HANDLE_VERSION_RANGE
95- )
89+
90+ if (CMAKE_VERSION VERSION_LESS 3.19)
91+ find_package_handle_standard_args(Cython
92+ REQUIRED_VARS CYTHON_EXECUTABLE
93+ VERSION_VAR ${CYTHON_VERSION}
94+ )
95+ else ()
96+ find_package_handle_standard_args(Cython
97+ REQUIRED_VARS CYTHON_EXECUTABLE
98+ VERSION_VAR ${CYTHON_VERSION}
99+ HANDLE_VERSION_RANGE
100+ )
101+ endif ()
96102
97103if (CYTHON_FOUND)
98104 if (NOT DEFINED Cython::Cython)
Original file line number Diff line number Diff line change 7272# limitations under the License.
7373#=============================================================================
7474
75- if (CMAKE_VERSION VERSION_LESS "3.20 " )
76- message (FATAL_ERROR "CMake 3.20 required" )
75+ if (CMAKE_VERSION VERSION_LESS "3.7 " )
76+ message (SEND_ERROR "CMake 3.7 required for DEPFILE " )
7777endif ()
7878
7979
@@ -124,14 +124,21 @@ function(Cython_compile_pyx)
124124 endif ()
125125
126126 # Place the cython files in the current binary dir if no path given
127+ # Can use cmake_path for CMake 3.20+
127128 if (NOT CYTHON_OUTPUT)
128- cmake_path(GET INPUT STEM basename)
129- cmake_path(APPEND CMAKE_CURRENT_BINARY_DIR "${basename}${langauge_ext} " OUTPUT_VARIABLE CYTHON_OUTPUT)
129+ # cmake_path(GET INPUT STEM basename)
130+ get_filename_component (basename "${INPUT} " NAME_WE )
131+
132+ # cmake_path(APPEND CMAKE_CURRENT_BINARY_DIR "${basename}${langauge_ext}" OUTPUT_VARIABLE CYTHON_OUTPUT)
133+ set (CYTHON_OUPUT "${CMAKE_CURRENT_BINARY_DIR} /{basename}${langauge_ext} " )
130134 endif ()
131- cmake_path(ABSOLUTE_PATH CYTHON_OUTPUT)
135+
136+ # cmake_path(ABSOLUTE_PATH CYTHON_OUTPUT)
137+ get_filename_component (CYTHON_OUTPUT "${CYTHON_OUPUT} " ABSOLUTE )
132138
133139 # Normalize the input path
134- cmake_path(ABSOLUTE_PATH INPUT )
140+ # cmake_path(ABSOLUTE_PATH INPUT)
141+ get_filename_component (INPUT "${INPUT} " ABSOLUTE )
135142 set_source_files_properties ("${INPUT} " PROPERTIES GENERATED TRUE )
136143
137144 # Support
Original file line number Diff line number Diff line change 1- cmake_minimum_required (VERSION 3.20 ...3.29)
1+ cmake_minimum_required (VERSION 3.15 ...3.29)
22project (${SKBUILD_PROJECT_NAME} LANGUAGES C)
33
44find_package (
You can’t perform that action at this time.
0 commit comments