Project

General

Profile

Build Quassel on Windows Mingw » History » Version 42

Version 41 (TheOneRing, 04/09/2014 10:45 AM) → Version 42/47 (TheOneRing, 04/09/2014 10:45 AM)

h1. Build Quassel on Windows Mingw

h2. Build Quassel with QT only

h2. Software Requirements

* "QT SDK":http://qt.nokia.com/downloads
* "DBGHELP Mingw":http://dl.dropbox.com/u/6292727/dbghelp/dbghelp.zip
* "CMake":http://www.cmake.org/cmake/resources/software.html

h2. Installation

h3. Step 1: Install QT SDK

Download and install the QT SDK and select mingw to install with QT.

h3. Step 2: Install DBGHELP Mingw

If you are using mingw w64 skip this step

Download "DBGHELP Mingw":http://bugs.quassel-irc.org/attachments/download/412/dbghelp-mingw.zip and extract it over the mingw folder (make sure dbghelp.h ends up in mingw\include and similarly for the mingw\lib). (this file was compiled from "libdbghelp.7z":http://download.gna.org/warzone/development/libdbghelp.7z and "dbghelp.h":http://sourceforge.net/tracker/index.php?func=detail&aid=1660497&group_id=2435&atid=352435 , the latter no longer available).

h3. Step 3: Install CMake

h2. Checkout Quassel

* "git clone git://gitorious.org/quassel/quassel.git"

h2. Compile Quassel

* open a command line
* add mingw to your path (set PATH=%PATH%;'mingwdir')
* add cmake to your path (analog to mingw)
* add QT to yo your path, 'qt\version'\qt\bin
* switch to the directory where you checked out Quassel
* type "mkdir build"
* type "cd build"
* type "cmake -G "MinGW Makefiles" .."
* type "mingw32-make"

h2. Build Quassel with Windows KDE

# got to the "Emerge Tutorial":http://techbase.kde.org/Getting_Started/Build/KDE4/Windows/emerge
# check out emerge and set up the kdesettings.bat acording to the kde tutorial
# install quassel "emerge quassel-qt" or "emerge quassel" to build quassel with kdesupport, emerge will install all dependency's for you
# when emerge has finished all jobs, start quassel

The steps above would also be possible with msvc2008

h3. Notes after following this guide with mingw which comes with QTSDK (1.2.1)

# When installing QtSDK, and especially if you have Visual Studio installed but you want to compile with mingw, make sure to use the custom installer, and check *Qt SDK > Development Tools > Desktop Qt > Qt 4.8.1 (Desktop) > Desktop Qt 4.8.1 - MinGW*
# Cmake can be downloaded "here":http://www.cmake.org/cmake/resources/software.html . I got the windows binary zip file, extracted it, and added the path of the 'bin' dir within it.
# The mingw bin dir is @<QTSDK-dir>\mingw\bin@, the QT path is @<QTSDK-dir>\Desktop\Qt\4.81\mingw\bin@ .
# The official 0.8 tarball failed to build after 80% with the following error (which I couldn't fix):
<pre>
mingw32-make[2]: *** No rule to make target `po/qt_cs.qm', needed by `po/CMakeFiles/po'. Stop.
mingw32-make[1]: *** [po/CMakeFiles/po.dir/all] Error 2
mingw32-make: *** [all] Error 2
</pre>
# After successfully compiling the cloned git master from command line, I needed the following DLLs at the same dir as the exe: *QtCore4.dll QtGui4.dll QtNetwork4.dll QtWebKit4.dll libgcc_s_dw2-1.dll mingwm10.dll phonon4.dll*. These files can be copied from the mingw and the QT dirs, or from the win32 official quassel distribution package "here":http://quassel-irc.org/downloads (7-zip can extract the windows installer, these files are in there).
# *Multi threaded compilation*: On windows, make doesn't support -jN for concurrent N compile threads, however, it does support -j (without N), which tries to use as many threads as possible (I _think_ upto 64 threads), so if you have enough RAM (I didn't see system memory usage go beyond ~5G when I tried it), you may use -j either when building from command line, or with QtCreator: add -j at: Projects > Build Steps > Make > additional arguments. It will speed up clean rebuild significantly.
# *QTCreator project* (not mandatory, but nice as IDE and for debugging):
* Run QTCreator and click File -> Open File or Project
* Choose the main CMakeList.txt file at the root of the source tree (the same dir with the INSTALL and README files).
* Point to your cmake.exe file (which you download earlier).
* Add the following arguments (make sure your qtsdk path matches): -DQT_QMAKE_EXECUTABLE=C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\qmake.exe -DCMAKE_BUILD_TYPE=RelWithDebInfo . Note that generally -DCMAKE_BUILD_TYPE=Debug should be better for breakpoints, but it crashed for me, and RelWithDebInfo didn't. Also worked for me for good single stepping: DebugFull. YMMV.
* Click run cmake. It should finish without errors, click Finish.
* Once the project is open, click "Projects" at the left side, expand Details at the "Build Environment" section, click the line of the variable PATH, and add the QT path (e.g. c:/QtSDK/Desktop/Qt/4.8.1/mingw/bin). Do the same for "Run Environment".
* Now you can edit the code, follow symbols, and should be able to build, breakpoint and single-step quassel.\

