#!/usr/bin/make -f
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
export QT_SELECT = qt5

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

VERSION = $(DEB_VERSION_UPSTREAM)

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure -- -DDTK_VERSION=$(VERSION)
	dh_auto_configure -Ddtklog -Bdtklog-debian -- -DDTK_VERSION=$(VERSION) -DBUILD_WITH_SYSTEMD=ON
	dh_auto_configure -Dtreeland-protocols -Btreeland-protocols-debian


execute_after_dh_auto_build:
	dh_auto_build -Ddtklog -Bdtklog-debian
	dh_auto_build -Dtreeland-protocols -Btreeland-protocols-debian

execute_after_dh_auto_install:
	dh_auto_install -Ddtklog -Bdtklog-debian
	dh_auto_install -Dtreeland-protocols -Btreeland-protocols-debian

#override_dh_auto_test:
#	echo "skip auto test"

override_dh_makeshlibs:
	dh_makeshlibs -V "libdtkcommon (>= $(shell echo $(VERSION) | cut -d '.' -f 1,2))"
