2022-03-18 01:06:23 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Test that the installed qpdf development packages enable a qpdf
|
|
|
|
# application to be build with cmake using qpdf's cmake package
|
|
|
|
# information. Requires cmake as well as libqpdf development
|
|
|
|
# dependencies.
|
|
|
|
#
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
TMP=$1
|
|
|
|
if [ ! -d "$TMP" ]; then
|
|
|
|
echo 1>&2 "Usage: $0 tmp-dir"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
2022-09-10 13:24:12 +00:00
|
|
|
WANTED_VERSION=$(awk -F'"' '/#define QPDF_VERSION / {print $2}' include/qpdf/DLL.h)
|
|
|
|
|
2022-03-18 01:06:23 +00:00
|
|
|
cp pkg-test/qpdf-version.cc $TMP
|
|
|
|
cd $TMP
|
2022-09-10 13:24:12 +00:00
|
|
|
if [ "$(pkg-config libqpdf --modversion)" != "$WANTED_VERSION" ]; then
|
|
|
|
echo 1>&2 "Failed to get correct qpdf version from pkg-config --modversion"
|
|
|
|
fi
|
2022-03-23 14:52:40 +00:00
|
|
|
pkg-config libqpdf --libs --static
|
2022-03-18 01:06:23 +00:00
|
|
|
g++ qpdf-version.cc -o qpdf-version \
|
|
|
|
$(pkg-config libqpdf --cflags) \
|
|
|
|
$(pkg-config libqpdf --libs)
|
2022-09-10 13:24:12 +00:00
|
|
|
if [ "$(./qpdf-version)" != "$WANTED_VERSION" ]; then
|
|
|
|
echo 1>&2 "Failed to get correct qpdf version from pkg-config test"
|
|
|
|
exit 2
|
|
|
|
fi
|