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