#!/usr/bin/make -f

%:
	dh $@ --parallel --builddirectory=Build

override_dh_auto_configure:
	# Put 3rd party packages where the cmake build system expects them
	mkdir -p ThirdPartyDownloads
	( cd ThirdPartyDownloads; cp ../debian/ThirdPartyDownloads/* . )
	dh_auto_configure -- -DSTATIC_BUILD:BOOL=OFF -DSTANDALONE_BUILD:BOOL=ON -DUSE_DYNAMIC_JSONCPP:BOOL=ON -DDEBIAN_USE_GTEST_SOURCE_PACKAGE:BOOL=ON -DCMAKE_BUILD_TYPE=Release "-DDCMTK_LIBRARIES=wrap;oflog"

override_dh_auto_test:
	( cd $(CURDIR)/Build; ./UnitTests )

override_dh_clean:
	rm -rf ThirdPartyDownloads

override_dh_auto_install:
	dh_install Build/Orthanc usr/sbin

override_dh_installchangelogs:
	dh_installchangelogs -k $(CURDIR)/NEWS

get-orig-source:
	uscan --verbose --force-download --rename
