]> git.saurik.com Git - wxWidgets.git/blob - build/bakefiles/wxpresets/presets/wx_xrc.bkl
Remove all lines containing cvs/svn "$Id$" keyword.
[wxWidgets.git] / build / bakefiles / wxpresets / presets / wx_xrc.bkl
1 <?xml version="1.0" ?>
2
3 <!--
4
5 Bakefile XRC support; included by wx.bkl, do not include directly.
6
7 Usage:
8
9 <exe id="myapp" template="wxgui,simple">
10 ...
11 <sources>...</sources>
12 ...
13 <xrc-file>myapp.xrc</xrc-file>
14 <xrc-file>file2.xrc</xrc-file>
15 </exe>
16
17 Then in application code, you have to call initialization for every XRC
18 file:
19
20 InitXMLResource_myapp();
21 InitXMLResource_file2();
22
23 -->
24
25 <makefile>
26
27 <!-- XRC section -->
28 <option name="WXRC" category="path">
29 <description>Path to find the wxrc executable.</description>
30 <default-value>wxrc</default-value>
31 </option>
32
33
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>
39
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>
47 <command>
48 $(WXRC) $(_wxrc_options) -o $(_xrc_cpp) $(_xrc)
49 </command>
50 </modify-target>
51 </if>
52 <if cond="FORMAT in ['msvc6prj','msvs2003prj','msvs2005prj']">
53 <sources>$(_xrc_file)</sources>
54 <!--
55 A hack to add XRC compilation step to MSVC projects.
56
57 NB: it's important to use backslashes and not slashes here.
58 -->
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)
63
64 "$(_xrc_cpp.replace('/','\\'))" : "$(DOLLAR)(INTDIR)"
65 $(TAB)$(WXRC) $(_wxrc_options) -o $(_xrc_cpp) $(_xrc_file)
66 </set>
67 </if>
68
69 </define-tag>
70
71 </makefile>