diff configure.ac @ 282:19eb6c4dca78

autotools: ax_have_qt sucks, use pkgconf instead this is particularly useful because m4_ax_have_qt really sucked when cross compiling because of qmake
author Paper <paper@paper.us.eu.org>
date Wed, 08 May 2024 15:54:10 -0400
parents f31305b9f60a
children 8535eb5fb836
line wrap: on
line diff
--- a/configure.ac	Mon May 06 17:44:16 2024 -0400
+++ b/configure.ac	Wed May 08 15:54:10 2024 -0400
@@ -21,15 +21,22 @@
 AM_PROG_AR
 LT_INIT
 
+
 dnl Qt?
-have_qt=no
-AX_HAVE_QT
-
-AS_IF([test "x$have_qt" = "xno"], [AC_MSG_ERROR([*** Qt not found.])])
-AC_SUBST([QT_LRELEASE])
-AC_SUBST([QT_LUPDATE])
-AC_SUBST([QT_MOC])
-AC_SUBST([QT_RCC])
+AS_IF([test "${enable_qt}" != "no"], [
+	PKG_CHECK_MODULES([QT], [Qt5Core >= 5.5.0 Qt5Widgets Qt5Gui Qt5Svg], [
+		QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
+		QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
+		QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
+		AC_PATH_PROGS(QT_MOC,      [moc-qt5 moc],           moc,      ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
+		AC_PATH_PROGS(QT_RCC,      [rcc-qt5 rcc],           rcc,      ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
+		AC_PATH_PROGS(QT_UIC,      [uic-qt5 uic],           uic,      ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
+		AC_PATH_PROGS(QT_LRELEASE, [lrelease-qt5 lrelease], lrelease, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
+		AC_PATH_PROGS(QT_LUPDATE,  [lupdate-qt5 lupdate],   lupdate,  ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
+	], [
+		AC_MSG_ERROR([${QT_PKG_ERRORS}])
+	])
+])
 
 dnl need this for moc
 AC_PROG_MKDIR_P