1 Explain the cmake build system for wireshark
5 To find out the current state of the cmake implementation for
6 Wireshark, please take a look at "What needs to be done?" below.
7 Basically this is an experiment and if we find out that it works
8 and we like cmake more than autofoo we might switch one day.
13 How to get started with cmake (Unix/Linux and Win32/64)?
16 What needs to be done?
19 How to get started with cmake (Unix/Linux and Win32/64)?
20 ========================================================
22 You can find documentation on cmake at: http://www.cmake.org/
24 cmake is designed to support out of tree builds. So much so, that
25 in tree builds do not work properly in all cases.
27 How to do out of tree build (Unix/Linux):
29 2) Assuming, you are in the top directory of the wireshark source
33 5) cmake ../<Name_of_WS_source_dir>
34 6) make (or cmake --build .)
35 7) (as root) umask 0022 && make install
38 in step 5), you may override the defaults for features:
39 cmake -DENABLE_CAP=OFF ../<Name_of_WS_source_dir>
40 will disable the capabilities check.
43 On OS X, you may want to run cmake like this:
44 cmake -DENABLE_CAP=OFF -G "Unix Makefiles"
47 After running cmake, you can always run "make help" to see
48 a list of all possible make targets.
51 Cmake honors user umask for creating directories as of now:
52 http://public.kitware.com/Bug/view.php?id=9620
53 To get predictable results please set umask explicitly.
55 How to do out of tree build (Win32/64):
56 [This is advanced alpha and should build all executables except the GTK3
57 Wireshark for 32-bit.]
58 1) Follow http://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html
60 1a) Set WIRESHARK_BASE_DIR=c:\wireshark (the parent directory of the
62 1b) set WIRESHARK_TARGET_PLATFORM=win32 (or win64)
63 1c) set QT5_BASE_DIR=c:\Qt\Qt5.1.1\5.1.1\msvc2010 (or whatever)
64 1d) In case you want to use Visual Studio, make sure that the paths
65 to python and cygwin are available to GUI applications.
67 2a) Build the zlib library, e.g.
68 cd %WIRESHARK_BASE_DIR%\wireshark-%WIRESHARK_TARGET_PLATFORM%-libs\zlib125
69 cmake -G "NMake Makefiles" . # msbuild will not do because of configuration path
71 3) mkdir c:\wireshark\build
72 4) cd c:\wireshark\build
73 5) cmake -G "NMake Makefiles" path\to\sources
74 (i.e. in case your sources are located at c:\wireshark\trunk, use "..\trunk")
75 5a) cmake path\to\sources (this will build for the latest Visual Studio version found)
76 5b) cmake -G "Visual Studio xx" where xx = 10 for VS2010, 11 for VS2012 and 12 for VS2013
77 will build a solution for a specfic version of VS (it must still be installed).
78 6) nmake /X- VERBOSE=1 (or cmake --build . -- VERBOSE=1 )
79 6a) Wireshark.sln (this will run up Visual Studio with the cmake built solution
80 (or using msbuild: msbuild wireshark.sln /m /p:Configuration=RelWithDebInfo)
81 7) In case you want to test the executable(s) inside the build tree:
82 Run setpath.bat whenever it gets updated (there is a message in each cmake
83 run whether it is necessary or not).
87 - Can create project files for some MS and Apple IDEs.
89 - Easier to understand/learn
90 - Doesn't create any files in the source tree in case
92 - One build infrastructure even including Windows
98 - Everyone who wants to build from source needs cmake
99 - Current state of documentation isn't really better than
100 autofoo documentation, in some respect it's even worse
101 (you need to buy a book to get an explanation as to how
108 All the executables now build from clean source on:
109 * 32bit openSUSE 11.3: (gnu)make and gcc
113 * 64bit Debian Wheezy
115 What needs to be done?
116 ======================
118 - Add back platform specific objects.
119 - Fix places in the cmake files marked as todo.
120 - Guides are not installed.
121 - Build source package (using CPack).
122 This is obsolete if we decide to release VCS snapshots instead
123 - Build rpm package (using CPack).
124 - Add back checkAPI target.
125 - Test and add support for other platforms (BSDs, OSX,
126 Solaris, Win32, Win64, ...)
127 - Add support for cmake configurations.
128 - Get plugins loading when running *shark from the build directory.
129 - Automatically figure out if *shark is running from the build directory
130 (making WIRESHARK_RUN_FROM_BUILD_DIRECTORY unnecessary like it is with
132 - Get cross-compilation working (or ensure it does). It works with autofoo.
135 Links regarding cmake
136 =====================
137 The home page of the cmake project
138 http://www.cmake.org/
140 The home page of the cmake project documentation
141 http://www.cmake.org/Wiki/CMake
143 About cmake in general and why KDE4 uses it
144 http://lwn.net/Articles/188693/
146 Introductory/tutorial presentation
147 http://ait.web.psi.ch/services/linux/hpc/hpc_user_cookbook/tools/cmake/docs/Cmake_VM_2007.pdf
149 Introductory article in Linux Journal
150 http://www.linuxjournal.com/node/6700/print
153 http://www.cmake.org/Wiki/CMake_Useful_Variables
156 http://www.cmake.org/Wiki/CMake_FAQ
158 Additional cmake modules
159 http://code.google.com/p/cmake-modules/