include_guard(GLOBAL)

# dict(CLEAR <dict>...)
function (ixm_dict_clear)
  foreach (@dict IN LISTS ARGN)
    ixm_dict_keys(${\@dict} @keys)
    if (NOT DEFINED @keys)
      continue()
    endif()
    ixm_dict_remove(${\@dict} ${\@keys})
  endforeach()
endfunction()

#dict(REMOVE <dict> <key> [<key>...])
function (ixm_dict_remove @dict)
  if (NOT ARGN)
    log(FATAL "dict(REMOVE) requires at least one key to be removed")
  endif()
  ixm_dict_noop(${\@dict})
  ixm_dict_keys(${\@dict} @keys)
  list(REMOVE_ITEM @keys ${ARGN})
  set_property(TARGET ${\@dict} PROPERTY "INTERFACE_${+C0}" ${\@keys})
  foreach (@key IN LISTS ARGN)
    set_property(TARGET ${\@dict} PROPERTY "INTERFACE_${\@key}")
  endforeach()
endfunction()
