Merge branch 'cmake'
[quassel.git] / README.cmake
1 CMake supports and encourages out-of-source builds, which do not clutter the source directory.
2 You can (and should) thus use an arbitrary directory for building.
3 There is no "make distclean"; "make clean" should usually be enough since CMake actually
4 cleans up properly (qmake often didn't). If you really want to get rid of all build files,
5 just remove the build directory.
6
7 Usually, you will build Quassel as follows:
8
9 cd /path/to/build/dir
10 cmake /path/to/quassel
11 make
12
13 Additionally, you may add some options to the cmake call, prefixed by -D. These need to follow
14 the source directory PATH:
15
16 cmake /path/to/quassel -D<option1> -D<option2>
17
18 NOTE: In order to reconfigure, you need to remove CMakeCache.txt (or empty
19       the build directory), otherwise cmake will ignore modified -D options!
20
21 Quassel recognizes the following options:
22
23 -DBUILD=<string>
24     Specify which Quassel binaries to build. <string> may contain any combination of
25     "core", "client", "mono" or "all".
26
27 -DQT=/path/to/qt
28     Use a non-system Qt installation. This is for example useful if you have a static
29     Qt installed in some local dir.
30
31 -DSTATIC=1
32     Enable static building of Quassel. You should link the static versions of some libs
33     (in particular libstdc++.a) into /path/to/build/dir/staticlibs in oder to create
34     a portable binary!
35
36 -DSTATICWIN=1
37     Enable static building for Windows platforms. This adds some libs that are not automatically
38     included for some reason.
39
40 BUILDING ON WINDOWS:
41 --------------------
42 We have tested building on Windows with a statically built Qt (with its /bin directory in %PATH%)
43 and MSVC 2005/2008. Make sure that you use a "shell" that has all needed env variables setup,
44 such as the "Visual Studio Command Prompt". You will also need the /bin of the Microsoft SDK in
45 your %PATH% at least for VS 2008, otherwise rc.exe is not found.
46 Currently, only building in the shell using nmake seems to work; CMake can also create MSVC project
47 files, but they seem to be problematic. However, YMMV.
48
49 After you have everything setup:
50
51 cd C:\path\to\quassel-build
52 cmake -G"NMake Makefiles" C:\path\to\quassel\source -DSTATICWIN=1
53 nmake