summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2011-12-21 20:42:21 +0100
committerRalf Habacker <ralf.habacker@freenet.de>2011-12-21 20:42:21 +0100
commit66a4f22841bd4fc942eb9cfac7aaf17577e0bd56 (patch)
treec8d05e60a40733318b6739141a498c90618e292d
parentc4e5c2ec7a9d2dd4fc058e5cef73aaa37f890073 (diff)
parentef8d0d75d538db543ab0ff68809656f3972e3848 (diff)
Merge branch 'dbus-1.4'
-rw-r--r--cmake/CMakeLists.txt19
-rw-r--r--cmake/modules/MacrosAutotools.cmake40
-rw-r--r--configure.ac3
3 files changed, 48 insertions, 14 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 9db47381..ba44d575 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -1,18 +1,5 @@
project(dbus)
-#########################################################################
-# detect version
-#########################################################################
-file (READ ../configure.ac configure_ac)
-string (REGEX REPLACE ".*dbus_major_version], .([0-9]+).*" "\\1" DBUS_MAJOR_VERSION ${configure_ac})
-string (REGEX REPLACE ".*dbus_minor_version], .([0-9]+).*" "\\1" DBUS_MINOR_VERSION ${configure_ac})
-string (REGEX REPLACE ".*dbus_micro_version], .([0-9]+).*" "\\1" DBUS_MICRO_VERSION ${configure_ac})
-# used by file version info
-set (DBUS_PATCH_VERSION "0")
-set (DBUS_VERSION ${DBUS_MAJOR_VERSION}.${DBUS_MINOR_VERSION}.${DBUS_MICRO_VERSION})
-
-set (DBUS_VERSION_STRING "${DBUS_VERSION}")
-
# we need to be up to date
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.4 FATAL_ERROR)
if(COMMAND cmake_policy)
@@ -22,6 +9,12 @@ endif(COMMAND cmake_policy)
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
+# detect version
+include(MacrosAutotools)
+autoversion(../configure.ac dbus)
+# used by file version info
+set (DBUS_PATCH_VERSION "0")
+
include(Macros)
TIMESTAMP(DBUS_BUILD_TIMESTAMP)
diff --git a/cmake/modules/MacrosAutotools.cmake b/cmake/modules/MacrosAutotools.cmake
new file mode 100644
index 00000000..ff30eaf9
--- /dev/null
+++ b/cmake/modules/MacrosAutotools.cmake
@@ -0,0 +1,40 @@
+#
+# @Author Ralf Habacker
+#
+# extracts version information from autoconf config file
+# and set related cmake variables
+#
+# returns
+# ${prefix}_VERSION
+# ${prefix}_VERSION_STRING
+# ${prefix}_MAJOR_VERSION
+# ${prefix}_MINOR_VERSION
+# ${prefix}_MICRO_VERSION
+#
+macro(autoversion config prefix)
+ file (READ ${config} _configure_ac)
+ string(TOUPPER ${prefix} prefix_upper)
+ string (REGEX REPLACE ".*${prefix}_major_version], .([0-9]+).*" "\\1" ${prefix_upper}_MAJOR_VERSION ${_configure_ac})
+ string (REGEX REPLACE ".*${prefix}_minor_version], .([0-9]+).*" "\\1" ${prefix_upper}_MINOR_VERSION ${_configure_ac})
+ string (REGEX REPLACE ".*${prefix}_micro_version], .([0-9]+).*" "\\1" ${prefix_upper}_MICRO_VERSION ${_configure_ac})
+ set (${prefix_upper}_VERSION ${${prefix_upper}_MAJOR_VERSION}.${${prefix_upper}_MINOR_VERSION}.${${prefix_upper}_MICRO_VERSION})
+ set (${prefix_upper}_VERSION_STRING "${${prefix_upper}_VERSION}")
+
+endmacro()
+
+#
+# parses config.h template and create cmake equivalent
+# not implemented yet
+#
+macro(autoconfig template output)
+ file(READ ${template} contents)
+ # Convert file contents into a CMake list (where each element in the list
+ # is one line of the file)
+ STRING(REGEX REPLACE ";" "\\\\;" contents "${contents}")
+ STRING(REGEX REPLACE "\n" ";" contents "${contents}")
+ foreach(line contents)
+ message(STATUS ${line})
+ # find #undef lines
+ # append to config.h #define <variable-name> <variable-content>
+ endforeach()
+endmacro()
diff --git a/configure.ac b/configure.ac
index 6579534b..243cbbcd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,6 +149,7 @@ AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filen
AC_ARG_WITH(launchd-agent-dir, AS_HELP_STRING([--with-launchd-agent-dir=[dirname]],[directory to put the launchd agent (default: /Library/LaunchAgents)]))
AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
+AC_ARG_WITH(dbus_session_bus_default_address, AS_HELP_STRING([--with-dbus-session-bus-default-address=[nonce-tcp:/autolaunch:/tcp:host:port]],[Transport Type to be used (default: nonce-tcp:)]),with_dbus_session_bus_default_address=$withval,with_dbus_session_bus_default_address=nonce-tcp:)
AC_ARG_ENABLE([embedded-tests],
AS_HELP_STRING([--enable-embedded-tests],
@@ -1580,7 +1581,7 @@ AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where p
AC_SUBST(DBUS_SESSION_SOCKET_DIR)
if test x$dbus_win = xyes; then
- DBUS_SESSION_BUS_DEFAULT_ADDRESS="nonce-tcp:"
+ DBUS_SESSION_BUS_DEFAULT_ADDRESS="$with_dbus_session_bus_default_address"
elif test x$have_launchd = xyes; then
DBUS_SESSION_BUS_DEFAULT_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET"
else