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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
	dh $@ --buildsystem=cmake
#	dh $@ --buildsystem=cmake --parallel

override_dh_auto_configure:
	dh_auto_configure -- -DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)" -DCMAKE_INSTALL_PREFIX=/usr -DUSEQT5=1 -DCMAKE_BUILD_TYPE=Release -DMAKE_TEST=1 -DCMAKE_SKIP_RPATH=1 -DCMAKE_NAMELINK_SKIP=1

override_dh_auto_build:
	dh_auto_build
	dh_auto_build -- doc

# That's a bit hackish but solved the lintian error about private cmake files
override_dh_install:
	dh_install
	mkdir -p debian/libodsstream-dev/usr/lib/$(DEB_HOST_MULTIARCH)/cmake
	mv debian/libodsstream-dev/usr/share/cmake-3.7/Modules/* debian/libodsstream-dev/usr/lib/$(DEB_HOST_MULTIARCH)/cmake
	rm -rf debian/libodsstream-dev/usr/share/cmake-3.7
