開発準備
はじめに
大規模なアプリケーション開発時にはいちいちファイルのコンパイルなどするのが面倒です。
また、システムによって使えるコードが違う場合などがあり、いちいち対応するのも面倒です。
ということで、KDEアプリケーション開発のひな型を用意します。
ひな型
template.tar.gzをダウンロードし、展開すると以下のファイルが現れます。
- template
- Makefile.am
- Makefile.cvs
- admin
- CVS
- Entries
- Repository
- Root
- Tag
- ChangeLog
- Doxyfile.am
- Doxyfile.global
- Makefile.common
- acinclude.m4.in
- am_edit
- compile
- conf.change.pl
- config.guess
- config.pl
- config.sub
- configure.in.bot.end
- configure.in.min
- cvs-clean.pl
- cvs.sh
- debianrules
- depcomp
- detect-autoconf.sh
- install-sh
- libtool.m4.in
- ltcf-c.sh
- ltcf-cxx.sh
- ltcf-gcj.sh
- ltconfig
- ltmain.sh
- missing
- mkinstalldirs
- new-libtool.m4.in
- new-ltmain.sh
- nmcheck
- old-libtool.m4.in
- old-ltcf-c.sh
- old-ltcf-cxx.sh
- old-ltcf-gcj.sh
- old-ltconfig
- old-ltmain.sh
- ylwrap
- CVS
- configure.in.in
- myapp
- Makefile.am
- main.cpp
- myapp.cpp
- myapp.desktop
- myapp.h
myapp.xpm
- pics
- Makefile.am
- hicolor
- Makefile.am
- hi16-app-myapp.xpm
- hi32-app-myapp.xpm
説明
新たにアプリケーション開発する場合以下の手順で始めます。
- myappのディレクトリ名をアプリケーション名に変更する
- 各ファイル(名)のmyappや@myapp@をアプリケーション名に変更する
- Makefile.am、myapp.desktop、hi(16|32)-app-myapp.xpmの名前と内容を各自のアプリケーションに沿ったものに変更する
- main.cpp内の@???@を各自のものに変更する
- myapp.h、myapp.cppの名前を変更しプログラムを作る
- 新たにソース、ヘッダーファイルを追加する場合はMakefile.amを修正する
- 新たにアプリケーションを追加する場合はtempalteディレクトリにmyappディレクトリと同じ内容のものをコピーし1.から始める
それ以外のファイル
- Makefile.am
- Makefile.cvs
- admin/*
- configure.in.in
については変更の必要がありません。
コンパイルの仕方
templateディレクトリで以下のようにします。
$ ./configure
$ make
個々のアプリケーションをコンパイルする場合はmyappディレクトリで
とします。
(アン)インストールの仕方
templateディレクトリでrootで以下のようにします。
# make uninstall
配布ファイルの作り方
$ cd ..
$ tar cvzf myapp.tar.gz template
おわりに
以上のようなことがKDE開発の一般的な方法らしいです。
私自身KDE開発初心者なので間違いなどあるかと思いますがとりあえずこういう風に始めます。
2003/08/31
Vine Plusのkdesdk内に「kapptemplate」というアプリケーションがあって、これが上記のものの元(を作る)みたいです。
しかし、automake1.6がないと言われ残念ながらつかえません。