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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh $@ --buildsystem=cmake

# Upstream unconditionally sets CMAKE_INSTALL_RPATH. Make it ineffective by
# setting CMAKE_SKIP_RPATH
# Also make sure that there is a gitversion.h file
override_dh_auto_configure:
	echo "#define GIT_VERSION \"unknown\" " > include/gitversion.h
	echo "#define MS2_GIT_VERSION \"unknown\" " >> include/gitversion.h
	dh_auto_configure -O--buildsystem=cmake -- -DCMAKE_SKIP_RPATH=ON

# Clean up the gitversion.h file
override_dh_auto_clean:
	rm -f include/gitversion.h
	dh_auto_clean -O--buildsystem=cmake
