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-libdirname>: sets the output directory for the current target to $(value)
64 when on Unix and to e.g. $(value)/vc_lib when on Windows,
65 i.e. acts like <dirname> just following wxWidgets naming rules.
66 Useful to allow multiple builds of the
68 - <wxlike-paths>: if your library/application needs to compile & link with both
69 wxWidgets and some other wx-based library, which in turn
70 follows the wxWidgets naming conventions, then this tag is
71 what you need to add to the compiler and linker flags the paths
72 of the "include" and "lib" folders of the wx-based additional library.
77 - <set-wxlike-builddir>: sets BUILDDIR using wxWidgets naming rules to help
78 to keep object files compiled with different
82 NOTE: as a reference here is a list of all wxWidgets libraries satisfying
83 the dependency constraints mentioned in <wx-lib> description:
85 <wx-lib>richtext</wx-lib>
88 <wx-lib>dbgrid</wx-lib>
93 <wx-lib>media</wx-lib>
105 <requires version=
"0.2.2"/>
108 <!-- this variable identifies the version of the wx presets.
109 this is changed only when major changes to wxpresets take place. -->
110 <set var=
"WX_PRESETS_VERSION">4</set>
112 <!-- list of known libraries used by wx-lib tag defined in wx_unix.bkl and wx_win32.bkl
113 VERY IMPORTANT: when updating this list also update the <wx-lib> and <wx-all-libs>
117 base core net xml odbc xrc html adv media gl dbgrid qa aui richtext
120 <!-- NOTE: refer to the NET contrib using NETUTILS instead of NET
121 (which is already in LIB_LIST)
123 <set var=
"CONTRIBLIB_LIST">
124 applet deprecated fl foldbar gizmos mmedia netutils ogl plot stc svg
126 <set var=
"ALLLIB_LIST">$(LIB_LIST) $(CONTRIBLIB_LIST)
</set>
128 <!-- this is a temporary variable until there is non general -->
129 <!-- function in bakefiles for returning native markup for -->
130 <!-- reading envrionment variables -->
132 <if cond=
"FORMAT=='watcom'">%
</if>
133 <if cond=
"FORMAT!='watcom'"></if>
140 <!-- These are essentially the configurations you -->
141 <!-- want in bakefile. -->
143 <!-- In MSVC these are the different build -->
144 <!-- configurations you can have (in the build menu), -->
145 <!-- and in autoconf is enabled with enable-xxx=xx. -->
146 <!-- For other compilers a separate configuration -->
147 <!-- file is created (such as config.gcc on gcc) -->
148 <!-- which has several options a user can modify. -->
150 <!-- Note that the above only happens if an option -->
151 <!-- is not constant, i.e. if it cannot be determined -->
152 <!-- by bakefile itself. -->
153 <!-- Also note that for 'autoconf' format these options -->
154 <!-- are only useful when used together with wxpresets.m4 -->
155 <!-- macro file which contains macros for detecting the -->
156 <!-- option values for wx-based projects. See wxpresets.m4 -->
157 <!-- comments for more info. -->
160 <!-- Presets for limited dmars make.exe format: -->
161 <if cond=
"FORMAT=='dmars'">
162 <set var=
"WX_UNICODE">0</set>
163 <set var=
"WX_DEBUG">1</set>
164 <set var=
"WX_SHARED">0</set>
167 <!-- 'gnu' format needs to redefine the following options later in wx_unix.bkl -->
168 <if cond=
"FORMAT=='gnu'">
169 <set var=
"WX_UNICODE"/>
170 <set var=
"WX_DEBUG"/>
171 <set var=
"WX_SHARED"/>
173 <set var=
"WX_VERSION"/>
177 <!-- This is a standard option that determines -->
178 <!-- whether the user wants to build this library as -->
179 <!-- a dll or as a static library. -->
180 <if cond=
"not isdefined('WX_SHARED')">
181 <set var=
"WX_SHARED_DEFAULT" overwrite=
"0">0</set>
182 <option name=
"WX_SHARED">
184 <values-description>Static,DLL
</values-description>
185 <default-value>$(WX_SHARED_DEFAULT)
</default-value>
187 Use DLL build of wx library to use?
192 <!-- Configuration for building the bakefile with -->
193 <!-- unicode strings or not (unicode or ansi). -->
194 <if cond=
"not isdefined('WX_UNICODE')">
195 <set var=
"WX_UNICODE_DEFAULT" overwrite=
"0">0</set>
196 <option name=
"WX_UNICODE">
198 <values-description>ANSI,Unicode
</values-description>
199 <default-value>$(WX_UNICODE_DEFAULT)
</default-value>
201 Compile Unicode build of wxWidgets?
206 <if cond=
"not isdefined('WX_DEBUG')">
207 <set var=
"WX_DEBUG_DEFAULT" overwrite=
"0">1</set>
208 <option name=
"WX_DEBUG">
210 <values-description>Release,Debug
</values-description>
211 <default-value>$(WX_DEBUG_DEFAULT)
</default-value>
213 Use debug build of wxWidgets (define __WXDEBUG__)?
218 <if cond=
"not isdefined('WX_VERSION')">
219 <set var=
"WX_VERSION_DEFAULT" overwrite=
"0">29</set>
220 <option name=
"WX_VERSION">
221 <default-value>$(WX_VERSION_DEFAULT)
</default-value>
223 Version of the wx library to build against.
228 <if cond=
"not isdefined('WX_MONOLITHIC')">
229 <set var=
"WX_MONOLITHIC_DEFAULT" overwrite=
"0">0</set>
230 <option name=
"WX_MONOLITHIC">
232 <values-description>Multilib,Monolithic
</values-description>
233 <default-value>$(WX_MONOLITHIC_DEFAULT)
</default-value>
235 Use monolithic build of wxWidgets?
240 <!-- The directory where wxWidgets is installed: -->
241 <if cond=
"not isdefined('WX_DIR')">
242 <set var=
"WX_DIR_DEFAULT" overwrite=
"0">$(DOLLAR)($(ENV_VAR)WXWIN)
</set>
243 <option name=
"WX_DIR" category=
"path">
244 <default-value>$(WX_DIR_DEFAULT)
</default-value>
246 The directory where wxWidgets library is installed
253 <!-- HELPER VARIABLES -->
256 <!-- These are handy ways of dealing with the -->
257 <!-- extensions in the library names of the -->
258 <!-- wxWindows library. -->
259 <set var=
"WXLIBPOSTFIX">
260 <if cond=
"WX_DEBUG=='1' and WX_UNICODE=='1'">ud
</if>
261 <if cond=
"WX_DEBUG=='1' and WX_UNICODE=='0'">d
</if>
262 <if cond=
"WX_DEBUG=='0' and WX_UNICODE=='1'">u
</if>
268 <!-- this is just a wrapper that includes the real implementation: -->
270 <set var=
"__wx_included_impl">0</set>
272 <if cond=
"FORMAT in ['autoconf','gnu']">
273 <include file=
"wx_unix.bkl"/>
274 <set var=
"__wx_included_impl">1</set>
277 <if cond=
"FORMAT!='autoconf' and PLATFORM_WIN32=='1'">
278 <include file=
"wx_win32.bkl"/>
279 <set var=
"__wx_included_impl">1</set>
282 <if cond=
"__wx_included_impl=='0'">
283 <error>This format is not (yet) supported by wx preset.
</error>
289 <!-- HIGH-LEVEL TEMPLATE -->
292 <!-- Combine 'wxlike' with 'wx' or 'wx-lib' templates to have your
293 project build in the same configuration used by the selected
295 <template id=
"wxlike">
296 <!-- WX_DEBUG-dependent -->
298 <if cond=
"WX_DEBUG=='1'">off
</if>
299 <if cond=
"WX_DEBUG=='0'">speed
</if>
301 <set var=
"_DEBUGINFO">
302 <if cond=
"WX_DEBUG=='1'">on
</if>
303 <if cond=
"WX_DEBUG=='0'">off
</if>
306 <if cond=
"FORMAT!='autoconf'">
307 <optimize>$(_OPT)
</optimize>
308 <debug-info>$(_DEBUGINFO)
</debug-info>
312 <!-- Template for building wx-based console applications -->
313 <template id=
"wxconsole" template=
"wx">
314 <define>wxUSE_GUI=
0</define>
315 <app-type>console
</app-type>
320 <!-- UTILITY TAGS -->
323 <!-- private helper tag -->
324 <define-tag name=
"__setlibname" rules=
"lib,dll,module">
326 <if cond=
"FORMAT!='autoconf' and FORMAT!='gnu'">
327 $(attributes['prefix'])_$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)
329 <if cond=
"FORMAT=='autoconf' or FORMAT=='gnu'">
330 $(attributes['prefix'])_$(WX_PORT)$(WXLIBPOSTFIX)_$(value)-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR)
335 <!-- A simple tag which helps you to define a library name using the same rules used
336 by wxWidgets. Use the 'prefix' attribute to add your lib's prefix.
338 <wxlike-libname prefix='mylib'>module1</wxlike-libname>
339 <wxlike-libname prefix='mylib'>module2</wxlike-libname>
341 <define-tag name=
"wxlike-libname" rules=
"lib">
342 <__setlibname prefix=
"$(attributes['prefix'])">$(value)
</__setlibname>
343 <libname>$(__temp)
</libname>
346 <!-- exactly like <wxlike-libname> but this one sets the DLL name (and the DLL lib import name)
347 and thus must be used only inside a <dll> target...
349 <define-tag name=
"wxlike-dllname" rules=
"dll,module">
350 <__setlibname prefix=
"$(attributes['prefix'])">$(value)
</__setlibname>
351 <libname>$(__temp)
</libname>
352 <dllname>$(__temp)
</dllname>
355 <!-- Links against a library which uses the same wxWidgets conventions.
357 <define-tag name=
"wxlike-lib" rules=
"exe,lib,dll,module">
358 <__setlibname prefix=
"$(attributes['prefix'])">$(value)
</__setlibname>
359 <sys-lib>$(__temp)
</sys-lib>
362 <!-- Sets as output folder for the generated lib/dll a directory
363 called "lib/$(COMPILER)_lib|dll", just like wxWidgets does.
364 This makes it possible to keep separed the libraries compiled with
365 different compilers and with a different value for WX_SHARED.
367 <define-tag name=
"wxlike-libdirname" rules=
"lib,dll">
368 <if cond=
"FORMAT!='autoconf'">
369 <set var=
"_DIRNAME_SHARED_SUFFIX">
370 <if cond=
"WX_SHARED=='0'">lib
</if>
371 <if cond=
"WX_SHARED=='1'">dll
</if>
374 $(value)/$(COMPILER)_$(_DIRNAME_SHARED_SUFFIX)
377 <dirname>$(_DIRNAME)
</dirname>
379 <if cond=
"FORMAT_SUPPORTS_ACTIONS=='1'">
380 <set var=
"__mkdir_tgt">make_lib_dir_$(id)
</set>
382 <add-target target=
"$(__mkdir_tgt)" type=
"action"/>
383 <modify-target target=
"$(__mkdir_tgt)">
384 <command cond=
"TOOLSET=='unix'">
385 @mkdir -p $(_DIRNAME)
387 <command cond=
"TOOLSET in ['win32','os2','dos']">
388 if not exist $(nativePaths(_DIRNAME)) mkdir $(nativePaths(_DIRNAME))
392 <!-- the following code is mostly equivalent to a:
393 <dependency-of>$(id)</dependency-of>
394 put into the __mkdir_tgt target, except that it does _prepend_
395 the __mkdir_tgt dependency instead of appending it.
397 This is required because some compilers (e.g. MSVC) need to store in the
398 output folder some files (e.g. the PDB file) while compiling and thus
399 the library output folder must have been created before _any_ source file
400 is compiled, not just before the library is linked.
402 <modify-target target=
"$(id)">
403 <set var=
"__deps" prepend=
"1">
404 $(substitute(__mkdir_tgt, lambda x: ref('__depname', x), 'DEP'))
409 <if cond=
"FORMAT=='autoconf'">
410 <set var=
"_DIRNAME">$(value)
</set>
411 <dirname>$(_DIRNAME)
</dirname>
415 <!-- Adds to the compiler & linker flags the path for the "include" and the
416 "lib" folders of a library following wxWidgets conventions which is
419 <define-tag name=
"wxlike-paths" rules=
"exe,lib,dll,module">
420 <if cond=
"FORMAT!='autoconf' and FORMAT!='gnu'">
421 <!-- WXLIBPATH is a path like "/lib/vc_lib"
422 NOTE: even if this template is going to be used for a "lib"
423 target (which does not uses lib-paths at all), we can still
424 use the <lib-path> target: it will just be discarded
426 <lib-path>$(value)$(WXLIBPATH)
</lib-path>
428 <!-- no special include paths for a lib following wxWidgets naming
430 <include>$(value)/include
</include>
433 <!-- for autoconf format the user should use CPPFLAGS and LDFLAGS to
434 specify non-system paths since the wx-based library should have
435 been installed in standard paths
439 <!-- Sets the BUILDDIR variable using the same rules used by wxWidgets itself.
440 This makes it possible to keep separed the object files compiled with
441 different configuration settings.
443 <define-global-tag name=
"set-wxlike-builddir">
444 <!-- note that the builddir for autoconf should always be '.' -->
445 <if cond=
"FORMAT!='autoconf'">
446 <set var=
"_BUILDDIR_SHARED_SUFFIX">
447 <if cond=
"WX_SHARED=='0'"></if>
448 <if cond=
"WX_SHARED=='1'">_dll
</if>
452 $(COMPILER)$(WX_PORT)$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)