]> git.saurik.com Git - wxWidgets.git/commitdiff
added <set-wxlike> tag (patch 1691429)
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Mar 2007 18:48:22 +0000 (18:48 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Mar 2007 18:48:22 +0000 (18:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

build/bakefiles/wxpresets/presets/wx.bkl

index 8f66d8ca2129954711342cd67132f1c2e93d68a4..f7accc54c0e6f805aa958df91e3ba4dfaa202460 100644 (file)
@@ -78,6 +78,9 @@
                              to keep object files compiled with different
                              settings separate.
 
                              to keep object files compiled with different
                              settings separate.
 
+    - <set-wxlike>: sets a variable with the name of a library named with the same
+                    wxWidgets rules.
+
 
  NOTE: as a reference here is a list of all wxWidgets libraries satisfying
        the dependency constraints mentioned in <wx-lib> description:
 
  NOTE: as a reference here is a list of all wxWidgets libraries satisfying
        the dependency constraints mentioned in <wx-lib> description:
     <!--                       UTILITY TAGS                         -->
     <!--                                                            -->
 
     <!--                       UTILITY TAGS                         -->
     <!--                                                            -->
 
-    <!-- private helper tag -->
+    <!-- private helper tag: does the same thing as for <set-wxlike> except that:
+         - the variable created is always named "__temp"
+         - can be used (only) inside targets as this is a non-global tag
+    -->
     <define-tag name="__setlibname" rules="lib,dll,module,exe">
         <set var="__temp">
             <if cond="FORMAT!='autoconf' and FORMAT!='gnu'">
     <define-tag name="__setlibname" rules="lib,dll,module,exe">
         <set var="__temp">
             <if cond="FORMAT!='autoconf' and FORMAT!='gnu'">
         -->
     </define-tag>
 
         -->
     </define-tag>
 
+
+
+    <!--                   UTILITY GLOBAL TAGS                      -->
+    <!--                                                            -->
+
     <!-- 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.
     <!-- 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.
         </if>
     </define-global-tag>
 
         </if>
     </define-global-tag>
 
+    <!-- Sets a variable with the name of the 'var' attribute value using the
+         same rules used for wxWidgets library naming.
+         E.g.
+
+            <set-wxlike var='MYMODULE_LIBNAME' prefix='mylib'>
+                mymodule
+            </set-wxlike>
+
+         This tag also supports a 'cond' attribute making it very powerful
+         for conditional linking a wx-based library:
+
+            <option name="USE_MYMODULE">
+                <values>0,1</values>
+            </option>
+            <set-wxlike var='MYMODULE_DEP'
+                        prefix='mylib'
+                        cond="USE_MYMODULE=='1'">
+                mymodule
+            </set-wxlike>
+            ...
+            <exe id="myexe">
+                <sys-lib>$(MYMODULE_DEP)</sys-lib>
+            </exe>
+    -->
+    <define-global-tag name="set-wxlike">
+        <if cond="FORMAT!='autoconf' and FORMAT!='gnu'">
+            <if cond="'cond' not in attributes">
+                <set var="$(attributes['var'])">
+                    $(attributes['prefix'])_$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)
+                </set>
+            </if>
+            <if cond="'cond' in attributes">
+                <set var="$(attributes['var'])">
+                    <if cond="$(attributes['cond'])">
+                        $(attributes['prefix'])_$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)
+                    </if>
+                </set>
+            </if>
+        </if>
+
+        <if cond="FORMAT=='autoconf' or FORMAT=='gnu'">
+            <if cond="'cond' not in attributes">
+                <set var="$(attributes['var'])">
+                    $(attributes['prefix'])_$(WX_PORT)$(WXLIBPOSTFIX)_$(value)-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR)
+                </set>
+            </if>
+            <if cond="'cond' in attributes">
+                <set var="$(attributes['var'])">
+                    <if cond="$(attributes['cond'])">
+                        $(attributes['prefix'])_$(WX_PORT)$(WXLIBPOSTFIX)_$(value)-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR)
+                    </if>
+                </set>
+            </if>
+        </if>
+    </define-global-tag>
+
 </makefile>
 </makefile>