@@ -20,24 +20,28 @@ set_target_properties(PyOpenImageIO PROPERTIES
2020set_source_files_properties (${python_srcs} PROPERTIES
2121 UNITY_GROUP PyOpenImageIO )
2222
23- message ("PROC: ${CMAKE_HOST_SYSTEM_PROCESSOR} " )
24-
25- # FIXME: choose aarch vs x86_64 based on the current platform
26-
27- add_custom_command (
28- COMMAND cd ${CMAKE_SOURCE_DIR} &&
29- cibuildwheel "." --output-dir "${CMAKE_BINARY_DIR} /wheelhouse" --only "cp311-manylinux_aarch64"
23+ # choose aarch vs x86_64 based on the current platform
24+ if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64" )
25+ set (_arch, "aarch64" )
26+ else ()
27+ set (_arch, "x86_64" )
28+ endif ()
29+
30+ # Note: this must be kept in sync with `[[tool.cibuildwheel.overrides]]` in pyproject.toml
31+ set (_python_build_id, "cp311-manylinux_${_arch} " )
32+
33+ add_custom_command (COMMAND cd ${CMAKE_SOURCE_DIR} &&
34+ cibuildwheel "." --output-dir "${CMAKE_BINARY_DIR} /wheelhouse" --only
3035 OUTPUT "${CMAKE_BINARY_DIR} /wheelhouse/OpenImageIO/__init__.pyi"
31- COMMENT "pystubs: creating python wheel "
36+ COMMENT "Generating python stubs "
3237 )
3338
34- add_custom_command (
35- OUTPUT "${CMAKE_SOURCE_DIR} /src/python/stubs/OpenImageIO-stubs/__init__.pyi"
36- COMMAND ${CMAKE_COMMAND} -E copy
39+ add_custom_command (COMMAND ${CMAKE_COMMAND} -E copy
3740 "${CMAKE_BINARY_DIR} /wheelhouse/OpenImageIO/__init__.pyi"
3841 "${CMAKE_SOURCE_DIR} /src/python/stubs/OpenImageIO-stubs/__init__.pyi"
42+ OUTPUT "${CMAKE_SOURCE_DIR} /src/python/stubs/OpenImageIO-stubs/__init__.pyi"
3943 DEPENDS "${CMAKE_BINARY_DIR} /wheelhouse/OpenImageIO/__init__.pyi"
40- COMMENT "pystubs: Copying generated stubs to source"
44+ COMMENT "Copying generated stubs to source"
4145 )
4246
4347add_custom_target (pystubs
0 commit comments