summaryrefslogtreecommitdiff
blob: 3ae4be71f24bb5b682168f197d459e34dfefd0bc (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
--- a/configure.in	2017-12-04 21:30:44.000000000 +0100
+++ b/configure.in	2017-12-04 21:56:00.277286322 +0100
@@ -45,44 +45,18 @@
 #define GENERATION   "$GENERATION"
 EOF
 
-dnl try to find QT
-dnl
-AC_ARG_WITH(qtdir,[  --with-qtdir=DIR        Specify directory path for QT ])
-
-if test -n "$with_qtdir"; then
-   AC_MSG_CHECKING(Using QT in )
-   QTDIR="$with_qtdir";
-   export QTDIR
-   AC_MSG_RESULT($QTDIR)
-fi
-
-# TODO: do we need to add $QTDIR/bin to PATH to find qmake?
-EXTENDED_PATH="/usr/local/bin:$QTDIR/bin/:$PATH"
+EXTENDED_PATH="/usr/local/bin:$PATH"
+PKG_PROG_PKG_CONFIG
 
-AC_ARG_WITH(qmake, [  --with-qmake=qmake     Specify the qmake to be used (debian qmake-qt4) ])
-if test -n "$with_qmake"; then
-    AC_PATH_PROG(QMAKE,  $with_qmake,      ,[$EXTENDED_PATH])
-    if test -z "$QMAKE"; then
-        AC_MSG_ERROR("Could not find qmake")
-    fi
-else
-    AC_PATH_PROG(QMAKE,  qmake,      ,[$EXTENDED_PATH])
-    if test -z "$QMAKE"; then
-        AC_PATH_PROG(QMAKE,  qmake-qt4,      ,[$EXTENDED_PATH])
-        if test -z "$QMAKE"; then
-            AC_MSG_ERROR("Could not find qmake")
-        fi
-    fi
-fi
-
-AC_MSG_CHECKING(checking version of QT this qmake is part of)
-qmake_version=`$QMAKE -v 2>&1 | awk '/Using Qt version/ { print $4;}'`
-case $qmake_version in
-    4.*) AC_MSG_RESULT( $qmake_version ) ;;
-    5.*) AC_MSG_RESULT( $qmake_version ) ;;
-      *) AC_MSG_ERROR( "$qmake_version -- v4.x or v5.x is required") ;;
-esac
+dnl try to find Qt5
+dnl
 
+PKG_CHECK_MODULES([QT5], [Qt5Core >= 5.1.0], [
+    QT_PATH="$( eval $PKG_CONFIG --variable=host_bins Qt5Core )"
+    AC_PATH_PROGS([QMAKE], [qmake-qt5 qmake], [qmake], [$QT_PATH])
+], [
+    AC_MSG_ERROR([Qt5 not found])
+])
 
 
 AC_ARG_WITH(templatedir, [  --with-templatedir=DIR  Specify directory path for fwbuilder template files ])