#!/usr/bin/make -f
#DH_VERBOSE = 1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

include /usr/share/dpkg/architecture.mk

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

QT5WEWCFG = /usr/lib/$(DEB_HOST_MULTIARCH)/cmake/Qt5WebEngineWidgets/Qt5WebEngineWidgetsConfig.cmake
QT6WEWCFG = /usr/lib/$(DEB_HOST_MULTIARCH)/cmake/Qt6WebEngineWidgets/Qt6WebEngineWidgetsConfig.cmake

override_dh_auto_configure:
# Only build with Qt on architectures with Qt5WebEngineWidgets
# or Qt6WebEngineWidgets
ifeq ($(QT5WEWCFG), $(wildcard $(QT5WEWCFG)))
	dh_auto_configure -- -DUSE_QT_GUI=ON
else ifeq ($(QT6WEWCFG), $(wildcard $(QT6WEWCFG)))
	dh_auto_configure -- -DUSE_QT_GUI=ON
else
	dh_auto_configure
endif

# There are no tests, and ninja test breaks the build
override_dh_auto_test:
