• 5509阅读
  • 0回复

[共享]windows系统mingw编译qt自动化批处理脚本 [复制链接]

上一主题 下一主题
离线cndiablocn
 

只看楼主 倒序阅读 楼主  发表于: 2012-03-29
前期准备工作下载mingw和perl,修改 set path=R:\mingw32\bin;R:\Perl\bin 这一行改为你自己mingw和perl的路径,把下面的脚本存为bat文件或直接下载下面的qt-自动编译,放到qt源代码目录下即可,例如:R:\qt-everywhere-opensource-src-4.8.1,改完路径后,运行即可

下载perl
http://www.perl.org/
下载mingw
http://www.mingw.org/
下载mingw64和mingw32
http://mingw-w64.sourceforge.net/
下载qt-自动编译.7z bat文件
http://115.com/file/be69q3qw
jom源码下载
ftp://ftp.qt.nokia.com/jom/


// bat



@echo offset path=R:\mingw32\bin;R:\Perl\bin;
set QTDIR=%cd%title 编译QT - cnhemiya@gmail.com

echo -- 配置 --
pauseconfigure -platform win32-g++ -opensource -debug-and-release -qt-style-windowsxp -qt-style-windowsvista -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde -no-qt3support -no-script -no-scripttools -no-webkit -nomake examples -nomake demos

echo -- 编译 --
time /tpause
jom -f Makefile

echo -- 编译结束,开始清理无用的文件 --time /t
pause

rd /s /q includecd bin
perl.exe -S syncqt

echo -- strip --cd ../lib
for /f "delims=" %%i in ('dir /b /a-d /s "*d4.dll"') do strip %%i

cd ../importsfor /f "delims=" %%i in ('dir /b /a-d /s "*d4.dll"') do strip %%i

cd ../plugins
for /f "delims=" %%i in ('dir /b /a-d /s "*d4.dll"') do strip %%i

echo -- 删除bin目录下的debug dll和bat --cd ../bin
del /q *d4.dlldel /q createpackage
del /q createpackage.batdel /q createpackage.pl
del /q elf2e32_qtwrapperdel /q elf2e32_qtwrapper.bat
del /q elf2e32_qtwrapper.pldel /q patch_capabilities
del /q patch_capabilities.batdel /q patch_capabilities.pl
del /q syncqtdel /q syncqt.bat
del /q findtrdel /q setcepaths.bat

echo -- 删除translations的ts --
cd ../translationsdel /q *.ts
del /q check-ts.pldel /q check-ts.xq
del /q polish.qphdel /q README

echo -- 删除目录,pri,pro文件 --
cd ..rd /s /q src
rd /s /q config.profilesrd /s /q config.tests
rd /s /q demosrd /s /q doc
rd /s /q examplesrd /s /q qmake
rd /s /q templatesrd /s /q tools
rd /s /q utildel /s /q *.pri
del /s /q *.prodel /q *LICENSE*

echo -- 结束 --
time /tpause
快速回复
限100 字节
 
上一个 下一个