def METHOD_NAME(
    ctx,
    clean=False,
    build="Debug",
    perf=False,
    prof=False,
    coverage=False,
    sanitiser=SANITISER_NONE,
    sgx=FAASM_SGX_MODE_DISABLED,
    cpu=None,
):
    """
    Configures the CMake build
    """
    if clean and exists(FAASM_BUILD_DIR):
        run("rm -rf {}/*".format(FAASM_BUILD_DIR), shell=True, check=True)
    if not exists(FAASM_BUILD_DIR):
        makedirs(FAASM_BUILD_DIR)
    if not exists(FAASM_INSTALL_DIR):
        makedirs(FAASM_INSTALL_DIR)
    cmd = [
        "cmake",
        "-GNinja",
        "-DCMAKE_BUILD_TYPE={}".format(build),
        "-DCMAKE_CXX_COMPILER=/usr/bin/clang++-13",
        "-DCMAKE_C_COMPILER=/usr/bin/clang-13",
        "-DCMAKE_INSTALL_PREFIX={}".format(FAASM_INSTALL_DIR),
        "-DFAASM_PERF_PROFILING=ON" if perf else "",
        "-DFAASM_CODE_COVERAGE=ON" if coverage else "",
        "-DFAASM_SELF_TRACING=ON" if prof else "",
        "-DFAABRIC_SELF_TRACING=ON" if prof else "",
        "-DFAASM_USE_SANITISER={}".format(sanitiser),
        "-DFAABRIC_USE_SANITISER={}".format(sanitiser),
        "-DFAASM_SGX_MODE={}".format(sgx),
        "-DFAASM_TARGET_CPU={}".format(cpu) if cpu else "",
        get_dict_as_cmake_vars(FAASM_RUNTIME_ENV_DICT),
        PROJ_ROOT,
    ]
    cmd_str = " ".join(cmd)
    print(cmd_str)
    run(cmd_str, shell=True, check=True, cwd=FAASM_BUILD_DIR)