Add QT5_CUSTOM_DIR as Qt root dir for install and lib subdirs

This commit is contained in:
Cătălin Răceanu 2018-06-24 19:46:58 +03:00
parent 01cd3cc019
commit e2594c8bb9
2 changed files with 38 additions and 10 deletions

View File

@ -3361,12 +3361,24 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
if test "$wxUSE_QT" = 1; then if test "$wxUSE_QT" = 1; then
PKG_CHECK_MODULES(QT5, TOOLKIT=QT
GUIDIST=QT_DIST
TOOLKIT_DIR="qt"
if test -n "$QT5_CUSTOM_DIR" ; then
dnl the name of the directory where the files for this toolkit live
TOOLKIT_INCLUDE="${TOOLKIT_INCLUDE} -I${QT5_CUSTOM_DIR}/include"
GUI_TK_LIBRARY="${GUI_TK_LIBRARY} -L${QT5_CUSTOM_DIR}/lib \
-lQt5Core -lQt5Widgets -lQt5Gui -lQt5OpenGL -lQt5Test \
-Wl,-rpath,${QT5_CUSTOM_DIR}/lib"
elif test -z "$PKG_CONFIG" ; then
AC_MSG_ERROR([specify QT5_CUSTOM_DIR or make sure pkg-config is available to search for Qt5 libraries])
else
PKG_CHECK_MODULES(QT5,
[Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test], [Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test],
[ [
TOOLKIT=QT
GUIDIST=QT_DIST
TOOLKIT_DIR="qt"
TOOLKIT_INCLUDE="${TOOLKIT_INCLUDE} ${QT5_CFLAGS}" TOOLKIT_INCLUDE="${TOOLKIT_INCLUDE} ${QT5_CFLAGS}"
GUI_TK_LIBRARY="${GUI_TK_LIBRARY} ${QT5_LIBS}" GUI_TK_LIBRARY="${GUI_TK_LIBRARY} ${QT5_LIBS}"
if `pkg-config --variable qt_config Qt5Core | grep "reduce_relocations" >/dev/null`; then if `pkg-config --variable qt_config Qt5Core | grep "reduce_relocations" >/dev/null`; then
@ -3374,11 +3386,12 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
SAMPLES_CXXFLAGS="-fPIC $SAMPLES_CXXFLAGS" SAMPLES_CXXFLAGS="-fPIC $SAMPLES_CXXFLAGS"
WXCONFIG_CXXFLAGS="-fPIC $WXCONFIG_CXXFLAGS" WXCONFIG_CXXFLAGS="-fPIC $WXCONFIG_CXXFLAGS"
fi fi
], ],
[ [
AC_MSG_ERROR([Qt5 libraries are not available]) AC_MSG_ERROR([Qt5 libraries are not available])
] ]
) )
fi
fi fi
dnl the name of the directory where the files for this toolkit live dnl the name of the directory where the files for this toolkit live
TOOLKIT_DIR=`echo ${TOOLKIT} | tr '[[A-Z]]' '[[a-z]]'` TOOLKIT_DIR=`echo ${TOOLKIT} | tr '[[A-Z]]' '[[a-z]]'`

View File

@ -91,6 +91,21 @@ cd tests
make make
./test_gui ./test_gui
* Building wxQT, using qt-unified-XXX-online installer
------------------------------------------------------
Download qt-unified-XXX-online installer from the qt website.
Install the Qt package of your choice (with the same minimum version
restriction as above).
The same build instructions apply, except that you need to explicitly pass
to configure the Qt dir of the build intended to use as QT5_CUSTOM_DIR, i.e.
# for Linux:
../configure --with-qt --enable-debug QT5_CUSTOM_DIR=~/Qt/5.11.0/gcc_64
# for Windows (ran from Git Bash, or any other Unix-like shell):
../configure --with-qt --enable-debug QT5_CUSTOM_DIR=/c/Qt/5.11.0/mingw53_32
* Building wxGT on Android * Building wxGT on Android
-------------------------- --------------------------