Is there a Qt installation path variable that I can use in a .pro file?

I want to copy the audio plugin to my target directory, as I need it for deployment.

He lives in <PATH_TO_QT_INSTALL>\gcc\plugins\audio

I do not know which variable I can use to refer to the installation path in the my / pro file.

The line of code I want to add is something like this:

QMAKE_PRE_LINK += cp $$PATH_TO_QT_INSTAL/gcc/plugins/audio/* $$DESTDIR/lib || :;

There is an environment variable called %{CurrentProject:QT_INSTALL_BINS}that returns me to $$PATH_TO_QT_INSTAL/gcc/binthat I could use, but I seem to be able to use this only in the gut creator build settings, which are not suitable for me, since these settings live in the .pro.user file. WHY there is no qt mechanism for generating general settings: (... (this is just a side question, no need to answer)

My question is, how can I refer to the qt installation path in my pro file, is there a variable that can do this, or in any other way?

+4
source share
2 answers

For Qt4 and Qt5 it looks like $$[QT_INSTALL_LIBS]what do you want? I can’t confirm firsthand that this works.

See https://forum.qt.io/topic/65778/qmake-and-qt-installation-root-directory/2 and http://doc.qt.io/qt-4.8/qmake-advanced-usage.html .

+2
source

Another solution (maybe not as bizarre as above with $ [QT_INSTALL_LIBS], but I have been using it for quite some time:

TEMPNAME = $${QMAKE_QMAKE}
QTPATH = $$dirname(TEMPNAME) 

(, ) :

INCLUDEPATH += $$QTPATH/../../Src/qtbase/src/sql/kernel
+2

All Articles