QMake Тестовый вывод всех переменных Код qmake .pri Работает в Qt5, т.к. в Qt4 недоступна $$enumerate_vars()
VARS = $$enumerate_vars()
# Убрать переменные, которые начинаются на QT.
QT_INTERNAL_VARS = $$find(VARS, QT\\.)
VARS -= $$QT_INTERNAL_VARS
# Убрать переменные, которые начинаются на .QMAKE
QT_INTERNAL_VARS = $$find(VARS, \\.QMAKE)
VARS -= $$QT_INTERNAL_VARS
# Убрать QMAKE_INTERNAL_INCLUDED_FILES, т.к. в ней много гуталина
VARS -= QMAKE_INTERNAL_INCLUDED_FILES
VARS -= QMAKE_INTERNAL_INCLUDED_FEATURES
#-------------------------------------------------
# небольшая сортировка
SORT_STR=. _ 0 1 2 3 4 5 6 7 8 9 \
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
a b c d e f g h i j k l m n o p q r s t u v w x y z
defineReplace(sort) {
_VARS = $$1
_BEGIN = $$2
for(_CHAR, SORT_STR) {
_FIND_VARS = $$find(_VARS, ^$${_BEGIN}[$${_CHAR}])
_VARS -= $$_FIND_VARS
_VARS += $$_FIND_VARS
}
unset(_CHAR)
unset(_BEGIN)
unset(_FIND_VARS)
return($$_VARS)
}
VARS = $$sort($$VARS)
VARS = $$sort($$VARS, QT)
VARS = $$sort($$VARS, QT_)
VARS = $$sort($$VARS, QMAKE)
VARS = $$sort($$VARS, QMAKE_)
#-------------------------------------------------
# Вывод в лог
for(var, VARS) {
eval(val=\$\$$${var})
message($$var=$$val)
}
Результат:
Project MESSAGE: _PRO_FILE_=C:/Proj/features/features.pro
Project MESSAGE: _PRO_FILE_PWD_=C:/Proj/features
Project MESSAGE: _DATE_=Вт дек 16 03:27:44 2014
Project MESSAGE: _QMAKE_CACHE_=C:/Proj/build-features-qt540_msvc2010-Release/.qmake.cache
Project MESSAGE: CODECFORTR=UTF-8
Project MESSAGE: CONFIG=lex yacc exceptions depend_includepath testcase_targets import_plugins import_qpa_plugin rtti_off incremental_off windows qt warn_on release link_prl incremental flat precompile_header autogen_precompile_source embed_manifest_dll embed_manifest_exe copy_dir_files release shared rtti no_plugin_manifest qpa win32 msvc release ordered silent
Project MESSAGE: DEFINES=UNICODE WIN32
Project MESSAGE: DIR_SEPARATOR=\
Project MESSAGE: DIRLIST_SEPARATOR=;
Project MESSAGE: FILE_M=_minqtversion.prf
Project MESSAGE: MIN_QT_VERSION=5.0.0
Project MESSAGE: MAKEFILE_GENERATOR=MSBUILD
Project MESSAGE: MSVC_VER=10.0
Project MESSAGE: OUT_PWD=C:/Proj/build-features-qt540_msvc2010-Release
Project MESSAGE: PWD=C:/Proj/features
Project MESSAGE: QT=core gui
Project MESSAGE: SUBDIRS=prj_Service prj_Gui prj_fb_ipp prj_plugins prj_translations
Project MESSAGE: TEMPLATE=subdirs
Project MESSAGE: TARGET=features
Project MESSAGE: TRANSLATIONS=C:/Proj/features/translations/features_ru.ts
Project MESSAGE: VCPROJ_EXTENSION=.vcxproj
Project MESSAGE: VCSOLUTION_EXTENSION=.sln
Project MESSAGE: VCPROJ_KEYWORD=Qt4VSv1.0
Project MESSAGE: dir=
Project MESSAGE: d=
Project MESSAGE: mod=
Project MESSAGE: prj_fb_ipp.subdir=drivers/sql/fb_ipp
Project MESSAGE: prj_Dbg.subdir=prj/Dbg
Project MESSAGE: prj_Daemon.subdir=prj/Daemon
Project MESSAGE: prj_Service.subdir=prj/Service
Project MESSAGE: prj_Gui.subdir=prj/Gui
Project MESSAGE: prj_Console.subdir=prj/Console
Project MESSAGE: prj_translations.subdir=translations
Project MESSAGE: prj_plugins.subdir=plugins
Project MESSAGE: QT_ARCH=i386
Project MESSAGE: QT_CONFIG=minimal-config small-config medium-config large-config full-config debug_and_release build_all debug release shared zlib icu png freetype harfbuzz build_all accessibility opengl ssl openssl audio-backend wmf-backend native-gestures qpa concurrent
Project MESSAGE: QT_MINOR_VERSION=4
Project MESSAGE: QT_MAJOR_VERSION=5
Project MESSAGE: QT_MODULES=axbase axcontainer axserver bluetooth bootstrap clucene concurrent core declarative designer designercomponents enginio gui help location multimedia multimediawidgets network nfc opengl openglextensions platformsupport positioning printsupport qml qmldevtools qmltest qtmultimediaquicktools quick quickparticles quickwidgets script scripttools sensors serialport sql svg testlib uitools webchannel webkit webkitwidgets websockets webview widgets winextras xml xmlpatterns
Project MESSAGE: QT_PLUGIN.qsqlibase.EXTENDS=
Project MESSAGE: QT_PLUGIN.qsqlibase.PATH=/plugins
Project MESSAGE: QT_PLUGIN.qsqlibase.TYPE=sqldrivers
Project MESSAGE: QT_PLUGIN.qsqlibase.CLASS_NAME=QIBaseDriverPlugin
Project MESSAGE: QT_PLUGINS=qsqlibase
Project MESSAGE: QT_PATCH_VERSION=0
Project MESSAGE: QT_VERSION=5.4.0
Project MESSAGE: QMAKEFEATURES=C:/Proj/features
Project MESSAGE: QMAKESPEC=E:/QT_WORK_DIR/qt540-msvc2010/5.4/msvc2010_opengl/mkspecs/win32-msvc2010
Project MESSAGE: QMAKE_CFLAGS_SSE4_1=-arch:SSE2
Project MESSAGE: QMAKE_CFLAGS_SSE4_2=-arch:SSE2
Project MESSAGE: QMAKE_CFLAGS_MP=-MP
Project MESSAGE: QMAKE_CXXFLAGS_RTTI_ON=-GR
Project MESSAGE: QMAKE_CFLAGS_SSE2=-arch:SSE2
Project MESSAGE: QMAKE_CFLAGS_SSE3=-arch:SSE2
Project MESSAGE: QMAKE_CXXFLAGS_EXCEPTIONS_ON=-EHsc
Project MESSAGE: QMAKE_CFLAGS=-nologo -Zm200 -Zc:wchar_t
Project MESSAGE: QMAKE_CXXFLAGS_STL_ON=-EHsc
Project MESSAGE: QMAKE_COMPILER=msvc
Project MESSAGE: QMAKE_CFLAGS_AVX2=-arch:AVX
Project MESSAGE: QMAKE_CFLAGS_DEBUG=-Zi -MDd
Project MESSAGE: QMAKE_CXXFLAGS_EXCEPTIONS_OFF=
Project MESSAGE: QMAKE_CFLAGS_YACC=
Project MESSAGE: QMAKE_CXXFLAGS_STL_OFF=
Project MESSAGE: QMAKE_CXXFLAGS_DEBUG=-Zi -MDd
Project MESSAGE: QMAKE_COPY_DIR=xcopy /s /q /y /i
Project MESSAGE: QMAKE_CFLAGS_RELEASE=-O2 -MD
Project MESSAGE: QMAKE_CFLAGS_WARN_ON=-W3
Project MESSAGE: QMAKE_CXXFLAGS_WARN_OFF=-W0
Project MESSAGE: QMAKE_CFLAGS_LTCG=-GL
Project MESSAGE: QMAKE_CXXFLAGS_MP=-MP
Project MESSAGE: QMAKE_CHK_DIR_EXISTS=if not exist
Project MESSAGE: QMAKE_CXXFLAGS_RELEASE=-O2 -MD
Project MESSAGE: QMAKE_CFLAGS_SSSE3=-arch:SSE2
Project MESSAGE: QMAKE_CXXFLAGS_RTTI_OFF=
Project MESSAGE: QMAKE_CFLAGS_WARN_OFF=-W0
Project MESSAGE: QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO=-O2 -MD -Zi
Project MESSAGE: QMAKE_CC=cl
Project MESSAGE: QMAKE_COPY=copy /y
Project MESSAGE: QMAKE_CXXFLAGS_YACC=
Project MESSAGE: QMAKE_COMPILER_DEFINES=_MSC_VER=1600 _WIN32
Project MESSAGE: QMAKE_CPP_MOD_MOC=
Project MESSAGE: QMAKE_CXXFLAGS_WARN_ON=-W3 -w34100 -w34189
Project MESSAGE: QMAKE_CFLAGS_AVX=-arch:AVX
Project MESSAGE: QMAKE_CHK_EXISTS=if not exist %1
Project MESSAGE: QMAKE_CXX=cl
Project MESSAGE: QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO=-O2 -MD -Zi
Project MESSAGE: QMAKE_CXXFLAGS=-nologo -Zm200 -Zc:wchar_t
Project MESSAGE: QMAKE_CXXFLAGS_LTCG=-GL
Project MESSAGE: QMAKE_DIR_REPLACE=OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR DESTDIR
Project MESSAGE: QMAKE_DEL_FILE=del
Project MESSAGE: QMAKE_DEL_DIR=rmdir
Project MESSAGE: QMAKE_DIRLIST_SEP=;
Project MESSAGE: QMAKE_DIR_SEP=\
Project MESSAGE: QMAKE_EXTENSION_STATICLIB=lib
Project MESSAGE: QMAKE_EXT_PKGCONFIG=.pc
Project MESSAGE: QMAKE_EXT_OBJ=.obj
Project MESSAGE: QMAKE_EXT_YACC=.y
Project MESSAGE: QMAKE_EXT_CPP=.cpp .cc .cxx
Project MESSAGE: QMAKE_EXT_H_MOC=.cpp
Project MESSAGE: QMAKE_EXT_UI=.ui
Project MESSAGE: QMAKE_EXT_LEX=.l
Project MESSAGE: QMAKE_EXT_CPP_MOC=.moc
Project MESSAGE: QMAKE_EXT_H=.h .hpp .hh .hxx
Project MESSAGE: QMAKE_EXT_C=.c
Project MESSAGE: QMAKE_EXT_RES=.res
Project MESSAGE: QMAKE_EXT_LIBTOOL=.la
Project MESSAGE: QMAKE_EXT_JS=.js
Project MESSAGE: QMAKE_EXT_PRL=.prl
Project MESSAGE: QMAKE_HOST.arch=x86
Project MESSAGE: QMAKE_HOST.version=144
Project MESSAGE: QMAKE_HOST.os=Windows
Project MESSAGE: QMAKE_H_MOD_MOC=moc_
Project MESSAGE: QMAKE_HOST.name=LESAV
Project MESSAGE: QMAKE_HOST.version_string=Unknown
Project MESSAGE: QMAKE_IDL=midl
Project MESSAGE: QMAKE_INCDIR=
Project MESSAGE: QMAKE_LIBS_CORE=kernel32.lib user32.lib shell32.lib uuid.lib ole32.lib advapi32.lib ws2_32.lib
Project MESSAGE: QMAKE_LIBS_COMPAT=advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32.lib ws2_32.lib
Project MESSAGE: QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO=/DEBUG /OPT:REF /INCREMENTAL:NO
Project MESSAGE: QMAKE_LFLAGS_DLL=/DLL
Project MESSAGE: QMAKE_LIBS_GUI=gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib user32.lib advapi32.lib
Project MESSAGE: QMAKE_LIBS_OPENGL_ES2_DEBUG=libEGLd.lib libGLESv2d.lib gdi32.lib user32.lib
Project MESSAGE: QMAKE_LFLAGS_LTCG=/LTCG
Project MESSAGE: QMAKE_LFLAGS=/NOLOGO /DYNAMICBASE /NXCOMPAT
Project MESSAGE: QMAKE_LINK=link
Project MESSAGE: QMAKE_LIBS_OPENGL_ES2=libEGL.lib libGLESv2.lib gdi32.lib user32.lib
Project MESSAGE: QMAKE_LFLAGS_CONSOLE=/SUBSYSTEM:CONSOLE
Project MESSAGE: QMAKE_LFLAGS_WINDOWS=/SUBSYSTEM:WINDOWS
Project MESSAGE: QMAKE_LEXFLAGS=
Project MESSAGE: QMAKE_LFLAGS_DEBUG=/DEBUG
Project MESSAGE: QMAKE_LIBS_OPENGL=glu32.lib opengl32.lib gdi32.lib user32.lib
Project MESSAGE: QMAKE_LIBS_QT_ENTRY=-lqtmain
Project MESSAGE: QMAKE_LFLAGS_EXE="/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"
Project MESSAGE: QMAKE_LFLAGS_RELEASE=/INCREMENTAL:NO
Project MESSAGE: QMAKE_LIB=lib /NOLOGO
Project MESSAGE: QMAKE_LEX=flex
Project MESSAGE: QMAKE_LN_SHLIB=copy /y
Project MESSAGE: QMAKE_LIBS_NETWORK=ws2_32.lib
Project MESSAGE: QMAKE_MOD_YACC=_yacc
Project MESSAGE: QMAKE_MKDIR=mkdir
Project MESSAGE: QMAKE_MOD_LEX=_lex
Project MESSAGE: QMAKE_MKDIR_CMD=if not exist %1 mkdir %1 & if not exist %1 exit 1
Project MESSAGE: QMAKE_MOVE=move
Project MESSAGE: QMAKE_PLATFORM=win32
Project MESSAGE: QMAKE_QT_CONFIG=E:/QT_WORK_DIR/qt540-msvc2010/5.4/msvc2010_opengl/mkspecs/qconfig.pri
Project MESSAGE: QMAKE_QMAKE=E:/QT_WORK_DIR/qt540-msvc2010/5.4/msvc2010_opengl/bin/qmake.exe
Project MESSAGE: QMAKE_RUN_CC= -c -Fo$obj $src
Project MESSAGE: QMAKE_RC=rc
Project MESSAGE: QMAKE_RUN_CXX= -c -Fo$obj $src
Project MESSAGE: QMAKE_RUN_CC_IMP= -c -Fo$@ $<
Project MESSAGE: QMAKE_RUN_CC_IMP_BATCH= -c -Fo$@ @<<
Project MESSAGE: QMAKE_RUN_CXX_IMP= -c -Fo$@ $<
Project MESSAGE: QMAKE_RUN_CXX_IMP_BATCH= -c -Fo$@ @<<
Project MESSAGE: QMAKE_SYMBOLIC_LINK=copy /y
Project MESSAGE: QMAKE_SH=
Project MESSAGE: QMAKE_STREAM_EDITOR= -install sed
Project MESSAGE: QMAKE_TARGET.arch=x86
Project MESSAGE: QMAKE_YACC=byacc
Project MESSAGE: QMAKE_YACCFLAGS=-d
Project MESSAGE: QMAKE_ZIP=zip -r -9