added new variable DBUS_BUILD_TIMESTAMP
[platform/upstream/dbus.git] / cmake / CMakeLists.txt
index 7a08a51..d0a290c 100644 (file)
@@ -1,23 +1,19 @@
-set (PACKAGE dbus)
-
-# the version major, minor and release number should be synchron to the dbus cvs - windows releases should only update the patch level
-set (VERSION_MAJOR "1")
-set (VERSION_MINOR "2")
-set (VERSION_RELEASE "14")
-set (VERSION_PATCH "0")
-if (VERSION_PATCH)
-    set (VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}-${VERSION_PATCH}" )
-else (VERSION_PATCH)
-    set (VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}" )
-endif (VERSION_PATCH)
-set (DBUS_MAJOR_VERSION ${VERSION_MAJOR})
-set (DBUS_MINOR_VERSION ${VERSION_MAJOR})
-set (DBUS_MICRO_VERSION ${VERSION_MAJOR})
-set (DBUS_MAJOR_VERSION ${VERSION_MAJOR})
-set (DBUS_VERSION ${VERSION})
-set (DBUS_VERSION_STRING "${VERSION}")
-
-project(${PACKAGE})
+project(dbus)
+
+set (DBUS_MAJOR_VERSION "1")
+set (DBUS_MINOR_VERSION "3")
+set (DBUS_MICRO_VERSION "1")
+# used by file version info
+set (DBUS_PATCH_VERSION "1")
+set (DBUS_VERSION ${DBUS_MAJOR_VERSION}.${DBUS_MINOR_VERSION}.${DBUS_MICRO_VERSION})
+endif (DBUS_PATCH_VERSION)
+
+set (DBUS_VERSION_STRING "${DBUS_VERSION}")
+
+if (NOT DBUS_BUILD_TIMESTAMP)
+    message(STATUS "FIXME set DBUS_BUILD_TIMESTAMP to current date or fix current time stamp generation for having actual build date in version file info")
+    set (DBUS_BUILD_TIMESTAMP 20091231)
+endif (NOT DBUS_BUILD_TIMESTAMP)
 
 # we need to be up to date
 CMAKE_MINIMUM_REQUIRED(VERSION 2.4.4 FATAL_ERROR)
@@ -43,7 +39,7 @@ if (WIN32)
     find_package(KDEWIN_Packager)
        find_package(LibIconv)
     include(Win32Macros)
-    addExplorerWrapper(${PACKAGE})
+    addExplorerWrapper(${CMAKE_PROJECT_NAME})
 endif (WIN32)
 find_package(LibXml2)
 find_package(LibExpat)
@@ -52,6 +48,14 @@ find_package(X11)
 
 OPTION(DBUS_ENABLE_ABSTRACT_SOCKETS "enable support for abstract sockets" ON)
 
+if (MINGW)
+    set (DBUS_VA_COPY_AS_ARRAY 1)
+endif (MINGW)
+if (MSVC)
+    set (DBUS_HAVE_VA_COPY 1)
+    set (DBUS_VA_COPY_AS_ARRAY 0)
+endif (MSVC)
+
 # do config checks
 INCLUDE(ConfigureChecks.cmake)
 
@@ -110,6 +114,8 @@ if(WIN32)
   set (CMAKE_DEBUG_POSTFIX "d")
 endif(WIN32)
 
+SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}  -D_DEBUG")
+
 #########################################################################
 # Windows CE
 #
@@ -119,7 +125,7 @@ endif(WIN32)
 # change configuration in Visual Studio to 'Pocket PC 2003 (ARMV4)'
 #
 if(wince)
-       project(${PACKAGE}-wince)
+       project(${CMAKE_PROJECT_NAME}-wince)
        # don't forget parameters
        set(wince 1 CACHE TYPE STRING FORCE)
        set(wcelibcex ${wcelibcex} CACHE TYPE STRING FORCE)
