#!/usr/bin/make -f

export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed

# from the top-level CMakeLists.txt
export KDEV_PLUGIN_VERSION=33

%:
	dh $@ --with kf5

override_dh_auto_configure:
	dh_auto_configure -Skf5 -- -DBUILD_TESTING=OFF

override_dh_install:
	# create this directory if not existing, so kdevelop-data.install
	# is the same, no matter whether clang is built
	mkdir -p debian/tmp/usr/share/kdevclangsupport/
	dh_install

override_dh_missing:
	dh_missing --fail-missing

override_dh_gencontrol:
	dh_gencontrol -- -V'kdevelop:clang=$(shell dpkg -S "$(shell realpath $(shell env PATH=$$(echo "$$PATH" | sed -r -e 's|/usr/lib/ccache/?:||') which clang))" | cut -d: -f1)'

.PHONY: override_dh_auto_test
