From e280a1f46207fd316f5c995eb63fb5107bac0b75 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 11 Dec 2025 20:07:26 +0500 Subject: [PATCH 1/2] fix: more readable error on missing `ccmake` --- src/cmake/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cmake/__init__.py b/src/cmake/__init__.py index ef8257d6..9dfea06a 100644 --- a/src/cmake/__init__.py +++ b/src/cmake/__init__.py @@ -50,6 +50,11 @@ def _program_exit(name: str, *args: str) -> NoReturn: def ccmake() -> NoReturn: + if not (Path(CMAKE_BIN_DIR) / "ccmake").exists(): + raise FileNotFoundError( + f"'ccmake' is not available in cmake installation at '{CMAKE_BIN_DIR}'. " + "Perhaps 'ccmake' is not yet inclucded to the package for this platform." + ) _program_exit('ccmake', *sys.argv[1:]) From 65ffb084bdc425642787a81b23a2114b41865525 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 11 Dec 2025 20:19:59 +0500 Subject: [PATCH 2/2] Make check cross-platform --- src/cmake/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cmake/__init__.py b/src/cmake/__init__.py index 9dfea06a..925cac87 100644 --- a/src/cmake/__init__.py +++ b/src/cmake/__init__.py @@ -1,6 +1,7 @@ from __future__ import annotations import os +import shutil import subprocess import sys from importlib.metadata import distribution @@ -50,7 +51,7 @@ def _program_exit(name: str, *args: str) -> NoReturn: def ccmake() -> NoReturn: - if not (Path(CMAKE_BIN_DIR) / "ccmake").exists(): + if shutil.which("ccmake", path=CMAKE_BIN_DIR) is None: raise FileNotFoundError( f"'ccmake' is not available in cmake installation at '{CMAKE_BIN_DIR}'. " "Perhaps 'ccmake' is not yet inclucded to the package for this platform."