PBA-cbs bootstrapping of portable C++ project

Version 2.1 by christoph_lechleitner@iteg_at on 2012-07-20 06.31:00

Setting up a portable C++ project still is a pain in the ass, especially if it shall be portable.

When trying to automate it in some way, we came to the conclusion that a full example in a public subversion repository is a good solutions because it's easy to use for you and easy to maintain for us.

HowTo ...

These are the steps for an ultra fast bootstrapping of a portable project relying on pba-cbs and our incarnation of the MinGW cross compilation toolchain.

Prepare

Just to avoid frustration: You need the pba-cbs package installed, using i.e. the pba debsource from https://deb.clazzes.org.

pba-cbs depends on required packages, but do not forget subversion, gcc, ...

Retrieve the sceleton

Decide for the main name of your app:

MYAPPNAME="myapp"

Export our example from public svn:

svn export "https://svn.clazzes.org/svn/pba/trunk/pba-helloworld-portable" $MYAPPNAME
Rename and search'n'replace

Rename some stuff and have the inlcude files adapted:

cd $MYAPPNAME
 
scripts/rename_main_files.sh $MYAPPNAME
Adapt debian information ...

If you want debian-packages, edit them, change my name and e-mail to yours and adapt the description:

$EDITOR debian*/control debian*/changelog
... or drop debian/

If you do not want debian packages, just remove the debian directory:

rm -rf debian*
Adapt the Windows rc template ...

If you want windows binaries, edit the resoure template:

$EDITOR src/*.rc

Do not forget to change the icon, too!

... or remove it

If you do not want windows binaries, remove it:

rm src/*.rc

In most cases you just broke the windows build!

Optional: Activate svn or another revision control

Now (and before any build activity) is a very good time to put your project under subversion control:

svn add .

You might also want to fill svn:ignore properties of some directories:

scripts/set_svn_ignore.sh
Optional: build it

To produce a debian package, just:

pba-build -u
 
# or dpkg-build*

We will soon add debian-mingw-*/ directories and NSIS installers, for now for Windows just use make:

make -C build/win32/release/

make -C build/win64/release/