qmake и QT_INSTALL_LIBS

QT_INSTALL_LIBS - переменная , которая определяет местонахождение библиотек QT (типа QtCore.dll, QtCore.a, ... ), которые вам необходимы для сборки ваших проектов.

фотка 1

Под Ubuntu можно посмотреть переменные qmake , спрятанные где-то в его недрах , командой qmake-qt4 -query:


p@p-System-Product-Name:/usr/bin$ \
> qmake-qt4 -query
QT_INSTALL_PREFIX:/usr
QT_INSTALL_DATA:/usr/share/qt4
QT_INSTALL_DOCS:/usr/share/qt4/doc
QT_INSTALL_HEADERS:/usr/include/qt4
QT_INSTALL_LIBS:/usr/lib/x86_64-linux-gnu
QT_INSTALL_BINS:/usr/bin
QT_INSTALL_PLUGINS:/usr/lib/x86_64-linux-gnu/qt4/plugins
QT_INSTALL_IMPORTS:/usr/lib/qt4/imports
QT_INSTALL_TRANSLATIONS:/usr/share/qt4/translations
QT_INSTALL_CONFIGURATION:/etc/xdg
QT_INSTALL_EXAMPLES:/usr/lib/qt4/examples
QT_INSTALL_DEMOS:/usr/lib/qt4/demos
QMAKE_MKSPECS:/usr/share/qt4/mkspecs
QMAKE_VERSION:2.01a
QT_VERSION:4.8.1

Можно добавить свою переменную , и она даже появится в списке переменных qmake:

p@p-System-Product-Name:/usr/bin$ qmake-qt4 -set PROPERTY123 276598748534
p@p-System-Product-Name:/usr/bin$ qmake-qt4 -query
PROPERTY123:276598748534
QT_INSTALL_PREFIX:/usr
QT_INSTALL_DATA:/usr/share/qt4
QT_INSTALL_DOCS:/usr/share/qt4/doc
.........

Но вот вопрос - почему это не влияет на список переменных в qmake в среде Qt Creator ?... То есть там PROPERTY123:276598748534 по прежнему нет .

И даже глобальный поиск не дает информации , в каком файле устанавливаются эти переменные :

p@p-System-Product-Name:/usr$ grep -R "QT_INSTALL_LIBS" /usr 
Двоичный файл /usr/bin/qmake совпадает
Двоичный файл /usr/bin/qmake-qt4 совпадает
Двоичный файл /usr/share/qt4/bin/qmake совпадает
/usr/share/qt4/mkspecs/netbsd-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/aix-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/solaris-cc/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/freebsd-icc/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/tru64-cxx/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/win32-msvc2003/qmake.conf:QMAKE_LIBDIR_QT         = $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/irix-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/macx-xlc/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/aix-g++-64/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/linux-kcc/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/unixware-cc/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/sco-cc/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/solaris-g++-64/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/win32-msvc2010/qmake.conf:QMAKE_LIBDIR_QT         = $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/hpux-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/tru64-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/hpux-acc-64/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/hpux-g++-64/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/win32-borland/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/hpux-acc/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/solaris-cc-64/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/common/mac.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/common/symbian/symbian-makefile.conf:QMAKE_LIBDIR_QT         = $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/common/linux.conf:QMAKE_LIBDIR_QT       = $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/common/wince/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/common/qcc-base-qnx.conf:QMAKE_LIBDIR_QT         = $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/common/ghs-base-integrity.conf:QMAKE_LIBDIR_QT         = $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/aix-xlc-64/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/hpux-acc-o64/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/freebsd-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/linux-cxx/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/aix-xlc/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/irix-g++-64/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/unixware-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/sco-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/win32-msvc2005/qmake.conf:QMAKE_LIBDIR_QT         = $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/freebsd-g++40/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/darwin-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/openbsd-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/linux-icc/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/linux-ecc-64/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/qws/macx-generic-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/qws/freebsd-generic-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/qws/solaris-generic-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/irix-cc-64/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf:QMAKE_LIBDIR_QT       = $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/unsupported/linux-host-g++/qmake.conf:QMAKE_LIBDIR_QT       = $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/unsupported/win32-g++-cross/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/unsupported/qws/qnx-641/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf:QMAKE_LIBDIR_QT       = $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/linux-pgcc/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/hurd-g++/qmake.conf:QMAKE_LIBDIR_QT       = $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/win32-msvc2008/qmake.conf:QMAKE_LIBDIR_QT         = $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/lynxos-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/hpuxi-g++-64/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/hpuxi-acc-32/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/irix-cc/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/hpuxi-acc-64/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/win32-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/cygwin-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/solaris-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/win32-icc/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/linux-lsb-g++/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
/usr/share/qt4/mkspecs/freebsd-g++34/qmake.conf:QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]

Хотя обратите внимание на первые строки Двоичный файл /usr/bin/qmake совпадает. Похоже прямо в исполнимом файле qmake прописана наша QT_INSTALL_LIBS. И сделано это по-видимо ну только при установке Qt.

Почему нас волнует расположение библиотек статических QT . Дело в том , что мы планируем собирать проект из исходников. То есть мы сами создаем QtCore.a и т.д. И нам совсем не надо , чтобы QT Creator при сборке наших проектов тянул статические библиотеки откуда-то еще (из стандартных путей).

Похоже изменение QT_INSTALL_LIBS нам не доступно. Надо как-то по другому выкручиваться. Похоже надо явно указывать путь до каждого файла:


LIBS += PATH_TO_LIB_DIR/libLIBNAME.a