#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

DEB_CMAKE_EXTRA_FLAGS = -Dracon_build_tests=ON

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS)
	# Somehow the means in the patch for CMakeLists.txt to replace -lpthread by -pthread to not work
	# Just hack it here
	sed -i 's/-lpthread/-pthread/' obj-*/CMakeFiles/racon_test.dir/link.txt

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	cd test && ../obj-*/bin/racon_test
endif
