Building gtkmm on Win32
===========================

Currently, both the mingw (native win32) gcc compiler and MS Visual
Studio 2013 or later are supported. gtkmm can be built with
mingw32-gcc using the gnu autotools (automake, autoconf, libtool).
As explicitly stated in the gtk+ for win32 distribution
(http://www.gimp.org/win32/), the gcc compiler provided by the cygwin
distribution should not be used to build gtk+/gtkmm libraries and/or
applications (see the README.win32 that comes with the gtk+ DLLs).
This MIGHT cause conflicts between the cygwin and msvcrt runtime
environments.

1. Mingw

The mingw distribution which has been tested with this release is the
following :

* MinGW-4.1 as the base distribution.

The bare mingw distribution does not provide the necessary tools (sh, perl, m4
, autoconf, automake, ..) to run the provided configure script "as is". One
(currently non supported) solution is to use mingw in conjunction with msys,
which is readily available on the mingw website (http://www.mingw.org/).

The preferred method is to combine the cygwin distribution (for the unix tools
that were mentioned above) with mingw by making sure that the mingw
tools (gcc, ld, dlltool, ..) are called first.

First, make sure that you have working distribution of the native port
of both libsigc++-2.x and gtk+-3.0 on win32 (see
http://www.gimp.org/win32). If you can't compile a simple gtk+ example
using gcc and `pkg-config --cflags --libs`, you should not even think
about trying to compile gtkmm, let alone using precompiled libgtkmm
DLLs to port your gtkmm application !

The configure script can then be called using (as an example) the
following options

./configure --prefix=/target --build=i386-pc-mingw32 --disable-static

then

make
make check
make install

2. MS Visual Studio 2013 or later

Open a Visual Studio command prompt suitable for your intended build
configuration, and change to the MSVC_NMake directory.  Ensure that
all the depedent libraries could be found in $(PREFIX), which is at
$(srcroot)\..\vsX\$(Platform) by default, where X is 12 for Visual
Studio 2013, and 14 for later versions of Visual Studio.  Run
'nmake /f Makefile.vc CFG=[release|debug]' to build pangomm.  If a
different $(PREFIX) is desired rather than the aforementioned default,
pass in PREFIX=$(PATH) into your command line.  If using C++
dependencies that are built with Meson, specify USE_MESON_LIBS=1 in your
NMake command line.

A 'clean' target is supported to remove all the built object files and
intermediate files that are generated during the build, while an
'install' target is supported to copy the built DLL and PDB, .lib and
headers to their appropriate locations under $(PREFIX).

The NMake Makefiles now support building the pangomm libraries directly from a GIT checkout
with a few manual steps required, namely to:

-Ensure that you have a copy of Cygwin or MSYS/MSYS64 installed, including
 m4.exe and sh.exe.  You should also have a PERL for Windows installation
 as well, and your PATH should contain the paths to your PERL interpreter
 and the bin\ directory of your Cygwin or MSYS/MSYS64 installation, and
 it is recommended that these paths are towards the end of your PATH.  You need
 to install the XML::Parser PERL module as well, which requires libexpat.  You
 may wish to pass in the directory where gmmproc and generate_wrap_init.pl
 from glibmm is found, if they are not in $(PREFIX)\share\glibmm-2.4\proc.

-Make a new copy of the entire source tree to some location, where the build
 is to be done; then in $(srcroot)\MSVC_NMake run
 nmake /f Makefile.vc CFG=[release|debug], which will copy and generate
 the following files with the proper info:
 --$(srcroot)\MSVC_NMake\pangomm\pangommconfig.h
 --$(srcroot)\MSVC_NMake\pangomm\pangomm.rc
 and will proceed with the build

For pangommconfig.h, it is recommended to keep PANGOMM_DISABLE_DEPRECATED
undefined unless you know what you are doing.  If $(srcroot)\MSVC_NMake\pangomm\pangommconfig.h
and/or $(srcroot)\MSVC_NMake\pangomm\pangomm.rc is missing from the release tarball, they will
also be generated when nmake /f Makefile.vc CFG=[release|debug] is run.

Note that if $(srcroot)\MSVC_NMake\pangomm\pangommconfig.h and/or
$(srcroot)\MSVC_NMake\pangomm\pangomm.rc needs to be generated, a working PERL installation is
required.

3. Using Meson

3.1 Meson with Visual Studio 2013 or later

Note also that before building, if using Visual Studio 2013,you will
need to ensure that 'warnings' is not configured to 'fatal' (the
default), as the C++11 support in Visual Studio 2013 is not complete
enough to avoid compiler warnings.  Visual Studio 2015 and later
should be able to build without warnings.

You will need to have Python 3.5.x or later installed with Meson 0.50.0
or later in order to use this build option, in addition to glibmm,
cairomm and libsigc++-2.x (built with Visual Studio) and PangoCairo,
with all of their required dependencies.  The Ninja build tool is
also required if not using --backend=[vs2015|vs2017|vs2019] in the Meson
command line, as noted towards the end of this section.

Note that for the -mm libraries (cairomm and glibmm), do ensure that the same compiler
is used to build the -mm libraries and pangomm, even if on Visual Studio 2015, 2017 or
2019.  One should be able to interexchange dependent C libraries that were built with
Visual Studio 2015, 2017 or 2019 without problems.  If there are strange linker errors,
it is likely caused by using a different compiler version.

Note that 'debug' builds should only be used against dependencies that are built
as debug builds, and 'release' and 'debugoptimized' should be only used against
dependencies that are built as 'release' or 'debugoptimized'.  On Visual Studio
builds in Meson, 'debugoptimized' is roughly equivilant to a Release build with
.PDB files enabled, perhaps with some debugging features that are specific to the
respective packages.

You will need to have a working copy of glibmm, cairomm and PangoCairo's
pkg-config files, which point to the corresponding locations of its headers
and .lib's and the headers and .lib's of all of its dependencies.

To carry out a build, do this in the same command prompt, with
the Python interpreter, Meson executable script and Ninja executable
(if not using --backend=vs[2015|2017|2019]) in your PATH:
-Create an empty build directory and cd to it.
-Run "meson <path-to-pangomm-sources> --buildtype=<buildtype> --prefix=<prefix> [--backend=vs[2015|2017|2019]]" without the quotes.
-Perform the build using ninja or Visual Studio (if --backend=vs[2015|2017|2019])
 is used.  Install the build results after the build succeeds.

3.2 Meson with MinGW
The standard Meson build instructions for *NIX should work, although it
is untested at the time of writing.

4. Gtkmm methods and signals not available on win32

All gtkmm methods and signals are available on win32.

5. Gtkmm examples and demos on win32

All demos and examples compile/run on win32

