def METHOD_NAME(case, build_dir, install_dir):
    cmake_args = [
        f'-D{key}={val}'
        for key, val in chain(COMMON_CMAKE_ARGS.items(), case.cmake_args.items())
        if val
    ]
    cmake_args.extend(
        [
            f'-DCMAKE_INSTALL_PREFIX={install_dir}',
            f'-DPython_EXECUTABLE={sys.executable}',
            str(SRCDIR),
        ]
    )
    try:
        subprocess.run(
            ['cmake', *cmake_args],
            capture_output=True,
            check=True,
            encoding='utf-8',
            cwd=build_dir,
        )
    except subprocess.CalledProcessError as err:
        print(
            f"Configuring build '{case.name}' " f"failed:\n{err.stdout}\n{err.stderr}"
        )
        sys.exit(1)