#Function returns
function(name_external_project __COMPONENTS __BASE_NAME __OUT_NAME)
	string(TOLOWER ${__BASE_NAME} __PART1)
	list(REMOVE_DUPLICATES __COMPONENTS)
	list(SORT __COMPONENTS)
	set(__PART2 )
	foreach(__COMPONENT IN LISTS __COMPONENTS)
		string(TOLOWER "${__COMPONENT}" __COMPONENT_SMALL)
		string(TOUPPER "${__COMPONENT}" __COMPONENT_LARGE)
		set(__COMPONENT_PLUGIN "${SUPERBUILD_ROOT}/cmake/build_install_prefix_plugins/${__COMPONENT_SMALL}.cmake")
		include(${__COMPONENT_PLUGIN} OPTIONAL RESULT_VARIABLE __COMPONENT_STATUS)
		if("${__COMPONENT_STATUS}" STREQUAL "NOTFOUND")
			set(__COMPONENT_PLUGIN "${SUPERBUILD_ROOT}/cmake/beetroot/build_install_prefix_plugins/${__COMPONENT_SMALL}.cmake")
			include(${__COMPONENT_PLUGIN} OPTIONAL RESULT_VARIABLE __COMPONENT_STATUS)
			if("${__COMPONENT_STATUS}" STREQUAL "NOTFOUND")
				message(FATAL_ERROR "Component plugin ${__COMPONENT_SMALL}.cmake was not found in ${SUPERBUILD_ROOT}/cmake/build_install_prefix_plugins/${__COMPONENT_SMALL}.cmake directory. It was required by the ${__BASE_NAME} external project definition.")
			endif()
		endif()
		set(__PART2 "${__PART2}-${${__COMPONENT_LARGE}_VERSION_STRING}")
	endforeach()
	string(TOLOWER "${__PART2}" __PART2)
	set(${__OUT_NAME} "${__PART1}${__PART2}" PARENT_SCOPE)
endfunction()
