This guide explains how to compile GtkRadiant 1.6.x from source code on Windows operating systems. The source code is obtained from the GtkRadiant Git repository, which is open to the public (details follow). These instructions are aimed at developers wanting to test changes to GtkRadiant source code. The instructions below have been executed successfully on Windows XP 32 bit (some late service pack) and on Windows 7 Professional 64 bit.
This guide is divided into the following main sections.
First to install is the Git, Git is a powerful distributed Source Code Management tool and the versioning tool of choice for GtkRadiant development.
The hompepage for Git is git-scm.com, but we are more interested in code.google.com/p/msysgit/ because this is the windows port of git. You should download and install the newest "Full installer for official Git for Windows".
We will now install the Python programming language, which is needed for SCons to work.
The homepage for Python is www.python.org. You should download and install 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 that is 2.x.x, not 3.x.x. This is because lots of legacy software that uses Python is known to work correctly 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 was 2.7.1. For purposes of this tutorial, Python is installed to C:\Python27 . All of the default options for installing Python should be fine.
We will now install SCons, which is a multi-platform substitute for traditional Make.
The homepage for SCons is www.scons.org. You should download and install the latest production release. During the install procedure you will be asked to confirm the location of your Python installation.
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 stinkin' GUI. Anyhow, command-line SVN is required to perform the SCons build target later on. In fact, you don't need to touch TortoiseSVN or any other GUI-based SVN client for any part of this entire tutorial. (I wouldn't touch a GUI-based SVN client with a 10 foot pole given the opportunity to use command-line SVN instead.)
The preferred download site for SVN client for Windows is CollabNet. You should download and install CollabNet Subversion Command-Line Client, not CollabNet Subversion Edge or something of any other nature. Unfortunately you'll have to create an account with CollabNet to download this software, but everything is free. You can use all defaults when installing SVN.
The CollabNet version of SVN client for Windows should automatically modify your PATH , and you should be able to execute the svn command in cmd after closing cmd and starting it again. If this is not the case for some strange reason, you'll have to tweak your environment to ensure that you can execute the svn command from cmd.
The GtkRadiant developers are currently using Microsoft Visual C++ 2012 to compile GtkRadiant. You can use the Express Edition as well (free). See this Microsoft web page for downloads.
When you install Visual C++ 2008 Express Edition, you can install the bare minimum application without any extras such as Microsoft Silverlight Runtime or Microsoft SQL Server 2008 Express Edition. For the rest of the install options, the defaults can be chosen.
We are now ready to get the source code for GtkRadiant.
Open an Git Bash shell. When you start the shell, you will be in what is called your "home directory". You can execute the pwd command in Git Bash to find out which directory you are currently in. For example, when I start Git Bash, my current directory is /c/Users/Christian .
In any case, we need to create ourselves a work area for purposes of downloading files and compiling software. I would recommend creating a directory radiant-work in your home directory. So:
$ mkdir radiant-work
Now, we're going to change to that directory and get the base GtkRadiant project:
$ cd radiant-work $ git clone git://github.com/TTimo/GtkRadiant.git
We created the extra radiant-work parent directory of GtkRadiant because the following step will place many files into the project's parent directory, and we don't want to litter our home directory with these files.
Remember all the work we did earlier in order to install SCons? Well, thanks to all that work we did, obtaining the remaining things we need for compiling is really really easy:
Open a cmd shell and execute:
$ cd radiant-work\GtkRadiant $ C:\Python27\Scripts\scons.bat target=setup
This SCons build target performs several actions:
We are now finally going to compile GtkRadiant using Microsoft Visual C++.
Start Microsoft Visual C++. From the "File" menu, choose "Open" -> "Project/Solution...". Navigate to your GtkRadiant directory (in my case C:\Users\Christian\radiant-work\GtkRadiant). Choose the project file radiant.sln from this directory.
You now have the GtkRadiant project loaded in Visual C++. You can poke around if you like, e.g. open up some source code files and edit them.
Before you build the project, you might want to select the "Release" target (as pictured below).
To build GtkRadiant, choose "Build Solution" from the "Build" menu. The build will take about 10 minutes [on a Pentium 4 with HTT], so this would be a good time to go get a cup of tea.
If the build completes successfully, you will get a message similar to the following in the output of Visual C++:
radiant - 0 error(s), 0 warning(s) ========== Build: 38 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
All of the files needed to run GtkRadiant are going to be in the folder radiant-work\GtkRadiant\install [relative to your home directory]. You can copy the entire install folder to some place such as your Desktop and you can rename this folder to ZeroRadiant for example. Then, you will use radiant.exe in that directory to launch the application.
There is one little bit of optional cleanup you can perform on your installation folder. You can remove all SVN-related files since they are no longer needed and only take up disk space. Let's say that you renamed your installation folder to ZeroRadiant (as the previous paragraph suggests), and let's say that you're in the cmd shell, and that your current working directory is the directory of ZeroRadiant. Then, in your cmd shell, you can execute this command to delete all SVN-related files (all .svn directories):
$ for /r %R in (.svn) do if exist %R (rd /s /q "%R")
That's it! Good luck and thanks for reading this enhanced tutorial! If you have comments or suggestions please email me at firstname.lastname@example.org or the updater email@example.com. More information about GtkRadiant is on icculus.org/gtkradiant.