|
From: Francesco M. <f18...@ya...> - 2005-12-14 21:12:33
|
Hi,
John Labenski wrote:
> What's the best way to add multiple samples to wxCode's bakefiles?
>
> I was thinking that we could add the ability for 4 samples using the
> bakefiles. We'll keep the current naming scheme the same, but just
> append 2,3,4,... for addition samples. We just need to add this code
> duplicate of existing code).
>
> build/bakefiles/templates.bkl
>
> <set var="PCOMP_SAMPLE_HDR2">$(''.join([(COMP_SAMPLE_DIR2 + DIRSEP
> + '%s ') % (x) for x in COMP_SAMPLE_HDR2.split()]))</set>
>
> <set var="PCOMP_SAMPLE_SRC2">$(''.join([(COMP_SAMPLE_DIR2 + DIRSEP
> + '%s ') % (x) for x in COMP_SAMPLE_SRC2.split()]))</set>
>
>
> <template id="compsample2" template="compsamplebasic">
> <app-type>gui</app-type>
> <headers>$(PCOMP_SAMPLE_HDR2)</headers>
> <sources>$(PCOMP_SAMPLE_SRC2)</sources>
> <dirname>$(COMP_SAMPLE_DIR2)</dirname>
> <res-include>$(COMP_SAMPLE_DIR2)</res-include>
>
> <!-- this template needs to be completed by the "library" tag
> which cannot be placed here since we don't know the name of
> the lib target for this component -->
> </template>
>
> repeat for 3 and 4.
>
> ---------------------------------------
> build/bakefiles/defaults.bkl
>
> <set var="COMP_SAMPLE_DIR2">$(COMP_BASEPATH)$(DIRSEP)samples</set>
> <set var="COMP_SAMPLE_DIR3">$(COMP_BASEPATH)$(DIRSEP)samples</set>
> <set var="COMP_SAMPLE_DIR4">$(COMP_BASEPATH)$(DIRSEP)samples</set>
>
> -------------------
>
Good idea !
This will make much easier to add additional samples to wxCode components.
However I think that also another small addition will be required; something like:
<set var="COMP_SAMPLE_HDR2" overwrite="0"/>
<set var="COMP_SAMPLE_SRC2" overwrite="0"/>
<set var="COMP_SAMPLE_HDR2" overwrite="0"/>
<set var="COMP_SAMPLE_SRC2" overwrite="0"/>
...
otherwise Bakefile will complain about the missing definitions of those vars...
> If there's a better way, let me know, otherwise I'll commit this in
> the next day or so.
I think there is not real better way... also with version 0.2.0 of bakefile (which
hopefully will happen soon and will have my patches into it) I'll be able to simplify a
lot wxCode bakefiles and also improve a lot of things (like options names which will be
made the sames of wxWidgets, uninstall support, etc).
Thanks,
Francesco
|