initial commit
Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
@@ -0,0 +1,266 @@
|
||||
-----------------------------------------------------------------------
|
||||
Creating a Cross-Platform Build System Using Bakefile
|
||||
The 10-minute, do-it-yourself wx project baking guide (with free sample recipes!)
|
||||
|
||||
Status: DRAFT
|
||||
Author: Kevin Ollivier
|
||||
Date: 2/13/04
|
||||
Licence: wxWindows Licence
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
Supporting many different platforms can be a difficult challenge. The
|
||||
challenge for wxWidgets is especially great, because it supports a variety of
|
||||
different compilers and development environments, including MSVC, Borland C++,
|
||||
MinGW, DevCPP, GNU make/automake, among others. Maintaining such a large
|
||||
number of different project files and formats can quickly become overwhelming.
|
||||
To simplify the maintenance of these formats, one of the wxWidgets developers,
|
||||
Vaclav Slavik, created Bakefile, a XML-based makefile wrapper that generates
|
||||
all the native project files for wxWidgets. So now, even though wxWidgets
|
||||
supports all these formats, wxWidgets developers need only update one file -
|
||||
the Bakefile, and it handles the rest. But Bakefile isn't specific to
|
||||
wxWidgets in any way - you can use Bakefile for your own projects, too. This
|
||||
brief tutorial will take a look at how to do that.
|
||||
|
||||
Note that this tutorial assumes that you are familiar with how to build
|
||||
software using one of the supported Bakefile makefile systems, that you have
|
||||
some basic familiarity with how makefiles work, and that you are capable of
|
||||
setting environment variables on your platform. Also note that the terms Unix
|
||||
and Unix-based refers to all operating systems that share a Unix heritage,
|
||||
including FreeBSD, Linux, Mac OS X, and various other operating systems.
|
||||
|
||||
-- Getting Started --
|
||||
|
||||
First, you'll need to install Bakefile. You can always find the latest version
|
||||
for download online at http://www.bakefile.org. A binary installer is provided
|
||||
for Windows users, while users of Unix-based operating systems (OS) will need
|
||||
to unpack the tarball and run configure && make && make install. (binary
|
||||
packages for some Linux distributions are also available, check
|
||||
http://www.bakefile.org/download.html for details).
|
||||
|
||||
-- Setting Up Your wx Build Environment --
|
||||
|
||||
Before you can build wxWidgets software using Bakefile or any other build
|
||||
system, you need to make sure that wxWidgets is built and that wxWidgets
|
||||
projects can find the wxWidgets includes and library files. wxWidgets build
|
||||
instructions can be found by going to the docs subfolder, then looking for the
|
||||
subfolder that corresponds to your platform (i.e. msw, gtk, mac) and reading
|
||||
"install.txt" there. Once you've done that, here are some extra steps you
|
||||
should take to make sure your Bakefile projects work with wxWidgets:
|
||||
|
||||
On Windows
|
||||
----------
|
||||
Once you've built wxWidgets, you should create an environment variable named
|
||||
WXWIN and set it to the home folder of your wxWidgets source tree. (If you use
|
||||
the command line to build, you can also set or override WXWIN at build time by
|
||||
passing it in as an option to your makefile.)
|
||||
|
||||
On Unix
|
||||
-------
|
||||
In a standard install, you need not do anything so long as wx-config is on
|
||||
your PATH. wx-config is all you need. (See the section of the book on using
|
||||
wx-config for more information.)
|
||||
|
||||
-- A Sample wx Project Bakefile --
|
||||
|
||||
Now that everything is setup, it's time to take Bakefile for a test run. I
|
||||
recommend that you use the wx sample Bakefile to get you started. It can be
|
||||
found in the 'build/bakefiles/wxpresets/sample' directory in the wxWidgets
|
||||
source tree. Here is the minimal.bkl Bakefile used in the sample:
|
||||
|
||||
minimal.bkl
|
||||
-------------------------------------------------------------
|
||||
<?xml version="1.0" ?>
|
||||
|
||||
<makefile>
|
||||
|
||||
<include file="presets/wx.bkl"/>
|
||||
|
||||
<exe id="minimal" template="wxgui">
|
||||
<debug-info>on</debug-info>
|
||||
<runtime-libs>dynamic</runtime-libs>
|
||||
|
||||
<sources>minimal.cpp</sources>
|
||||
|
||||
<wx-lib>core</wx-lib>
|
||||
<wx-lib>base</wx-lib>
|
||||
</exe>
|
||||
|
||||
</makefile>
|
||||
---------------------------------------------------------------
|
||||
|
||||
It's a complete sample ready to be baked, so go into the directory mentioned
|
||||
above and run the following command:
|
||||
|
||||
On Windows:
|
||||
bakefile -f msvc -I.. minimal.bkl
|
||||
|
||||
On Unix:
|
||||
bakefile -f gnu -I.. minimal.bkl
|
||||
|
||||
It should generate a makefile (makefile.vc or GNUmakefile, respectively) which
|
||||
you can use to build the software. Just build the software using the command
|
||||
"nmake -f makefile.vc" or "make -f GNUmakefile" respectively. Now let's take a
|
||||
look at some of the basic Bakefile concepts that you'll need to know to move
|
||||
on from here.
|
||||
|
||||
-- Project Types --
|
||||
|
||||
As mentioned earlier, Bakefile builds makefiles for many different
|
||||
development environments. The -f option accepts a list of formats that you
|
||||
would like to build, separated by commas. Valid values are:
|
||||
|
||||
autoconf GNU autoconf Makefile.in files
|
||||
borland Borland C/C++ makefiles
|
||||
gnu GNU toolchain makefiles (Unix)
|
||||
mingw MinGW makefiles (mingw32-make)
|
||||
msvc MS Visual C++ nmake makefiles
|
||||
|
||||
TIP: autoconf Project Type
|
||||
---------------------------
|
||||
You may notice that in the sample folder, there is also a file called
|
||||
configure.ac. That file is the input for autoconf, which creates the configure
|
||||
scripts that you often see when you build software from source on Unix-based
|
||||
platforms. People use configure scripts because they make your Unix makefiles
|
||||
more portable by automatically detecting the right libraries and commands to
|
||||
use on the user's machine and OS. This is necessary because there are many
|
||||
Unix-based operating systems and they all are slightly different in various
|
||||
small ways.
|
||||
|
||||
Bakefile does not generate a configure or configure.ac script, so if you want
|
||||
to use configure scripts with your Unix-based software, you will need to learn
|
||||
how to use autoconf. Unfortunately, this topic deserves a book all its own and
|
||||
is beyond the scope of this tutorial, but a book on the subject can be found
|
||||
online at: http://sources.redhat.com/autobook/. Note that you do not need to
|
||||
use automake when you are using Bakefile, just autoconf, as Bakefile
|
||||
essentially does the same thing as automake.
|
||||
----------------------------
|
||||
|
||||
-- Targets --
|
||||
|
||||
Every project needs to have a target or targets, specifying what is to be
|
||||
built. In Bakefile, you specify the target by creating a tag named with the
|
||||
target type. The possible names for targets are:
|
||||
|
||||
exe create an executable file
|
||||
dll create a shared library
|
||||
lib create a static library
|
||||
module create a library that is loaded at runtime (i.e. a plugin)
|
||||
|
||||
Note the sample above is an "exe" target. Once you create the target, all the
|
||||
build settings, including flags and linker options, should be placed inside
|
||||
the target tag, as they are in the sample above.
|
||||
|
||||
-- Adding Sources and Includes --
|
||||
|
||||
Obviously, you need to be able to add source and include files to your
|
||||
project. You add sources using the "<sources>" tag (as shown above), and add
|
||||
include directories using the "<include>" tag. You can add multiple <sources>
|
||||
and <include> tags to add multiple source files, or you can also add multiple
|
||||
sources and includes into one tag by separating them with a space, like so:
|
||||
|
||||
<sources>minimal.cpp minimal2.cpp minimal3.cpp</sources>
|
||||
|
||||
If your sources are in a subfolder of your Bakefile, you use the slash "/"
|
||||
character to denote directories, even on Windows. (i.e. src/minimal.cpp) For
|
||||
more options and flags, please consult the Bakefile documentation in the 'doc'
|
||||
subfolder of Bakefile, or you can also find it on the Bakefile web site.
|
||||
|
||||
-- Build Options --
|
||||
|
||||
What if you want to offer a DEBUG and a RELEASE build?
|
||||
You can do this in Bakefile by creating options. To create an option,
|
||||
use the "<option>" tag. A typical option has three important parts: a name, a
|
||||
default value, and a comma-separated list of values. For example, here is how
|
||||
to create a DEBUG option which builds debug by default:
|
||||
|
||||
<option name="DEBUG">
|
||||
<default-value>1</default-value>
|
||||
<values>0 1</values>
|
||||
</option>
|
||||
|
||||
You can then test the value of this option and conditionally set build
|
||||
settings, flags, etc. For more information on both options and conditional
|
||||
statements, please refer to the Bakefile documentation.
|
||||
|
||||
-- Bakefile Presets/Templates and Includes --
|
||||
|
||||
It is common that most projects will reuse certain settings, or options, in
|
||||
their makefiles. (i.e. DEBUG or static/dynamic library options) Also, it is
|
||||
common to have to use settings from another project; for example, any project
|
||||
that uses wxWidgets will need to build using the same flags and options that
|
||||
wxWidgets was built with. Bakefile makes these things easier by allowing users
|
||||
to create Bakefile templates, where you can store common settings.
|
||||
|
||||
Bakefile ships with a couple of templates, found in the 'presets' subfolder of
|
||||
your Bakefile installation. The "simple.bkl" template adds a DEBUG option to
|
||||
makefiles so you can build in release or debug mode. To add this template to
|
||||
your project, simply add the tag "<include file="presets/simple.bkl"/>" to the
|
||||
top of your Bakefile. Then, when creating your target, add the
|
||||
"template="simple"" attribute to it. Now, once you build the makefile, your
|
||||
users can write commands like:
|
||||
|
||||
nmake -f makefile.vc DEBUG=1
|
||||
|
||||
or
|
||||
|
||||
make -f GNUmakefile DEBUG=1
|
||||
|
||||
In order to build the software in debug mode.
|
||||
|
||||
To simplify the building of wxWidgets-based projects, wxWidgets contains a
|
||||
set of Bakefiles that automatically configure your build system to be
|
||||
compatible with wxWidgets. As you'll notice in the sample above, the sample
|
||||
project uses the "wxgui" template. Once you've included the template, your software
|
||||
will now build as a GUI application with wxWidgets support.
|
||||
|
||||
There's also "wxconsole" template for building console-based wxWidgets applications
|
||||
and "wx" template that doesn't specify application type (GUI or console) and can be
|
||||
used e.g. for building libraries that use wxWidgets.
|
||||
|
||||
But since the wx presets don't exist in the Bakefile presets subfolder,
|
||||
Bakefile needs to know where to find these presets. The "-I" command adds the
|
||||
wxpresets folder to Bakefile's search path.
|
||||
|
||||
If you regularly include Bakefile presets in places other than the Bakefile
|
||||
presets folder, then you can set the BAKEFILE_PATHS environment variable so
|
||||
that Bakefile can find these Bakefiles and include them in your project. This
|
||||
way you no longer need to specify the -I flag each time you build.
|
||||
|
||||
Lastly, it's important to note that the Win 32 wx project Bakefiles come with
|
||||
some common build options that users can use when building the software. These
|
||||
options are:
|
||||
|
||||
Option Values Description
|
||||
------ ------ -------------
|
||||
WX_MONOLITHIC 0(default),1 Set this to 1 if you built wx
|
||||
as a monolithic library
|
||||
WX_SHARED 0(default),1 Specify static or dynamic wx libs
|
||||
WX_DEBUG 0,1(default) Use release or debug wx libs
|
||||
*WX_VERSION 25,26(default) Specify version of wx libs
|
||||
|
||||
*Note: Any version of wx past 2.5 will be allowed here, so 25/26 is not a
|
||||
complete list of values.
|
||||
|
||||
These options are not needed under Unix as wx-config can be used to specify
|
||||
these options.
|
||||
|
||||
-- bakefile_gen - Automated Bakefile Scripts --
|
||||
|
||||
If you have a large project, you can imagine that the calls to Bakefile would
|
||||
get more and more complex and unwieldy to manage. For this reason, a script
|
||||
called bakefile_gen was created, which reads in a .bkgen file that provides
|
||||
all the commands needed to build all the makefiles your project supports. A
|
||||
discussion of how to use bakefile_gen is beyond the scope of this tutorial,
|
||||
but it deserves mention because it can be invaluable to large projects.
|
||||
Documentation on bakefile_gen can be found in the Bakefile documentation.
|
||||
|
||||
-- Conclusion --
|
||||
|
||||
This concludes our basic tutorial of the cross-platform Bakefile build system
|
||||
management tool. From here, please be sure to take a good look at the Bakefile
|
||||
documentation to see what else it is capable of. Please post questions to the
|
||||
bakefile-devel@lists.sourceforge.net list, or if you have questions specific
|
||||
to the wx template Bakefile, send an email to the wxWidgets users mailing list:
|
||||
https://www.wxwidgets.org/support/mailing-lists/
|
||||
|
||||
Enjoy using Bakefile!
|
||||
@@ -0,0 +1,63 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.59)
|
||||
AC_INIT([libsample],[1.2.5],[vslavik@fastmail.fm])
|
||||
AC_CONFIG_SRCDIR([libsample.cpp])
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl DEFINE CONFIGURE OPTIONS
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
dnl define all the wx-config related options
|
||||
dnl (i.e. --with-wxdir, --with-wx-config, --with-wx-prefix, --with-wx-exec-prefix)
|
||||
WX_CONFIG_OPTIONS
|
||||
|
||||
dnl define all the wxpresets related options
|
||||
WX_STANDARD_OPTIONS([debug,unicode,shared,toolkit,wxshared])
|
||||
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CONFIGURE CHECKS
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
dnl these checks are required by bakefile:
|
||||
AC_CANONICAL_SYSTEM
|
||||
AC_PROG_AWK
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CXXCPP
|
||||
|
||||
dnl we want to always have DEBUG==WX_DEBUG
|
||||
WX_DEBUG=$DEBUG
|
||||
|
||||
dnl the following macros will search for the best matching wxWidgets build
|
||||
dnl (taking in count the values of the --enable-debug|unicode|shared and of
|
||||
dnl the --with-toolkit|wxshared options) and then set appropriately all the
|
||||
dnl WX_* options
|
||||
WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
|
||||
WX_CONFIG_CHECK([2.8.0], [wxWin=1],,[core,base],[$WXCONFIG_FLAGS])
|
||||
WX_DETECT_STANDARD_OPTION_VALUES
|
||||
|
||||
dnl here all WX_* option values are available for your own processing...
|
||||
|
||||
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CONFIGURE END
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
AC_BAKEFILE([m4_include(autoconf_inc.m4)])
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
|
||||
dnl show a nice summary of the chosen build settings to the user
|
||||
WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN
|
||||
WX_STANDARD_OPTIONS_SUMMARY_MSG_END
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" ?>
|
||||
|
||||
<makefile>
|
||||
|
||||
<!-- a typical nice feature which wxpresets make available to wx-based programs
|
||||
is to allow the user to build with different configurations those programs;
|
||||
this is achieved in few fundamental steps:
|
||||
|
||||
1) set a different BUILDDIR for different build configurations
|
||||
2) set different output dirs for the libraries built with a
|
||||
different shared/static setting
|
||||
3) set different output names for the libraries built with
|
||||
different unicode/ansi and release/debug settings
|
||||
-->
|
||||
<include file="presets/wx.bkl"/>
|
||||
|
||||
<!-- the following line implements step #1: -->
|
||||
<set-wxlike-builddir/>
|
||||
|
||||
<!-- through the use of the 'wx-lib' and 'wxlike' templates, we'll get
|
||||
the ability to compile against any wxWidgets build using, for our
|
||||
program, the same configuration of the selected wxWidgets build.
|
||||
-->
|
||||
<template id="my" template="wx-lib,wxlike">
|
||||
<!-- wxlike-dirname implements step #2 (see initial comment) -->
|
||||
<wxlike-dirname>lib</wxlike-dirname>
|
||||
|
||||
<sources>libsample.cpp</sources>
|
||||
</template>
|
||||
|
||||
|
||||
<lib id="static" template="my" cond="WX_SHARED=='0'">
|
||||
<!-- wxlike-libname implements step #3 (see initial comment) -->
|
||||
<wxlike-libname prefix='sample'>test</wxlike-libname>
|
||||
</lib>
|
||||
|
||||
<dll id="shared" template="my" cond="WX_SHARED=='1'">
|
||||
<!-- wxlike-dllname does step #3 (see initial comment) -->
|
||||
<wxlike-dllname prefix='sample'>test</wxlike-dllname>
|
||||
<define>WXMAKINGDLL_LIBSAMPLE</define>
|
||||
|
||||
<wx-lib>core</wx-lib>
|
||||
<wx-lib>base</wx-lib>
|
||||
</dll>
|
||||
|
||||
</makefile>
|
||||
@@ -0,0 +1,36 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: libsample.cpp
|
||||
// Purpose: The source of a dummy sample wx-based library
|
||||
// Author: Francesco Montorsi
|
||||
// Created: 26/11/06
|
||||
// Copyright: (c) Francesco Montorsi
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
|
||||
// for all others, include the necessary headers (this file is usually all you
|
||||
// need because it includes almost all "standard" wxWindows headers)
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
void MyUtilityFunction()
|
||||
{
|
||||
wxPrintf(wxT("Hello world!\n"));
|
||||
fflush(stdout);
|
||||
}
|
||||
533
libs/wxWidgets-3.3.1/build/bakefiles/wxpresets/presets/wx.bkl
Normal file
533
libs/wxWidgets-3.3.1/build/bakefiles/wxpresets/presets/wx.bkl
Normal file
@@ -0,0 +1,533 @@
|
||||
<?xml version="1.0" ?>
|
||||
|
||||
<!--
|
||||
Presets for building wxWidgets applications.
|
||||
|
||||
These presets provide the following "public" interface:
|
||||
|
||||
OPTIONS:
|
||||
|
||||
- WX_* : used to let the user of the generated makefile choose a wxWidgets
|
||||
build among those available; you can use them in your project to
|
||||
e.g. build a target only if WX_SHARED is 0 or if WX_PORT is "msw".
|
||||
|
||||
|
||||
VARIABLES:
|
||||
|
||||
- WXLIBPOSTFIX: contains the [u][d] string which is typically useful when
|
||||
defining names of directories/files which should coexist
|
||||
with other builds using different wxWidgets configurations.
|
||||
|
||||
|
||||
TEMPLATES:
|
||||
|
||||
- wx, wx-lib: templates to be used respectively for <dll>/<exe> and <lib>
|
||||
targets; they add all the wxWidgets-related settings (e.g. the
|
||||
include and library search paths, the necessary preprocessor
|
||||
symbols, etc).
|
||||
|
||||
- wxgui: to be used when building GUI-mode applications.
|
||||
|
||||
- wxconsole: to be used when building console-only applications
|
||||
(NOTE: it doesn't add the wxUSE_GUI=0 define since you don't
|
||||
need it when compiling wxBase-only code).
|
||||
|
||||
- wxlike: this template should be combined with "wx" or "wx-lib" and will
|
||||
make your project build with the same Unicode & shared
|
||||
config as the wxWidgets build selected using the WX_* options.
|
||||
|
||||
|
||||
TARGET TAGS:
|
||||
|
||||
- <wx-lib>: to define which wxWidgets libraries to link with;
|
||||
please note that you should use them in the right order or
|
||||
linking under Unix would result in errors, e.g.
|
||||
|
||||
<wx-lib>core</wx-lib>
|
||||
<wx-lib>base</wx-lib>
|
||||
|
||||
is correct, but the reverse is not (if lib A depends on lib B, then
|
||||
lib A must be listed before B). So <wx-lib>base</wx-lib>
|
||||
(which must always be present) should be the last wx-lib tag.
|
||||
|
||||
- <wxlike-libname>,
|
||||
<wxlike-dllname>: useful if you want to have a build logic similar to the
|
||||
wxWidgets build logic which allows different builds to
|
||||
coexist without conflicts. These tags helps you to name
|
||||
libraries using the same wxWidgets rules and thus avoid
|
||||
conflicts between libraries compiled in e.g. Unicode,
|
||||
shared mode and those compiled in ANSI, shared mode &c.
|
||||
|
||||
- <wxlike-lib>: if your library/application needs to link with both
|
||||
wxWidgets and some other wx-based library, which in turn
|
||||
follows the wxWidgets naming conventions, then this tag is
|
||||
what you need to reference the wx-based additional library.
|
||||
|
||||
- <wxlike-dirname>: sets the output directory for the current target to $(value)
|
||||
when on Unix and to e.g. $(value)/vc_lib when on Windows,
|
||||
i.e. acts like <dirname> just following wxWidgets naming rules.
|
||||
Useful to allow multiple builds of the
|
||||
|
||||
- <wxlike-paths>: if your library/application needs to compile & link with both
|
||||
wxWidgets and some other wx-based library, which in turn
|
||||
follows the wxWidgets naming conventions, then this tag is
|
||||
what you need to add to the compiler and linker flags the paths
|
||||
of the "include" and "lib" folders of the wx-based additional library.
|
||||
|
||||
|
||||
GLOBAL TAGS:
|
||||
|
||||
- <set-wxlike-builddir>: sets BUILDDIR using wxWidgets naming rules to help
|
||||
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>webview</wx-lib>
|
||||
<wx-lib>richtext</wx-lib>
|
||||
<wx-lib>aui</wx-lib>
|
||||
<wx-lib>ribbon</wx-lib>
|
||||
<wx-lib>propgrid</wx-lib>
|
||||
<wx-lib>stc</wx-lib>
|
||||
<wx-lib>qa</wx-lib>
|
||||
<wx-lib>gl</wx-lib>
|
||||
<wx-lib>xrc</wx-lib>
|
||||
<wx-lib>html</wx-lib>
|
||||
<wx-lib>media</wx-lib>
|
||||
<wx-lib>net</wx-lib>
|
||||
<wx-lib>xml</wx-lib>
|
||||
<wx-lib>core</wx-lib>
|
||||
<wx-lib>base</wx-lib>
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<makefile>
|
||||
|
||||
<requires version="0.2.2"/>
|
||||
|
||||
<using module="wx_presets"/>
|
||||
|
||||
<!-- this variable identifies the version of the wx presets.
|
||||
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="WX_LIB_LIST">
|
||||
base core net xml xrc html adv media gl qa aui ribbon propgrid richtext stc webview
|
||||
</set>
|
||||
|
||||
<!-- 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="WX_TEST_FOR_SELECTED_WXBUILD" overwrite="0">
|
||||
1
|
||||
</set>
|
||||
|
||||
<!-- OPTIONS -->
|
||||
<!-- -->
|
||||
<!-- These are essentially the configurations you -->
|
||||
<!-- want in bakefile. -->
|
||||
<!-- -->
|
||||
<!-- In MSVC these are the different build -->
|
||||
<!-- configurations you can have (in the build menu), -->
|
||||
<!-- and in autoconf is enabled with enable-xxx=xx. -->
|
||||
<!-- For other compilers a separate configuration -->
|
||||
<!-- file is created (such as config.gcc on gcc) -->
|
||||
<!-- which has several options a user can modify. -->
|
||||
<!-- -->
|
||||
<!-- Note that the above only happens if an option -->
|
||||
<!-- is not constant, i.e. if it cannot be determined -->
|
||||
<!-- by bakefile itself. -->
|
||||
<!-- Also note that for 'autoconf' format these options -->
|
||||
<!-- are only useful when used together with wxpresets.m4 -->
|
||||
<!-- macro file which contains macros for detecting the -->
|
||||
<!-- option values for wx-based projects. See wxpresets.m4 -->
|
||||
<!-- comments for more info. -->
|
||||
|
||||
|
||||
<!-- 'gnu' format needs to redefine the following options later in wx_unix.bkl -->
|
||||
<if cond="FORMAT=='gnu'">
|
||||
<set var="WX_UNICODE"/>
|
||||
<set var="WX_SHARED"/>
|
||||
<set var="WX_PORT"/>
|
||||
<set var="WX_VERSION"/>
|
||||
</if>
|
||||
|
||||
|
||||
<!-- This is a standard option that determines -->
|
||||
<!-- whether the user wants to build this library as -->
|
||||
<!-- a dll or as a static library. -->
|
||||
<if cond="not isdefined('WX_SHARED')">
|
||||
<set var="WX_SHARED_DEFAULT" overwrite="0">0</set>
|
||||
<option name="WX_SHARED">
|
||||
<values>0,1</values>
|
||||
<values-description>Static,DLL</values-description>
|
||||
<default-value>$(WX_SHARED_DEFAULT)</default-value>
|
||||
<description>
|
||||
Use DLL build of wx library?
|
||||
</description>
|
||||
</option>
|
||||
</if>
|
||||
|
||||
<!-- Configuration for building the bakefile with -->
|
||||
<!-- unicode strings or not (unicode or ansi). -->
|
||||
<if cond="not isdefined('WX_UNICODE')">
|
||||
<set var="WX_UNICODE_DEFAULT" overwrite="0">1</set>
|
||||
<option name="WX_UNICODE">
|
||||
<values>0,1</values>
|
||||
<values-description>ANSI,Unicode</values-description>
|
||||
<default-value>$(WX_UNICODE_DEFAULT)</default-value>
|
||||
<description>
|
||||
Use Unicode build of wxWidgets?
|
||||
</description>
|
||||
</option>
|
||||
</if>
|
||||
|
||||
<if cond="not isdefined('WX_DEBUG')">
|
||||
<set var="WX_DEBUG_DEFAULT" overwrite="0">1</set>
|
||||
<option name="WX_DEBUG">
|
||||
<values>0,1</values>
|
||||
<values-description>Release,Debug</values-description>
|
||||
<default-value>$(WX_DEBUG_DEFAULT)</default-value>
|
||||
<description>
|
||||
Use debug build of wxWidgets (linked with debug CRT)?
|
||||
</description>
|
||||
</option>
|
||||
</if>
|
||||
|
||||
<if cond="not isdefined('WX_VERSION')">
|
||||
<set var="WX_VERSION_DEFAULT" overwrite="0">31</set>
|
||||
<option name="WX_VERSION">
|
||||
<default-value>$(WX_VERSION_DEFAULT)</default-value>
|
||||
<description>
|
||||
Version of the wx library to build against.
|
||||
</description>
|
||||
</option>
|
||||
</if>
|
||||
|
||||
<if cond="not isdefined('WX_MONOLITHIC')">
|
||||
<set var="WX_MONOLITHIC_DEFAULT" overwrite="0">0</set>
|
||||
<option name="WX_MONOLITHIC">
|
||||
<values>0,1</values>
|
||||
<values-description>Multilib,Monolithic</values-description>
|
||||
<default-value>$(WX_MONOLITHIC_DEFAULT)</default-value>
|
||||
<description>
|
||||
Use monolithic build of wxWidgets?
|
||||
</description>
|
||||
</option>
|
||||
</if>
|
||||
|
||||
<!-- The directory where wxWidgets is installed: -->
|
||||
<if cond="not isdefined('WX_DIR')">
|
||||
<set var="WX_DIR_DEFAULT" overwrite="0">$(DOLLAR)(WXWIN)</set>
|
||||
<option name="WX_DIR" category="path" never_empty="1">
|
||||
<default-value>$(WX_DIR_DEFAULT)</default-value>
|
||||
<description>
|
||||
The directory where wxWidgets library is installed
|
||||
</description>
|
||||
</option>
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
<!-- HELPER VARIABLES -->
|
||||
<!-- -->
|
||||
|
||||
<!-- These are handy ways of dealing with the -->
|
||||
<!-- extensions in the library names of the -->
|
||||
<!-- wxWindows library. -->
|
||||
<set var="WXLIBPOSTFIX">
|
||||
<if cond="WX_DEBUG=='1' and WX_UNICODE=='1'">ud</if>
|
||||
<if cond="WX_DEBUG=='1' and WX_UNICODE=='0'">d</if>
|
||||
<if cond="WX_DEBUG=='0' and WX_UNICODE=='1'">u</if>
|
||||
</set>
|
||||
|
||||
<if cond="FORMAT!='autoconf'">
|
||||
<set var="COMPILER_PREFIX" make_var="1">$(COMPILER)</set>
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- REAL IMPLEMENTATION -->
|
||||
<!-- -->
|
||||
|
||||
<set var="__wx_included_impl">0</set>
|
||||
|
||||
<if cond="FORMAT in ['autoconf','gnu']">
|
||||
<include file="wx_unix.bkl"/>
|
||||
<set var="__wx_included_impl">1</set>
|
||||
</if>
|
||||
|
||||
<if cond="FORMAT!='autoconf' and PLATFORM_WIN32=='1'">
|
||||
<include file="wx_win32.bkl"/>
|
||||
<set var="__wx_included_impl">1</set>
|
||||
</if>
|
||||
|
||||
<if cond="FORMAT=='xcode2'">
|
||||
<!-- xCode2 is an IDE and thus reuses almost nothing from unix part of wxpresets;
|
||||
better use the win32 part! -->
|
||||
<include file="wx_win32.bkl"/>
|
||||
<set var="__wx_included_impl">1</set>
|
||||
</if>
|
||||
|
||||
<if cond="__wx_included_impl=='0'">
|
||||
<error>This format is not (yet) supported by wx preset.</error>
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 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 GUI applications -->
|
||||
<template id="wxgui" template="wx">
|
||||
<app-type>gui</app-type>
|
||||
</template>
|
||||
|
||||
<!-- Template for building wx-based console applications -->
|
||||
<template id="wxconsole" template="wx">
|
||||
<app-type>console</app-type>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<!-- UTILITY TAGS -->
|
||||
<!-- -->
|
||||
|
||||
<!-- 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'">
|
||||
$(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 current target a directory
|
||||
called "$(value)/$(COMPILER_PREFIX)_lib|dll", just like wxWidgets does.
|
||||
This makes it possible to keep separated the libraries/exes compiled with
|
||||
different compilers and with a different value for WX_SHARED.
|
||||
-->
|
||||
<define-tag name="wxlike-dirname" rules="lib,dll,exe,module">
|
||||
<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">
|
||||
$(value)/$(COMPILER_PREFIX)_$(_DIRNAME_SHARED_SUFFIX)
|
||||
</set>
|
||||
|
||||
<dirname>$(_DIRNAME)</dirname>
|
||||
|
||||
<if cond="FORMAT_SUPPORTS_ACTIONS=='1'">
|
||||
<set var="__mkdir_tgt">make_dir_$(id)</set>
|
||||
|
||||
<add-target target="$(__mkdir_tgt)" type="action"/>
|
||||
<modify-target target="$(__mkdir_tgt)">
|
||||
<command cond="TOOLSET=='unix'">
|
||||
@mkdir -p $(_DIRNAME)
|
||||
</command>
|
||||
<command cond="TOOLSET in ['win32','dos']">
|
||||
if not exist $(nativePaths(_DIRNAME)) mkdir $(nativePaths(_DIRNAME))
|
||||
</command>
|
||||
</modify-target>
|
||||
|
||||
<!-- the following code is mostly equivalent to a:
|
||||
<dependency-of>$(id)</dependency-of>
|
||||
put into the __mkdir_tgt target, except that it does _prepend_
|
||||
the __mkdir_tgt dependency instead of appending it.
|
||||
|
||||
This is required because some compilers (e.g. MSVC) need to store in the
|
||||
output folder some files (e.g. the PDB file) while compiling and thus
|
||||
the library output folder must have been created before _any_ source file
|
||||
is compiled, not just before the library is linked.
|
||||
-->
|
||||
<modify-target target="$(id)">
|
||||
<set var="__deps" prepend="1">
|
||||
$(substitute(__mkdir_tgt, lambda x: ref('__depname', x), 'DEP'))
|
||||
</set>
|
||||
</modify-target>
|
||||
</if>
|
||||
</if>
|
||||
<if cond="FORMAT=='autoconf'">
|
||||
<set var="_DIRNAME">$(value)</set>
|
||||
<dirname>$(_DIRNAME)</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' and FORMAT!='gnu'">
|
||||
<!-- 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>
|
||||
|
||||
|
||||
|
||||
<!-- UTILITY GLOBAL TAGS -->
|
||||
<!-- -->
|
||||
|
||||
<!-- Sets the BUILDDIR variable using the same rules used by wxWidgets itself.
|
||||
This makes it possible to keep separated 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_PREFIX)$(WX_PORT)$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)
|
||||
</set>
|
||||
</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>
|
||||
|
||||
|
||||
<include file="wx_xrc.bkl"/>
|
||||
|
||||
</makefile>
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
# We use 'COMPILER_PREFIX' option in places where bakefile doesn't like it, so
|
||||
# we must register a substitution function for it that provides additional
|
||||
# knowledge about the option (in this case that it does not contain dir
|
||||
# separators and so utils.nativePaths() doesn't have to do anything with it):
|
||||
|
||||
from utils import addSubstituteCallback
|
||||
|
||||
def __noopSubst(name, func, caller):
|
||||
return '$(%s)' % name
|
||||
addSubstituteCallback('COMPILER_PREFIX', __noopSubst)
|
||||
@@ -0,0 +1,251 @@
|
||||
<?xml version="1.0" ?>
|
||||
|
||||
<!--
|
||||
Presents for building wxWidgets applications using Autoconf or GNU toosets.
|
||||
See wx.bkl for platform-independent notes.
|
||||
|
||||
Format-specific notes:
|
||||
|
||||
* autoconf:
|
||||
Beware that you have to use WX_CONFIG_OPTIONS and
|
||||
WX_CONFIG_CHECK in your configure.ac to get at least the
|
||||
WX_CPPFLAGS, WX_CFLAGS, WX_CXXFLAGS, WX_LIBS option values defined.
|
||||
|
||||
To detect the WX_* option values typically you also want to use
|
||||
the WX_STANDARD_OPTIONS, WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS,
|
||||
WX_CONFIG_CHECK and finally WX_DETECT_STANDARD_OPTION_VALUES macros
|
||||
(see wxwin.m4 for more info).
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<makefile>
|
||||
|
||||
|
||||
|
||||
<!-- ============================================================== -->
|
||||
<!-- Autoconf -->
|
||||
<!-- ============================================================== -->
|
||||
|
||||
<if cond="FORMAT=='autoconf'">
|
||||
<option name="WX_CFLAGS"/>
|
||||
<option name="WX_CXXFLAGS"/>
|
||||
<option name="WX_CPPFLAGS"/>
|
||||
<option name="WX_LIBS"/>
|
||||
<option name="WX_RESCOMP"/>
|
||||
<option name="WX_VERSION_MAJOR"/>
|
||||
<option name="WX_VERSION_MINOR"/>
|
||||
<option name="WX_PORT"/>
|
||||
|
||||
<!-- wxwin.m4 macros will detect all WX_* options defined above -->
|
||||
|
||||
|
||||
<!-- VERY IMPORTANT: <wx-lib>base</wx-lib> must be the last wx-lib tag
|
||||
in all your bakefiles !!
|
||||
-->
|
||||
<define-tag name="wx-lib" rules="exe,dll,module">
|
||||
<if cond="value=='base'">
|
||||
<!-- all wx-dependent libraries should have been already listed
|
||||
thus we can now add WX_LIBS to the linker line -->
|
||||
<ldlibs>$(WX_LIBS)</ldlibs>
|
||||
</if>
|
||||
<if cond="value not in WX_LIB_LIST.split()">
|
||||
<error>Unknown wxWidgets library given in the wx-lib tag</error>
|
||||
</if>
|
||||
</define-tag>
|
||||
</if>
|
||||
|
||||
|
||||
<!-- ============================================================== -->
|
||||
<!-- GNU makefiles for Unix -->
|
||||
<!-- ============================================================== -->
|
||||
|
||||
<if cond="FORMAT=='gnu'">
|
||||
|
||||
<!-- remove those WX_* vars which were created just to avoid the definition
|
||||
of the WX_* options in wx.bkl -->
|
||||
<unset var="WX_SHARED"/>
|
||||
<unset var="WX_UNICODE"/>
|
||||
<unset var="WX_PORT"/>
|
||||
<unset var="WX_VERSION"/>
|
||||
|
||||
<set var="WX_CONFIG_DEFAULT" overwrite="0">wx-config</set>
|
||||
<option name="WX_CONFIG">
|
||||
<default-value>$(WX_CONFIG_DEFAULT)</default-value>
|
||||
<description>Location and arguments of wx-config script</description>
|
||||
</option>
|
||||
|
||||
<set var="WX_PORT_DEFAULT" overwrite="0">
|
||||
$(DOLLAR)(shell $(WX_CONFIG) --query-toolkit)
|
||||
</set>
|
||||
<option name="WX_PORT">
|
||||
<values>gtk2,msw,x11,osx_cocoa,osx_carbon,dfb</values>
|
||||
<default-value force="1">$(WX_PORT_DEFAULT)</default-value>
|
||||
<description>
|
||||
Port of the wx library to build against
|
||||
</description>
|
||||
</option>
|
||||
|
||||
<set var="WX_SHARED_DEFAULT" overwrite="0">
|
||||
$(DOLLAR)(shell if test -z `$(WX_CONFIG) --query-linkage`; then echo 1; else echo 0; fi)
|
||||
</set>
|
||||
<option name="WX_SHARED">
|
||||
<values>0,1</values>
|
||||
<values-description>Static,DLL</values-description>
|
||||
<default-value force="1">$(WX_SHARED_DEFAULT)</default-value>
|
||||
<description>
|
||||
Use DLL build of wx library to use?
|
||||
</description>
|
||||
</option>
|
||||
|
||||
<set var="WX_UNICODE_DEFAULT" overwrite="0">
|
||||
$(DOLLAR)(shell $(WX_CONFIG) --query-chartype | sed 's/unicode/1/;s/ansi/0/')
|
||||
</set>
|
||||
<option name="WX_UNICODE">
|
||||
<values>0,1</values>
|
||||
<values-description>ANSI,Unicode</values-description>
|
||||
<default-value force="1">$(WX_UNICODE_DEFAULT)</default-value>
|
||||
<description>
|
||||
Compile Unicode build of wxWidgets?
|
||||
</description>
|
||||
</option>
|
||||
|
||||
<set var="WX_VERSION_DEFAULT" overwrite="0">
|
||||
$(DOLLAR)(shell $(WX_CONFIG) --query-version | sed -e 's/\([0-9]*\)\.\([0-9]*\)/\1\2/')
|
||||
</set>
|
||||
<option name="WX_VERSION">
|
||||
<default-value>$(WX_VERSION_DEFAULT)</default-value>
|
||||
<description>
|
||||
Version of the wx library to build against.
|
||||
</description>
|
||||
</option>
|
||||
|
||||
<!-- Get MAJOR and MINOR version numbers -->
|
||||
<set var="WX_VERSION_MAJOR" make_var="1">
|
||||
$(DOLLAR)(shell echo $(DOLLAR)(WX_VERSION) | cut -c1,1)
|
||||
</set>
|
||||
<set var="WX_VERSION_MINOR" make_var="1">
|
||||
$(DOLLAR)(shell echo $(DOLLAR)(WX_VERSION) | cut -c2,2)
|
||||
</set>
|
||||
|
||||
|
||||
<!--
|
||||
Using the GNU format creates a configurable makefile just like
|
||||
a win32 makefile: i.e. a makefile where you can select the wanted
|
||||
wxWidgets build using the WX_* options.
|
||||
|
||||
The difference with win32 makefiles is that WX_PORT, WX_UNICODE and
|
||||
WX_SHARED options have a smart default value which is created using
|
||||
the installed wx-config or the wx-config given using WX_CONFIG option
|
||||
-->
|
||||
<set var="WX_CONFIG_UNICODE_FLAG">
|
||||
<if cond="WX_UNICODE=='0'">--unicode=no</if>
|
||||
<if cond="WX_UNICODE=='1'">--unicode=yes</if>
|
||||
</set>
|
||||
<set var="WX_CONFIG_SHARED_FLAG">
|
||||
<if cond="WX_SHARED=='0'">--static=yes</if>
|
||||
<if cond="WX_SHARED=='1'">--static=no</if>
|
||||
</set>
|
||||
<set var="WX_CONFIG_PORT_FLAG">
|
||||
--toolkit=$(WX_PORT)
|
||||
</set>
|
||||
<set var="WX_CONFIG_VERSION_FLAG">
|
||||
--version=$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR)
|
||||
</set>
|
||||
|
||||
<set var="WX_CONFIG_FLAGS" make_var="1">
|
||||
$(WX_CONFIG_UNICODE_FLAG) $(WX_CONFIG_SHARED_FLAG)
|
||||
$(WX_CONFIG_PORT_FLAG) $(WX_CONFIG_VERSION_FLAG)
|
||||
</set>
|
||||
|
||||
<set var="DEFAULT_CXX">`$(DOLLAR)(WX_CONFIG) --cxx`</set>
|
||||
<set var="WX_CFLAGS">`$(DOLLAR)(WX_CONFIG) --cflags $(WX_CONFIG_FLAGS)`</set>
|
||||
<set var="WX_CXXFLAGS">`$(DOLLAR)(WX_CONFIG) --cxxflags $(WX_CONFIG_FLAGS)`</set>
|
||||
<set var="WX_CPPFLAGS">`$(DOLLAR)(WX_CONFIG) --cppflags $(WX_CONFIG_FLAGS)`</set>
|
||||
<set var="WX_RESCOMP">`$(DOLLAR)(WX_CONFIG) --rescomp $(WX_CONFIG_FLAGS)`</set>
|
||||
|
||||
<!--
|
||||
VERY IMPORTANT: before starting to build all targets of the generated makefile,
|
||||
we need to check if the selected wxWidgets build exists; we do
|
||||
that simply creating the following target; if it fails the make
|
||||
program will halt with the wx-config error message...
|
||||
-->
|
||||
<if cond="WX_TEST_FOR_SELECTED_WXBUILD=='1'">
|
||||
<action id="test_for_selected_wxbuild">
|
||||
<dependency-of>all</dependency-of>
|
||||
|
||||
<!-- Use @ to hide to the user that we're running wx-config... -->
|
||||
<command>@$(DOLLAR)(WX_CONFIG) $(WX_CONFIG_FLAGS)</command>
|
||||
</action>
|
||||
</if>
|
||||
|
||||
<!-- we need these vars but the trick used in the default values above
|
||||
prevents bakefile from detecting it: -->
|
||||
<set var="FORMAT_OUTPUT_VARIABLES" append="1">WX_CONFIG WX_VERSION</set>
|
||||
|
||||
|
||||
<!-- VERY IMPORTANT: <wx-lib>base</wx-lib> must be the last wx-lib tag
|
||||
in all your bakefiles !!
|
||||
-->
|
||||
<define-tag name="wx-lib" rules="exe,dll,module">
|
||||
<if cond="value=='base'">
|
||||
<!-- all wx libraries should have been already specified, thus
|
||||
$(__liblist) should contain the full list of required wxlibs... -->
|
||||
<set var="__liblist" append="1">base</set>
|
||||
<ldlibs>`$(WX_CONFIG) $(WX_CONFIG_FLAGS) --libs $(','.join(__liblist.split()))`</ldlibs>
|
||||
</if>
|
||||
<if cond="value!='base'">
|
||||
<set var="__liblist" append="1">$(value)</set>
|
||||
</if>
|
||||
<if cond="value not in WX_LIB_LIST.split()">
|
||||
<error>Unknown wxWidgets library given in the wx-lib tag</error>
|
||||
</if>
|
||||
</define-tag>
|
||||
</if>
|
||||
|
||||
<!-- ============================================================== -->
|
||||
<!-- Common code -->
|
||||
<!-- ============================================================== -->
|
||||
|
||||
<if cond="FORMAT not in ['gnu','autoconf']">
|
||||
<error>
|
||||
Don't include presets/wx_unix.bkl directly, use presets/wx.bkl.
|
||||
</error>
|
||||
</if>
|
||||
|
||||
<!--
|
||||
We need to re-define the WINDRES resource compiler name to the resource compiler
|
||||
returned by 'wx-config - -rescomp' since this option returns both the name of the
|
||||
resource compiler to use (windres) and the flags required for that compiler.
|
||||
|
||||
This line typically does something *only* when the Makefile.in generated
|
||||
using this bakefile, is used on Windows with MSYS (when using Cygwin, resources
|
||||
are not compiled at all).
|
||||
Without this line, in fact, when compiling with MSYS on Windows, the - -include-dir
|
||||
option which tells windres to look in wxWidgets\include folder would be missing and
|
||||
then windres would fail to find the wxMSW resources.
|
||||
|
||||
NOTE: overwriting the WINDRES variable we add wxWidgets resource flags to
|
||||
all targets which include this bakefile; this could be useless to those
|
||||
targets which are not wx-based eventually present in that bakefile but
|
||||
in any case it shouldn't do any harm.
|
||||
-->
|
||||
<set var="WINDRES">$(WX_RESCOMP)</set>
|
||||
|
||||
<template id="wx-lib">
|
||||
<cxxflags>$(WX_CXXFLAGS)</cxxflags>
|
||||
<cflags>$(WX_CFLAGS)</cflags>
|
||||
</template>
|
||||
|
||||
<template id="wx" template="wx-lib">
|
||||
<!--
|
||||
Don't include the $(WX_LIBS) variable in linker options here since
|
||||
it would make impossible for the user to obtain the right library
|
||||
order when he needs to specify, *before* WX_LIBS, its own libraries
|
||||
that depend on wxWidgets libraries; to avoid this, we include
|
||||
$(WX_LIBS) as soon as we found the <wx-lib>base</wx-lib> tag which
|
||||
the user should always put *after* all other wx-dependent libraries
|
||||
-->
|
||||
</template>
|
||||
|
||||
</makefile>
|
||||
@@ -0,0 +1,342 @@
|
||||
<?xml version="1.0" ?>
|
||||
|
||||
<!-- Original source: https://wiki.wxwidgets.org/Bakefile -->
|
||||
<!-- Modified by: Francesco Montorsi <frm@users.sourceforge.net> -->
|
||||
<!-- Vaclav Slavik <vslavik@fastmail.fm> to better fit
|
||||
into Bakefile's presets -->
|
||||
<!-- Creation date: 6/9/2004 -->
|
||||
<!-- Last revision: 22/1/2005 off-CVS -->
|
||||
|
||||
|
||||
<makefile>
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- OPTIONS -->
|
||||
<!-- -->
|
||||
|
||||
<set var="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL">
|
||||
<!-- 'NORMAL' here refers to the fact that the formats for which
|
||||
FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL==1 only need
|
||||
additional compiler and/or linker flags (see e.g. WXMACHINE_FLAG)
|
||||
-->
|
||||
<if cond="FORMAT in ['msvc']">1</if>
|
||||
<if cond="FORMAT not in ['msvc']">0</if>
|
||||
</set>
|
||||
<set var="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS">
|
||||
<!-- the formats for which FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS==1
|
||||
need special handling: see the docs of the MSVS_PLATFORMS variable in Bakefile docs.
|
||||
-->
|
||||
<if cond="FORMAT in ['msvs2005prj','msvs2008prj']">1</if>
|
||||
<if cond="FORMAT not in ['msvs2005prj','msvs2008prj']">0</if>
|
||||
</set>
|
||||
<set var="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES">
|
||||
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='1'">1</if>
|
||||
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS=='1'">1</if>
|
||||
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='0' and FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS=='0'">0</if>
|
||||
</set>
|
||||
|
||||
<!-- This is a standard option that determines -->
|
||||
<!-- the architecture for which the lib/exe/dll later -->
|
||||
<!-- declared are meant. -->
|
||||
<if cond="not isdefined('TARGET_CPU') and FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='1'">
|
||||
<set var="TARGET_CPU_DEFAULT" overwrite="0">X86</set>
|
||||
<option name="TARGET_CPU">
|
||||
<values>X86,AMD64,IA64</values>
|
||||
<values-description>i386-compatible,AMD 64 bit,Itanium 64 bit</values-description>
|
||||
<default-value>$(TARGET_CPU_DEFAULT)</default-value>
|
||||
<description>
|
||||
Architecture of the CPU for which to build the executables and libraries
|
||||
</description>
|
||||
</option>
|
||||
</if>
|
||||
<if cond="not isdefined('TARGET_CPU') and FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS=='1'">
|
||||
<!-- defining TARGET_CPU also for the formats using the MSVS_PLATFORM variable allows to write
|
||||
easier tests in user bakefiles; e.g.:
|
||||
|
||||
<set var="MY_ARCH_DEPENDENT_VARIABLE">
|
||||
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES=='0'">value1</if>
|
||||
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES=='1' and TARGET_CPU=='X86'">value2</if>
|
||||
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES=='1' and TARGET_CPU=='AMD64'">value3</if>
|
||||
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES=='1' and TARGET_CPU=='IA64'">value4</if>
|
||||
</set>
|
||||
-->
|
||||
<set var="TARGET_CPU">
|
||||
<if cond="MSVS_PLATFORM=='win32'">X86</if>
|
||||
<if cond="MSVS_PLATFORM=='win64'">AMD64</if>
|
||||
<if cond="MSVS_PLATFORM=='ia64'">IA64</if>
|
||||
<!-- MSVS_PLATFORM currently does not support ia64 but this line is still needed by bakefile
|
||||
to correctly set the TARGET_CPU variable -->
|
||||
</set>
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
<!-- HELPER VARIABLES -->
|
||||
<!-- -->
|
||||
|
||||
|
||||
<!-- The debug define we need with win32 compilers -->
|
||||
<!-- (on Linux, the wx-config program is used). -->
|
||||
<set var="WXDEBUG_DEFINE">
|
||||
<if cond="WX_DEBUG=='1'">__WXDEBUG__</if>
|
||||
</set>
|
||||
|
||||
<!-- These are handy ways of dealing with the -->
|
||||
<!-- extensions in the library names of the -->
|
||||
<!-- wxWindows library. -->
|
||||
<set var="WX3RDPARTYLIBPOSTFIX">
|
||||
<if cond="WX_DEBUG=='1'">d</if>
|
||||
</set>
|
||||
|
||||
<set var="WXCPU">
|
||||
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES=='1' and TARGET_CPU=='AMD64'">_x64</if>
|
||||
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES=='1' and TARGET_CPU=='IA64'">_ia64</if>
|
||||
</set>
|
||||
|
||||
<set var="WXMACHINE_FLAG">
|
||||
<!-- add the /MACHINE linker flag to formats with "normal" multiple-arch support when building in 64bit mode
|
||||
(formats using the MSVS_PLATFORM variable don't need the /MACHINE linker flag!): -->
|
||||
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='1' and TARGET_CPU=='AMD64'">/MACHINE:AMD64</if>
|
||||
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='1' and TARGET_CPU=='IA64'">/MACHINE:IA64</if>
|
||||
</set>
|
||||
|
||||
<set var="WXLIBPATH">
|
||||
<if cond="WX_SHARED=='0'">$(DIRSEP)lib$(DIRSEP)$(COMPILER_PREFIX)$(WXCPU)_lib</if>
|
||||
<if cond="WX_SHARED=='1'">$(DIRSEP)lib$(DIRSEP)$(COMPILER_PREFIX)$(WXCPU)_dll</if>
|
||||
</set>
|
||||
|
||||
<!-- under Unix this is an option (detected at configure-time);
|
||||
under Windows this is not an user option! -->
|
||||
<set var="WX_PORT">msw</set>
|
||||
|
||||
<set var="WXLIBINCLUDE">$(WXLIBPATH)$(DIRSEP)$(WX_PORT)$(WXLIBPOSTFIX)</set>
|
||||
|
||||
|
||||
<!-- All the possible mixes for the wx library names -->
|
||||
<set var="WXLIB_BASE_NAME">
|
||||
<if cond="WX_MONOLITHIC=='0'">wxbase$(WX_VERSION)$(WXLIBPOSTFIX)</if>
|
||||
|
||||
<!--
|
||||
the trick used to support monolithic builds is here: when the
|
||||
<wx-lib>base</wx-lib> tag is found, and user selected
|
||||
WX_MONOLITHIC=1, then the base library is translated to the
|
||||
monolithic library
|
||||
-->
|
||||
<if cond="WX_MONOLITHIC=='1'">wx$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)</if>
|
||||
</set>
|
||||
|
||||
|
||||
<!-- Libraries whose name is prefixed with 'wxbase' -->
|
||||
<define-global-tag name="define-wxbase-lib-name">
|
||||
<set var="WXLIB_$(value.upper())_NAME">
|
||||
<if cond="WX_MONOLITHIC=='0'">
|
||||
wxbase$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)
|
||||
</if>
|
||||
</set>
|
||||
</define-global-tag>
|
||||
|
||||
<define-wxbase-lib-name>net</define-wxbase-lib-name>
|
||||
<define-wxbase-lib-name>xml</define-wxbase-lib-name>
|
||||
|
||||
|
||||
<!-- Libraries whose name is prefixed with 'wx' only -->
|
||||
<define-global-tag name="define-wxlib-name">
|
||||
<set var="WXLIB_$(value.upper())_NAME">
|
||||
<if cond="WX_MONOLITHIC=='0'">
|
||||
wx$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)
|
||||
</if>
|
||||
</set>
|
||||
</define-global-tag>
|
||||
|
||||
<define-wxlib-name>core</define-wxlib-name>
|
||||
<define-wxlib-name>media</define-wxlib-name>
|
||||
<define-wxlib-name>xrc</define-wxlib-name>
|
||||
<define-wxlib-name>html</define-wxlib-name>
|
||||
<define-wxlib-name>adv</define-wxlib-name>
|
||||
<define-wxlib-name>qa</define-wxlib-name>
|
||||
<define-wxlib-name>aui</define-wxlib-name>
|
||||
<define-wxlib-name>ribbon</define-wxlib-name>
|
||||
<define-wxlib-name>propgrid</define-wxlib-name>
|
||||
<define-wxlib-name>stc</define-wxlib-name>
|
||||
<define-wxlib-name>richtext</define-wxlib-name>
|
||||
<define-wxlib-name>webview</define-wxlib-name>
|
||||
|
||||
<!-- NOTE: The GL lib is not part of the monolithic build; treat it as a contrib! -->
|
||||
|
||||
|
||||
|
||||
<!-- WX TEMPLATE -->
|
||||
<!-- -->
|
||||
<!-- -->
|
||||
<!-- While not required, templates make your -->
|
||||
<!-- bakefiles much more readable. Templates, in -->
|
||||
<!-- essence, are abstract classes like c++. -->
|
||||
<!-- -->
|
||||
<!-- Your build targets "inherit" the template, -->
|
||||
<!-- along with the info associated with the template -->
|
||||
|
||||
<!-- -->
|
||||
<!-- wxWidgets LIBRARY/APP TEMPLATE -->
|
||||
<!-- -->
|
||||
<!-- The "base class" of all our build targets -->
|
||||
<!-- This links with the appropriate native -->
|
||||
<!-- libraries required by the platform, the libraries -->
|
||||
<!-- we want for our stuff, and the wxWindows libs. -->
|
||||
|
||||
<!-- this tag is used to include wx libraries: -->
|
||||
<define-tag name="wx-lib" rules="exe,dll,module">
|
||||
<if cond="value=='base'"><sys-lib>$(WXLIB_BASE_NAME)</sys-lib></if>
|
||||
<if cond="value=='core'"><sys-lib>$(WXLIB_CORE_NAME)</sys-lib></if>
|
||||
|
||||
<if cond="value=='net'"><sys-lib>$(WXLIB_NET_NAME)</sys-lib></if>
|
||||
<if cond="value=='xml'"><sys-lib>$(WXLIB_XML_NAME)</sys-lib></if>
|
||||
|
||||
<if cond="value=='media'"><sys-lib>$(WXLIB_MEDIA_NAME)</sys-lib></if>
|
||||
<if cond="value=='xrc'"><sys-lib>$(WXLIB_XRC_NAME)</sys-lib></if>
|
||||
<if cond="value=='html'"><sys-lib>$(WXLIB_HTML_NAME)</sys-lib></if>
|
||||
<if cond="value=='adv'"><sys-lib>$(WXLIB_ADV_NAME)</sys-lib></if>
|
||||
<if cond="value=='qa'"><sys-lib>$(WXLIB_QA_NAME)</sys-lib></if>
|
||||
<if cond="value=='aui'"><sys-lib>$(WXLIB_AUI_NAME)</sys-lib></if>
|
||||
<if cond="value=='ribbon'"><sys-lib>$(WXLIB_RIBBON_NAME)</sys-lib></if>
|
||||
<if cond="value=='propgrid'"><sys-lib>$(WXLIB_PROPGRID_NAME)</sys-lib></if>
|
||||
<if cond="value=='richtext'"><sys-lib>$(WXLIB_RICHTEXT_NAME)</sys-lib></if>
|
||||
<if cond="value=='webview'"><sys-lib>$(WXLIB_WEBVIEW_NAME)</sys-lib></if>
|
||||
|
||||
<!-- The GL lib isn't part of the monolithic build, treat it as a contrib: -->
|
||||
<if cond="value=='gl'">
|
||||
<sys-lib>wx$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)</sys-lib>
|
||||
</if>
|
||||
|
||||
<if cond="value=='stc'">
|
||||
<!-- wxSTC requires also the basic scintilla and lexilla libraries
|
||||
which are built as a separate 3rd party libraries -->
|
||||
<sys-lib>$(WXLIB_STC_NAME)</sys-lib>
|
||||
<sys-lib>wxscintilla$(WX3RDPARTYLIBPOSTFIX)</sys-lib>
|
||||
<sys-lib>wxlexilla$(WX3RDPARTYLIBPOSTFIX)</sys-lib>
|
||||
</if>
|
||||
|
||||
<if cond="value not in WX_LIB_LIST.split()">
|
||||
<error>Unknown wxWidgets library given in the wx-lib tag</error>
|
||||
</if>
|
||||
</define-tag>
|
||||
|
||||
<!-- just a placeholder to mark the place where <wx-lib> will be placed,
|
||||
thanks to the order precedence declaration below it: -->
|
||||
<define-tag name="__wx-libs-point" rules="exe,dll,module"/>
|
||||
<tag-info name="wx-lib"
|
||||
position="before:__wx-libs-point"/>
|
||||
<tag-info name="__wx-syslibs"
|
||||
position="after:__wx-libs-point"/>
|
||||
|
||||
|
||||
<!-- template for static wx libraries: -->
|
||||
<template id="wx-lib">
|
||||
<!-- MISCELLANEOUS -->
|
||||
<if cond="FORMAT=='mingw'">
|
||||
<ldflags>-mthreads</ldflags>
|
||||
</if>
|
||||
|
||||
<define>$(substituteFromDict(WX_SHARED,{'1':'WXUSINGDLL','0':''}))</define>
|
||||
|
||||
<define>$(WXDEBUG_DEFINE)</define>
|
||||
<define>__WXMSW__</define>
|
||||
|
||||
<if cond="FORMAT!='xcode2'">
|
||||
<include>$(WX_DIR)$(WXLIBINCLUDE)</include>
|
||||
<include>$(WX_DIR)/include</include>
|
||||
</if>
|
||||
</template>
|
||||
|
||||
|
||||
<!-- this ugly tag contains all sys-lib tags used by "wx" template,
|
||||
in order to make sure they are not reorder when wx-lib is moved
|
||||
after __wx-libs-point: -->
|
||||
<define-tag name="__wx-syslibs" rules="exe,dll,module">
|
||||
<!-- wx 3rd party libs, always use them: -->
|
||||
<sys-lib>wxtiff$(WX3RDPARTYLIBPOSTFIX)</sys-lib>
|
||||
<sys-lib>wxjpeg$(WX3RDPARTYLIBPOSTFIX)</sys-lib>
|
||||
<sys-lib>wxpng$(WX3RDPARTYLIBPOSTFIX)</sys-lib>
|
||||
<sys-lib>wxwebp$(WX3RDPARTYLIBPOSTFIX)</sys-lib>
|
||||
<sys-lib>wxzlib$(WX3RDPARTYLIBPOSTFIX)</sys-lib>
|
||||
<!-- For regex we won't use the WX3RDPARTYLIBPOSTIX postfix:
|
||||
unliked tiff, jpeg, png, webp, zlib, expat, when building
|
||||
in Unicode mode, the "u" suffix is appended to regex -->
|
||||
<sys-lib>wxregex$(WXLIBPOSTFIX)</sys-lib>
|
||||
<sys-lib>wxexpat$(WX3RDPARTYLIBPOSTFIX)</sys-lib>
|
||||
|
||||
<!-- link-in system libs that wx depends on: -->
|
||||
<!-- If on borland, we don't need to do much -->
|
||||
<if cond="FORMAT=='borland'">
|
||||
<sys-lib>ole2w32</sys-lib>
|
||||
</if>
|
||||
|
||||
<!-- Non-borland, on the other hand... -->
|
||||
<if cond="FORMAT!='borland'">
|
||||
<sys-lib>kernel32</sys-lib>
|
||||
<sys-lib>user32</sys-lib>
|
||||
<sys-lib>gdi32</sys-lib>
|
||||
<sys-lib>gdiplus</sys-lib>
|
||||
<sys-lib>msimg32</sys-lib>
|
||||
<sys-lib>comdlg32</sys-lib>
|
||||
<sys-lib>winspool</sys-lib>
|
||||
<sys-lib>winmm</sys-lib>
|
||||
<sys-lib>shell32</sys-lib>
|
||||
<sys-lib>comctl32</sys-lib>
|
||||
<sys-lib>ole32</sys-lib>
|
||||
<sys-lib>oleaut32</sys-lib>
|
||||
<sys-lib>uuid</sys-lib>
|
||||
<sys-lib>rpcrt4</sys-lib>
|
||||
<sys-lib>advapi32</sys-lib>
|
||||
<sys-lib>ws2_32</sys-lib>
|
||||
</if>
|
||||
|
||||
<!-- Libs common to both borland and MSVC -->
|
||||
<if cond="FORMAT=='msvc' or FORMAT=='borland'">
|
||||
<sys-lib>oleacc</sys-lib>
|
||||
</if>
|
||||
</define-tag>
|
||||
|
||||
<!-- template for wx executables/dlls: -->
|
||||
<template id="wx" template="wx-lib">
|
||||
<if cond="FORMAT!='xcode2'">
|
||||
<lib-path>$(WX_DIR)$(WXLIBPATH)</lib-path>
|
||||
</if>
|
||||
|
||||
<ldflags>$(WXMACHINE_FLAG)</ldflags>
|
||||
|
||||
<!-- wx libs must come before 3rd party and sys libs, this is
|
||||
the place where the hack explained above is carried on: -->
|
||||
<__wx-libs-point/>
|
||||
<__wx-syslibs/>
|
||||
</template>
|
||||
|
||||
<if cond="FORMAT_SUPPORTS_ACTIONS=='1' and WX_TEST_FOR_SELECTED_WXBUILD=='1'">
|
||||
|
||||
<!--
|
||||
VERY IMPORTANT: before starting to build all targets of the generated makefile,
|
||||
we need to check if the selected wxWidgets build exists; we do
|
||||
that simply creating the following target; if it fails the make
|
||||
program will halt printing the following nice error message...
|
||||
(much better than the 'could not find wx/*.h file')
|
||||
-->
|
||||
<action id="test_for_selected_wxbuild">
|
||||
<dependency-of>all</dependency-of>
|
||||
|
||||
<!-- the @ is to hide these actions from the user -->
|
||||
<command>
|
||||
@if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \
|
||||
echo ----------------------------------------------------------------------------
|
||||
@if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \
|
||||
echo The selected wxWidgets build is not available!
|
||||
@if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \
|
||||
echo Please use the options prefixed with WX_ to select another wxWidgets build.
|
||||
@if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \
|
||||
echo ----------------------------------------------------------------------------
|
||||
@if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \
|
||||
exit 1
|
||||
</command>
|
||||
</action>
|
||||
</if>
|
||||
|
||||
</makefile>
|
||||
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" ?>
|
||||
|
||||
<!--
|
||||
|
||||
Bakefile XRC support; included by wx.bkl, do not include directly.
|
||||
|
||||
Usage:
|
||||
|
||||
<exe id="myapp" template="wxgui,simple">
|
||||
...
|
||||
<sources>...</sources>
|
||||
...
|
||||
<xrc-file>myapp.xrc</xrc-file>
|
||||
<xrc-file>file2.xrc</xrc-file>
|
||||
</exe>
|
||||
|
||||
Then in application code, you have to call initialization for every XRC
|
||||
file:
|
||||
|
||||
InitXMLResource_myapp();
|
||||
InitXMLResource_file2();
|
||||
|
||||
-->
|
||||
|
||||
<makefile>
|
||||
|
||||
<!-- XRC section -->
|
||||
<option name="WXRC" category="path">
|
||||
<description>Path to find the wxrc executable.</description>
|
||||
<default-value>wxrc</default-value>
|
||||
</option>
|
||||
|
||||
|
||||
<define-tag name="xrc-file" rules="exe,dll,lib">
|
||||
<set var="_xrc_file">$(value)</set>
|
||||
<set var="_xrc_cpp">$(value.replace('.xrc', '_xrc.cpp'))</set>
|
||||
<set var="_xrc_base">$(value[value.rfind('/')+1:value.rfind('.')])</set>
|
||||
<set var="_wxrc_options">-c -n InitXMLResource_$(_xrc_base)</set>
|
||||
|
||||
<sources>$(_xrc_cpp)</sources>
|
||||
<if cond="FORMAT not in ['msvs2003prj','msvs2005prj']">
|
||||
<clean-files>$(_xrc_cpp)</clean-files>
|
||||
<add-target target="$(_xrc_cpp)" type="action"/>
|
||||
<modify-target target="$(_xrc_cpp)">
|
||||
<set var="_xrc">$(_xrc_file)</set>
|
||||
<depends-on-file>$(SRCDIR)/$(_xrc)</depends-on-file>
|
||||
<command>
|
||||
$(WXRC) $(_wxrc_options) -o $(_xrc_cpp) $(_xrc)
|
||||
</command>
|
||||
</modify-target>
|
||||
</if>
|
||||
<if cond="FORMAT in ['msvs2003prj','msvs2005prj']">
|
||||
<sources>$(_xrc_file)</sources>
|
||||
<!--
|
||||
A hack to add XRC compilation step to MSVC projects.
|
||||
|
||||
NB: it's important to use backslashes and not slashes here.
|
||||
-->
|
||||
<set var="_custom_build_files" append="1">$(_xrc_file.replace('/','\\'))</set>
|
||||
<set var="_custom_build_$(_xrc_file.replace('/','_').replace('.','_'))">
|
||||
Compiling XRC resources: $(_xrc_file)...
|
||||
InputPath=$(_xrc_file)
|
||||
|
||||
"$(_xrc_cpp.replace('/','\\'))" : "$(DOLLAR)(INTDIR)"
|
||||
$(TAB)$(WXRC) $(_wxrc_options) -o $(_xrc_cpp) $(_xrc_file)
|
||||
</set>
|
||||
</if>
|
||||
|
||||
</define-tag>
|
||||
|
||||
</makefile>
|
||||
@@ -0,0 +1,48 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.59)
|
||||
|
||||
AC_INIT([minimal],[1.2.5],[vslavik@fastmail.fm])
|
||||
|
||||
AC_CONFIG_SRCDIR([minimal.cpp])
|
||||
|
||||
AC_CANONICAL_BUILD
|
||||
AC_CANONICAL_HOST
|
||||
AC_CANONICAL_TARGET
|
||||
|
||||
|
||||
|
||||
AM_OPTIONS_WXCONFIG
|
||||
|
||||
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_AWK
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CXXCPP
|
||||
|
||||
|
||||
|
||||
AM_PATH_WXCONFIG(2.4.1, WXFOUND=1)
|
||||
|
||||
if test "$WXFOUND" != 1; then
|
||||
AC_MSG_ERROR([
|
||||
Please check that wx-config is in path, the directory
|
||||
where wxWindows libraries are installed (returned by
|
||||
'wx-config --libs' command) is in LD_LIBRARY_PATH or
|
||||
equivalent variable and wxWindows is version 2.4.0 or above.
|
||||
])
|
||||
fi
|
||||
|
||||
AC_BAKEFILE([m4_include(autoconf_inc.m4)])
|
||||
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" ?>
|
||||
|
||||
<makefile>
|
||||
|
||||
<include file="presets/wx.bkl"/>
|
||||
|
||||
<exe id="minimal" template="wxgui">
|
||||
|
||||
<!-- this sample builds always in debug mode; if you have
|
||||
compiled wxWidgets in release mode, you'll get link errors! -->
|
||||
<debug-info>on</debug-info>
|
||||
<runtime-libs>dynamic</runtime-libs>
|
||||
|
||||
<sources>minimal.cpp</sources>
|
||||
|
||||
<wx-lib>core</wx-lib>
|
||||
<wx-lib>base</wx-lib>
|
||||
</exe>
|
||||
|
||||
</makefile>
|
||||
@@ -0,0 +1,177 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: minimal.cpp
|
||||
// Purpose: Minimal wxWidgets sample
|
||||
// Author: Julian Smart
|
||||
// Created: 04/01/98
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
|
||||
// for all others, include the necessary headers (this file is usually all you
|
||||
// need because it includes almost all "standard" wxWidgets headers)
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// resources
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Define a new application type, each program should derive a class from wxApp
|
||||
class MyApp : public wxApp
|
||||
{
|
||||
public:
|
||||
// override base class virtuals
|
||||
// ----------------------------
|
||||
|
||||
// this one is called on application startup and is a good place for the app
|
||||
// initialization (doing it here and not in the ctor allows to have an error
|
||||
// return: if OnInit() returns false, the application terminates)
|
||||
virtual bool OnInit();
|
||||
};
|
||||
|
||||
// Define a new frame type: this is going to be our main frame
|
||||
class MyFrame : public wxFrame
|
||||
{
|
||||
public:
|
||||
// ctor(s)
|
||||
MyFrame(const wxString& title);
|
||||
|
||||
// event handlers (these functions should _not_ be virtual)
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
void OnAbout(wxCommandEvent& event);
|
||||
|
||||
private:
|
||||
// any class wishing to process wxWindows events must use this macro
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// IDs for the controls and the menu commands
|
||||
enum
|
||||
{
|
||||
// menu items
|
||||
Minimal_Quit = wxID_EXIT,
|
||||
|
||||
// it is important for the id corresponding to the "About" command to have
|
||||
// this standard value as otherwise it won't be handled properly under Mac
|
||||
// (where it is special and put into the "Apple" menu)
|
||||
Minimal_About = wxID_ABOUT
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event tables and other macros for wxWindows
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// the event tables connect the wxWindows events with the functions (event
|
||||
// handlers) which process them. It can be also done at run-time, but for the
|
||||
// simple menu events like this the static method is much simpler.
|
||||
wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
EVT_MENU(Minimal_Quit, MyFrame::OnQuit)
|
||||
EVT_MENU(Minimal_About, MyFrame::OnAbout)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
// Create a new application object: this macro will allow wxWidgets to create
|
||||
// the application object during program execution (it's better than using a
|
||||
// static object for many reasons) and also implements the accessor function
|
||||
// wxGetApp() which will return the reference of the right type (i.e. MyApp and
|
||||
// not wxApp)
|
||||
wxIMPLEMENT_APP(MyApp);
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// the application class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// 'Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
// create the main application window
|
||||
MyFrame *frame = new MyFrame(wxT("Minimal wxWidgets App"));
|
||||
|
||||
// and show it (the frames, unlike simple controls, are not shown when
|
||||
// created initially)
|
||||
frame->Show(true);
|
||||
|
||||
// success: wxApp::OnRun() will be called which will enter the main message
|
||||
// loop and the application will run. If we returned false here, the
|
||||
// application would exit immediately.
|
||||
return true;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// main frame
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// frame constructor
|
||||
MyFrame::MyFrame(const wxString& title)
|
||||
: wxFrame(nullptr, wxID_ANY, title)
|
||||
{
|
||||
// set the frame icon
|
||||
|
||||
#if wxUSE_MENUS
|
||||
// create a menu bar
|
||||
wxMenu *menuFile = new wxMenu;
|
||||
|
||||
// the "About" item should be in the help menu
|
||||
wxMenu *helpMenu = new wxMenu;
|
||||
helpMenu->Append(Minimal_About, wxT("&About\tF1"), wxT("Show about dialog"));
|
||||
|
||||
menuFile->Append(Minimal_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
|
||||
|
||||
// now append the freshly created menu to the menu bar...
|
||||
wxMenuBar *menuBar = new wxMenuBar();
|
||||
menuBar->Append(menuFile, wxT("&File"));
|
||||
menuBar->Append(helpMenu, wxT("&Help"));
|
||||
|
||||
// ... and attach this menu bar to the frame
|
||||
SetMenuBar(menuBar);
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
// create a status bar just for fun (by default with 1 pane only)
|
||||
CreateStatusBar(2);
|
||||
SetStatusText(wxT("Welcome to wxWidgets!"));
|
||||
#endif // wxUSE_STATUSBAR
|
||||
}
|
||||
|
||||
|
||||
// event handlers
|
||||
|
||||
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
// true is to force the frame to close
|
||||
Close(true);
|
||||
}
|
||||
|
||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( wxT("This is the About dialog of the minimal sample.\n")
|
||||
wxT("Welcome to %s"), wxVERSION_STRING);
|
||||
|
||||
wxMessageBox(msg, wxT("About Minimal"), wxOK | wxICON_INFORMATION, this);
|
||||
}
|
||||
Reference in New Issue
Block a user