From e95d29155173d94d488e12c0a0221fcc9cdeb9ec Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Sun, 22 May 2022 05:52:56 +0200 Subject: [PATCH] Fix pcsc-lite include directory on UNIX OpenBSD fails to compile `QPCSC_p.h` (in the qdigidoc4 build) since pcsc-lite's include path does not match. pkg-config(1), as used by CMake to detect the libpcsclite dependency: ``` $ pkg-config --cflags libpcsclite -I/sr/local/include/PCSC -pthread ``` Hence, "PCSC/" must be omitted in sources since CMake will use `-I/sr/local/include/PCSC` already. Debian's code search[0] shows lots of other software projects including `` rather than ``, but it also shows a trend towards purposefully doing the former/latter on !MAC/MAC. Inspecting Ubuntu's libpcsclite-dev package[0] containing the libpcsclite.pc file confirms that at least Ubuntu uses `-I/usr/include/PCSC`, i.e. with "PCSC/" like OpenBSD. On OpenBSD, compilation fails since `-I/usr/local` is neither used by default nor pulled in via any other dependency configured via CMake. I am unable to test MacOS and Windows builds, but neither platforms are effected by this change. I am unable to test Linux builds, but my strong suspicion is that this works by accident since, contrary to OpenBSD, `-I/usr` is used in one way or the other, making "/usr" + "PCSC/winscard.h" work. 0: https://codesearch.debian.net/search?q=PCSC%2Fwinscard.h&literal=1 1: https://packages.ubuntu.com/bionic/amd64/libpcsclite-dev/download Signed-off-by: Klemens Nanni --- QPCSC_p.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/QPCSC_p.h b/QPCSC_p.h index 0397665..1628694 100644 --- a/QPCSC_p.h +++ b/QPCSC_p.h @@ -29,10 +29,14 @@ #define NOMINMAX #include #include -#else +#elif Q_OS_MAC #include #include #include +#else +#include +#include +#include #endif #ifndef SCARD_CTL_CODE