import shlex


def generate_cmake_call(cmake_exe, build_system_name, conformance_filter,
                        additional_cmake_args, host_names, opencl_names):
    """
    Generates a CMake call based on the input in a form accepted by
    subprocess.call().
    """
    return [
        cmake_exe,
        '..',
        '-G' + build_system_name,
        '-DSYCL_CTS_TEST_FILTER=' + conformance_filter,
        '-Dhost_platform_name=' + host_names[0],
        '-Dhost_device_name=' + host_names[1],
        '-Dopencl_platform_name=' + opencl_names[0],
        '-Dopencl_device_name=' + opencl_names[1],
    ] + shlex.split(additional_cmake_args)