2
1
mirror of https://github.com/qpdf/qpdf.git synced 2025-02-02 20:08:24 +00:00
qpdf/pkg-test/test-cmake
Jay Berkenbilt 38cd94bec8 Strengthen pkg-test
* Define POINTERHOLDER_TRANSITION
* Make sure we are getting the intended version of qpdf
2022-09-10 09:44:29 -04:00

25 lines
628 B
Bash
Executable File

#!/bin/sh
#
# Test that the installed qpdf development packages enable a qpdf
# application to be build with information from pkg-config. Requires
# pkg-config 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 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