Returns cmake command.
()
| 51 | |
| 52 | @staticmethod |
| 53 | def _get_cmake_command() -> str: |
| 54 | "Returns cmake command." |
| 55 | |
| 56 | cmake_command = "cmake" |
| 57 | if IS_WINDOWS: |
| 58 | return cmake_command |
| 59 | cmake3_version = CMake._get_version(which("cmake3")) |
| 60 | cmake_version = CMake._get_version(which("cmake")) |
| 61 | |
| 62 | _cmake_min_version = LooseVersion("3.18.0") |
| 63 | if all( |
| 64 | ver is None or ver < _cmake_min_version |
| 65 | for ver in [cmake_version, cmake3_version] |
| 66 | ): |
| 67 | raise RuntimeError("no cmake or cmake3 with version >= 3.18.0 found") |
| 68 | |
| 69 | if cmake3_version is None: |
| 70 | cmake_command = "cmake" |
| 71 | elif cmake_version is None: |
| 72 | cmake_command = "cmake3" |
| 73 | else: |
| 74 | if cmake3_version >= cmake_version: |
| 75 | cmake_command = "cmake3" |
| 76 | else: |
| 77 | cmake_command = "cmake" |
| 78 | return cmake_command |
| 79 | |
| 80 | @staticmethod |
| 81 | def _get_version(cmd: Optional[str]) -> Any: |
no test coverage detected