@@ -233,7 +239,15 @@ set (DBUS_DAEMONDIR ${EXPANDED_BINDIR})
 
 #AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[enable unit test code]),enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE)
 OPTION(DBUS_BUILD_TESTS "enable unit test code" ON)
-add_definitions(-DDBUS_BUILD_TESTS)
+if(DBUS_BUILD_TESTS)
+    add_definitions(-DDBUS_BUILD_TESTS)
+endif(DBUS_BUILD_TESTS)
+
+OPTION(DBUS_USE_OUTPUT_DEBUG_STRING "enable win32 debug port for message output" OFF)
+if(DBUS_USE_OUTPUT_DEBUG_STRING)
+    add_definitions(-DDBUS_USE_OUTPUT_DEBUG_STRING)
+endif(DBUS_USE_OUTPUT_DEBUG_STRING)
 
 # win32 dbus service support - this support is not complete
 OPTION(DBUS_SERVICE "enable dbus service installer" OFF)
@@ -441,8 +455,14 @@ set (DBUS_USER )
 
 
 if (WIN32)
-  set (DBUS_SESSION_BUS_DEFAULT_ADDRESS "tcp:host=localhost,port=0")
-  set (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "tcp:host=localhost,port=0")
+  OPTION(DBUS_USE_NONCE_TCP_DEFAULT_ADDRESS "Use nonce tcp default address" OFF)
+  if (DBUS_USE_NONCE_TCP_DEFAULT_ADDRESS)
+      set (DBUS_SESSION_BUS_DEFAULT_ADDRESS "nonce-tcp:host=localhost,port=0")
+      set (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "nonce-tcp:host=localhost,port=0")
+  else (DBUS_USE_NONCE_TCP_DEFAULT_ADDRESS)
+      set (DBUS_SESSION_BUS_DEFAULT_ADDRESS "tcp:host=localhost,port=12434")
+      set (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS  "tcp:host=localhost,port=12434")
+  endif (DBUS_USE_NONCE_TCP_DEFAULT_ADDRESS)
   set (DBUS_SYSTEM_CONFIG_FILE "etc/system.conf")
   set (DBUS_SESSION_CONFIG_FILE "etc/session.conf")
   # bus-test expects a non empty string
@@ -525,8 +545,8 @@ MESSAGE(" ")
 GET_FILENAME_COMPONENT(C_COMPILER ${CMAKE_C_COMPILER} NAME)
 GET_FILENAME_COMPONENT(CXX_COMPILER ${CMAKE_CXX_COMPILER} NAME)
 
-message("                  D-BUS ${VERSION}                                    ")
-message("                  ==========                                          ")
+message("                  D-BUS ${DBUS_VERSION}                               ")
+message("                  ===========                                         ")
 message("                                                                      ")
 message("        prefix:                   ${prefix}                           ")
 message("        exec_prefix:              ${exec_prefix}                      ")
@@ -578,6 +598,10 @@ message("        Console auth dir:         ${DBUS_CONSOLE_AUTH_DIR}            "
 message("        System bus user:          ${DBUS_USER}                        ")
 message("        'make check' socket dir:  ${TEST_SOCKET_DIR}                  ")
 endif (WIN32)
+if (MSVC)
+message("        build timestamp:          ${DBUS_BUILD_TIMESTAMP}             ")
+endif (MSVC)
+
 MESSAGE(" ")
 if (DBUS_BUILD_TESTS)
     message("NOTE: building with unit tests increases the size of the installed library and renders it insecure.")
@@ -607,5 +631,5 @@ MESSAGE(" ")
 INCLUDE(modules/CPackInstallConfig.cmake)
 
 if (KDEWIN_PACKAGER_FOUND)
-    KDEWIN_PACKAGER(${PACKAGE} ${VERSION} "ipc library" "")
+    KDEWIN_PACKAGER(${CMAKE_PROJECT_NAME} ${DBUS_VERSION} "ipc library" "")
 endif (KDEWIN_PACKAGER_FOUND)