#!/usr/bin/make -f

# See debhelper(7) (uncomment to enable).
# Output every command that modifies files on the build system.
#export DH_VERBOSE = 1


# See FEATURE AREAS in dpkg-buildflags(1).
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# See ENVIRONMENT in dpkg-buildflags(1).
# Package maintainers to append CFLAGS.
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic

export DEB_CXXFLAGS_MAINT_APPEND = -DQT_NO_DEBUG_OUTPUT -DQT_NO_WARNING_OUTPUT
export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')

# Package maintainers to append LDFLAGS.
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


%:
	dh $@ --buildsystem=cmake


# dh_make generated override targets.
# This is an example for Cmake (see <https://bugs.debian.org/641051>).
#override_dh_auto_configure:
#	dh_auto_configure -- \
#	-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

# Also implicitly: -DHAVE_VISUALISATIONS=OFF -DVISUALISATIONS=OFF
override_dh_auto_configure:
	dh_auto_configure -- \
	    -DBUNDLE_PROJECTM_PRESETS=OFF \
	    -DFORCE_GIT_REVISION=$(DEB_VERSION)

override_dh_auto_clean:
	rm -fv dist/Info.plist
	rm -fv dist/clementine.spec
	rm -fv dist/maketarball.sh
	rm -fv dist/windows/clementine.nsi
	rm -fv dist/windows/clementine-portable.nsi
	rm -fv src/translations/translations.pot
	dh_auto_clean

override_dh_installchangelogs:
	dh_installchangelogs Changelog

override_dh_auto_test: