#!/usr/bin/sh
ICON_SIZES="16 24 32 48 64 128 256"
if [ -n "$2" ]; then
	SRCDIR="$2"
else
	SRCDIR="@CMAKE_CURRENT_SOURCE_DIR@"
fi

	echo "Begin freedesktop install..."
	for size in ${ICON_SIZES}; do \
		echo "Install icon: ${size}x${size}"
		xdg-icon-resource install --noupdate --context mimetypes --theme gnome --size ${size} ${SRCDIR}/grc-icon-${size}.png application-gnuradio-grc; \
		xdg-icon-resource install --noupdate --context mimetypes --size ${size} ${SRCDIR}/grc-icon-${size}.png application-gnuradio-grc; \
		xdg-icon-resource install --noupdate --context apps --theme gnome --size ${size} ${SRCDIR}/grc-icon-${size}.png gnuradio-grc; \
		xdg-icon-resource install --noupdate --context apps --size ${size} ${SRCDIR}/grc-icon-${size}.png gnuradio-grc; \
	done
	echo "Install mime type"
	install ${SRCDIR}/gnuradio-grc.xml
	echo "Install menu items"
	install ${SRCDIR}/*.desktop
	echo "Done!"
	echo ""

