gtk/win32/vs12
Chun-wei Fan ffc15bf922 Visual Studio builds: Adapt to new glib-mkenums
glib-mkenums is now done in Python, but since the Visual Studio build
environment (cmd.exe) does not support shebang lines, we need to call
the interpretor explicitly to run the script.

This means that we need to update on how we generate
gsk/gskenumtypes.[c|h] in our projects, as at this point GTK+-3.91.x
does not require a GLib installation that ships with the Python-fied
glib-mkenums.  As a result, we adapt to this by first using Python
to call glib-mkenums.  If this fails (where the output file becomes 0
in size), then we use PERL to call the glib-mkenums script.  Note that
during the build this will cause a warning message to be displayed,
stating that '&' cannot be found, but due to the way Windows .bat script
are done, we need to live with that until a solution can be found on
this.

This is likely a problem that does not exist in the Meson builds, as
Meson will take care of calling the interpretor for us by looking at
the shebang lines for our case.

Also, clean up the .batin Windows batch script that is used to call
glib-mkenums by using a for loop in there.
2017-08-01 16:26:43 +08:00
..
gdk4-win32.vcxproj.filtersin
gdk4-win32.vcxprojin
gdk-4.vcxproj.filtersin
gdk-4.vcxprojin
gsk-4.vcxproj.filtersin Visual Studio builds: Update GSK project 2017-01-20 18:35:52 +08:00
gsk-4.vcxprojin Visual Studio builds: Adapt to new glib-mkenums 2017-08-01 16:26:43 +08:00
gtk4-build-defines.props
gtk4-builder-tool.vcxproj
gtk4-builder-tool.vcxproj.filters
gtk4-demo-application.vcxproj.filtersin
gtk4-demo-application.vcxprojin
gtk4-demo.vcxproj.filtersin
gtk4-demo.vcxprojin
gtk4-encode-symbolic-svg.vcxproj
gtk4-encode-symbolic-svg.vcxproj.filters
gtk4-gen-srcs.props Visual Studio builds: Adapt to new glib-mkenums 2017-08-01 16:26:43 +08:00
gtk4-icon-browser.vcxproj.filtersin
gtk4-icon-browser.vcxprojin
gtk4-install.propsin MSVC builds: Allow different Python versions per toolset 2017-07-31 17:39:56 +08:00
gtk4-install.vcxproj
gtk4-install.vcxproj.filters
gtk4-prebuild.vcxproj
gtk4-prebuild.vcxproj.filters
gtk4-query-settings.vcxproj
gtk4-query-settings.vcxproj.filters
gtk4-update-icon-cache.vcxproj
gtk4-update-icon-cache.vcxproj.filters
gtk4-version-paths.props.in MSVC builds: Allow different Python versions per toolset 2017-07-31 17:39:56 +08:00
gtk-4.vcxproj.filtersin
gtk-4.vcxprojin MSVC builds: Allow different Python versions per toolset 2017-07-31 17:39:56 +08:00
gtk+-4.sln
Makefile.am Visual Studio builds: Support Visual Studio 2017 2017-02-15 14:43:15 +08:00
README.txt

Please do not compile this package (GTK+) in paths that contain
spaces in them-as strange problems may occur during compilation or during
the use of the library.

A more detailed outline for instructions on building the GTK+ with Visual
C++ can be found in the following GNOME Live! page:

https://wiki.gnome.org/Projects/GTK+/Win32/MSVCCompilationOfGTKStack

This VS12 solution and the projects it includes are intented to be used
in a GTK+ source tree unpacked from a tarball. In a git checkout you
first need to use some Unix-like environment or manual work to expand
the files needed, like config.h.win32.in into config.h.win32 and the
.vcxprojin and .vcxproj.filtersin files here into corresponding actual
.vcxproj and vcxproj.filters files.

You will need the parts from below in the GTK+ stack: GDK-Pixbuf, Pango,
ATK and GLib.  External dependencies are at least Cairo
(with Cairo-GObject support, meaning Cairo 1.10.x or later), zlib, libpng,
gettext-runtime, fontconfig*, freetype*, expat*.  See the 
build/win32/vs12/README.txt file in glib for details where to unpack them.

