def cmake_options_to_str(cmake_options):
  """Convert CMake options as a dictionary of list to a string"""
  res = ""
  for key in cmake_options:
    if key.startswith("-"):
      res += key + " "
      continue
    values = cmake_options[key]
    if values:
      res += "-D{}=\"".format(key)
      if type(values) == type([]):
        res += " ".join(values)
      else:
        res += values
      res += "\" "
  return res