Fix: value string specified as a BASE_VAL64_STRING in
[metze/wireshark/wip.git] / README.cmake
index 1b8e7828ba2e4ed11a9ddd7a62b186dfa465ce0a..24eb8af04e9849dd736427eb6b4a651647b8ec08 100644 (file)
@@ -2,13 +2,10 @@
 
    $Id$
 
-                           Notice 
+                           Notice
 
-   The CMake build system for Wireshark is not yet ready for
-   building the whole system. You'll still need autofoo to buld it.
-   The only thing that can be build is dumpcap, and even that one
-   requires that you successfully ran autofoo prior to running cmake
-   (e.g. config.h is not yet build, lex and yacc are not run).
+   To find out the current state of the cmake implementation 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.
 
@@ -31,21 +28,68 @@ in tree builds do not work properly in all cases.
 
 How to do out of tree build (Unix/Linux):
 1) Install cmake.
-2) Build the project with the old build system once (to generate
-   config.h and run bison and flex to generate some c-files).
-3) Assuming, you are in the top directory of the wireshark source
+2) Assuming, you are in the top directory of the wireshark source
    cd ..
-4) mkdir build
-5) cd build
-6) cmake ../<Name_of_WS_source_dir>
-7) make
+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 advanced alpha and should build all executables except the GTK3
+ Wireshark for 32-bit.]
+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).
+1b) set WIRESHARK_TARGET_PLATFORM=win32 (or win64)
+1c) set QT5_BASE_DIR=c:\Qt\Qt5.1.1\5.1.1\msvc2010 (or whatever)
+1d) In case you want to use Visual Studio, make sure that the paths
+    to python and cygwin are available to GUI applications.
+2) Install cmake
+2a) Build the zlib 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 .
+3) mkdir c:\wireshark\build
+4) cd c:\wireshark\build
+5) cmake -G "NMake Makefiles" path\to\sources
+  (i.e. in case your sources are located at c:\wireshark\trunk, use "..\trunk")
+5a) cmake path\to\sources (this will build for the latest Visual Studio version found)
+6) nmake /X- VERBOSE=1 (or cmake --build . -- VERBOSE=1 )
+6a) Wireshark.sln (this will run up Visual Studio with the cmake built solution
+   (or use msbuild: cmake --build . -- /p:Configuration=RelWithDebInfo)
+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).
 
 Why cmake?
 ==========
 - Can create project files for some MS and Apple IDEs.
 - Fast
 - Easier to understand/learn
-- One build infrastructure even including Windows?
+- 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?
@@ -58,18 +102,38 @@ Why not cmake?
   cmake really works).
 ...
 
-What needs to be done?
-======================
+What works?
+===========
 
-only dumpcap and libwiretap have been done, and even those rely on
-autofoo having been run before:
+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
 
-- Add proper GTK1/GLIB2/GLIB1 detection (currently links against gtk2
-  to pull in glib2).
-- Create config.h
-- Autocreated source files in wiretap need to be build from .l, .y files.
+What needs to be done?
+======================
 
-All other tools and libs still need to be built.
+- Add back platform specific objects.
+- Fix places in the cmake files marked as todo.
+- Guides are not installed.
+- 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, ...)
+- 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.
+...
 
 Links regarding cmake
 =====================
@@ -82,7 +146,10 @@ The home page of the cmake project documentation
 About cmake in general and why KDE4 uses it
        http://lwn.net/Articles/188693/
 
-Introductory arcticle in Linux Journal
+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
@@ -91,3 +158,5 @@ Useful variables
 cmake FAQ
        http://www.cmake.org/Wiki/CMake_FAQ
 
+Additional cmake modules
+       http://code.google.com/p/cmake-modules/