def find_legate_cmake_dir() -> Path:
    r"""Try to determine the location of legate cmake files.

    Returns
    -------
    Path
        The directory containing the legate cmake files.

    Raises
    ------
    RuntimeError
        If legate cmake directory could not be found.
    """
    try:
        import legate.install_info as lg_install_info
    except (ImportError, ModuleNotFoundError) as e:
        raise RuntimeError(
            "Cannot determine Legate install directory. Please make sure "
            "Legate is installed in the current Python environment."
        ) from e

    path = Path(lg_install_info.libpath).resolve()
    if (path / "cmake" / "legate").exists():
        # If this exists, then we were installed normally into a python or
        # conda env.
        return path

    # Possibly installed in an editable installation, in which case legate
    # config.cmake and friends will live in the root binary directory.
    root_path = path.root
    assert isinstance(root_path, str)
    while not any(p.name == "legate-config.cmake" for p in path.iterdir()):
        path = path.parent
        if str(path) == root_path:
            raise RuntimeError(
                "Could not determine directory containing legate CMake files"
            )
    return path
Try to determine the location of legate cmake files.

    Returns
    -------
    Path
        The directory containing the legate cmake files.

    Raises
    ------
    RuntimeError
        If legate cmake directory could not be found.
    
install.py