Version: 2017-05-14
This web site explains how I can easily compile the GTK+ 3.0 libraries and related libraries on Microsoft Windows. There are other web sites explaining how to build the GTK+ library, but usually they require all sorts of tools. This web site tries to simplify the building process and avoid the using of special versions of the libraries.
Generally I have created or modified CMake files for most of the libraries. At the moment some libraries (like gtk, glib) have fixed Visual Studio solution files and therefore the following preliminary steps must be performed. (I would like to generate CMake files for these libraries as well, as time permits.)
c:\work\gtk
c:\work\gtk\zlib-X.Y.Z c:\work\gtk\pcre-A.B.C
c:\work\gtk\vs10\Win32In the case of Visual Studio 2015 the directory will be:
c:\work\gtk\vs14\Win32(Please note, that after 2010 there is a difference between the year and the version number of the Visual Studio.)
c:\work\gtk\vs10\Win32\bin \include \lib
CMakelists.txt
) are available with the library by default,
however there are some problems with them. The following changes are applied to it:
CMAKE_INSTALL_PREFIX
.CMakelists.txt
file.c:\work\gtk
.
The original package can be found at the official web site.c:\work\gtk\zlib-1.2.8
directory. In this way we overwrite the original
CMakelists.txt
c:\work\gtk\zlib-1.2.8\You can use the "
Browse Source...
" button or type in the
name of the directory. In the later case do not worry about the "backslash",
just use letter "/". Even on Windows.c:\work\gtk\zlib-1.2.8\output
Configuration
":CMAKE_INSTALL_PREFIX
option specify
c:\work\gtk\vs14\Win32
Configuration
" again until all red lines disappear.Generate
". This will generate the Visual Studio
solution and project files in directory c:\work\gtk\zlib-1.2.8\output
.INSTALL
project separately.
(Right click on the project and select Build.)
This project will copy all required files into the directory specified in CMAKE_INSTALL_PREFIX
.c:\work\gtk
.
The original package can be found at the official web site.Configuration
" in CMake.BUILD_SHARED_LIBS
PCRE_SUPPORT_UTF
PCRE_BUILD_TESTS
PCRE_NEWLINE
to the value ANY
CMAKE_INSTALL_PREFIX
to the value
c:\work\gtk\vs14\Win32
CMAKE_INSTALL_PREFIX
was specified correctly then CMake finds zlib and a new
option PCRE_SUPPORT_ZLIB
will appear.ZLIB_INCLUDE_DIR
to the value c:\work\gtk\vs14\Win32\include
.
You can browse to it.
ZLIB_LIBRARY_RELEASE
to the value c:\work\gtk\vs14\Win32\lib\zlib1.lib
.
You can also browse to it.
Configuration
" again until all red lines disappear.INSTALL
project to install files.include/ffi.h.cmake
: Small modification to theoetically enable shared library
compilation. However it is still not possible.src/x86/ffitarget.h
: Complex data type is not really supported under Windows.
The support of the Complex data type is checked during configuration and it is set properly.c:\work\gtk
.
The original package can be found at the official web site.c:\work\gtk\ffi-3.2.1
directory.
CMAKE_INSTALL_PREFIX
to the value c:\work\gtk\vs14\Win32
.
/W3
.
This is usually set in the file:
c:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations\masm.propsUnfortunately when MASM compiles the ffi library (or some other assembly file) with this warning level then the MASM compiler fails!
ffi.sln
in the Visual Studio.ffi
projectwin32.asm
INSTALL
.CMakeLists.txt
files will be checked and adjusted, so the project can compile on Linux as well.
c:\work\gtk
.
The original package can be found at the official web site.c:\work\gtk\glib-2.52.1
directory.
CMAKE_INSTALL_PREFIX
to the value c:\work\gtk\vs14\Win32
.
If the correct directory is specified then CMake will find the libraries and there should be no error.
c:\work\gtk
.
The original package can be found at the official web site.zlib
library. Do not worry. The only option to set is
CMAKE_INSTALL_PREFIX
to the value c:\work\gtk\vs14\Win32
.
If the correct directory is specified then CMake will find the libraries and there should be no error.
PNG_STATIC
PNG_TESTS
c:\work\gtk
.
The original package can be found at the official web site.CMAKE_INSTALL_PREFIX
to the value c:\work\gtk\vs14\Win32
WITH_SIMD
c:\work\gtk
.
The original package can be found at the official web site.c:\work\gtk\jasper-1.900.3
directory.
jpeg
. Do not worry. The only option to set is
CMAKE_INSTALL_PREFIX
to the value c:\work\gtk\vs14\Win32
.
If the correct directory is specified then CMake will find the libraries and there should be no error.
c:\work\gtk
.
The original package can be found at the official web site.CMAKE_INSTALL_PREFIX
to the value c:\work\gtk\vs14\Win32
.
If the correct directory is specified then CMake will find the libraries and there should be no error.
c:\work\gtk
.
The original package can be found at the official web site.c:\work\gtk\pixman-0.34.0
directory.
CMAKE_INSTALL_PREFIX
to the value c:\work\gtk\vs14\Win32
.
c:\work\gtk
.
The original package can be found at the official web site.c:\work\gtk\cairo-1.15.2
directory.
CMAKE_INSTALL_PREFIX
to the value c:\work\gtk\vs14\Win32
If the correct directory is specified then CMake will find the libraries and there should be no error.
CAIRO_GLIB
c:\work\gtk
.
The original package can be found at the official web site.c:\work\gtk\atk-2.24.0
directory.
CMAKE_INSTALL_PREFIX
to the value c:\work\gtk\vs14\Win32
If the correct directory is specified then CMake will find the libraries and there should be no error.
c:\work\gtk
.
The original package can be found at the official web site.c:\work\gtk\pango-1.40.5
directory.
CMAKE_INSTALL_PREFIX
to the value c:\work\gtk\vs14\Win32
If the correct directory is specified then CMake will find the libraries and there should be no error.