File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed
Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -127,12 +127,13 @@ jobs:
127127 uses : pypa/cibuildwheel@v3.3.0
128128 env :
129129 CIBW_ENVIRONMENT_LINUX : " CCACHE_DIR=/host/home/runner/work/sumo/sumo/.ccache"
130- CIBW_ENVIRONMENT_WINDOWS : " CMAKE_GENERATOR=Ninja CMAKE_ARGS =-DPython_EXECUTABLE={python}"
130+ CIBW_ENVIRONMENT_WINDOWS : " CMAKE_GENERATOR=Ninja SKBUILD_CMAKE_ARGS =-DPython_EXECUTABLE={python}"
131131 CIBW_MANYLINUX_X86_64_IMAGE : ${{ matrix.manylinux }}
132132 CIBW_MANYLINUX_AARCH64_IMAGE : ${{ matrix.manylinux }}
133133 CIBW_PROJECT_REQUIRES_PYTHON : " >=3.9"
134134 # CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" # disable repair process to inspect the wheel
135135 # CIBW_BUILD_VERBOSITY: 2
136+ CMAKE_ARGS : " -DPython_EXECUTABLE={python}"
136137 MACOSX_DEPLOYMENT_TARGET : ' 14.0'
137138
138139 - uses : actions/upload-artifact@v6
Original file line number Diff line number Diff line change @@ -221,7 +221,11 @@ if (${CMAKE_VERSION} VERSION_LESS 3.12.0)
221221 # define variable for compatibility
222222 set (Python_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "Python executable" )
223223else ()
224- find_package (Python REQUIRED COMPONENTS Interpreter)
224+ # we search for Interpreter _and_ Development to make sure the versions match
225+ find_package (Python COMPONENTS Interpreter Development)
226+ if (NOT Python_FOUND)
227+ message (FATAL_ERROR "Python NOT found" )
228+ endif ()
225229endif ()
226230message (STATUS "Found Python: " ${Python_EXECUTABLE} )
227231if (${CMAKE_VERSION} VERSION_LESS 3.15.0 AND (ENABLE_PYTHON_BINDINGS OR ENABLE_JAVA_BINDINGS OR ENABLE_CS_BINDINGS))
Original file line number Diff line number Diff line change @@ -157,8 +157,7 @@ if (SWIG_FOUND)
157157 endif (ENABLE_CS_BINDINGS)
158158
159159 if (ENABLE_PYTHON_BINDINGS)
160- find_package (Python COMPONENTS Development.Module)
161- if (Python_Development.Module_FOUND)
160+ if (Python_Development.FOUND OR Python_Development.Module_FOUND) # the latter exists only since CMake 3.18
162161 set (CMAKE_SWIG_FLAGS -keyword) # is necessary for using keyword args
163162 # other options which should be evaluated: -builtin, -modern, -extranative
164163 if (FOX_FOUND)
Original file line number Diff line number Diff line change @@ -129,8 +129,7 @@ if (SWIG_FOUND)
129129 endif ()
130130
131131 if (ENABLE_PYTHON_BINDINGS)
132- find_package (Python COMPONENTS Development.Module)
133- if (Python_Development.Module_FOUND)
132+ if (Python_Development.FOUND OR Python_Development.Module_FOUND) # the latter exists only since CMake 3.18
134133 set (CMAKE_SWIG_FLAGS "-keyword" ) # is necessary for using keyword args
135134 # other options which should be evaluated: -builtin, -modern, -extranative
136135 set (SWIG_OUTFILE_DIR ${CMAKE_CURRENT_BINARY_DIR} )
You can’t perform that action at this time.
0 commit comments