File: rules

package info (click to toggle)
visp 3.7.0-7
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 166,380 kB
  • sloc: cpp: 392,705; ansic: 224,448; xml: 23,444; python: 13,701; java: 4,792; sh: 206; objc: 145; makefile: 118
file content (154 lines) | stat: -rwxr-xr-x 4,009 bytes parent folder | download | duplicates (2)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk

# Hardening flags.
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

BUILDDIR = obj-$(DEB_HOST_MULTIARCH)

# Retrieve environment information.
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

# Linux-specific stuff (dc1394, v4l, ois only available on linux)
ifeq ($(DEB_HOST_ARCH_OS),linux)
  CMAKE_ARCH_FLAGS = -DUSE_DC1394=ON -DUSE_V4L2=ON -DUSE_OIS=ON
else
  CMAKE_ARCH_FLAGS = -DUSE_DC1394=OFF -DUSE_V4L2=OFF -DUSE_OIS=OFF
endif

# Comply with Debian architectures baseline
# https://wiki.debian.org/ArchitectureSpecificsMemo#Architecture_baselines
# Enable only SSE2 since SSE3 is not guaranteed
CMAKE_ARCH_FLAGS += -DENABLE_SSE2=ON
CMAKE_ARCH_FLAGS += -DENABLE_SSE3=OFF
CMAKE_ARCH_FLAGS += -DENABLE_SSSE3=OFF

# On armel, since 3.4.0-3 build returns the following error
# "ABORT: Received TERM signal"
# Disable parallel build (make -j1) to reduce memory usage
ifeq ($(DEB_HOST_ARCH_OS),armel)
  export DEB_BUILD_MAINT_OPTIONS="parallel=1"
endif

# Check whether nodoc is present in the build profiles
ifneq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
  export WITHOUT_DOC=1
endif

BUILDDIR_DOC = obj-doc

# CMake flags
CMAKE_FLAGS = \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_VERBOSE_MAKEFILE=ON \
	-DCMAKE_C_FLAGS_RELEASE="$(CFLAGS)" \
	-DCMAKE_CXX_FLAGS_RELEASE="$(CXXFLAGS)" \
	-DCMAKE_SHARED_LINKER_FLAGS_RELEASE="$(LDFLAGS)" \
	-DCMAKE_EXE_LINKER_FLAGS_RELEASE="$(LDFLAGS)" \
	-DCMAKE_INSTALL_LIBDIR="lib" \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_SKIP_RPATH=ON \
	-DENABLE_MULTIARCH=ON \
	-DENABLE_VISP_NAMESPACE=ON \
	-DUSE_SOQT=OFF \
	-DBUILD_JAVA=OFF

%:
	dh $@

override_dh_clean:
	dh_clean -O--buildsystem=cmake

# For arch:any
override_dh_auto_configure-arch:
	dh_auto_configure --arch -- $(CMAKE_FLAGS) $(CMAKE_ARCH_FLAGS)

# For arch:all
override_dh_auto_configure-indep:
ifndef WITHOUT_DOC
	dh_auto_configure --indep --builddirectory=$(BUILDDIR_DOC) -- $(CMAKE_FLAGS) \
		-DBUILD_APPS=OFF \
		-DBUILD_DEMOS=OFF \
		-DBUILD_EXAMPLES=OFF \
		-DBUILD_TESTS=OFF \
		-DBUILD_TUTORIALS=OFF \
		-DUSE_COIN3D=OFF \
		-DUSE_COMEDI=OFF \
		-DUSE_DC1394=OFF \
		-DUSE_DMTX=OFF \
		-DUSE_EIGEN3=OFF \
		-DUSE_FREENECT=OFF \
		-DUSE_GSL=OFF \
		-DUSE_JPEG=OFF \
		-DUSE_NLOHMAN_JSON=OFF \
		-DUSE_OPENCV=OFF \
		-DUSE_PCL=OFF \
		-DUSE_PNG=OFF \
		-DUSE_V4L2=OFF \
		-DUSE_X11=OFF \
		-DUSE_XML2=OFF \
		-DUSE_ZBAR=OFF
else
	@echo "Nodoc profile enabled: skipping configure-indep"
endif

override_dh_auto_build-arch:
	dh_auto_build --arch

override_dh_auto_build-indep:
ifndef WITHOUT_DOC
	dh_auto_build --indep --builddirectory=$(BUILDDIR_DOC) -- visp_doc
else
	@echo "Nodoc profile enabled: skipping build-indep"
endif

override_dh_install-arch:
	# Install only packages arch: any (libvisp-*, visp-tools)
	dh_install -a
	
override_dh_install-indep:
ifndef WITHOUT_DOC
	# Install libvisp-doc
	dh_install -i
else
	# Do nothing or install the other all packages if they exist, 
    	# explicitly excluding the documentation.
	dh_install -i -Nlibvisp-doc
endif

override_dh_installdocs:
ifndef WITHOUT_DOC
	dh_installdocs -X.md5 
endif

override_dh_auto_install:
	if [ -d "$(BUILDDIR)" ]; then \
		dh_auto_install --arch --builddirectory=$(BUILDDIR); \
	fi
	if [ -z "$(WITHOUT_DOC)" ]; then \
		if [ -d "$(BUILDDIR_DOC)" ]; then \
			dh_auto_install --indep --builddirectory=$(BUILDDIR_DOC); \
		fi; \
	fi

# Due to numerical imprecision, some tests are failing on ia64.
# This is not a critical issue so we let the testing fail on this
# architecture for now.
# See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=723803
ifeq ($(DEB_HOST_ARCH),ia64)
  DH_AUTOTEST_CAN_FAIL=true
else
  DH_AUTOTEST_CAN_FAIL=false
endif

override_dh_auto_test-indep:

override_dh_auto_test-arch:
	-LD_LIBRARY_PATH=$(shell realpath $(BUILDDIR))/lib dh_auto_test || ${DH_AUTOTEST_CAN_FAIL}

override_dh_auto_clean:
	dh_auto_clean
	rm -rf $(BUILDDIR_DOC)