2009年5月4日星期一

Configure Codeblocks For Qt on Windows

将安装目录下\MinGW\bin内的mingw32-make文件复制并改名为make。

1.在Code::Blocks里选择Tools —> Configure tools... 添加两个新的工具
A.第一个工具,在弹出的工具编辑框中依次填入
Name: create Qt.pro file
Executable: c:\Qt\4.4.3\bin\qmake.exe (即本机上qmake的绝对路径)
Parameters: -project
Working directory: ${PROJECT_DIR}
下面的Launching options选择 Launch tool hidden with standard output redirected (这样就不会跳出命令行窗口)

B.第二个工具,在弹出的工具编辑框中依次填入
Name: create Qt makefile
Executable: c:\Qt\4.4.3\bin\qmake.exe (即本机上qmake的绝对路径)
Parameters: -makefile
Working directory: ${PROJECT_DIR}
下面的Launching options选择 Launch tool hidden with standard output redirected (这样就不会跳出命令行窗口)

4.选择Project —> Properties... —> Project settings,在"This is a custom Makefile"前打勾,这样就会启用Makefile来编译
5.转到Build targets,将output filename由bin\Debug\xxx.exe改成Debug\xxx.exe,即去掉前面的bin\
6.选择Project —> Build options... —> "Make" commands,修改两个地方
Clean project/target: $make -f $makefile $target-clean
Dist-clean project/target: $make -f $makefile $target-distclean

所有地方都设置好了,接下来只要在Build前,先在Tools下依次运行create Qt.pro file和create Qt makefile (只需在项目有文件添加和删除的情况下需要运行一遍)

没有评论:

发表评论

关于我

我的照片
从事计算机软件应用软件开发,4年经验,做过若干个项目,涉及电信、安防、视频等领域。

他/她/它 来过