README.cmake 5.14 KB
Newer Older
1 2 3 4 5
This file describes how to compile dbus using the cmake build system

Requirements
------------
- cmake version >= 2.4.4 see http://www.cmake.org
6 7 8
- installed libexpat see http://sourceforge.net/projects/expat/ 
    unsupported RelWithDebInfo builds could be fetched 
    from http://sourceforge.net/projects/kde-windows/files/expat/
9 10 11 12

Building
--------

13 14 15 16 17 18 19 20
Win32 MinGW-w64|32
1. install mingw-w64 from http://sourceforge.net/projects/mingw-w64/
2. install cmake and libexpat
3. get dbus sources
4. unpack dbus sources into a sub directory (referred as <dbus-src-root> later)
5. mkdir dbus-build
6. cd dbus-build
7. run 
21
    cmake -G "MinGW Makefiles" [<options, see below>] <dbus-src-root>/cmake
22 23
    mingw32-make
    mingw32-make install
24 25

Win32 Microsoft nmake
26 27 28 29 30 31 32
1. install MSVC 2010 Express Version from http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express
2. install cmake and libexpat
3. get dbus sources
4. unpack dbus sources into a sub directory (referred as <dbus-src-root> later)
5. mkdir dbus-build
6. cd dbus-build
7. run 
33
    cmake -G "NMake Makefiles" [<options, see below>] <dbus-src-root>/cmake
34 35
    nmake
    nmake install
36

37 38 39 40 41 42 43 44
Win32 Visual Studio 2010 Express IDE
1. install MSVC 2010 Express Version from http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express
2. install cmake and libexpat
3. get dbus sources
4. unpack dbus sources into a sub directory (referred as <dbus-src-root> later)
5. mkdir dbus-build
6. cd dbus-build
7. run
45
      cmake -G "Visual Studio 10" [<options, see below>] <dbus-src-root>/cmake
46
8a. open IDE with
47
      vcexpress dbus.sln
48
8b. for immediate build run
49 50
      vcexpress dbus.sln /build

51 52 53 54 55 56 57 58
Win32 Visual Studio 2010 Professional IDE
1. install MSVC 2010 Professional Version
2. install cmake and libexpat
3. get dbus sources
4. unpack dbus sources into a sub directory (referred as <dbus-src-root> later)
5. mkdir dbus-build
6. cd dbus-build
7. run 
59
      cmake -G "Visual Studio 10" [<options, see below>] <dbus-src-root>/cmake
60
8a. open IDE with
61
      devenv dbus.sln
62
8b. for immediate build run
63
      devenv dbus.sln /build
64 65

Linux
66
1. install cmake and libexpat
67 68 69 70 71
2. get dbus sources
3. unpack dbus sources into a sub directory (referred as <dbus-src-root> later)
4. mkdir dbus-build
5. cd dbus-build
6. run 
72
    cmake -G "<for available targets, see cmake --help for a list>" [<options, see below>] <dbus-src-root>/cmake
73 74 75 76
    make
    make install

For other compilers see cmake --help in the Generators section
77

78 79
Configuration flags
-------------------
80

81 82
When using the cmake build system the dbus-specific configuration flags that can be given 
to the cmake program are these (use -D<key>=<value> on command line). The listed values 
83
are the defaults (in a typical build - some are platform-specific).
84

85
// Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
CMAKE_BUILD_TYPE:STRING=Debug

// Include path for 3rdparty packages
CMAKE_INCLUDE_PATH:PATH=

// Library path for 3rdparty packages
CMAKE_LIBRARY_PATH:PATH=

// Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=C:/Program Files/dbus


// enable unit test code
DBUS_BUILD_TESTS:BOOL=ON

// The name of the dbus daemon executable
DBUS_DAEMON_NAME:STRING=dbus-daemon

// Disable assertion checking
106
DBUS_DISABLE_ASSERT:BOOL=OFF
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

// Disable public API sanity checking
DBUS_DISABLE_CHECKS:BOOL=OFF

// enable -ansi -pedantic gcc flags
DBUS_ENABLE_ANSI:BOOL=OFF

// build DOXYGEN documentation (requires Doxygen)
DBUS_ENABLE_DOXYGEN_DOCS:BOOL=OFF

// enable bus daemon usage statistics
DBUS_ENABLE_STATS:BOOL=OFF

// support verbose debug mode
DBUS_ENABLE_VERBOSE_MODE:BOOL=ON

// build XML  documentation (requires xmlto or meinproc4)
DBUS_ENABLE_XML_DOCS:BOOL=ON

// Some atomic integer implementation present
DBUS_HAVE_ATOMIC_INT:BOOL=OFF

// install required system libraries
DBUS_INSTALL_SYSTEM_LIBS:BOOL=OFF

132 133 134 135 136
// session bus default listening address
DBUS_SESSION_BUS_LISTEN_ADDRESS:STRING=autolaunch:

// session bus fallback address for clients
DBUS_SESSION_BUS_CONNECT_ADDRESS:STRING=autolaunch:
137

138 139
// system bus default address (only useful on Unix)
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS:STRING=unix:path=/var/run/dbus/system_bus_socket
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158

// Use atomic integer implementation for 486
DBUS_USE_ATOMIC_INT_486:BOOL=OFF

win32 only:
// enable win32 debug port for message output
DBUS_USE_OUTPUT_DEBUG_STRING:BOOL=OFF

gcc only:
// compile with coverage profiling instrumentation
DBUS_GCOV_ENABLED:BOOL=OFF

solaris only:
// enable console owner file 
HAVE_CONSOLE_OWNER_FILE:BOOL=ON

// Directory to check for console ownership
DBUS_CONSOLE_OWNER_FILE:STRING=/dev/console

159 160 161 162 163 164 165 166 167 168 169 170
// Linux only:
// enable inotify as dir watch backend
DBUS_BUS_ENABLE_INOTIFY:BOOL=ON

*BSD only:
// enable kqueue as dir watch backend
DBUS_BUS_ENABLE_KQUEUE:BOOL=ON

not available on windows:
// enable abstract socket transport
DBUS_ENABLE_ABSTRACT_SOCKETS:BOOL=ON

171 172 173 174 175 176 177 178 179
x11 only:
// Build with X11 auto launch support
DBUS_BUILD_X11:BOOL=ON


Note: The above mentioned options could be extracted after 
configuring from the output of running "<maketool> help-options" 
in the build directory. The related entries start with 
CMAKE_ or DBUS_.