+
+
+
+ <!-- HIGH-LEVEL TEMPLATE -->
+ <!-- -->
+
+ <!-- Combine 'wxlike' with 'wx' or 'wx-lib' templates to have your
+ project build in the same configuration used by the selected
+ wxWidgets build -->
+ <template id="wxlike">
+ <!-- WX_DEBUG-dependent -->
+ <set var="_OPT">
+ <if cond="WX_DEBUG=='1'">off</if>
+ <if cond="WX_DEBUG=='0'">speed</if>
+ </set>
+ <set var="_DEBUGINFO">
+ <if cond="WX_DEBUG=='1'">on</if>
+ <if cond="WX_DEBUG=='0'">off</if>
+ </set>
+
+ <if cond="FORMAT!='autoconf'">
+ <optimize>$(_OPT)</optimize>
+ <debug-info>$(_DEBUGINFO)</debug-info>
+ </if>
+ </template>
+
+ <!-- Template for building wx-based console applications -->
+ <template id="wxconsole" template="wx">
+ <define>wxUSE_GUI=0</define>
+ <app-type>console</app-type>
+ </template>
+
+
+
+ <!-- UTILITY TAGS -->
+ <!-- -->
+
+ <!-- private helper tag -->
+ <define-tag name="__setlibname" rules="lib,dll,module">
+ <set var="__temp">
+ <if cond="FORMAT!='autoconf' and FORMAT!='gnu'">
+ $(attributes['prefix'])_$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)
+ </if>
+ <if cond="FORMAT=='autoconf' or FORMAT=='gnu'">
+ $(attributes['prefix'])_$(WX_PORT)$(WXLIBPOSTFIX)_$(value)-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR)
+ </if>
+ </set>
+ </define-tag>
+
+ <!-- A simple tag which helps you to define a library name using the same rules used
+ by wxWidgets. Use the 'prefix' attribute to add your lib's prefix.
+ E.g.:
+ <wxlike-libname prefix='mylib'>module1</wxlike-libname>
+ <wxlike-libname prefix='mylib'>module2</wxlike-libname>
+ -->
+ <define-tag name="wxlike-libname" rules="lib">
+ <__setlibname prefix="$(attributes['prefix'])">$(value)</__setlibname>
+ <libname>$(__temp)</libname>
+ </define-tag>
+
+ <!-- exactly like <wxlike-libname> but this one sets the DLL name (and the DLL lib import name)
+ and thus must be used only inside a <dll> target...
+ -->
+ <define-tag name="wxlike-dllname" rules="dll,module">
+ <__setlibname prefix="$(attributes['prefix'])">$(value)</__setlibname>
+ <libname>$(__temp)</libname>
+ <dllname>$(__temp)</dllname>
+ </define-tag>
+
+ <!-- Links against a library which uses the same wxWidgets conventions.
+ -->
+ <define-tag name="wxlike-lib" rules="exe,lib,dll,module">
+ <__setlibname prefix="$(attributes['prefix'])">$(value)</__setlibname>
+ <sys-lib>$(__temp)</sys-lib>
+ </define-tag>
+
+ <!-- Sets as output folder for the generated lib/dll a directory
+ called "lib/$(COMPILER)_lib|dll", just like wxWidgets does.
+ This makes it possible to keep separed the libraries compiled with
+ different compilers and with a different value for WX_SHARED.
+ -->
+ <define-tag name="wxlike-libdirname" rules="lib,dll">
+ <if cond="FORMAT!='autoconf'">
+ <set var="_DIRNAME_SHARED_SUFFIX">
+ <if cond="WX_SHARED=='0'">lib</if>
+ <if cond="WX_SHARED=='1'">dll</if>
+ </set>
+ <set var="_DIRNAME">
+ lib/$(COMPILER)_$(_DIRNAME_SHARED_SUFFIX)
+ </set>
+
+ <dirname>$(_DIRNAME)</dirname>
+
+ <add-target target="make_lib_dir_$(id)" type="action"/>
+ <modify-target target="make_lib_dir_$(id)">
+ <command cond="TOOLSET=='unix'">
+ @mkdir -p $(_DIRNAME)
+ </command>
+ <command cond="TOOLSET in ['win32','os2','dos']">
+ if not exist $(_DIRNAME) mkdir $(_DIRNAME)
+ </command>
+ <dependency-of>$(id)</dependency-of>
+ </modify-target>
+
+ </if>
+ <if cond="FORMAT=='autoconf'">
+ <dirname>lib</dirname>
+ </if>
+ </define-tag>
+
+ <!-- Adds to the compiler & linker flags the path for the "include" and the
+ "lib" folders of a library following wxWidgets conventions which is
+ located in $(value).
+ -->
+ <define-tag name="wxlike-paths" rules="exe,lib,dll,module">
+ <if cond="FORMAT!='autoconf'">
+ <!-- WXLIBPATH is a path like "/lib/vc_lib"
+ NOTE: even if this template is going to be used for a "lib"
+ target (which does not uses lib-paths at all), we can still
+ use the <lib-path> target: it will just be discarded
+ -->
+ <lib-path>$(value)$(WXLIBPATH)</lib-path>
+
+ <!-- no special include paths for a lib following wxWidgets naming
+ conventions -->
+ <include>$(value)/include</include>
+ </if>
+
+ <!-- for autoconf format the user should use CPPFLAGS and LDFLAGS to
+ specify non-system paths since the wx-based library should have
+ been installed in standard paths
+ -->
+ </define-tag>
+
+ <!-- Sets the BUILDDIR variable using the same rules used by wxWidgets itself.
+ This makes it possible to keep separed the object files compiled with
+ different configuration settings.
+ -->
+ <define-global-tag name="set-wxlike-builddir">
+ <!-- note that the builddir for autoconf should always be '.' -->
+ <if cond="FORMAT!='autoconf'">
+ <set var="_BUILDDIR_SHARED_SUFFIX">
+ <if cond="WX_SHARED=='0'"></if>
+ <if cond="WX_SHARED=='1'">_dll</if>
+ </set>
+
+ <set var="BUILDDIR">
+ $(COMPILER)$(WX_PORT)$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)
+ </set>
+ </if>
+ </define-global-tag>
+