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