5 Presets for building wxWidgets applications.
7 These presets provide the following "public" interface:
11 - WX_* : used to let the user of the generated makefile choose a wxWidgets
12 build among those available; you can use them in your project to
13 e.g. build a target only if WX_DEBUG is 0 or if WX_PORT is "msw".
18 - WXLIBPOSTFIX: contains the [u][d] string which is typically useful when
19 defining names of directories/files which should coexist
20 with other builds using different wxWidgets configurations.
25 - wx, wx-lib: templates to be used respectively for <dll>/<exe> and <lib>
26 targets; they add all the wxWidgets-related settings (e.g. the
27 include and library search paths, the __WXDEBUG__ symbol, etc)
29 - wxconsole: to be used when building console-only libraries or apps
30 (adds the wxUSE_GUI=0 define).
32 - wxlike: this template should be combined with "wx" or "wx-lib" and will
33 make your project build with the same Unicode, debug & shared
34 config as the wxWidgets build selected using the WX_* options.
39 - <wx-lib>: to define which wxWidgets libraries to link with;
40 please note that you should use them in the right order or
41 linking under Unix would result in errors, e.g.
46 is correct, but the reverse is not (if lib A depends on lib B, then
47 lib A must be listed before B). So <wx-lib>base</wx-lib>
48 (which must always be present) should be the last wx-lib tag.
51 <wxlike-dllname>: useful if you want to have a build logic similar to the
52 wxWidgets build logic which allows different builds to
53 coexist without conflicts. These tags helps you to name
54 libraries using the same wxWidgets rules and thus avoid
55 conflicts between libraries compiled in e.g. Unicode,
56 shared mode and those compiled in ANSI, shared mode &c.
58 - <wxlike-lib>: if your library/application needs to link with both
59 wxWidgets and some other wx-based library, which in turn
60 follows the wxWidgets naming conventions, then this tag is
61 what you need to reference the wx-based additional library.
63 - <wxlike-paths>: if your library/application needs to cpmpile & link with both
64 wxWidgets and some other wx-based library, which in turn
65 follows the wxWidgets naming conventions, then this tag is
66 what you need to add to the compiler and linker flags the paths
67 of the "include" and "lib" folders of the wx-based additional library.
72 - <set-wxlike-builddir>: sets BUILDDIR using wxWidgets naming rules to help
73 to keep object files compiled with different
77 NOTE: as a reference here is a list of all wxWidgets libraries satisfying
78 the dependency constraints mentioned in <wx-lib> description:
80 <wx-lib>richtext</wx-lib>
83 <wx-lib>dbgrid</wx-lib>
88 <wx-lib>media</wx-lib>
100 <!-- this variable identifies the version of the wx presets.
101 this is changed only when major changes to wxpresets take place. -->
102 <set var=
"WX_PRESETS_VERSION">4</set>
104 <!-- list of known libraries used by wx-lib tag defined in wx_unix.bkl and wx_win32.bkl
105 VERY IMPORTANT: when updating this list also update the <wx-lib> and <wx-all-libs>
109 base core net xml odbc xrc html adv media gl dbgrid qa aui richtext
112 <!-- NOTE: refer to the NET contrib using NETUTILS instead of NET
113 (which is already in LIB_LIST)
115 <set var=
"CONTRIBLIB_LIST">
116 applet deprecated fl foldbar gizmos mmedia netutils ogl plot stc svg
118 <set var=
"ALLLIB_LIST">$(LIB_LIST) $(CONTRIBLIB_LIST)
</set>
120 <!-- this is a temporary variable until there is non general -->
121 <!-- function in bakefiles for returning native markup for -->
122 <!-- reading envrionment variables -->
124 <if cond=
"FORMAT=='watcom'">%
</if>
125 <if cond=
"FORMAT!='watcom'"></if>
132 <!-- These are essentially the configurations you -->
133 <!-- want in bakefile. -->
135 <!-- In MSVC these are the different build -->
136 <!-- configurations you can have (in the build menu), -->
137 <!-- and in autoconf is enabled with enable-xxx=xx. -->
138 <!-- For other compilers a separate configuration -->
139 <!-- file is created (such as config.gcc on gcc) -->
140 <!-- which has several options a user can modify. -->
142 <!-- Note that the above only happens if an option -->
143 <!-- is not constant, i.e. if it cannot be determined -->
144 <!-- by bakefile itself. -->
145 <!-- Also note that for 'autoconf' format these options -->
146 <!-- are only useful when used together with wxpresets.m4 -->
147 <!-- macro file which contains macros for detecting the -->
148 <!-- option values for wx-based projects. See wxpresets.m4 -->
149 <!-- comments for more info. -->
152 <!-- Presets for limited dmars make.exe format: -->
153 <if cond=
"FORMAT=='dmars'">
154 <set var=
"WX_UNICODE">0</set>
155 <set var=
"WX_DEBUG">1</set>
156 <set var=
"WX_SHARED">0</set>
159 <!-- 'gnu' format needs to redefine the following options later in wx_unix.bkl -->
160 <if cond=
"FORMAT=='gnu'">
161 <set var=
"WX_UNICODE"/>
162 <set var=
"WX_DEBUG"/>
163 <set var=
"WX_SHARED"/>
165 <set var=
"WX_VERSION"/>
169 <!-- This is a standard option that determines -->
170 <!-- whether the user wants to build this library as -->
171 <!-- a dll or as a static library. -->
172 <if cond=
"not isdefined('WX_SHARED')">
173 <set var=
"WX_SHARED_DEFAULT" overwrite=
"0">0</set>
174 <option name=
"WX_SHARED">
176 <values-description>Static,DLL
</values-description>
177 <default-value>$(WX_SHARED_DEFAULT)
</default-value>
179 Use DLL build of wx library to use?
184 <!-- Configuration for building the bakefile with -->
185 <!-- unicode strings or not (unicode or ansi). -->
186 <if cond=
"not isdefined('WX_UNICODE')">
187 <set var=
"WX_UNICODE_DEFAULT" overwrite=
"0">0</set>
188 <option name=
"WX_UNICODE">
190 <values-description>ANSI,Unicode
</values-description>
191 <default-value>$(WX_UNICODE_DEFAULT)
</default-value>
193 Compile Unicode build of wxWidgets?
198 <if cond=
"not isdefined('WX_DEBUG')">
199 <set var=
"WX_DEBUG_DEFAULT" overwrite=
"0">1</set>
200 <option name=
"WX_DEBUG">
202 <values-description>Release,Debug
</values-description>
203 <default-value>$(WX_DEBUG_DEFAULT)
</default-value>
205 Use debug build of wxWidgets (define __WXDEBUG__)?
210 <if cond=
"not isdefined('WX_VERSION')">
211 <set var=
"WX_VERSION_DEFAULT" overwrite=
"0">28</set>
212 <option name=
"WX_VERSION">
213 <default-value>$(WX_VERSION_DEFAULT)
</default-value>
215 Version of the wx library to build against.
220 <if cond=
"not isdefined('WX_MONOLITHIC')">
221 <set var=
"WX_MONOLITHIC_DEFAULT" overwrite=
"0">0</set>
222 <option name=
"WX_MONOLITHIC">
224 <values-description>Multilib,Monolithic
</values-description>
225 <default-value>$(WX_MONOLITHIC_DEFAULT)
</default-value>
227 Use monolithic build of wxWidgets?
232 <!-- The directory where wxWidgets is installed: -->
233 <if cond=
"not isdefined('WX_DIR')">
234 <set var=
"WX_DIR_DEFAULT" overwrite=
"0">$(DOLLAR)($(ENV_VAR)WXWIN)
</set>
235 <option name=
"WX_DIR" category=
"path">
236 <default-value>$(WX_DIR_DEFAULT)
</default-value>
238 The directory where wxWidgets library is installed
245 <!-- HELPER VARIABLES -->
248 <!-- These are handy ways of dealing with the -->
249 <!-- extensions in the library names of the -->
250 <!-- wxWindows library. -->
251 <set var=
"WXLIBPOSTFIX">
252 <if cond=
"WX_DEBUG=='1' and WX_UNICODE=='1'">ud
</if>
253 <if cond=
"WX_DEBUG=='1' and WX_UNICODE=='0'">d
</if>
254 <if cond=
"WX_DEBUG=='0' and WX_UNICODE=='1'">u
</if>
260 <!-- this is just a wrapper that includes the real implementation: -->
262 <set var=
"__wx_included_impl">0</set>
264 <if cond=
"FORMAT in ['autoconf','gnu']">
265 <include file=
"wx_unix.bkl"/>
266 <set var=
"__wx_included_impl">1</set>
269 <if cond=
"FORMAT!='autoconf' and PLATFORM_WIN32=='1'">
270 <include file=
"wx_win32.bkl"/>
271 <set var=
"__wx_included_impl">1</set>
274 <if cond=
"__wx_included_impl=='0'">
275 <error>This format is not (yet) supported by wx preset.
</error>
281 <!-- HIGH-LEVEL TEMPLATE -->
284 <!-- Combine 'wxlike' with 'wx' or 'wx-lib' templates to have your
285 project build in the same configuration used by the selected
287 <template id=
"wxlike">
288 <!-- WX_DEBUG-dependent -->
290 <if cond=
"WX_DEBUG=='1'">off
</if>
291 <if cond=
"WX_DEBUG=='0'">speed
</if>
293 <set var=
"_DEBUGINFO">
294 <if cond=
"WX_DEBUG=='1'">on
</if>
295 <if cond=
"WX_DEBUG=='0'">off
</if>
298 <if cond=
"FORMAT!='autoconf'">
299 <optimize>$(_OPT)
</optimize>
300 <debug-info>$(_DEBUGINFO)
</debug-info>
304 <!-- Template for building wx-based console applications -->
305 <template id=
"wxconsole" template=
"wx">
306 <define>wxUSE_GUI=
0</define>
307 <app-type>console
</app-type>
312 <!-- UTILITY TAGS -->
315 <!-- private helper tag -->
316 <define-tag name=
"__setlibname" rules=
"lib,dll,module">
318 <if cond=
"FORMAT!='autoconf' and FORMAT!='gnu'">
319 $(attributes['prefix'])_$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)
321 <if cond=
"FORMAT=='autoconf' or FORMAT=='gnu'">
322 $(attributes['prefix'])_$(WX_PORT)$(WXLIBPOSTFIX)_$(value)-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR)
327 <!-- A simple tag which helps you to define a library name using the same rules used
328 by wxWidgets. Use the 'prefix' attribute to add your lib's prefix.
330 <wxlike-libname prefix='mylib'>module1</wxlike-libname>
331 <wxlike-libname prefix='mylib'>module2</wxlike-libname>
333 <define-tag name=
"wxlike-libname" rules=
"lib">
334 <__setlibname prefix=
"$(attributes['prefix'])">$(value)
</__setlibname>
335 <libname>$(__temp)
</libname>
338 <!-- exactly like <wxlike-libname> but this one sets the DLL name (and the DLL lib import name)
339 and thus must be used only inside a <dll> target...
341 <define-tag name=
"wxlike-dllname" rules=
"dll,module">
342 <__setlibname prefix=
"$(attributes['prefix'])">$(value)
</__setlibname>
343 <libname>$(__temp)
</libname>
344 <dllname>$(__temp)
</dllname>
347 <!-- Links against a library which uses the same wxWidgets conventions.
349 <define-tag name=
"wxlike-lib" rules=
"exe,lib,dll,module">
350 <__setlibname prefix=
"$(attributes['prefix'])">$(value)
</__setlibname>
351 <sys-lib>$(__temp)
</sys-lib>
354 <!-- Sets as output folder for the generated lib/dll a directory
355 called "lib/$(COMPILER)_lib|dll", just like wxWidgets does.
356 This makes it possible to keep separed the libraries compiled with
357 different compilers and with a different value for WX_SHARED.
359 <define-tag name=
"wxlike-libdirname" rules=
"lib,dll">
360 <if cond=
"FORMAT!='autoconf'">
361 <set var=
"_DIRNAME_SHARED_SUFFIX">
362 <if cond=
"WX_SHARED=='0'">lib
</if>
363 <if cond=
"WX_SHARED=='1'">dll
</if>
366 lib/$(COMPILER)_$(_DIRNAME_SHARED_SUFFIX)
369 <dirname>$(_DIRNAME)
</dirname>
371 <add-target target=
"make_lib_dir_$(id)" type=
"action"/>
372 <modify-target target=
"make_lib_dir_$(id)">
373 <command cond=
"TOOLSET=='unix'">
374 @mkdir -p $(_DIRNAME)
376 <command cond=
"TOOLSET in ['win32','os2','dos']">
377 if not exist $(_DIRNAME) mkdir $(_DIRNAME)
379 <dependency-of>$(id)
</dependency-of>
383 <if cond=
"FORMAT=='autoconf'">
384 <dirname>lib
</dirname>
388 <!-- Adds to the compiler & linker flags the path for the "include" and the
389 "lib" folders of a library following wxWidgets conventions which is
392 <define-tag name=
"wxlike-paths" rules=
"exe,lib,dll,module">
393 <if cond=
"FORMAT!='autoconf'">
394 <!-- WXLIBPATH is a path like "/lib/vc_lib"
395 NOTE: even if this template is going to be used for a "lib"
396 target (which does not uses lib-paths at all), we can still
397 use the <lib-path> target: it will just be discarded
399 <lib-path>$(value)$(WXLIBPATH)
</lib-path>
401 <!-- no special include paths for a lib following wxWidgets naming
403 <include>$(value)/include
</include>
406 <!-- for autoconf format the user should use CPPFLAGS and LDFLAGS to
407 specify non-system paths since the wx-based library should have
408 been installed in standard paths
412 <!-- Sets the BUILDDIR variable using the same rules used by wxWidgets itself.
413 This makes it possible to keep separed the object files compiled with
414 different configuration settings.
416 <define-global-tag name=
"set-wxlike-builddir">
417 <!-- note that the builddir for autoconf should always be '.' -->
418 <if cond=
"FORMAT!='autoconf'">
419 <set var=
"_BUILDDIR_SHARED_SUFFIX">
420 <if cond=
"WX_SHARED=='0'"></if>
421 <if cond=
"WX_SHARED=='1'">_dll
</if>
425 $(COMPILER)$(WX_PORT)$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)