2022-03-18 01:06:23 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Test that the installed qpdf development packages enable a qpdf
|
2022-09-10 15:33:10 +00:00
|
|
|
# application to be built with cmake using qpdf's cmake package
|
|
|
|
# information. Requires cmake as well as libqpdf development
|
|
|
|
# dependencies.
|
2022-03-18 01:06:23 +00:00
|
|
|
#
|
|
|
|
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
|
|
|
|
2023-12-23 15:41:55 +00:00
|
|
|
WANTED_VERSION=$(awk -F'"' '/# *define QPDF_VERSION / {print $2}' include/qpdf/DLL.h | tail -n 1)
|
2022-09-10 13:24:12 +00:00
|
|
|
|
2022-03-18 01:06:23 +00:00
|
|
|
cp pkg-test/qpdf-version.cc pkg-test/CMakeLists.txt $TMP
|
|
|
|
cd $TMP
|
|
|
|
cmake -S . -B build
|
|
|
|
cmake --build build
|
2022-09-10 13:24:12 +00:00
|
|
|
if [ "$(./build/qpdf-version)" != "$WANTED_VERSION" ]; then
|
|
|
|
echo 1>&2 "Failed to get correct qpdf version from cmake test"
|
|
|
|
exit 2
|
|
|
|
fi
|