]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - windows_compile_guide/index.html
Merge branch 'master' of github.com:TTimo/GtkRadiant
[xonotic/netradiant.git] / windows_compile_guide / index.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4   <head>
5     <title>Compiling GtkRadiant on Windows</title>
6     <style type="text/css">
7       body
8       {
9         color: black;
10         background-color: white;
11         font-family: sans-serif;
12         margin: 1em 1em 1em 1em;
13       }
14       a { color: blue; text-decoration: underline; }
15       a:hover { color: red; text-decoration: underline; }
16       .error { color: #dd0000; }
17     </style>
18   </head>
19   <body>
20     <div style="left:0px; top:0px; width:88px; height:31px; position:absolute">
21       <a href="http://validator.w3.org/check?uri=referer">
22         <img src="http://www.w3.org/Icons/valid-xhtml10"
23              style="border-style:none"
24              alt="Valid XHTML 1.0!" height="31" width="88" />
25       </a>
26     </div>
27     <br />
28     <center><h1>Compiling GtkRadiant on Windows</h1></center>
29     <hr />
30     <p>This guide explains how to compile GtkRadiant 1.6.x from source code on Windows operating systems.
31       The source code is obtained from
32       the GtkRadiant Git repository, which is open to the public (details follow).
33       These instructions are aimed at developers wanting to test changes to GtkRadiant source code.
34       The instructions below have been executed successfully on
35       Windows XP 32 bit (some late service pack) and on Windows 7 Professional 64 bit.</p>
36     <p>This guide is divided into the following main sections.
37     </p>
38     <ul>
39       <li><h3><a href="#git">Section 1: Installing Git</a></h3></li>
40       <li><h3><a href="#python">Section 2: Installing Python</a></h3></li>
41       <li><h3><a href="#scons">Section 3: Installing SCons</a></h3></li>
42       <li><h3><a href="#svn">Section 4: Installing SVN</a></h3></li>
43       <li><h3><a href="#vcpp">Section 5: Installing Visual C++</a></h3></li>
44       <li><h3><a href="#sources">Section 6: Obtaining Source Code, Game Paks, and Libs</a></h3></li>
45       <li><h3><a href="#compile">Section 7: Compiling GtkRadiant</a></h3></li>
46       <li><h3><a href="#run">Section 8: Running GtkRadiant</a></h3></li>
47     </ul>
48     <hr />
49     <br />
50         <a name "git"></a>
51         <h2>Section 1: Installing Git</h2>
52         <p>
53           First to install is the Git, Git is a powerful distributed Source Code Management tool and the versioning tool of choice for GtkRadiant development.
54         </p>
55         <p>
56                 The hompepage for Git is <a href="http://git-scm.com/">git-scm.com</a>, but we are more interested in 
57                 <a href="http://code.google.com/p/msysgit/">code.google.com/p/msysgit/</a> because this is the windows port of git. You should
58                 download and install the newest "Full installer for official Git for Windows".
59         </p>
60         <hr />
61         <br />
62     <a name="python"></a>
63     <h2>Section 2: Installing Python</h2>
64     <p>We will now install the Python programming language, which is needed for SCons to work.</p>
65     <p>
66       The homepage for Python is <a href="http://www.python.org/download">www.python.org</a>.  You should download and install
67       a 32 bit version of Python, because scons is only avaiable in 32 bit builds.  I would strongly recommend sticking to a version of Python
68       that is 2.x.x, <i>not</i> 3.x.x.  This is because lots of legacy software that uses Python is known to work correctly
69       with 2.x.x, but might not necessarily work with 3.x.x.  At the time of writing this tutorial, the preferred version of Python
70       was 2.7.1.  For purposes of this tutorial, Python is installed to <tt>C:\Python27</tt> .  All of the default
71       options for installing Python should be fine.
72     </p>
73     <hr />
74     <br />
75     <a name="scons"></a>
76     <h2>Section 3: Installing SCons</h2>
77     <p>We will now install SCons, which is a multi-platform substitute for traditional Make.</p>
78     <p>
79       The homepage for SCons is <a href="http://www.scons.org/download.php">www.scons.org</a>.  You should download and install the
80       latest production release.  During the install procedure you will be asked to confirm the location of your Python
81       installation.
82     </p>
83     <hr />
84     <br />
85     <a name="svn"></a>
86     <h2>Section 4: Installing SVN</h2>
87     <p>
88       We're now going to install a command-line version of the SVN client that we can use from cmd.  We don't need no
89       stinkin' GUI.  Anyhow, command-line SVN is required to perform the SCons build target later on.
90       In fact, you don't need to touch TortoiseSVN or any other GUI-based SVN client for any part of this entire tutorial.
91       (I wouldn't touch a GUI-based SVN client with a 10 foot pole given the opportunity to use command-line SVN instead.)
92     </p>
93     <p>
94       The preferred download site for SVN client for Windows is <a href="http://www.collab.net/downloads/subversion/">CollabNet</a>.
95       You should download and install CollabNet Subversion Command-Line Client,
96       <i>not</i> CollabNet Subversion Edge or something of any other nature.  Unfortunately you'll have to create an account with CollabNet
97       to download this software, but everything is free.  You can use all defaults when installing SVN.
98     </p>
99     <p>
100       The CollabNet version of SVN client for Windows should automatically modify your <tt>PATH</tt> , and you should be able to
101       execute the <tt>svn</tt> command in cmd after closing cmd and starting it again.  If this is not the case for some strange
102       reason, you'll have to tweak your environment to ensure that you can execute the <tt>svn</tt> command from cmd.
103     </p>
104     <hr />
105     <br />
106     <a name="vcpp"></a>
107     <h2>Section 5: Installing Visual C++</h2>
108     <p>
109       The GtkRadiant developers are currently using Microsoft Visual C++ 2008 to compile GtkRadiant.  Even though Visual C++ 2010 is a newer
110       version, don't use it [unless you want to be on your own].  You can download Visual C++ 2008 Express Edition from
111       <a href="http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express">this Microsoft webpage</a>.
112     </p>
113     <p>
114       When you install Visual C++ 2008 Express Edition, you can install the bare minimum application <i>without</i> any extras such as
115       Microsoft Silverlight Runtime or Microsoft SQL Server 2008 Express Edition.  For the rest of the install options, the
116       defaults can be chosen.
117     </p>
118     <hr />
119     <br />
120     <a name="sources"></a>
121     <h2>Section 6: Obtaining Source Code, Game Paks, and Libs</h2>
122     <p>We are now ready to get the source code for GtkRadiant.</p>
123     <h3>Step A: Get Base Project</h3>
124     <p>
125       Open an Git Bash shell.  When you start the shell, you will be in what is called your "home directory".  You can execute the
126       <tt>pwd</tt> command in Git Bash to find out which directory you are currently in.  For example, when I start Git Bash, my
127       current directory is <tt>/c/Users/Christian</tt> .
128     </p>
129     <p>
130       In any case, we need to create ourselves a work area for purposes of downloading files and compiling software.  I would recommend
131       creating a directory <tt>radiant-work</tt> in your home directory.  So:
132     </p>
133     <blockquote>
134       <pre width="80" style="background: #CCCCCC; padding: 2mm; border-style: ridge">$ <b>mkdir radiant-work</b>
135 </pre>
136     </blockquote>
137     <p>Now, we're going to change to that directory and get the base GtkRadiant project:</p>
138     <blockquote>
139       <pre width="88" style="background: #CCCCCC; padding: 2mm; border-style: ridge">$ <b>cd radiant-work</b>
140 $ <b>git clone git://github.com/TTimo/GtkRadiant.git</b>
141 </pre>
142     </blockquote>
143     <p>We created the extra <tt>radiant-work</tt> parent directory of <tt>GtkRadiant</tt> because the following step will
144       place many files into the project's parent directory, and we don't want to litter our home directory with these files.</p>
145     <h3>Step B: Execute SCons Build Target</h3>
146     <p>
147       Remember all the work we did earlier in order to install SCons?  Well, thanks to all that work we did,
148       obtaining the remaining things we need for compiling is really really easy:
149     </p>
150         <p>
151           Open a cmd shell and execute:
152         </p>
153     <blockquote>
154       <pre width="80" style="background: #CCCCCC; padding: 2mm; border-style: ridge">$ <b>cd radiant-work\GtkRadiant</b>
155 $ <b>C:\Python27\Scripts\scons.bat target=setup</b>
156 </pre>
157     </blockquote>
158     <p>This SCons build target performs several actions:</p>
159     <ul>
160       <li>Downloads "install paks" for several games such as Quake III Arena and Urban Terror.</li>
161       <li>Downloads library dependencies (such as GTK+) for building and running GtkRadiant.</li>
162       <li>Places library dependencies in proper locations.</li>
163       <li>Performs any other actions needed prior to compiling GtkRadiant.</li>
164     </ul>
165     <hr />
166     <br />
167     <a name="compile"></a>
168     <h2>Section 7: Compiling GtkRadiant</h2>
169     <p>We are now finally going to compile GtkRadiant using Microsoft Visual C++.</p>
170     <p>
171       Start Microsoft Visual C++.  From the "File" menu, choose "Open" -> "Project/Solution...".
172       Navigate to your <tt>GtkRadiant</tt> directory (in my case <tt>C:\Users\Christian\radiant-work\GtkRadiant</tt>).
173       Choose the project file <tt>radiant.sln</tt> from this directory.
174     </p>
175     <p>
176       You now have the GtkRadiant project loaded in Visual C++.  You can poke around if you like, e.g. open up some source code
177       files and edit them.
178     </p>
179     <p>
180       Before you build the project, you might want to select the "Release" target (as pictured below).
181     </p>
182     <table border="0" cellpadding="0" cellspacing="0">
183       <tr>
184         <td width="20">&nbsp;</td>
185         <td><img src="vc-radiant-release.png" alt="vc-radiant-release.png"></img></td>
186       </tr>
187     </table>
188     <p>
189       To build GtkRadiant, choose "Build Solution" from the "Build" menu.  The build will take
190       about 10 minutes [on a Pentium 4 with HTT], so this would be a good time to go get a cup of tea.
191     </p>
192     <p>If the build completes successfully, you will get a message similar to the following in the output
193       of Visual C++:</p>
194     <blockquote>
195       <pre width="80" style="background: #CCCCCC; padding: 2mm; border-style: ridge">radiant - 0 error(s), 0 warning(s)
196 ========== Build: 38 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
197 </pre>
198     </blockquote>
199     <hr />
200     <br />
201     <a name="run"></a>
202     <h2>Section 8: Running GtkRadiant</h2>
203     <p>All of the files needed to run GtkRadiant are going to be in the folder <tt>radiant-work\GtkRadiant\install</tt> [relative
204       to your home directory].  You can copy the entire <tt>install</tt> folder to some place such as your Desktop
205       and you can rename this folder to <tt>ZeroRadiant</tt> for example.
206       Then, you will use <tt>radiant.exe</tt> in that directory to launch the application.
207     </p>
208     <p>
209       There is one little bit of optional cleanup you can perform on your installation folder.  You can remove all SVN-related
210       files since they are no longer needed and only take up disk space.  Let's say that you renamed your installation folder
211       to <tt>ZeroRadiant</tt> (as the previous paragraph suggests), and let's say that you're in the cmd shell, and that your current
212       working directory is the directory of <tt>ZeroRadiant</tt>.  Then, in your cmd shell, you can execute this command to
213       delete all SVN-related files (all <tt>.svn</tt> directories):
214     </p>
215     <blockquote>
216       <pre width="80" style="background: #CCCCCC; padding: 2mm; border-style: ridge">$ <b>for /r %R in (.svn) do if exist %R (rd /s /q "%R")</b>
217 </pre>
218     </blockquote>
219     <p>
220       That's it!  Good luck and thanks for reading this enhanced tutorial!  If you have comments or suggestions please email me at nlandys@gmail.com or the updater christian_ratzenhofer@yahoo.de.
221       More information about GtkRadiant is on <a href="http://icculus.org/gtkradiant/">icculus.org/gtkradiant</a>.
222     </p>
223     <br />
224     <br />
225   </body>
226 </html>