diff configure.ac @ 239:cae61340cc86

configure: check pkg-config for qt
author Paper <paper@paper.us.eu.org>
date Fri, 19 Jan 2024 12:29:53 -0500
parents a7d0d543b334
children 6ffe42286978
line wrap: on
line diff
--- a/configure.ac	Fri Jan 19 11:17:42 2024 -0500
+++ b/configure.ac	Fri Jan 19 12:29:53 2024 -0500
@@ -18,11 +18,21 @@
 AM_PROG_AR
 LT_INIT
 
+have_qt=no
 # Qt?
 AX_HAVE_QT
 
 if test "x$have_qt" = "xno"; then
-	AC_MSG_ERROR([*** Qt not found.])
+	PKG_CHECK_MODULES([QT], [Qt6Widgets >= 6.0.0], [have_qt=yes], [])
+	# prioritize qt 5
+	PKG_CHECK_MODULES([QT], [Qt5Widgets >= 5.15.0], [have_qt=yes], [])
+
+	if test "x$have_qt" = "xno"; then
+		AC_MSG_ERROR([*** Qt not found.])
+	fi
+
+	QT_CXXFLAGS=$QT_CFLAGS
+	AC_SUBST([QT_CXXFLAGS])
 fi
 
 # need this for moc