h1. Build Quassel on Windows Mingw

h2. Build Quassel with QT only

h2. Software Requirements

* "python 3" https://www.python.org/
* "Git" http://msysgit.github.io/
* "Emerge" https://projects.kde.org/projects/kdesupport/emerge
* "QT 4.8.5":http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-win-opensource-4.8.5-mingw.exe

h2. Installation

h3. Install Python
If you already have installed python you can skip this step.

h3. Install Git
If you already have installed python you can skip this step.

h3. Setup your installation directory
Create the directory you will use as your ROOT directory for your quassel build.

h3. Install and setup emerge
First of all you need to checkout emerge using git.
Open a powershell or instance, switch to your ROOT directory and clone emerge "git clone git://anongit.kde.org/emerge".
Check out the latest stable branch which is currently "kde-4.12"("cd emerge" "git checkout kde-4.12").
Create a "etc" folder in your ROOT directory.
Save the following folowing ini file to "ROOT/etc/kdesettings.ini"

<pre>
[General]
#a fast make tool for cmake projects
EMERGE_USE_NINJA = True
KDECOMPILER = mingw4
EMERGE_ARCHITECTURE = x86
EMERGE_VERBOSE = 1
EMERGE_NOCOPY = True
#use jom, jom is a fast make tool
EMERGE_MAKE_PROGRAM = jom
#use gcc 4.4.7
EMERGE_OPTIONS = features.legacyGCC=True

[Paths]
DOWNLOADDIR = ${KDEROOT}\download
KDEROOT = D:\quassel-noqt
PYTHONPATH = C:\python34
KDESVNDIR = ${DOWNLOADDIR}\svn
KDEGITDIR = ${DOWNLOADDIR}\git

[ShortPath]
EMERGE_USE_SHORT_PATH = False
EMERGE_ROOT_DRIVE = u:
EMERGE_SVN_DRIVE = s:
EMERGE_GIT_DRIVE = q:
EMERGE_DOWNLOAD_DRIVE = t:

[Version]
EMERGE_SETTINGS_VERSION = 1

[Portage]
PACKAGE_IGNORES = libs/qt;kde/kdelibs;kde/kde-runtime;kdesupport/phonon;kdesupport/phonon-ds9;binary/mysql-pkg;win32libs/dbus;dev-util/git;dev-util/subversion

</pre>
Set KDEROOT to your ROOT directory for building quassel.
Set PYTHONPATH to the location of your python installation.

Important is the value of PACKAGE_IGNORES here we disable all packages emerge wants to install by default.

In your powersehll instance go to ROOT/emerge and call ". kdeenv.ps1" the "." is important to load the script.

Lets start with emerging the compiler, "emerge mingw-w32".
Now lets see what emerge wants to install, call "emerge -p quassel", if you see a package in the list of dependencies you don't want to install add it to PACKAGE_IGNORES.

h3. Install Qt 4.8.5
Install to your ROOT directory.
When you get asked for the location of your mingw location set it to "ROOT/mingw" and ignore the warning.

h3. Build quassel
Go to your powershell window, and enter "emerge quassel" now quassel and all dependencies for quassel should be automatically be build.