2006-09-05 09:50:45 +00:00
|
|
|
Explain the cmake build system for wireshark
|
|
|
|
|
|
|
|
$Id$
|
2006-09-05 09:27:22 +00:00
|
|
|
|
2013-05-11 20:52:50 +00:00
|
|
|
Notice
|
2006-09-05 09:27:22 +00:00
|
|
|
|
2013-10-10 17:23:12 +00:00
|
|
|
To find out the current state of the cmake implementation for
|
2009-09-11 13:30:01 +00:00
|
|
|
Wireshark, please take a look at "What needs to be done?" below.
|
2006-09-05 09:27:22 +00:00
|
|
|
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?
|
2006-09-05 12:04:46 +00:00
|
|
|
Links regarding cmake
|
2006-09-05 09:27:22 +00:00
|
|
|
|
|
|
|
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.
|
2009-09-11 13:30:01 +00:00
|
|
|
2) Assuming, you are in the top directory of the wireshark source
|
2006-09-05 09:27:22 +00:00
|
|
|
cd ..
|
2009-09-11 13:30:01 +00:00
|
|
|
3) mkdir build
|
|
|
|
4) cd build
|
|
|
|
5) cmake ../<Name_of_WS_source_dir>
|
2013-09-23 21:45:55 +00:00
|
|
|
6) make (or cmake --build .)
|
|
|
|
7) (as root) umask 0022 && make install
|
2006-09-05 09:27:22 +00:00
|
|
|
|
2009-09-23 19:41:08 +00:00
|
|
|
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"
|
|
|
|
|
2009-12-29 12:12:26 +00:00
|
|
|
Note 3:
|
|
|
|
After running cmake, you can always run "make help" to see
|
|
|
|
a list of all possible make targets.
|
|
|
|
|
2013-02-23 22:54:17 +00:00
|
|
|
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.
|
|
|
|
|
2013-09-23 21:45:55 +00:00
|
|
|
How to do out of tree build (Win32/64):
|
2013-10-12 22:08:03 +00:00
|
|
|
[This is advanced alpha and should build all executables except the GTK3
|
|
|
|
Wireshark for 32-bit.]
|
2013-09-23 21:45:55 +00:00
|
|
|
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).
|
2013-10-05 08:02:17 +00:00
|
|
|
1b) set WIRESHARK_TARGET_PLATFORM=win32 (or win64)
|
2013-12-02 09:50:30 +00:00
|
|
|
1c) set QT5_BASE_DIR=c:\Qt\Qt5.1.1\5.1.1\msvc2010 (or whatever)
|
2013-12-04 22:07:26 +00:00
|
|
|
1d) In case you want to use Visual Studio, make sure that the paths
|
|
|
|
to python and cygwin are available to GUI applications.
|
2013-09-23 21:45:55 +00:00
|
|
|
2) Install cmake
|
2013-12-04 09:10:35 +00:00
|
|
|
2a) Build the zblib library, e.g.
|
|
|
|
cd %WIRESHARK_BASE_DIR%\wireshark-%WIRESHARK_TARGET_PLATFORM%-libs\zlib125
|
|
|
|
cmake -G "NMake Makefiles" . # msbuild will not do because of configuration path
|
|
|
|
cmake --build .
|
2013-09-23 21:45:55 +00:00
|
|
|
3) mkdir c:\wireshark\build
|
|
|
|
4) cd c:\wireshark\build
|
2013-11-10 11:00:54 +00:00
|
|
|
5) cmake -G "NMake Makefiles" path\to\sources
|
2013-10-10 17:23:12 +00:00
|
|
|
(i.e. in case your sources are located at c:\wireshark\trunk, use "..\trunk")
|
2013-10-05 08:02:17 +00:00
|
|
|
5a) cmake path\to\sources (this will build for the latest Visual Studio version found)
|
2013-10-10 17:28:50 +00:00
|
|
|
6) nmake /X- VERBOSE=1 (or cmake --build . -- VERBOSE=1 )
|
2013-10-05 08:02:17 +00:00
|
|
|
6a) Wireshark.sln (this will run up Visual Studio with the cmake built solution
|
2013-12-04 09:10:35 +00:00
|
|
|
(or use msbuild: cmake --build . -- /p:Configuration=RelWithDebInfo)
|
2013-10-10 17:16:21 +00:00
|
|
|
7) In case you want to test the executable(s) inside the build tree:
|
|
|
|
Run setpath.bat whenever it gets updated (there is a message in each cmake
|
|
|
|
run whether it is necessary or not).
|
2013-09-23 21:45:55 +00:00
|
|
|
|
2006-09-05 09:27:22 +00:00
|
|
|
Why cmake?
|
|
|
|
==========
|
|
|
|
- Can create project files for some MS and Apple IDEs.
|
|
|
|
- Fast
|
|
|
|
- Easier to understand/learn
|
2009-09-11 13:30:01 +00:00
|
|
|
- Doesn't create any files in the source tree in case
|
|
|
|
of out of tree builds
|
|
|
|
- One build infrastructure even including Windows
|
2006-09-05 09:27:22 +00:00
|
|
|
...
|
|
|
|
|
|
|
|
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).
|
|
|
|
...
|
|
|
|
|
2009-09-11 13:30:01 +00:00
|
|
|
What works?
|
|
|
|
===========
|
2006-09-05 09:27:22 +00:00
|
|
|
|
2009-10-09 20:14:56 +00:00
|
|
|
All the executables now build from clean source on:
|
2010-09-24 13:54:23 +00:00
|
|
|
* 32bit openSUSE 11.3: (gnu)make and gcc
|
2010-06-03 13:04:22 +00:00
|
|
|
* 64bit FedoraXXX
|
2009-10-09 20:14:56 +00:00
|
|
|
* 32bit Ubuntu 9.04
|
2010-06-06 06:09:26 +00:00
|
|
|
* 32bit Ubuntu 10.04
|
2013-02-23 22:54:26 +00:00
|
|
|
* 64bit Debian Wheezy
|
2006-09-05 09:27:22 +00:00
|
|
|
|
2009-09-11 13:30:01 +00:00
|
|
|
What needs to be done?
|
|
|
|
======================
|
2006-09-05 09:27:22 +00:00
|
|
|
|
2009-09-11 13:30:01 +00:00
|
|
|
- Add back platform specific objects.
|
|
|
|
- Fix places in the cmake files marked as todo.
|
2013-02-23 22:54:17 +00:00
|
|
|
- Guides are not installed.
|
2009-09-11 13:30:01 +00:00
|
|
|
- Build source package (using CPack).
|
2013-02-25 18:12:28 +00:00
|
|
|
This is obsolete if we decide to release VCS snapshots instead
|
2009-09-11 13:30:01 +00:00
|
|
|
- Build rpm package (using CPack).
|
2009-09-30 14:06:11 +00:00
|
|
|
- Build dpkg package (using CPack).
|
2013-02-25 18:12:28 +00:00
|
|
|
This is obsolete, we should call CMake from debian/rules instead, using dh
|
|
|
|
(rbalint)
|
2009-09-11 13:30:01 +00:00
|
|
|
- Add back checkAPI target.
|
|
|
|
- Test and add support for other platforms (BSDs, OSX,
|
|
|
|
Solaris, Win32, Win64, ...)
|
2013-10-29 15:28:49 +00:00
|
|
|
- Add support for cmake configurations.
|
|
|
|
- Get plugins loading when running *shark from the build directory.
|
|
|
|
- Automatically figure out if *shark is running from the build directory
|
|
|
|
(making WIRESHARK_RUN_FROM_BUILD_DIRECTORY unnecessary like it is with
|
|
|
|
autofoo).
|
|
|
|
- Get cross-compilation working (or ensure it does). It works with autofoo.
|
2009-09-11 13:30:01 +00:00
|
|
|
...
|
2006-09-05 09:27:22 +00:00
|
|
|
|
2006-09-05 12:04:46 +00:00
|
|
|
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/
|
|
|
|
|
2009-09-11 13:30:01 +00:00
|
|
|
Introductory/tutorial presentation
|
|
|
|
http://ait.web.psi.ch/services/linux/hpc/hpc_user_cookbook/tools/cmake/docs/Cmake_VM_2007.pdf
|
|
|
|
|
2011-09-01 04:35:57 +00:00
|
|
|
Introductory article in Linux Journal
|
2006-09-05 12:04:46 +00:00
|
|
|
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
|
|
|
|
|
2006-09-06 22:14:20 +00:00
|
|
|
Additional cmake modules
|
|
|
|
http://code.google.com/p/cmake-modules/
|