File: gtk.txt

package info (click to toggle)
wxwidgets3.0 3.0.5.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 120,464 kB
  • sloc: cpp: 896,633; makefile: 52,303; ansic: 21,971; sh: 5,713; python: 2,940; xml: 1,534; perl: 264; javascript: 33
file content (97 lines) | stat: -rw-r--r-- 3,406 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Building wxGTK port with Win32 GDK backend
------------------------------------------

GTK+ widget toolkit has multiple GDK backends and one of them is Win32.
It is a wrapper around Windows API.

See http://www.gtk.org/download/win32.php

These notes don't consider building wxGTK with X11 backend under Windows.

Building steps:

1. wxGTK/Win32 build is similar to wxMSW one and you should have configured
and be able to build wxWidgets as described in docs/msw/install.txt

2. wxGTK/Win32 is disabled by default in wxWidgets, you need to enable it
in bakefiles manually. TOOLKIT variable should not be a constantly MSW
for required bakefile formats.


diff build/bakefiles/config.bkl build/bakefiles/config.bkl
--- build/bakefiles/config.bkl
+++ build/bakefiles/config.bkl
@@ -67,9 +67,9 @@
         </if>
 
         <!-- We must make TOOLKIT a constant under Windows -->
-        <if cond="FORMAT in ['borland','mingw','msvc','watcom', 'msvc6prj', 'msvs2003prj', 'msvs2005prj', 'msvs2008prj']">
+        <!--if cond="FORMAT in ['borland','mingw','msvc','watcom', 'msvc6prj', 'msvs2003prj', 'msvs2005prj', 'msvs2008prj']">
             <set var="TOOLKIT">MSW</set>
-        </if>
+        </if-->
     </if>
 
     <!--


Regenerate required make/project files:
    cd build\bakefiles
    bakefile_gen

3. Download GTK+ for Windows and uncompress files in the directory
without spaces in the name. We suppose later that GTK+/Win32 is
in the C:\gtk directory.

    http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+_2.24.10-1_win32.zip

4. Building

4.1 If you are using Visual C++ project files you need to setup GTK+ 2 include directories
    C:\gtk\lib\include\gtk-2.0
    C:\gtk\lib\include\glib-2.0
    C:\gtk\lib\include\cairo
    C:\gtk\lib\include\pango-1.0
    C:\gtk\lib\include\gdk-pixbuf-2.0
    C:\gtk\lib\include\atk-1.0
    C:\gtk\lib\glib-2.0\include
    C:\gtk\lib\gtk-2.0\include

and library directory

    C:\gtk\lib\

    See http://msdn.microsoft.com/en-us/library/t9az1d21(v=vs.90).aspx

Open solution file in build\msw directory, select "GTK+ Debug" solution
configuration and build the solution. To be sure that everything is as expected
you can build minimal sample.

GTK+ is linked to wxWidgets always as DLL, so C:\gtk\bin directory should be
in %PATH% environment variable before application run.

4.2 You can also build using nmake:

    set INCLUDE=C:\gtk\lib\glib-2.0\include\;C:\gtk\lib\gtk-2.0\include\;C:\gtk\include\cairo\;C:\gtk\include\pango-1.0\;C:\gtk\include\gtk-2.0\;C:\gtk\include\glib-2.0\;C:\gtk\include\gdk-pixbuf-2.0\;C:\gtk\include\atk-1.0\;
    set LIB=C:\gtk\lib\;
    set PATH=C:\gtk\bin\;%PATH%;

    nmake -f makefile.vc "TOOLKIT=GTK" "TOOLKIT_VERSION=2"

or with MinGW:

    set CXXFLAGS=%CXXFLAGS% -IC:\gtk\include\gtk-2.0
    set CXXFLAGS=%CXXFLAGS% -IC:\gtk\include\glib-2.0
    set CXXFLAGS=%CXXFLAGS% -IC:\gtk\include\cairo
    set CXXFLAGS=%CXXFLAGS% -IC:\gtk\include\pango-1.0
    set CXXFLAGS=%CXXFLAGS% -IC:\gtk\include\gdk-pixbuf-2.0
    set CXXFLAGS=%CXXFLAGS% -IC:\gtk\include\atk-1.0
    set CXXFLAGS=%CXXFLAGS% -IC:\gtk\lib\glib-2.0\include
    set CXXFLAGS=%CXXFLAGS% -IC:\gtk\lib\gtk-2.0\include
    set CFLAGS=%CXXFLAGS%
    set LDFLAGS=%LDFLAGS% -LC:\gtk\lib
    set PATH=C:\gtk\bin\;%PATH%;

    mingw32-make -f makefile.gcc "TOOLKIT=GTK" "TOOLKIT_VERSION=2"

5. Now you can use wxGTK/Win32 as wxMSW in your applications.