#!/usr/bin/make -f
# -*- makefile -*-

# Use debhelper default for all targets (but some are overridden below).
%:
	dh $@ --buildsystem=cmake

# Enable all hardening options (since grfcodec potentially handles
# untrusted data files).
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

# Build release
CMAKE_CONFIG_ARGUMENTS += -DCMAKE_BUILD_TYPE=RelWithDebInfo

# Explicitly mark dependencies as required or disabled, so an issue with
# build dependencies does not silently remove a feature or add a
# dependency
CMAKE_CONFIG_ARGUMENTS += -DCMAKE_REQUIRE_FIND_PACKAGE_Boost=TRUE
CMAKE_CONFIG_ARGUMENTS += -DCMAKE_REQUIRE_FIND_PACKAGE_PNG=TRUE

override_dh_auto_configure:
	dh_auto_configure -- $(CMAKE_CONFIG_ARGUMENTS)

execute_after_dh_install-arch:
	# Prevent installing duplicate license file
	rm debian/grfcodec/usr/share/doc/grfcodec/COPYING
