|
Boost-Build : |
From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-01-11 02:28:36
Hi All,
I have been working on developing a portable UI framework. My current
implementation makes use of a platform.jam file. The file consists of a
definition of the platform:
import feature : feature compose ;
feature platform
:
windows macintosh unix palm generic
:
propagated
;
Where generic is a platform-independant API such as wxWidgets. This
forms the basis for api which defines the C/C++ library used to target
the UI framework:
feature api
:
win wtl mfc # windows
cocoa # macintosh
x11 # *nix
palmos # palm
wx qt # generic
:
composite propagated
;
feature.compose <api>win : <define>_USE_NATIVE ;
feature.compose <api>wtl : <define>_USE_WTL ;
feature.compose <api>mfc : <define>_USE_MFC ;
feature.compose <api>cocoa : <define>_USE_NATIVE ;
feature.compose <api>x11 : <define>_USE_NATIVE ;
feature.compose <api>palmos : <define>_USE_NATIVE ;
feature.compose <api>wx : <define>_USE_WX ;
feature.compose <api>qt : <define>_USE_QT ;
What I would like to do is add support for graphics and UI sub-api so
you could do:
bjam release msvc-7.1 api=win-gdiplus
bjam release gcc-3.3 api=wx-win-wx
Is it also possible to extend what I have above, or do I need symmetric
like the toolset definition? How would this affect the directory path?
I am using the above to declare the libraries like this:
# platform specific details and entry point
import platform ;
project platform
: requirements
<include>.
;
obj ui_entry
:
../platform/src/entry.cpp
: :
<user-interface>gui
;
where src/entry.cpp is defined as:
#include <boost/platform/platform.hpp>
#include PLATF_INCLUDE(src,entry.cpp)
to allow the correct source to be included for the specific platform.
Thoughts? Comments?
Regards,
Reece
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk