set Qt path to configure in a project on Ubuntu
-
I am using configure to build one project which needs Qt. How to set Qt Path to configure
./configure --prefix=path
I tried to
export QT_CFLAGS=/opt/thirdParties/Qt/5.15.2/gcc_64/include
export QT_LIBS=/opt/thirdParties/Qt/5.15.2/gcc_64/lib
Although configure is ok, the Qt path is not set properly in Makefile which does not include any qt paths. And make fails with error message QApplication can not be found.
Have not used configure for ages. -
Could you please run configure in an empty target directory and post the output?
-
thank for your reply. The Qt part in configure file is as follows:
if test -n "$QT_CFLAGS"; then pkg_cv_QT_CFLAGS="$QT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.11.0 Qt5Widgets Qt5Gui Qt5Quick Qt5QuickWidgets Qt5QuickControls2 Qt5Svg\""; } >&5 ($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.11.0 Qt5Widgets Qt5Gui Qt5Quick Qt5QuickWidgets Qt5QuickControls2 Qt5Svg") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_QT_CFLAGS=`$PKG_CONFIG --cflags "Qt5Core >= 5.11.0 Qt5Widgets Qt5Gui Qt5Quick Qt5QuickWidgets Qt5QuickControls2 Qt5Svg" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$QT_LIBS"; then pkg_cv_QT_LIBS="$QT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.11.0 Qt5Widgets Qt5Gui Qt5Quick Qt5QuickWidgets Qt5QuickControls2 Qt5Svg\""; } >&5 ($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.11.0 Qt5Widgets Qt5Gui Qt5Quick Qt5QuickWidgets Qt5QuickControls2 Qt5Svg") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_QT_LIBS=`$PKG_CONFIG --libs "Qt5Core >= 5.11.0 Qt5Widgets Qt5Gui Qt5Quick Qt5QuickWidgets Qt5QuickControls2 Qt5Svg" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi
-
@JoeCFD said in set Qt path to configure in a project on Ubuntu:
pkg_cv_QT_LIBS
prefix path in pkg pc files is not set properly when qt is installed. The prefix is something like /home/qt/work/install which does not exist and is not the installed path.
Otherwise, export PKG_CONFIG_PATH=$Qt5_DIR/lib/pkgconfig:$PKG_CONFIG_PATH will solve the problem.