added bakefile presets for creation of user makefiles
[wxWidgets.git] / build / bakefiles / wxpresets / presets / wx_win32.bkl
1 <?xml version="1.0" ?>
2 <!-- $Id$ -->
3
4 <!-- Original source: http://wiki.wxwidgets.org/wiki.pl?Bakefile    -->
5 <!-- Modified by: Francesco Montorsi <frm@users.sourceforge.net>    -->
6 <!--              Vaclav Slavik <vslavik@fastmail.fm> to better fit
7                   into Bakefile's presets                           -->
8 <!-- Creation date: 6/9/2004                                        -->
9 <!-- Last revision: 22/1/2005 off-CVS                               -->
10 <!--                $Id$ -->
11
12
13 <!--
14
15 FIXME: this template has (at least) the following bugs:
16
17  * it's MSW-only, the port is assumed to be wxMSW unconditionally
18
19  * multiple wx configurations (CFG variable set when building the
20    library) are not supported
21
22 -->
23
24 <!-- makefile tag signifies the beginning of the bakefile           -->
25 <makefile>
26
27     <requires version="0.1.5"/>
28
29     <!--                        OPTIONS                             -->
30     <!--                                                            -->
31     <!--    These are essentially the configurations you            -->
32     <!--    want in bakefile.                                       -->
33     <!--                                                            -->
34     <!--    In MSVC these are the different build                   -->
35     <!--    configurations you can have (in the build menu),        -->
36     <!--    and in autoconf is enabled with enable-xxx=xx.          -->
37     <!--    For other compilers a seperate configuration            -->
38     <!--    file is created (such as config.gcc on gcc)             -->
39     <!--    which has several options a user can modify.            -->
40     <!--                                                            -->
41     <!--    Note that the above only happens if an option           -->
42     <!--    is not constant, i.e. if it cannot be determined        -->
43     <!--    by bakefile itself.                                     -->
44
45     <!-- The directory where wxWidgets is installed: -->
46     <option name="WX_DIR" category="path">
47         <default-value>$(DOLLAR)(WXWIN)</default-value>
48         <description>
49             The directory where wxWidgets library is installed
50         </description>
51     </option>
52
53     <!--    This is a standard option that determines               -->
54     <!--    whether the user wants to build this library as         -->
55     <!--    a dll or as a static library.                           -->
56     <option name="WX_SHARED">
57         <values>0,1</values>
58         <values-description>,DLL</values-description>
59         <default-value>0</default-value>
60         <description>
61             Use DLL build of wx library to use?
62         </description>
63     </option>
64
65     <!-- Configuration for building the bakefile with               -->
66     <!-- unicode strings or not (unicode or ansi).                  -->
67     <option name="WX_UNICODE">
68         <values>0,1</values>
69         <values-description>,Unicode</values-description>
70         <default-value>0</default-value>        
71         <description>
72             Compile Unicode build of wxWidgets?
73         </description>
74     </option>
75
76     <option name="WX_DEBUG">
77         <values>0,1</values>
78         <values-description>,Debug</values-description>
79         <default-value>1</default-value>
80         <description>
81             Use debug build of wxWidgets (define __WXDEBUG__)?
82         </description>
83     </option>
84
85     <option name="WX_VERSION">
86         <default-value>25</default-value>
87         <description>
88             Version of the wx library to build against.
89         </description>
90     </option>
91
92     <!--                     HELPER VARIABLES                       -->
93     <!--                                                            -->
94     
95     
96     <!--    The unicode define we want.  By default bakefile        -->
97     <!--    makes variables an empty string, so if unicode          -->
98     <!--    is not defined $(UNICODE_DEFINE) would expand           -->
99     <!--    to nothing (literally).                                 -->
100     <set var="WXUNICODE_DEFINE">
101         <if cond="WX_UNICODE=='1'">_UNICODE</if>
102     </set>    
103     
104     <!--    The debug define we need with win32 compilers           -->    
105     <!--    (on Linux, the wx-config program is used).              -->    
106     <set var="WXDEBUG_DEFINE">        
107         <if cond="WX_DEBUG=='1'">__WXDEBUG__</if>    
108     </set>
109
110     <!--    These are handy ways of dealing with the                -->
111     <!--    extensions in the library names of the                  --> 
112     <!--    wxWindows library.                                      -->
113     <set var="WXLIBPOSTFIX">
114         <if cond="WX_DEBUG=='1' and WX_UNICODE=='1'">ud</if>
115         <if cond="WX_DEBUG=='1' and WX_UNICODE=='0'">d</if>
116         <if cond="WX_DEBUG=='0' and WX_UNICODE=='1'">u</if>
117     </set>
118     <set var="WXSUBLIBPOSTFIX">
119         <if cond="WX_DEBUG=='1' and WX_UNICODE=='0'">d</if>
120     </set>
121
122     <set var="WXLIBPATH">
123         <if cond="WX_SHARED=='0'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)_lib</if>
124         <if cond="WX_SHARED=='1'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)_dll</if>
125     </set>
126
127     <set var="WXLIBINCLUDE">$(WXLIBPATH)$(DIRSEP)msw$(WXLIBPOSTFIX)</set>
128     
129     
130     <!--                        WX TEMPLATE                         -->
131     <!--                                                            -->
132     <!--                                                            -->
133     <!--    While not required, templates make your                 -->
134     <!--    bakefiles much more readable.  Templates, in            -->
135     <!--    essence, are abstract classes like c++.                 -->
136     <!--                                                            -->
137     <!--    Your build targets "inherit" the template,              -->
138     <!--    along with the info associated with the template        -->
139
140     <!--                                                            -->
141     <!--                wxWidgets LIBRARY/APP TEMPLATE              -->
142     <!--                                                            -->
143     <!--    The "base class" of all our build targets               -->
144     <!--    This links with the appropriate native                  -->
145     <!--    libraries required by the platform, the libaries        -->
146     <!--    we want for our stuff, and the wxWindows libs.          -->
147
148
149     
150     <!-- this tag is used to include wx libraries: -->
151     <define-tag name="wx-lib" rules="exe,dll,module">
152         <if cond="value=='base'">
153             <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)</sys-lib>
154         </if>
155         <if cond="value in ['net','xml']">
156             <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)</sys-lib>
157         </if>
158         <if cond="value not in ['base','net','xml']">
159             <sys-lib>wxmsw$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)</sys-lib>
160         </if>
161     </define-tag>
162
163     <!-- just a placeholder to mark the place where <wx-lib> will be placed,
164          thanks to the order precedence declaration below it: -->
165     <define-tag name="__wx-libs-point" rules="exe,dll,module"/>
166     <tag-info name="wx-lib"
167               position="before:__wx-libs-point"/>
168     
169
170     <template id="wx">
171         <!--                    MISCELLANEOUS                       -->
172         <if cond="FORMAT=='mingw'">                    
173             <define>HAVE_W32API_H</define>
174             <ldflags>-mthreads</ldflags>
175         </if>
176
177         <define>$(WXUNICODE_DEFINE)</define>
178         <define>$(WXDEBUG_DEFINE)</define>        
179         <define>__WXMSW__</define>
180
181         <include>$(WX_DIR)$(WXLIBINCLUDE)</include>
182         <include>$(WX_DIR)/include</include>
183
184         <lib-path>$(WX_DIR)$(WXLIBPATH)</lib-path>
185
186         <!-- wx libs must come before 3rd party and sys libs, this is
187              the place where the hack explained above is carried on: -->
188         <__wx-libs-point/>
189
190         <!-- wx 3rd party libs, always use them: -->
191         <sys-lib>wxtiff$(WXSUBLIBPOSTFIX)</sys-lib> 
192         <sys-lib>wxjpeg$(WXSUBLIBPOSTFIX)</sys-lib> 
193         <sys-lib>wxpng$(WXSUBLIBPOSTFIX)</sys-lib> 
194         <sys-lib>wxzlib$(WXSUBLIBPOSTFIX)</sys-lib> 
195         <!-- For regex we won't use the WXSUBLIBPOSTIX postfix: 
196              unliked tiff, jpeg, png, zlib, expat, when building
197              in Unicode mode, the "u" suffix is appended to regex -->
198         <sys-lib>wxregex$(WXLIBPOSTFIX)</sys-lib> 
199         <sys-lib>wxexpat$(WXSUBLIBPOSTFIX)</sys-lib>
200    
201         <!-- link-in system libs that wx depends on: -->
202         <!-- If on borland, we don't need to do much            -->
203         <if cond="FORMAT=='borland'">
204             <sys-lib>ole2w32</sys-lib>
205         </if>
206
207         <!-- Non-borland, on the other hand...                  -->
208         <if cond="FORMAT!='borland'">
209             <sys-lib>kernel32</sys-lib>
210             <sys-lib>user32</sys-lib>
211             <sys-lib>gdi32</sys-lib>
212             <sys-lib>comdlg32</sys-lib>
213             <sys-lib>winspool</sys-lib>
214             <sys-lib>winmm</sys-lib>
215             <sys-lib>shell32</sys-lib>
216             <sys-lib>comctl32</sys-lib>
217             <sys-lib>ole32</sys-lib>
218             <sys-lib>oleaut32</sys-lib>
219             <sys-lib>uuid</sys-lib>
220             <sys-lib>rpcrt4</sys-lib>
221             <sys-lib>advapi32</sys-lib>
222             <sys-lib>wsock32</sys-lib>
223             <sys-lib>odbc32</sys-lib>
224         </if>
225
226         <!-- Libs common to both borland and MSVC               -->
227         <if cond="FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'">
228             <sys-lib>oleacc</sys-lib>
229         </if>
230     </template>
231
232 </makefile>