def METHOD_NAME(
    fixture_name,
    source_directory,
    cmake_arguments=None,
    make_targets=None,
    install_directory=None,
):
    """Generate and build a cmake deployment, then returns a pytest fixture for it"""
    cmake_arguments = {} if cmake_arguments is None else cmake_arguments
    build_directory = Path(tempfile.mkdtemp())
    install_directory_calc = Path(
        Path(source_directory) / "build-artifacts"
        if install_directory is None
        else install_directory
    )
    make_targets = ["all"] if make_targets is None else make_targets
    if install_directory is not None:
        cmake_arguments["CMAKE_INSTALL_PREFIX"] = str(install_directory)
    cmake_output = run_cmake(source_directory, build_directory, cmake_arguments)
    target_outputs = {
        target: run_make(build_directory, target) for target in make_targets
    }
    @pytest.fixture(scope="session", name=fixture_name)
    def fixture_function():
        yield {
            "source": source_directory,
            "build": build_directory,
            "install": install_directory_calc,
            "cmake": cmake_output,
            "targets": target_outputs,
        }
        shutil.rmtree(build_directory, ignore_errors=True)
        shutil.rmtree(install_directory, ignore_errors=True)
    return fixture_function