]> git.saurik.com Git - wxWidgets.git/blobdiff - build/bakefiles/wxpresets/presets/wx.bkl
enabling clip
[wxWidgets.git] / build / bakefiles / wxpresets / presets / wx.bkl
index 8f66d8ca2129954711342cd67132f1c2e93d68a4..0c24e31aff0f2bf2756292725a0f985184eddcd0 100644 (file)
                              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:
 
         <wx-lib>richtext</wx-lib>
         <wx-lib>aui</wx-lib>
+        <wx-lib>stc</wx-lib>
         <wx-lib>qa</wx-lib>
-        <wx-lib>dbgrid</wx-lib>
         <wx-lib>gl</wx-lib>
-        <wx-lib>odbc</wx-lib>
         <wx-lib>xrc</wx-lib>
         <wx-lib>html</wx-lib>
         <wx-lib>media</wx-lib>
 
 
     <!-- this variable identifies the version of the wx presets.
-         this is changed only when major changes to wxpresets take place. -->
+         this is changed only when major changes to wxpresets take place. 
+    -->
     <set var="WX_PRESETS_VERSION">4</set>
 
     <!-- list of known libraries used by wx-lib tag defined in wx_unix.bkl and wx_win32.bkl
          VERY IMPORTANT: when updating this list also update the <wx-lib> and <wx-all-libs>
                          tag definitions.
     -->
-    <set var="LIB_LIST">
-        base core net xml odbc xrc html adv media gl dbgrid qa aui richtext
+    <set var="WX_LIB_LIST">
+        base core net xml xrc html adv media gl qa aui richtext stc
     </set>
 
-    <!-- NOTE: refer to the NET contrib using NETUTILS instead of NET
-               (which is already in LIB_LIST)
+    <!-- if you define this variable to 0 before including wx presets, the
+         "test_for_selected_wxbuild" target which is added by default in win32 and GNU 
+         makefiles, won't be added.
+         This is useful when e.g. you want to have wxWidgets as an optional
+         dependency and thus you don't want to perform that check unconditionally.
     -->
-    <set var="CONTRIBLIB_LIST">
-        applet deprecated fl foldbar gizmos mmedia netutils ogl plot stc svg
+    <set var="WX_TEST_FOR_SELECTED_WXBUILD" overwrite="0">
+        1
     </set>
-    <set var="ALLLIB_LIST">$(LIB_LIST) $(CONTRIBLIB_LIST)</set>
 
     <!-- this is a temporary variable until there is non general    -->
     <!-- function in bakefiles for returning native markup for      -->
     <!--                       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>
 
+
+
+    <!--                   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.
         </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>