2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-17 18:15:09 +00:00
qpdf/pkg-test/test-pkg-config

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
833 B
Plaintext
Raw Normal View History

#!/bin/sh
#
# Test that the installed qpdf development packages enable a qpdf
# application to be built with cmake. 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
WANTED_VERSION=$(awk -F'"' '/#define QPDF_VERSION / {print $2}' include/qpdf/DLL.h)
cp pkg-test/qpdf-version.cc $TMP
cd $TMP
if [ "$(pkg-config libqpdf --modversion)" != "$WANTED_VERSION" ]; then
echo 1>&2 "Failed to get correct qpdf version from pkg-config --modversion"
fi
pkg-config libqpdf --libs --static
g++ qpdf-version.cc -o qpdf-version \
$(pkg-config libqpdf --cflags) \
$(pkg-config libqpdf --libs)
if [ "$(./qpdf-version)" != "$WANTED_VERSION" ]; then
echo 1>&2 "Failed to get correct qpdf version from pkg-config test"
exit 2
fi