From b1ed3d24b992bf60d702f3f045033f0dbb3536e6 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Wed, 30 Oct 2024 23:21:14 +0100 Subject: [PATCH] check for 'bdist_wheel' --- cmake/MakePythonWheel.cmake | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cmake/MakePythonWheel.cmake b/cmake/MakePythonWheel.cmake index 92da632cc..226098796 100644 --- a/cmake/MakePythonWheel.cmake +++ b/cmake/MakePythonWheel.cmake @@ -26,6 +26,23 @@ except ImportError as e: message(FATAL_ERROR "Python module `setuptools` required for correct wheel filename generation.") endif() + execute_process( + COMMAND ${Python3_EXECUTABLE} -c " +import sys +try: + from wheel.bdist_wheel import bdist_wheel + sys.exit(0) +except ImportError as e: + print(f'{e}. Search paths:', file=sys.stderr) + for p in sys.path: print(f' {p}', file=sys.stderr) + sys.exit(1) +" + RESULT_VARIABLE has_bdist_wheel) + + if(has_bdist_wheel EQUAL "1") + message(FATAL_ERROR "Python module `wheel.bdist_wheel` required for correct wheel filename generation.") + endif() + execute_process( COMMAND ${Python3_EXECUTABLE} -c " from setuptools.dist import Distribution