{"library":"cmake","code":"import cmake\nimport subprocess\nimport sys\n\ntry:\n    cmake_executable = cmake.cmake_path()\n    print(f\"Found CMake executable at: {cmake_executable}\")\n\n    # Run a simple CMake command, e.g., --version\n    result = subprocess.run([cmake_executable, '--version'], capture_output=True, text=True, check=True)\n    print(\"\\nCMake --version output:\")\n    print(result.stdout)\n\n    # Example of getting CMake version programmatically\n    print(f\"\\nCMake version from package: {cmake.cmake_version()}\")\n\nexcept subprocess.CalledProcessError as e:\n    print(f\"Error running CMake: {e}\", file=sys.stderr)\n    print(f\"Stderr: {e.stderr}\", file=sys.stderr)\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\", file=sys.stderr)\n","lang":"python","description":"This quickstart demonstrates how to retrieve the path to the CMake executable provided by the `cmake` package and execute a basic CMake command using Python's `subprocess` module. It also shows how to get the version string directly from the `cmake` package.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}