You will also need a Python 2.6+/3.x interpretor installed on your system,
which can be obtained from the official installers available from
http://www.python.org.  Please note that the Python interpretor (python.exe)
either needs to be in your PATH before attempting the build of GTK+, or it
can be found in the path specified by PythonPath in gtk-version-paths.props.
If you happen to change the PythonPath setting in gtk-version-paths.props after
opening gtk+.sln with Visual Studio, you will need to close the gtk+.sln solution,
delete all the *.sdf, *.suo and *.user files before re-attempting the build.

It is recommended that one builds the dependencies with VS12 as far as
possible, especially those from and using the GTK+ stack (i.e. GLib,
Cairo, ATK, Pango, GDK-Pixbuf), so that crashes caused by mixing calls
to different CRTs can be kept at a minimum.

To build with Vulkan renderer support, use the configs that end with _Vulkan.
You will need the LunarG Vulkan SDK installed, and its include\ directory
and Bin\ (64-bit) or Bin32 (32-bit) need to be in your INCLUDE and LIB paths
(or need to be set in your additional include paths and additional library paths)
so that they can be found by the build.  To run with the Vulkan renderer, set
GSK_RENDERER=vulkan--you will need a video adapter with driver support for Vulkan
to support this.

zlib, libpng, and Cairo do contain support for compiling under VS12
using VS project files and/or makefiles at this time of writing, For the
GTK+ stack, VS12 project files are either available under
$(srcroot)/build/vs12 in the case of GLib (stable/unstable), ATK
(stable/unstable) and GDK-Pixbuf (unstable), and should be in the next
unstable version of Pango.  There is no known official VS12 build
support for fontconfig (along with freetype and expat) and
gettext-runtime, so please use the binaries from: 

ftp://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/ (32 bit)
ftp://ftp.gnome.org/pub/GNOME/binaries/win64/dependencies/ (64 bit)

Unzip the binaries obtained from ftp.gnome.org in <root>\vs12\<PlatformName>,
and build the following, if not already done so: 

Note: put the resulting zlib, libpng, pcre and Cairo files as follows:
 .dll files: <root>\vs12\<PlatformName>\bin
 .lib files: <root>\vs12\<PlatformName>\lib
 .h files: <root>\vs12\<PlatformName>\include

The recommended build order for these dependencies:
(first unzip any dependent binaries downloaded from the ftp.gnome.org
 as described in the README.txt file in the build/win32/vs12 folder)
-zlib
-libpng
-(for GDK-Pixbuf, if not using GDI+) IJG JPEG or libjpeg-turbo
-(for GDK-Pixbuf, if not using GDI+) libtiff
 [libtiff requires zlib and IJG JPEG or libjpeg-turbo]
-(for GDK-Pixbuf, if not using GDI+) jasper [jpeg-2000 library]
-(optional for GLib) PCRE (version 8.12 or later, use of CMake to
  build PCRE is recommended-see build/win32/vs12/README.txt of GLib)
-GLib **
-Cairo (inclusive of Cairo-GObject)
-ATK**
-Pango**
-GDK-Pixbuf**
(note the last 3 dependencies are not interdependent, so the last 3
 dependencies can be built in any order)

The "install" project will copy build results and headers into their
appropriate location under <root>\vs12\<PlatformName>. For instance,
built DLLs go into <root>\vs12\<PlatformName>\bin, built LIBs into
<root>\vs12\<PlatformName>\lib and GTK+ headers into
<root>\vs12\<PlatformName>\include\gtk-3.0. This is then from where
project files higher in the stack are supposed to look for them, not
from a specific GLib source tree.

Please note, as GTK+ uses the Adwaita theme for all platforms by default,
most icons used are not included with GTK+ (which *are* needed), so please see
https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack (under the
GTK+ section) on how to get those icons set up for use with GTK+.

*About the dependencies marked with *: These dependencies are optional
 as those are not compulsory components for building and running GTK+
 itself, but note that they are needed for people running and building
 GIMP or those who need complex script support via fontconfig.  They
 are referred to by components in Cairo and Pango mainly.
 Decide whether you need fontconfig support prior to building Cairo
 and Pango.

**:Put the sources of the packages marked with ** in <root>\<package-
    source-tree>, and build with VS12 from there.

--Tor Lillqvist <tml@iki.fi>
--Updated by Chun-wei Fan <fanc999@yahoo.com.tw>