目的
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 的配置方法
(暫且寫得比較精簡,有機會再補充詳細)