configure: add switch for circumventing pkg-config for Qt detection

Normally configure uses pkg-config for detecting Qt and setting
QT_CFLAGS and QT_LIBS. With this option configure won't use pkg-config
and rely on the user having set both variables before running
configure. This enables using Qt on systems where no pkg-config files
are generated (e.g. Qt 5.6.0 on MacOS with frameworks enabled).

See https://github.com/Homebrew/homebrew/pull/50234
This commit is contained in:
Moritz Bunkus 2016-03-20 10:01:14 +01:00
parent 562d1d8e80
commit 8b6b876d2a
2 changed files with 18 additions and 4 deletions

View File

@ -1,3 +1,13 @@
2016-03-20 Moritz Bunkus <moritz@bunkus.org>
* build system: added an option to configure
»--without-qt-pkg-config«. Normally configure uses pkg-config for
detecting Qt and setting QT_CFLAGS and QT_LIBS. With this option
configure won't use pkg-config and rely on the user having set
both variables before running configure. This enables using Qt on
systems where no pkg-config files are generated (e.g. Qt 5.6.0 on
MacOS with frameworks enabled).
2016-03-18 Moritz Bunkus <moritz@bunkus.org>
* mkvinfo: change: on Windows and Mac OS mkvinfo will now launch

View File

@ -9,6 +9,9 @@ AC_ARG_ENABLE([static_qt],
AC_HELP_STRING([--enable-static-qt],[link to static versions of the Qt library (no)]))
AC_ARG_WITH([qt_pkg_config_modules],
AC_HELP_STRING([--with-qt-pkg-config-modules=modules],[gather include/link flags for additional Qt modules from pkg-config]))
AC_ARG_WITH([qt_pkg_config],
AC_HELP_STRING([--without-qt-pkg-config], [do not use pkg-config for detecting Qt; instead rely on QT_CFLAGS/QT_LIBS being set correctly already]),
[ with_qt_pkg_config=${withval} ], [ with_qt_pkg_config=yes ])
qt_min_ver=5.2.0
@ -123,7 +126,7 @@ if test x"$enable_qt" = "xyes" -a \
ok=1
fi
if test $ok = 1; then
if test $ok = 1 -a "x$with_qt_pkg_config" = xyes; then
with_qt_pkg_config_modules="`echo "$with_qt_pkg_config_modules" | sed -e 's/ /,/g'`"
if test x"$with_qt_pkg_config_modules" != x ; then
with_qt_pkg_config_modules="$with_qt_pkg_config_modules,"
@ -141,13 +144,14 @@ if test x"$enable_qt" = "xyes" -a \
if test $ok = 0; then
AC_MSG_RESULT(no: not found by pkg-config)
fi
with_qt_pkg_config_modules="`echo "$with_qt_pkg_config_modules" | sed -e 's/,/ /g'`"
QT_CFLAGS="`$PKG_CONFIG --cflags $with_qt_pkg_config_modules $QT_PKG_CONFIG_STATIC`"
QT_LIBS="`$PKG_CONFIG --libs $with_qt_pkg_config_modules $QT_PKG_CONFIG_STATIC`"
fi
if test $ok = 1; then
dnl Try compiling and linking an application.
with_qt_pkg_config_modules="`echo "$with_qt_pkg_config_modules" | sed -e 's/,/ /g'`"
QT_CFLAGS="`$PKG_CONFIG --cflags $with_qt_pkg_config_modules $QT_PKG_CONFIG_STATIC`"
QT_LIBS="`$PKG_CONFIG --libs $with_qt_pkg_config_modules $QT_PKG_CONFIG_STATIC`"
AC_LANG_PUSH(C++)
AC_CACHE_VAL(am_cv_qt_compilation, [