#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --buildsystem=cmake+ninja

override_dh_auto_configure:
	dh_auto_configure --builddirectory=debian/build -- \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_QT5=OFF \
		-DBUILD_QT6=ON \
		-DBUILD_SETTINGS=ON \
		-DBUILD_DECORATION=ON \
		-DBUILD_COLOR_SCHEMES=ON \
		-DBUILD_TESTING=OFF

override_dh_auto_build:
	dh_auto_build --builddirectory=debian/build

# BUILD_TESTING is explicitly disabled for the binary package build.
# Do not ask Ninja for a non-existent test target.
override_dh_auto_test:
	@:

override_dh_auto_install:
	DESTDIR=$(CURDIR)/debian/lingmo-appearance-common cmake --install debian/build --component Common --prefix /usr
	DESTDIR=$(CURDIR)/debian/lingmo-appearance-qt6 cmake --install debian/build --component Qt6Style --prefix /usr
	DESTDIR=$(CURDIR)/debian/lingmo-appearance-settings cmake --install debian/build --component Settings --prefix /usr
	DESTDIR=$(CURDIR)/debian/lingmo-appearance-decoration cmake --install debian/build --component Decoration --prefix /usr
