summaryrefslogtreecommitdiff
blob: 3be9c2222776f7bc517073d65a78fe8d73585ef5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From cac1fffce80f0835e4d8d234023a775b4243b916 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sun, 20 Oct 2019 01:44:02 +0200
Subject: [PATCH] Create correct pkconfig file for zbar-qt5

Although zbar supports Qt5, the created pkgconfig file always requested
the Qt(4) components.

Fixes issue #62.
---
 configure.ac   | 13 ++++++++++---
 zbar-qt5.pc.in | 12 ++++++++++++
 2 files changed, 22 insertions(+), 3 deletions(-)
 create mode 100644 zbar-qt5.pc.in

diff --git a/configure.ac b/configure.ac
index 935110a..49ef6a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -659,15 +659,23 @@ AS_IF([test "x$with_qt" != "xno"],
      CPPFLAGS="$CPPFLAGS $QT_CPPFLAGS"
 dnl -fPIC has no effect on Windows and breaks windres
      AS_IF([test "x$win32" = "xno"], [CPPFLAGS="$CPPFLAGS -fPIC"])
-     AC_MSG_NOTICE([using Qt version $QT_VERSION])],
+     AC_MSG_NOTICE([using Qt version $QT_VERSION])
+     qt_pkgconfig_file="zbar-qt5.pc"
+     ],
 
     [MOC=`$PKG_CONFIG QtGui --variable=moc_location`
      AC_MSG_NOTICE([using moc from $MOC])
      QT_VERSION=`$PKG_CONFIG QtGui --modversion`
-     AC_MSG_NOTICE([using Qt version $QT_VERSION])]))
+     AC_MSG_NOTICE([using Qt version $QT_VERSION])
+     qt_pkgconfig_file="zbar-qt.pc"
+     ]))
 
 AM_CONDITIONAL([HAVE_QT], [test "x$with_qt" = "xyes"])
 
+AM_COND_IF([HAVE_QT],
+     [AC_CONFIG_FILES([zbar-qt.pc:"${qt_pkgconfig_file}.in"])]
+)
+
 dnl Java
 have_java="maybe"
 
@@ -820,7 +828,6 @@ java/Makefile
 zbar/Makefile
 zbar.pc
 zbar-gtk.pc
-zbar-qt.pc
 doc/doxygen.conf])
 
 AC_CONFIG_FILES([test/test_examples.sh],[chmod 755 test/test_examples.sh])
diff --git a/zbar-qt5.pc.in b/zbar-qt5.pc.in
new file mode 100644
index 0000000..3378993
--- /dev/null
+++ b/zbar-qt5.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: zbar-qt
+Description: bar code scanning and decoding Qt5 widget
+URL: http://zbar.sourceforge.net
+Version: @VERSION@
+Requires: zbar, Qt5Core >= 5, Qt5Gui >= 5
+Libs: -L${libdir} -lzbarqt
+Cflags: -I${includedir}