1 Explain the cmake build system for wireshark
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.
15 How to get started with cmake?
18 What needs to be done?
21 How to get started with cmake?
22 ==============================
24 You can find documentation on cmake at: http://www.cmake.org/
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.
29 How to do out of tree build (Unix/Linux):
31 2) Assuming, you are in the top directory of the wireshark source
35 5) cmake ../<Name_of_WS_source_dir>
36 6) make (or cmake --build .)
37 7) (as root) umask 0022 && make install
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.
45 On OS X, you may want to run cmake like this:
46 cmake -DENABLE_CAP=OFF -G "Unix Makefiles"
49 After running cmake, you can always run "make help" to see
50 a list of all possible make targets.
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.
57 How to do out of tree build (Win32/64):
58 [This is advanced alpha and should build all executables except the GTK3
59 Wireshark for 32-bit.]
60 1) Follow http://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html
62 1a) Set WIRESHARK_BASE_DIR=c:\wireshark (the parent directory of the
64 1b) set WIRESHARK_TARGET_PLATFORM=win32 (or win64)
65 1c) set QT5_BASE_DIR=c:\Qt\Qt5.1.1\5.1.1 (or whatever)
67 3) mkdir c:\wireshark\build
68 4) cd c:\wireshark\build
69 5) cmake -G "NMake Makefiles" path\to\sources
70 (i.e. in case your sources are located at c:\wireshark\trunk, use "..\trunk")
71 5a) cmake path\to\sources (this will build for the latest Visual Studio version found)
72 6) nmake /X- VERBOSE=1 (or cmake --build . -- VERBOSE=1 )
73 6a) Wireshark.sln (this will run up Visual Studio with the cmake built solution
74 7) In case you want to test the executable(s) inside the build tree:
75 Run setpath.bat whenever it gets updated (there is a message in each cmake
76 run whether it is necessary or not).
80 - Can create project files for some MS and Apple IDEs.
82 - Easier to understand/learn
83 - Doesn't create any files in the source tree in case
85 - One build infrastructure even including Windows
91 - Everyone who wants to build from source needs cmake
92 - Current state of documentation isn't really better than
93 autofoo documentation, in some respect it's even worse
94 (you need to buy a book to get an explanation as to how
101 All the executables now build from clean source on:
102 * 32bit openSUSE 11.3: (gnu)make and gcc
106 * 64bit Debian Wheezy
108 What needs to be done?
109 ======================
111 - Add back platform specific objects.
112 - Fix places in the cmake files marked as todo.
113 - Guides are not installed.
114 - Build source package (using CPack).
115 This is obsolete if we decide to release VCS snapshots instead
116 - Build rpm package (using CPack).
117 - Build dpkg package (using CPack).
118 This is obsolete, we should call CMake from debian/rules instead, using dh
120 - Add back checkAPI target.
121 - Test and add support for other platforms (BSDs, OSX,
122 Solaris, Win32, Win64, ...)
123 - Add support for cmake configurations.
124 - Get plugins loading when running *shark from the build directory.
125 - Automatically figure out if *shark is running from the build directory
126 (making WIRESHARK_RUN_FROM_BUILD_DIRECTORY unnecessary like it is with
128 - Get cross-compilation working (or ensure it does). It works with autofoo.
131 Links regarding cmake
132 =====================
133 The home page of the cmake project
134 http://www.cmake.org/
136 The home page of the cmake project documentation
137 http://www.cmake.org/Wiki/CMake
139 About cmake in general and why KDE4 uses it
140 http://lwn.net/Articles/188693/
142 Introductory/tutorial presentation
143 http://ait.web.psi.ch/services/linux/hpc/hpc_user_cookbook/tools/cmake/docs/Cmake_VM_2007.pdf
145 Introductory article in Linux Journal
146 http://www.linuxjournal.com/node/6700/print
149 http://www.cmake.org/Wiki/CMake_Useful_Variables
152 http://www.cmake.org/Wiki/CMake_FAQ
154 Additional cmake modules
155 http://code.google.com/p/cmake-modules/