-
Notifications
You must be signed in to change notification settings - Fork 0
/
rules
executable file
·39 lines (30 loc) · 1.3 KB
/
rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/cmake.mk
DEB_MAKE_ENVVARS = CTEST_OUTPUT_ON_FAILURE=ON
DEB_BUILD_PARALLEL = true
DEB_CMAKE_EXTRA_FLAGS = -Denable_testing=ON
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEB_TARGET_ARCH ?= $(shell dpkg-architecture -qDEB_TARGET_ARCH)
DEB_TARGET_GNU_CPU ?= $(shell dpkg-architecture -qDEB_TARGET_GNU_CPU)
ifneq ($(DEB_BUILD_ARCH),$(DEB_TARGET_ARCH))
# cross compiling
DEB_CMAKE_EXTRA_FLAGS += -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=$(DEB_TARGET_GNU_CPU)
else
# only run unit tests and build documentation on x86_64 and i386
ifeq ($(shell (dpkg-architecture -qDEB_BUILD_ARCH | egrep -q "amd64|i386") && echo "yes"),yes)
DEB_CMAKE_EXTRA_FLAGS += -Dbuild_doc=ON
# for running tests
DEB_MAKE_ENVVARS += LD_LIBRARY_PATH=$(CURDIR)/lib
DEB_MAKE_CHECK_TARGET = test
endif
endif
$(info $$DEB_BUILD_ARCH is [${DEB_BUILD_ARCH}])
$(info $$DEB_TARGET_ARCH is [${DEB_TARGET_ARCH}])
$(info $$DEB_CMAKE_EXTRA_FLAGS is [${DEB_CMAKE_EXTRA_FLAGS}])
# PDF documentation build works on Trusty (not Xenial yet)
ifeq ($(shell (lsb_release -c | egrep -q "trusty") && echo "yes"),yes)
DEB_CMAKE_EXTRA_FLAGS += -Dbuild_doc_pdf=ON
endif
CC=$(DEB_HOST_GNU_TYPE)-gcc
CXX=$(DEB_HOST_GNU_TYPE)-g++