6 Bakefile XRC support; included by wx.bkl, do not include directly.
10 <exe id="myapp" template="wxgui,simple">
12 <sources>...</sources>
14 <xrc-file>myapp.xrc</xrc-file>
15 <xrc-file>file2.xrc</xrc-file>
18 Then in application code, you have to call initialization for every XRC
21 InitXMLResource_myapp();
22 InitXMLResource_file2();
29 <option name=
"WXRC" category=
"path">
30 <description>Path to find the wxrc executable.
</description>
31 <default-value>wxrc
</default-value>
35 <define-tag name=
"xrc-file" rules=
"exe,dll,lib">
36 <set var=
"_xrc_file">$(value)
</set>
37 <set var=
"_xrc_cpp">$(value.replace('.xrc', '_xrc.cpp'))
</set>
38 <set var=
"_xrc_base">$(value[value.rfind('/')+
1:value.rfind('.')])
</set>
39 <set var=
"_wxrc_options">-c -n InitXMLResource_$(_xrc_base)
</set>
41 <sources>$(_xrc_cpp)
</sources>
42 <if cond=
"FORMAT not in ['msvc6prj','msvs2003prj','msvs2005prj']">
43 <clean-files>$(_xrc_cpp)
</clean-files>
44 <add-target target=
"$(_xrc_cpp)" type=
"action"/>
45 <modify-target target=
"$(_xrc_cpp)">
46 <set var=
"_xrc">$(_xrc_file)
</set>
47 <depends-on-file>$(SRCDIR)/$(_xrc)
</depends-on-file>
49 $(WXRC) $(_wxrc_options) -o $(_xrc_cpp) $(_xrc)
53 <if cond=
"FORMAT in ['msvc6prj','msvs2003prj','msvs2005prj']">
54 <sources>$(_xrc_file)
</sources>
56 A hack to add XRC compilation step to MSVC projects.
58 NB: it's important to use backslashes and not slashes here.
60 <set var=
"_custom_build_files" append=
"1">$(_xrc_file.replace('/','\\'))
</set>
61 <set var=
"_custom_build_$(_xrc_file.replace('/','_').replace('.','_'))">
62 Compiling XRC resources: $(_xrc_file)...
63 InputPath=$(_xrc_file)
65 "$(_xrc_cpp.replace('/','\\'))" : "$(DOLLAR)(INTDIR)"
66 $(TAB)$(WXRC) $(_wxrc_options) -o $(_xrc_cpp) $(_xrc_file)