2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 10:58:58 +00:00
qpdf/pkg-test/test-cmake

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

26 lines
656 B
Plaintext
Raw Permalink Normal View History

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