-
Notifications
You must be signed in to change notification settings - Fork 7
FwTemplateCPPWalkthrough
fw-template-Cxx is a C development template for framewerk. It is very similar to fw-template-C and like it features:
- automake setup: libtool and compiler setup done for you.
- pkg-config integration: pkg-config files for your project are made for you. In addition, if any dependencies provide pkg-config files they are used, generally eliminating the need for AC_CHECK_LIBS and AC_CHECK_HEADERS.[1]
- valgrind integration: standard targets for running make check with valgrind.
- coverage integration: standard configure and make check support for enabling coverage analysis. guards against releasing packages with coverage enabled.
This walkthrough demonstrates fw-template-cxx.
It's very helpful to have done the framewerk walkthrough and the fw-template-c walkthrough.
First, set up the project with fw-init in the usual way.
% env CVSROOT="YOURCVSROOT" fw-init --name myproject --template Cxx --revision cvs
Changing directory into the project,
% cd myproject/
% cvs -n -q up
A .cvsignore
A AUTHORS
A ChangeLog
A Makefile.am.local
A NEWS
A README
A bootstrap
A configure.ac.local
A fw-pkgin/.cvsignore
A fw-pkgin/Makefile.am.local
A fw-pkgin/config
A fw-pkgin/post-install
A fw-pkgin/post-remove
A fw-pkgin/pre-install
A fw-pkgin/pre-remove
A fw-pkgin/start
A fw-pkgin/stop
A src/.cvsignore
A src/Makefile.am.local
A src/mylib.cc
A src/mylib.hh
A src/myprog.cc
A tests/.cvsignore
A tests/Makefile.am.local
A tests/testprog.cc
This template is almost identical to fw-template-c. This is not necessarily because C++ development is almost identical. It's more due to the fact that I haven't done alot of C++ since writing framewerk and so I haven't really explored the possibilities.
Here are the differences:
- the automake macros for C++ compiler set up are called.
- AC_LANG is set to C++ .
- the automatically generated header is called PROJECTNAME.hh, and includes all .hh files in
src/
. - the options for hardcore compilation are slightly tweaked.
That's it! So you should really read the fw-template-c walkthrough.
Congratulations! You've made it through the fw-template-cxx walkthrough. Hopefully you found it helpful.
So I've discovered this is true if you and all your consumers are using a packaging format (because pkg-config files are found by querying the package system for files ending in .pc provided by a dependency). Once you start making dist tarballs that you want to work anywhere, you have to start manually finding the .pc files again. :(