The path for the Qt5 installation now needs to be set as a
[metze/wireshark/wip.git] / README.cmake
1           Explain the cmake build system for wireshark
2
3    $Id$
4
5                            Notice
6
7    To find out the current state of the cmake implementation for
8    Wireshark, please take a look at "What needs to be done?" below.
9    Basically this is an experiment and if we find out that it works
10    and we like cmake more than autofoo we might switch one day.
11
12 Table of contents
13 =================
14
15 How to get started with cmake?
16 Why cmake?
17 Why not cmake?
18 What needs to be done?
19 Links regarding cmake
20
21 How to get started with cmake?
22 ==============================
23
24 You can find documentation on cmake at: http://www.cmake.org/
25
26 cmake is designed to support out of tree builds. So much so, that
27 in tree builds do not work properly in all cases.
28
29 How to do out of tree build (Unix/Linux):
30 1) Install cmake.
31 2) Assuming, you are in the top directory of the wireshark source
32    cd ..
33 3) mkdir build
34 4) cd build
35 5) cmake ../<Name_of_WS_source_dir>
36 6) make (or cmake --build .)
37 7) (as root) umask 0022 && make install
38
39 Note 1:
40 in step 5), you may override the defaults for features:
41  cmake -DENABLE_CAP=OFF ../<Name_of_WS_source_dir>
42  will disable the capabilities check.
43
44 Note 2:
45  On OS X, you may want to run cmake like this:
46  cmake -DENABLE_CAP=OFF -G "Unix Makefiles"
47
48 Note 3:
49   After running cmake, you can always run "make help" to see
50   a list of all possible make targets.
51
52 Note 4:
53   Cmake honors user umask for creating directories as of now:
54   http://public.kitware.com/Bug/view.php?id=9620
55   To get predictable results please set umask explicitly.
56
57 How to do out of tree build (Win32/64):
58 [This is early alpha and while the build should build all executables except
59  the GUIs don't waste your time testing unless you are willing to fix things
60  yourself]
61 1) Follow http://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html
62    Steps 1-9
63 1a) Set WIRESHARK_BASE_DIR=c:\wireshark (the parent directory of the
64    library directory).
65 1b) set WIRESHARK_TARGET_PLATFORM=win32 (or win64)
66 1c) set QT5_BASE_DIR=c:\Qt\Qt5.1.1\5.1.1 (or whatever)
67 2) Install cmake
68 3) mkdir c:\wireshark\build
69 4) cd c:\wireshark\build
70 5) cmake -G "NMake Makefiles" -DBUILD_wireshark=OFF path\to\sources
71   (i.e. in case your sources are located at c:\wireshark\trunk, use "..\trunk")
72 5a) cmake path\to\sources (this will build for the latest Visual Studio version found)
73 6) nmake /X- VERBOSE=1 (or cmake --build . -- VERBOSE=1 )
74 6a) Wireshark.sln (this will run up Visual Studio with the cmake built solution
75 7) In case you want to test the executable(s) inside the build tree:
76    Run setpath.bat whenever it gets updated (there is a message in each cmake
77    run whether it is necessary or not).
78
79 Why cmake?
80 ==========
81 - Can create project files for some MS and Apple IDEs.
82 - Fast
83 - Easier to understand/learn
84 - Doesn't create any files in the source tree in case
85   of out of tree builds
86 - One build infrastructure even including Windows
87 ...
88
89 Why not cmake?
90 ==============
91 - Lots of work to do
92 - Everyone who wants to build from source needs cmake
93 - Current state of documentation isn't really better than
94   autofoo documentation, in some respect it's even worse
95   (you need to buy a book to get an explanation as to how
96   cmake really works).
97 ...
98
99 What works?
100 ===========
101
102 All the executables now build from clean source on:
103 * 32bit openSUSE 11.3: (gnu)make and gcc
104 * 64bit FedoraXXX
105 * 32bit Ubuntu 9.04
106 * 32bit Ubuntu 10.04
107 * 64bit Debian Wheezy
108
109 What needs to be done?
110 ======================
111
112 - Add back platform specific objects.
113 - Fix places in the cmake files marked as todo.
114 - Guides are not installed.
115 - Release notes are not built.
116 - Build source package (using CPack).
117   This is obsolete if we decide to release VCS snapshots instead
118 - Build rpm package (using CPack).
119 - Build dpkg package (using CPack).
120   This is obsolete, we should call CMake from debian/rules instead, using dh
121   (rbalint)
122 - Add back checkAPI target.
123 - Test and add support for other platforms (BSDs, OSX,
124   Solaris, Win32, Win64, ...)
125 ...
126
127 Links regarding cmake
128 =====================
129 The home page of the cmake project
130         http://www.cmake.org/
131
132 The home page of the cmake project documentation
133         http://www.cmake.org/Wiki/CMake
134
135 About cmake in general and why KDE4 uses it
136         http://lwn.net/Articles/188693/
137
138 Introductory/tutorial presentation
139         http://ait.web.psi.ch/services/linux/hpc/hpc_user_cookbook/tools/cmake/docs/Cmake_VM_2007.pdf
140
141 Introductory article in Linux Journal
142         http://www.linuxjournal.com/node/6700/print
143
144 Useful variables
145         http://www.cmake.org/Wiki/CMake_Useful_Variables
146
147 cmake FAQ
148         http://www.cmake.org/Wiki/CMake_FAQ
149
150 Additional cmake modules
151         http://code.google.com/p/cmake-modules/