<?xml version="1.0" ?>
<!-- $Id: simple.bkl,v 1.2 2004/04/30 21:55:10 vaclavslavik Exp $ -->

<!--

Adds the logic for handling a UNICODE=0/1 option, which switches between unicode and
ansi builds.

Usage: use template "unicodeopt" for your targets:

  <include file="presets/unicodeopt.bkl"/>

  <exe id="myapp" template="unicodeopt">
    <sources>myapp.cpp</sources>
  </exe>

-->

<makefile>

    <set var="UNICODE_DEFAULT" overwrite="0">0</set>
    <option name="UNICODE">
        <values>0,1</values>
        <default-value>$(UNICODE_DEFAULT)</default-value>
        <values-description>ANSI,Unicode</values-description>
        <description>Set to 1 to build Unicode version</description>
    </option>

    <template id="unicodeopt">
        <define>
            $(substituteFromDict(UNICODE,{'1':'_UNICODE','0':''}))
        </define>
    </template>


    <!-- The UNICODEBUILDPOSTFIX variable is useful to set the BUILDDIR variable
         as done in presets/setbuilddir.bkl -->
    <set var="UNICODEBUILDPOSTFIX">
        <if cond="UNICODE=='0'">a</if>
        <if cond="UNICODE=='1'">u</if>
    </set>

</makefile>

