|
| 1 | +#!/usr/bin/make -f |
| 2 | +# -*- makefile -*- |
| 3 | +# Sample debian/rules that uses debhelper. |
| 4 | +# This file was originally written by Joey Hess and Craig Small. |
| 5 | +# As a special exception, when this file is copied by dh-make into a |
| 6 | +# dh-make output file, you may use that output file without restriction. |
| 7 | +# This special exception was added by Craig Small in version 0.37 of dh-make. |
| 8 | + |
| 9 | +# Uncomment this to turn on verbose mode. |
| 10 | +export DH_VERBOSE=1 |
| 11 | +# TODO: remove the LDFLAGS override. It's here to avoid esoteric problems |
| 12 | +# of this sort: |
| 13 | +# https://code.ros.org/trac/ros/ticket/2977 |
| 14 | +# https://code.ros.org/trac/ros/ticket/3842 |
| 15 | +export LDFLAGS= |
| 16 | +export PKG_CONFIG_PATH=@(InstallationPrefix)/lib/pkgconfig |
| 17 | +# Explicitly enable -DNDEBUG, see: |
| 18 | +# https://github.com/ros-infrastructure/bloom/issues/327 |
| 19 | +export DEB_CXXFLAGS_MAINT_APPEND=-DNDEBUG |
| 20 | +ifneq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),) |
| 21 | + BUILD_TESTING_ARG=-DBUILD_TESTING=OFF |
| 22 | +endif |
| 23 | + |
| 24 | +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
| 25 | + |
| 26 | +%: |
| 27 | + dh $@@ -v --buildsystem=cmake --builddirectory=.obj-$(DEB_HOST_GNU_TYPE) |
| 28 | + |
| 29 | +override_dh_auto_configure: |
| 30 | + # In case we're installing to a non-standard location, look for a setup.sh |
| 31 | + # in the install tree and source it. It will set things like |
| 32 | + # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. |
| 33 | + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ |
| 34 | + dh_auto_configure -- \ |
| 35 | + -DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \ |
| 36 | + -DAMENT_PREFIX_PATH="@(InstallationPrefix)" \ |
| 37 | + -DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \ |
| 38 | + $(BUILD_TESTING_ARG) |
| 39 | + |
| 40 | +override_dh_auto_build: |
| 41 | + # In case we're installing to a non-standard location, look for a setup.sh |
| 42 | + # in the install tree and source it. It will set things like |
| 43 | + # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. |
| 44 | + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ |
| 45 | + dh_auto_build |
| 46 | + |
| 47 | +override_dh_auto_test: |
| 48 | + # In case we're installing to a non-standard location, look for a setup.sh |
| 49 | + # in the install tree and source it. It will set things like |
| 50 | + # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. |
| 51 | + echo -- Running tests. Even if one of them fails the build is not canceled. |
| 52 | + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ |
| 53 | + dh_auto_test || true |
| 54 | + |
| 55 | +override_dh_shlibdeps: |
| 56 | + # In case we're installing to a non-standard location, look for a setup.sh |
| 57 | + # in the install tree and source it. It will set things like |
| 58 | + # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. |
| 59 | + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ |
| 60 | + dh_shlibdeps -l$(CURDIR)/debian/@(Package)/@(InstallationPrefix)/lib/ |
| 61 | + |
| 62 | +override_dh_auto_install: |
| 63 | + # In case we're installing to a non-standard location, look for a setup.sh |
| 64 | + # in the install tree and source it. It will set things like |
| 65 | + # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. |
| 66 | + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ |
| 67 | + dh_auto_install |
0 commit comments