function(map_create _map)
	set(${_map}_key PARENT_SCOPE)
endfunction()

function(map_add _map _key _value)
	list(APPEND ${_map}_key ${_key})
	list(REMOVE_DUPLICATES ${_map}_key)
	set(${_map}_key ${${_map}_key} PARENT_SCOPE)
	set(${_map}${_key} ${_value} PARENT_SCOPE)
endfunction()

function(map_get _map _key _value)
	set(${_value} ${${_map}${_key}} PARENT_SCOPE)
endfunction()

function(map_get _map _key _value)
	set(${_value} ${${_map}${_key}} PARENT_SCOPE)
endfunction()

function(map_size _map _result)
	list(LENGTH ${_map}_key out)
	set(${_result} ${out} PARENT_SCOPE)
endfunction()

function(map_contain _map _key _result)
	list(FIND ${_map}_key ${_key} out)
	if(${out} EQUAL -1)
		set(${_result} FALSE PARENT_SCOPE)
	else()
		set(${_result} TRUE PARENT_SCOPE)
	endif()
endfunction()

function(map_remove _map _key)
	map_contain(${_map} ${_key} out)
	if(${out})
		message("yes")
		list(REMOVE_ITEM ${_map}_key ${_key})
		set(${_map}_key ${${_map}_key} PARENT_SCOPE)
		unset(${_map}${_key} PARENT_SCOPE)
	endif()
endfunction()

function(map_clear _map)
	foreach(item ${${_map}_key})
		list(REMOVE_ITEM ${_map}_key ${item})
		set(${_map}_key ${${_map}_key} PARENT_SCOPE)
		unset(${_map}${_key} PARENT_SCOPE)
	endforeach()
endfunction()

# map_create(m)
# map_add(m a 1)
# message("map_add: " "${m_key}")
# map_get(m a r)
# message("map_get: " ${r})
# map_size(m r)
# message("map_size: " ${r})
# map_contain(m a r)
# message("map_contain: " ${r})
# map_contain(m b r)
# message("map_contain: " ${r})
# map_remove(m a)
# message("map_remove: " "${m_key}")
# map_add(m a 1)
# map_add(m b 2)
# map_add(m c 3)
# map_clear(m)
# message("map_clear: " "${m_key}")
