如何在kdevelop中添加appwizard

kdevelop 是linux的一个program-IDE,类似WINDOWS下的VC,当然我认为没有VC好用,毕尽是个开源代码,不过在LINUX下他也是一个不错的IDE了。而且只要你有兴趣,你可以订制修改KDEVELOP的源代码。

由于项目需要,最近研究了一下kdevelop的APPWIZARD。并且自己做了一个WIZARD,这个WIZARD是生成高通公司(BREW)手机上的一个HELLOWORD,并且编译生成.SO库。

下面介绍一下如何通过在kdevelop源代码中编写这样一个WIZARD:

?? 1.你可以看到所有的KDEVELOP的wizard都在目录??? $(kdevelop_src)/language/cpp/app_templates

2.先了解一下在每个wizard目录下面都有几个关键的文件(比如cpphello):

??app.kdevelop --这里记录了生成wizard时的一些信息,比如author,email,以及创建wizard后的一些编译选项,如cppflags等

?cpphello? --- 这是一个配置文件,描述wizard的一些信息,比如

? src-Makefile.am -- 创建wizard时生成的makefile.am

?script -- 创建wizard时执行的perl脚本

configure.in -- 创建wizard时生成的configure.in

3. 编写自己的wizard:

?几个关键文件如下

?app.kdevelop --- 和cpphello中的一样

?mywizard -- 配置文件

# KDE Config File
[General]
Name=mywiard
Name[fr]=Un simple programme de test ?Hello world ?
Icon=chello.png
Category=C++
Comment=Generates a simple Hello world program in brew-handset FrameWorld
Comment[fr]=G閚鑢e un simple programme de test du type ?Hello world ?dans le language C.
FileTemplates=h,CStyle,cpp,CStyle
ShowFilesAfterGeneration=src/APPNAMELC.cpp

src-Makefile.am -- 这个makefile可以使源代码生成.so

lib_LTLIBRARIES = lib$APPNAMELC$.la
#$APPNAMELC$_SOURCES = $APPNAMELC$.c AEEModGen.c AEEAppGen.c
lib$APPNAMELC$_la_SOURCES = $APPNAMELC$.cpp AEEModGen.c AEEAppGen.c

# set the include path found by configure
INCLUDES= $(all_includes)

script -- 创建wizard时执行的脚本,用来拷贝一些文件

#!/usr/bin/perl

use kdevelop;

initKDevelop();
installFileTemplate();
installLicense();
installIncAdmin();
installGNU();

print "Installing project file/n";
install( "${src}/template-cppapplecore/app.project",???? "${dest}/${APPNAMELC}.project" );

print "Installing application framework/n";
mkdir( "${dest}/src", 0777 );
install( "${src}/template-cppapplecore/cpp-Makefile.am",? "${dest}/Makefile.am" );
install( "${src}/template-cppapplecore/cpp-Makefile.cvs", "${dest}/Makefile.cvs" );
install( "${src}/template-cppapplecore/configure.in",???? "${dest}/configure.in" );


print "Installing application sources/n";
install( "${src}/template-cppapplecore/src-Makefile.am",? "${dest}/src/Makefile.am" );
${APPNAMELC}.cpp" );
install( "${src}/template-cppapplecore/helloworld.c",????????? "${dest}/src/${APPNAMELC}.c" );
install( "${src}/template-cppapplecore/aeemodgen.c",????????? "${dest}/src/AEEModGen.c" );
install( "${src}/template-cppapplecore/aeeappgen.c",????????? "${dest}/src/AEEAppGen.c" );
install( "${src}/template-cppapplecore/helloworld.bid",????????? "${dest}/src/helloworld.bid" );

?

print "Finished/n";

configure.in -- 可以和cpphello下个一样

4. 除此之外,你要保证执行script 拷贝的文件都在目录下,比如我的wizard就要有aeemodgen.c,aeeappgen.c,helloworld.c等

?编写一个wizard就这么容易,如果要在kdeveop 启动时看到自己的wiard, 在

$(kdevelop_src)/language/cpp/app_templates下的Makefile.am下加入自己的mywizard目录名字,重新编译kdevelop,并安装就可以了。你也可以到kdevelop站点察看相关资料,上面会告诉你如何写appwiard.

因为第一次写文章,自己也觉得写得不够清楚。不过我想以后会越写越好的。:)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值