def get_cached_var(build_dir, var, default=None):
    """Get a variable from cmake cache

    :param build_dir: CMakeCache.txt file directory
    :param var:       Requested variable
    :param default:   Default value if not found (default: None)

    :return: the variable value

    """
    cmakecache = os.path.join(build_dir, "CMakeCache.txt")
    if not os.path.exists(cmakecache):
        mess  = build_dir % "Could not find CMakeCache.txt in %s"
        raise qisys.error.Error(mess)
    res = read_cmake_cache(cmakecache)
    return res.get(var, default)
dataset/ETHPy150Open aldebaran/qibuild/python/qibuild/cmake/__init__.py/get_cached_var/swapped operands of `%`