目的
1. 学习Qt5框架
2. 学习 VC++ 命令行工具链
本文编译环境
1. Windows 10(64-bit)
2. Visual Studio 2013 Express (with Update 4)
3. qt-everywhere-opensource-src-5.4.1.7z (源代码)
4. Perl: ActivePerl-5.20.1.2000-MSWin32-x86-64int-298557.msi
5. Python: python-2.7.9.msi
6. Ruby: rubyinstaller-1.9.3.p551.exe
步骤
0. 先查看一下 configure 的选项:configure -help
其中常用选项如下:
-debug 只编译出 debug 版本,是默认选项(相对于 -release 选项)
-debug-and-release 两种版本都编译
-opensource 使用 opensource 版本的Qt(相对于 -commercial 选项)
-c++11 打开 C++11 的支持
-shared 使用共享库,是默认选项(相对于 -static 选项)
-skip <module> 移除某模块
-make <part> 添加编译的部分:libs, tools, examples (相对于 -nomake)
-iconv 开启 iconv 的支持
-mp MSVC 多进程编译加速
-developer-build Compile and link Qt with Qt developer options (including auto-tests exporting)
-no-openssl 不编译 openssl
-no-iconv 不编译 iconv
-no-qml-debug 不编译 qml debug 的支持
1. 使用编译选项
configure -opensource -platform win32-msvc2013 -developer-build -mp -nomake examples -nomake tests -no-icu -no-openssl -no-iconv -no-qml-debug -skip qtactiveqt -skip qtconnectivity -skip qtdeclarative -skip qtdoc -skip qtenginio -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtquick1 -skip qtquickcontrols -skip qtscript -skip qtsensors -skip qtserialport -skip qtsvg -skip qttools -skip qttranslations -skip qtwebchannel -skip qtwebengine -skip qtwebkit -skip qtwebkit-examples -skip qtwebsockets -skip qtxmlpatterns
2. 编译并安装
nmake && nmake install
参考资料
·
http://www.cnblogs.com/lingdhox/p/3685360.html 的 configure 参数
·
http://doc.qt.io/qt-5/qtmodules.html Qt5 的模块列表
·
http://doc.qt.io/qt-5/configure-options.html Qt5 configure 的配置方法
(暂且写得比较精简,有机会再补充详细)