summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2014-10-01 19:45:00 +0100
committerSimon McVittie <smcv@debian.org>2014-10-01 19:45:00 +0100
commit255f62947424c4622609eb93ed53371dda28aac9 (patch)
tree6f8c5dbb96e48fa2d40919bb3282fae0b6d953de /cmake
parentc03b8e681afa8e45977fc74e30142497939b47d1 (diff)
parent33ee25f98af863e9355fd53b9184c0b798343b89 (diff)
downloaddbus-upstream/1.9.0.tar.gz
Imported Upstream version 1.9.0upstream/1.9.0
Diffstat (limited to 'cmake')
-rw-r--r--cmake/CMakeLists.txt45
-rw-r--r--cmake/ConfigureChecks.cmake2
-rw-r--r--cmake/bus/CMakeLists.txt56
-rw-r--r--cmake/config.h.cmake5
-rw-r--r--cmake/dbus/CMakeLists.txt27
-rw-r--r--cmake/doc/CMakeLists.txt15
-rw-r--r--cmake/modules/COPYING-CMAKE-SCRIPTS22
-rw-r--r--cmake/modules/FindGLIB.cmake42
-rw-r--r--cmake/modules/FindGLib2.cmake60
-rw-r--r--cmake/modules/FindGObject.cmake52
-rw-r--r--cmake/modules/Macros.cmake50
-rw-r--r--cmake/modules/MacrosAutotools.cmake7
-rw-r--r--cmake/test/CMakeLists.txt84
-rw-r--r--cmake/test/name-test/CMakeLists.txt40
-rw-r--r--cmake/tools/CMakeLists.txt5
15 files changed, 350 insertions, 162 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index fe111966..628a681a 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -73,7 +73,7 @@ set(EXPANDED_DATADIR ${DBUS_INSTALL_DIR}/${DBUS_DATADIR})
set(DBUS_MACHINE_UUID_FILE ${DBUS_INSTALL_DIR}/lib/dbus/machine-id)
set(DBUS_BINDIR ${EXPANDED_BINDIR})
set(DBUS_DAEMONDIR ${EXPANDED_BINDIR})
-
+set(DBUS_LOCALSTATEDIR ${DBUS_INSTALL_DIR}/var)
#enable building of shared library
SET(BUILD_SHARED_LIBS ON)
@@ -107,8 +107,17 @@ option (DBUS_DISABLE_ASSERT "Disable assertion checking" OFF)
option (DBUS_ENABLE_STATS "enable bus daemon usage statistics" OFF)
+if(WIN32)
+ set(FD_SETSIZE "8192" CACHE STRING "The maximum number of connections that can be handled at once")
+endif()
+
find_package(EXPAT)
find_package(X11)
+find_package(GLib2)
+find_package(GObject)
+if(GLIB2_FOUND AND GOBJECT_FOUND)
+ option (DBUS_WITH_GLIB "build with glib" ON)
+endif()
# analogous to AC_USE_SYSTEM_EXTENSIONS in configure.ac
add_definitions(-D_GNU_SOURCE)
@@ -127,7 +136,6 @@ if(VCS)
endif(VCS)
if(WIN32)
- set(CMAKE_DEBUG_POSTFIX "d")
if(MSVC)
# controll folders in msvc projects
include(ProjectSourceGroup)
@@ -348,9 +356,8 @@ endif(X11_FOUND)
# test binary names
if (WIN32)
- # Automake calls this EXEEXT, and CMake doesn't have a standard name
- # for it; follow Automake's naming convention so we can share .in files
- set (EXEEXT ".exe")
+ # follow Automake's naming convention so we can share .in files
+ set (EXEEXT ${CMAKE_EXECUTABLE_SUFFIX})
endif(WIN32)
if (MSVC_IDE)
@@ -393,13 +400,8 @@ endif (MSVC_IDE)
endif (NOT $ENV{TEMP} STREQUAL "")
endif (NOT $ENV{TMPDIR} STREQUAL "")
-# TODO: fix redhet
-if (WIN32)
- # bus-test expects a non empty string
- set (DBUS_SYSTEM_PID_FILE "/dbus-pid")
-else (WIN32)
- set (DBUS_SYSTEM_PID_FILE ${EXPANDED_LOCALSTATEDIR}/run/dbus/pid)
-endif (WIN32)
+ # Not used on Windows, where there is no system bus
+set (DBUS_SYSTEM_PID_FILE ${DBUS_LOCALSTATEDIR}/run/dbus/pid)
if (WIN32)
set (DBUS_CONSOLE_AUTH_DIR "")
@@ -409,10 +411,6 @@ endif (WIN32)
set (DBUS_USER )
-# In Autotools this has a different default on QNX, but there seems little
-# point in replicating that here; if you're on an unusual Unix, use Autotools.
-set (DEFAULT_MESSAGE_UNIX_FDS 1024)
-
# This won't work on Windows. It's not meant to - the system bus is
# meaningless on Windows anyway.
#
@@ -421,7 +419,7 @@ set (DEFAULT_MESSAGE_UNIX_FDS 1024)
# and also to connect to. If this ever changes, it'll need to be split into
# two variables, one for the listening address and one for the connecting
# address.
-set (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "unix:path=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket" CACHE STRING "system bus default address")
+set (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "unix:path=${DBUS_LOCALSTATEDIR}/run/dbus/system_bus_socket" CACHE STRING "system bus default address")
if (WIN32)
set (DBUS_SESSION_BUS_LISTEN_ADDRESS "autolaunch:" CACHE STRING "session bus default listening address")
@@ -463,6 +461,7 @@ if (DBUS_BUILD_TESTS)
set(DBUS_TEST_DATA ${CMAKE_BINARY_DIR}/test/data)
set(TEST_SOCKET_DIR ${DBUS_SESSION_SOCKET_DIR} )
set(TEST_LAUNCH_HELPER_BINARY ${EXECUTABLE_OUTPUT_PATH}/dbus-daemon-launch-helper-test)
+ set(TEST_BUS_LAUNCH_BINARY ${EXECUTABLE_OUTPUT_PATH}/dbus-launch${EXEEXT})
if (UNIX)
set (TEST_LISTEN "unix:tmpdir=${TEST_SOCKET_DIR}")
endif (UNIX)
@@ -539,19 +538,20 @@ message(" Docbook Generator: ${DOCBOOK_GENERATOR_NAME} "
message(" gcc coverage profiling: ${DBUS_GCOV_ENABLED} ")
message(" Building unit tests: ${DBUS_BUILD_TESTS} ")
+message(" Building with GLib: ${DBUS_WITH_GLIB} ")
message(" Building verbose mode: ${DBUS_ENABLE_VERBOSE_MODE} ")
-message(" Building w/o assertions: ${DBUS_DISABLE_ASSERT} ")
+message(" Building w/o assertions: ${DBUS_DISABLE_ASSERT} ")
message(" Building w/o checks: ${DBUS_DISABLE_CHECKS} ")
message(" Building bus stats API: ${DBUS_ENABLE_STATS} ")
message(" installing system libs: ${DBUS_INSTALL_SYSTEM_LIBS} ")
message(" Building inotify support: ${DBUS_BUS_ENABLE_INOTIFY} ")
-message(" Building kqueue support: ${DBUS_BUS_ENABLE_KQUEUE} ")
+message(" Building kqueue support: ${DBUS_BUS_ENABLE_KQUEUE} ")
message(" Building Doxygen docs: ${DBUS_ENABLE_DOXYGEN_DOCS} ")
message(" Building XML docs: ${DBUS_ENABLE_XML_DOCS} ")
message(" Daemon executable name: ${DBUS_DAEMON_NAME}")
if (WIN32)
message(" System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS} ")
-message(" Session bus listens on: ${DBUS_SESSION_BUS_LISTEN_ADDRESS} ")
+message(" Session bus listens on: ${DBUS_SESSION_BUS_LISTEN_ADDRESS} ")
message(" Session clients connect to: ${DBUS_SESSION_BUS_CONNECT_ADDRESS} ")
else (WIN32)
message(" System bus socket: ${DBUS_SYSTEM_SOCKET} ")
@@ -591,6 +591,11 @@ endif(NOT DBUS_DISABLE_ASSERT)
if (DBUS_DISABLE_CHECKS)
message("NOTE: building without checks for arguments passed to public API makes it harder to debug apps using D-BUS, but will slightly decrease D-BUS library size and _very_ slightly improve performance.")
endif(DBUS_DISABLE_CHECKS)
+
+foreach(_note ${FOOTNOTES})
+ message(${_note})
+endforeach()
+
MESSAGE(" ")
INCLUDE(modules/CPackInstallConfig.cmake)
diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake
index 2794975e..d290b0f2 100644
--- a/cmake/ConfigureChecks.cmake
+++ b/cmake/ConfigureChecks.cmake
@@ -90,7 +90,7 @@ find_program(DOXYGEN doxygen)
find_program(XMLTO xmlto)
if(MSVC)
- SET(DBUS_VA_COPY_FUNC "_DBUS_VA_COPY_ASSIGN";)
+ SET(DBUS_VA_COPY_FUNC "_DBUS_VA_COPY_ASSIGN")
else(MSVC)
write_file("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/cmake_try_compile.c" "#include <stdarg.h>
#include <stdlib.h>
diff --git a/cmake/bus/CMakeLists.txt b/cmake/bus/CMakeLists.txt
index 9943584a..2ff6c9bc 100644
--- a/cmake/bus/CMakeLists.txt
+++ b/cmake/bus/CMakeLists.txt
@@ -1,21 +1,16 @@
-project(bus)
-
add_definitions(-DDBUS_COMPILATION)
SET(EFENCE "")
SET(BUS_DIR ${CMAKE_SOURCE_DIR}/../bus)
-set (config_DATA
- session.conf
- system.conf
-)
-
# config files for installation
CONFIGURE_FILE( "${BUS_DIR}/session.conf.in" "${CMAKE_CURRENT_BINARY_DIR}/session.conf" IMMEDIATE @ONLY)
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/session.d)
-CONFIGURE_FILE( "system.conf.cmake" "${CMAKE_CURRENT_BINARY_DIR}/system.conf" IMMEDIATE @ONLY)
-FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/system.d)
+if(NOT WIN32)
+ CONFIGURE_FILE( "system.conf.cmake" "${CMAKE_CURRENT_BINARY_DIR}/system.conf" IMMEDIATE @ONLY)
+ FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/system.d)
+endif()
# copy services for local daemon start to local service dir data/dbus-1/services
SET (SERVICE_FILES test/data/valid-service-files)
@@ -82,7 +77,11 @@ if(DBUS_ENABLE_STATS)
)
endif(DBUS_ENABLE_STATS)
-include_directories(${XML_INCLUDE_DIR})
+include_directories(
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/..
+ ${XML_INCLUDE_DIR}
+)
add_executable(dbus-daemon ${BUS_SOURCES} ${BUS_DIR}/main.c)
target_link_libraries(dbus-daemon ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
@@ -90,8 +89,16 @@ set_target_properties(dbus-daemon PROPERTIES OUTPUT_NAME ${DBUS_DAEMON_NAME})
set_target_properties(dbus-daemon PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
install_targets(/bin dbus-daemon)
-install_files(/etc/dbus-1 FILES ${config_DATA})
-install(DIRECTORY . DESTINATION etc/dbus-1/session.d FILES_MATCHING PATTERN "*.conf")
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/session.conf DESTINATION etc/dbus-1)
+install(DIRECTORY DESTINATION etc/dbus-1/session.d)
+install(DIRECTORY DESTINATION share/dbus-1/services)
+
+if(NOT WIN32)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/system.conf DESTINATION etc/dbus-1)
+ install(DIRECTORY DESTINATION etc/dbus-1/system.d)
+ install(DIRECTORY DESTINATION share/dbus-1/system-services)
+ install(DIRECTORY DESTINATION var/run/dbus)
+endif()
if (DBUS_SERVICE)
set (dbus_service_SOURCES
@@ -108,10 +115,19 @@ if (DBUS_SERVICE)
endif (DBUS_SERVICE)
if (DBUS_ENABLE_EMBEDDED_TESTS)
- add_executable(bus-test ${BUS_SOURCES} ${BUS_DIR}/test-main.c)
- target_link_libraries(bus-test ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
- set_target_properties(bus-test PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
- add_test(bus-test ${EXECUTABLE_OUTPUT_PATH}/bus-test ${CMAKE_BINARY_DIR}/test/data)
+ set(SOURCES ${BUS_SOURCES} ${BUS_DIR}/test-main.c)
+ add_test_executable(test-bus "${SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
+ set_target_properties(test-bus PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
+ if (NOT DBUS_WIN32)
+ set(test_bus_system_SOURCES
+ ${XML_SOURCES}
+ ${BUS_DIR}/config-parser-common.c
+ ${BUS_DIR}/config-parser-trivial.c
+ ${BUS_DIR}/utils.c
+ ${BUS_DIR}/test-system.c
+ )
+ add_test_executable(test-bus-system "${test_bus_system_SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} ${DBUS_BUS_LIBS})
+ endif()
endif (DBUS_ENABLE_EMBEDDED_TESTS)
if(MSVC)
@@ -148,11 +164,9 @@ if(NOT WIN32)
set_target_properties(dbus-daemon-launch-helper-test PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST")
target_link_libraries(dbus-daemon-launch-helper-test ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} )
- add_executable(bus-test-launch-helper ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/test-launch-helper.c)
- set_target_properties(bus-test-launch-helper PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST -DACTIVATION_LAUNCHER_DO_OOM")
- target_link_libraries(bus-test-launch-helper ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} )
- add_test(bus-test-launch-helper ${EXECUTABLE_OUTPUT_PATH}/bus-test-launch-helper )
-
+ set (SOURCES ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/test-launch-helper.c)
+ add_test_executable(test-bus-launch-helper "${SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
+ set_target_properties(test-bus-launch-helper PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST -DACTIVATION_LAUNCHER_DO_OOM")
endif(NOT WIN32)
#### Init scripts fun
diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake
index 37355609..eaec1e98 100644
--- a/cmake/config.h.cmake
+++ b/cmake/config.h.cmake
@@ -32,6 +32,7 @@
// test binaries
#define DBUS_TEST_EXEC "@DBUS_TEST_EXEC@"
#define DBUS_EXEEXT "@EXEEXT@"
+#cmakedefine TEST_BUS_LAUNCH_BINARY "@TEST_BUS_LAUNCH_BINARY@"
/* Some dbus features */
#cmakedefine DBUS_ENABLE_ANSI 1
@@ -81,8 +82,6 @@
# define DBUS_ENABLE_X11_AUTOLAUNCH 1
#endif
-#define DBUS_DEFAULT_MESSAGE_UNIX_FDS @DEFAULT_MESSAGE_UNIX_FDS@
-
#define _DBUS_VA_COPY_ASSIGN(a1,a2) { a1 = a2; }
#cmakedefine DBUS_VA_COPY_FUNC
@@ -195,6 +194,8 @@
/* Define to 1 if you have struct cmsgred */
#cmakedefine HAVE_CMSGCRED 1
+#cmakedefine FD_SETSIZE @FD_SETSIZE@
+
// system type defines
#if defined(_WIN32) || defined(_WIN64) || defined (_WIN32_WCE)
# define DBUS_WIN
diff --git a/cmake/dbus/CMakeLists.txt b/cmake/dbus/CMakeLists.txt
index 0205f852..a6aaba07 100644
--- a/cmake/dbus/CMakeLists.txt
+++ b/cmake/dbus/CMakeLists.txt
@@ -1,5 +1,3 @@
-project(dbus-lib)
-
SET(DBUS_DIR ${CMAKE_SOURCE_DIR}/../dbus)
configure_file(${DBUS_DIR}/dbus-arch-deps.h.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-arch-deps.h )
@@ -216,14 +214,12 @@ else (WIN32)
${DBUS_DIR}/dbus-sysdeps-unix.c
${DBUS_DIR}/dbus-sysdeps-pthread.c
${DBUS_DIR}/dbus-userdb.c
- ${DBUS_DIR}/sd-daemon.c
)
set (DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS}
${DBUS_DIR}/dbus-server-unix.h
${DBUS_DIR}/dbus-transport-unix.h
${DBUS_DIR}/dbus-sysdeps-unix.h
${DBUS_DIR}/dbus-userdb.h
- ${DBUS_DIR}/sd-daemon.h
)
set (DBUS_UTIL_SOURCES ${DBUS_UTIL_SOURCES}
${DBUS_DIR}/dbus-spawn.c
@@ -263,13 +259,29 @@ add_library(dbus-1 SHARED
${libdbus_SOURCES}
${libdbus_HEADERS}
)
+if(DBUS_LIBRARY_REVISION)
+ math(EXPR DBUS_LIBRARY_MAJOR "${DBUS_LIBRARY_CURRENT} - ${DBUS_LIBRARY_AGE}")
+endif()
+
if(WIN32)
+ if(DBUS_LIBRARY_REVISION)
+ get_target_property(LEGACY_FILE_NAME dbus-1 LOCATION)
+ set_target_properties(dbus-1 PROPERTIES SUFFIX "-${DBUS_LIBRARY_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+ add_custom_command(TARGET dbus-1 POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:dbus-1>" "${LEGACY_FILE_NAME}"
+ COMMENT "Create non versioned dbus-1 library for legacy applications"
+ )
+ install(FILES ${LEGACY_FILE_NAME} DESTINATION bin)
+ endif()
if(WINCE)
target_link_libraries(dbus-1 ws2)
else(WINCE)
target_link_libraries(dbus-1 ws2_32 advapi32 netapi32 iphlpapi)
endif(WINCE)
else(WIN32)
+ if(DBUS_LIBRARY_REVISION)
+ set_target_properties(dbus-1 PROPERTIES VERSION ${DBUS_LIBRARY_MAJOR}.${DBUS_LIBRARY_AGE}.${DBUS_LIBRARY_REVISION} SOVERSION ${DBUS_LIBRARY_MAJOR})
+ endif()
target_link_libraries(dbus-1 ${CMAKE_THREAD_LIBS_INIT} rt)
endif(WIN32)
@@ -299,11 +311,8 @@ else(WIN32)
endif(WIN32)
if (DBUS_ENABLE_EMBEDDED_TESTS)
- set (TESTS_ENVIRONMENT "DBUS_TEST_DATA=${CMAKE_SOURCE_DIR}/test/data DBUS_TEST_HOMEDIR=${CMAKE_BUILD_DIR}/dbus")
- ADD_EXECUTABLE(dbus-test ${CMAKE_SOURCE_DIR}/../dbus/dbus-test-main.c)
- target_link_libraries(dbus-test ${DBUS_INTERNAL_LIBRARIES})
- add_test(dbus-test ${EXECUTABLE_OUTPUT_PATH}/dbus-test ${CMAKE_SOURCE_DIR}/../test/data)
- set_target_properties(dbus-test PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
+ add_test_executable(test-dbus ${CMAKE_SOURCE_DIR}/../dbus/dbus-test-main.c ${DBUS_INTERNAL_LIBRARIES})
+ set_target_properties(test-dbus PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
ENDIF (DBUS_ENABLE_EMBEDDED_TESTS)
if (UNIX)
diff --git a/cmake/doc/CMakeLists.txt b/cmake/doc/CMakeLists.txt
index 7fdfc219..807af60c 100644
--- a/cmake/doc/CMakeLists.txt
+++ b/cmake/doc/CMakeLists.txt
@@ -20,6 +20,8 @@ find_program(MEINPROC4_EXECUTABLE meinproc4)
find_program(XMLTO_EXECUTABLE xmlto)
+find_program(CYGPATH_EXECUTABLE cygpath)
+
if (MEINPROC4_EXECUTABLE OR XMLTO_EXECUTABLE)
OPTION(DBUS_ENABLE_XML_DOCS "build XML documentation (requires xmlto or meinproc4)" ON)
ADD_CUSTOM_TARGET(xmldoc ALL)
@@ -71,6 +73,19 @@ macro (DOCBOOK _sources _format)
)
endif ()
if (XMLTO_EXECUTABLE)
+ if (MSYS)
+ if (CYGPATH_EXECUTABLE)
+ execute_process(
+ COMMAND cygpath ${_infile}
+ OUTPUT_VARIABLE _infile)
+ else ()
+ execute_process(COMMAND dirname ${_infile} OUTPUT_VARIABLE _path)
+ string(STRIP ${_path} _path)
+ execute_process(COMMAND sh -c "cd ${_path}; pwd -W" OUTPUT_VARIABLE _path)
+ string(STRIP ${_path} _path)
+ set(_infile "${_path}/${_name}")
+ endif(CYGPATH_EXECUTABLE)
+ endif (MSYS)
ADD_CUSTOM_COMMAND(
OUTPUT ${_outfile}
COMMAND ${XMLTO_EXECUTABLE} -vv ${_format} ${_infile}
diff --git a/cmake/modules/COPYING-CMAKE-SCRIPTS b/cmake/modules/COPYING-CMAKE-SCRIPTS
new file mode 100644
index 00000000..53b6b71e
--- /dev/null
+++ b/cmake/modules/COPYING-CMAKE-SCRIPTS
@@ -0,0 +1,22 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/cmake/modules/FindGLIB.cmake b/cmake/modules/FindGLIB.cmake
deleted file mode 100644
index 1fdaee95..00000000
--- a/cmake/modules/FindGLIB.cmake
+++ /dev/null
@@ -1,42 +0,0 @@
-# - Try to find the GLIB library
-# Once done this will define
-#
-# GLIB_FOUND - system has GLIB
-# GLIB_INCLUDES - the GLIB include directories
-# GLIB_LIBRARIES - The libraries needed to use GLIB
-
-if (WIN32)
-
-INCLUDE(MacroGetenvWinPath)
-
-MACRO_GETENV_WIN_PATH(_program_FILES_DIR PROGRAMFILES)
-
-FIND_PATH(GLIB_INCLUDE_DIR glib.h
- ${_program_FILES_DIR}/glib/include/glib-2.0
-)
-
-
-# search for GLIB in the default install directory for applications (default of (n)make install)
-FIND_LIBRARY(GLIB_LIBRARY NAMES glib-2.0
- PATHS
- ${_program_FILES_DIR}/glib/lib
-)
-
-if (GLIB_LIBRARY AND GLIB_INCLUDE_DIR)
- set(GLIB_FOUND TRUE)
- set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GLIB_INCLUDES})
- set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${GLIB_LIBRARIES})
-
-endif (GLIB_LIBRARY AND GLIB_INCLUDE_DIR)
-
-if (GLIB_FOUND)
- if (NOT GLIB_FIND_QUIETLY)
- message(STATUS "Found GLIB: ${GLIB_LIBRARY}")
- endif (NOT GLIB_FIND_QUIETLY)
-else (GLIB_FOUND)
- if (GLIB_FIND_REQUIRED)
- message(FATAL_ERROR "Could NOT find GLIB library")
- endif (GLIB_FIND_REQUIRED)
-endif (GLIB_FOUND)
-
-endif (WIN32)
diff --git a/cmake/modules/FindGLib2.cmake b/cmake/modules/FindGLib2.cmake
new file mode 100644
index 00000000..d72b2a09
--- /dev/null
+++ b/cmake/modules/FindGLib2.cmake
@@ -0,0 +1,60 @@
+# - Try to find the GLIB2 libraries
+# Once done this will define
+#
+# GLIB2_FOUND - system has glib2
+# GLIB2_INCLUDE_DIR - the glib2 include directory
+# GLIB2_LIBRARIES - glib2 library
+
+# Copyright (c) 2008 Laurent Montel, <montel@kde.org>
+# Copyright (c) 2013 Ralf Habacker, <ralf.habacker@freenet.de>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
+ # Already in cache, be silent
+ set(GLIB2_FIND_QUIETLY TRUE)
+endif(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
+
+if (NOT WIN32)
+ find_package(PkgConfig)
+ pkg_check_modules(PC_LibGLIB2 QUIET glib-2.0)
+endif()
+
+find_path(GLIB2_MAIN_INCLUDE_DIR
+ NAMES glib.h
+ HINTS ${PC_LibGLIB2_INCLUDEDIR}
+ PATH_SUFFIXES glib-2.0)
+
+find_library(GLIB2_LIBRARY
+ NAMES glib-2.0
+ HINTS ${PC_LibGLIB2_LIBDIR}
+)
+
+find_library(GIO2_LIBRARY
+ NAMES gio-2.0
+ HINTS ${PC_LibGLIB2_LIBDIR}
+)
+
+set(GLIB2_LIBRARIES ${GLIB2_LIBRARY} ${GIO2_LIBRARY})
+
+# search the glibconfig.h include dir under the same root where the library is found
+get_filename_component(glib2LibDir "${GLIB2_LIBRARY}" PATH)
+
+find_path(GLIB2_INTERNAL_INCLUDE_DIR glibconfig.h
+ PATH_SUFFIXES glib-2.0/include
+ HINTS ${PC_LibGLIB2_INCLUDEDIR} "${glib2LibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH})
+
+set(GLIB2_INCLUDE_DIR "${GLIB2_MAIN_INCLUDE_DIR}")
+
+# not sure if this include dir is optional or required
+# for now it is optional
+if(GLIB2_INTERNAL_INCLUDE_DIR)
+ set(GLIB2_INCLUDE_DIR ${GLIB2_INCLUDE_DIR} "${GLIB2_INTERNAL_INCLUDE_DIR}")
+endif(GLIB2_INTERNAL_INCLUDE_DIR)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GLIB2 DEFAULT_MSG GLIB2_LIBRARIES GLIB2_MAIN_INCLUDE_DIR)
+
+mark_as_advanced(GLIB2_INCLUDE_DIR GLIB2_LIBRARIES)
diff --git a/cmake/modules/FindGObject.cmake b/cmake/modules/FindGObject.cmake
new file mode 100644
index 00000000..af0c9f73
--- /dev/null
+++ b/cmake/modules/FindGObject.cmake
@@ -0,0 +1,52 @@
+# - Try to find GObject
+# Once done this will define
+#
+# GOBJECT_FOUND - system has GObject
+# GOBJECT_INCLUDE_DIR - the GObject include directory
+# GOBJECT_LIBRARIES - the libraries needed to use GObject
+# GOBJECT_DEFINITIONS - Compiler switches required for using GObject
+
+# Copyright (c) 2011, Raphael Kubo da Costa <kubito@gmail.com>
+# Copyright (c) 2006, Tim Beaulen <tbscope@gmail.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(PC_GOBJECT gobject-2.0)
+SET(GOBJECT_DEFINITIONS ${PC_GOBJECT_CFLAGS_OTHER})
+
+FIND_PATH(GOBJECT_INCLUDE_DIR gobject.h
+ HINTS
+ ${PC_GOBJECT_INCLUDEDIR}
+ ${PC_GOBJECT_INCLUDE_DIRS}
+ PATH_SUFFIXES glib-2.0/gobject/
+ )
+
+FIND_LIBRARY(_GObjectLibs NAMES gobject-2.0
+ HINTS
+ ${PC_GOBJECT_LIBDIR}
+ ${PC_GOBJECT_LIBRARY_DIRS}
+ )
+FIND_LIBRARY(_GModuleLibs NAMES gmodule-2.0
+ HINTS
+ ${PC_GOBJECT_LIBDIR}
+ ${PC_GOBJECT_LIBRARY_DIRS}
+ )
+FIND_LIBRARY(_GThreadLibs NAMES gthread-2.0
+ HINTS
+ ${PC_GOBJECT_LIBDIR}
+ ${PC_GOBJECT_LIBRARY_DIRS}
+ )
+FIND_LIBRARY(_GLibs NAMES glib-2.0
+ HINTS
+ ${PC_GOBJECT_LIBDIR}
+ ${PC_GOBJECT_LIBRARY_DIRS}
+ )
+
+SET( GOBJECT_LIBRARIES ${_GObjectLibs} ${_GModuleLibs} ${_GThreadLibs} ${_GLibs} )
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GOBJECT DEFAULT_MSG GOBJECT_LIBRARIES GOBJECT_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(GOBJECT_INCLUDE_DIR _GObjectLibs _GModuleLibs _GThreadLibs _GLibs)
diff --git a/cmake/modules/Macros.cmake b/cmake/modules/Macros.cmake
index adb34b51..fd3f62c4 100644
--- a/cmake/modules/Macros.cmake
+++ b/cmake/modules/Macros.cmake
@@ -1,3 +1,28 @@
+if(DBUS_BUILD_TESTS AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
+ find_file(WINE_EXECUTABLE
+ NAMES wine
+ PATHS /usr/bin /usr/local/bin
+ NO_CMAKE_FIND_ROOT_PATH
+ )
+ find_file(HAVE_BINFMT_WINE_SUPPORT
+ NAMES DOSWin wine Wine windows Windows
+ PATHS /proc/sys/fs/binfmt_misc
+ NO_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH
+ )
+ if(WINE_EXECUTABLE AND HAVE_BINFMT_WINE_SUPPORT)
+ list(APPEND FOOTNOTES "NOTE: The requirements to run cross compiled applications on your host system are achieved. You may run 'make check'.")
+ endif()
+ if(NOT WINE_EXECUTABLE)
+ list(APPEND FOOTNOTES "NOTE: You may install the Windows emulator 'wine' to be able to run cross compiled test applications.")
+ endif()
+ if(NOT HAVE_BINFMT_WINE_SUPPORT)
+ list(APPEND FOOTNOTES "NOTE: You may activate binfmt_misc support for wine to be able to run cross compiled test applications.")
+ endif()
+ else()
+ list(APPEND FOOTNOTES "NOTE: You will not be able to run cross compiled applications on your host system.")
+ endif()
+endif()
MACRO(TIMESTAMP RESULT)
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
@@ -10,3 +35,28 @@ MACRO(TIMESTAMP RESULT)
EXECUTE_PROCESS(COMMAND "date" "+%Y%m%d%H%M" OUTPUT_VARIABLE ${RESULT})
endif ()
ENDMACRO()
+
+macro(add_test_executable _target _source)
+ add_executable(${_target} ${_source})
+ target_link_libraries(${_target} ${ARGN})
+ if (CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ # run tests with binfmt_misc
+ set(PREFIX "z:")
+ set(_env "DBUS_TEST_DAEMON=${PREFIX}${CMAKE_BINARY_DIR}/bin/dbus-daemon${EXEEXT}")
+ add_test(NAME ${_target} COMMAND $<TARGET_FILE:${_target}>)
+ else()
+ set(PREFIX)
+ set(_env "DBUS_TEST_DAEMON=${CMAKE_BINARY_DIR}/bin/dbus-daemon${EXEEXT}")
+ add_test(NAME ${_target} COMMAND $<TARGET_FILE:${_target}>)
+ endif()
+ list(APPEND _env "DBUS_SESSION_BUS_ADDRESS=")
+ list(APPEND _env "DBUS_FATAL_WARNINGS=1")
+ list(APPEND _env "DBUS_TEST_DATA=${PREFIX}${CMAKE_BINARY_DIR}/test/data")
+ list(APPEND _env "DBUS_TEST_HOMEDIR=${PREFIX}${CMAKE_BINARY_DIR}/dbus")
+ set_tests_properties(${_target} PROPERTIES ENVIRONMENT "${_env}")
+endmacro(add_test_executable)
+
+macro(add_helper_executable _target _source)
+ add_executable(${_target} ${_source})
+ target_link_libraries(${_target} ${ARGN})
+endmacro(add_helper_executable)
diff --git a/cmake/modules/MacrosAutotools.cmake b/cmake/modules/MacrosAutotools.cmake
index 68e8ae51..2b1c59d4 100644
--- a/cmake/modules/MacrosAutotools.cmake
+++ b/cmake/modules/MacrosAutotools.cmake
@@ -10,6 +10,9 @@
# ${prefix}_MAJOR_VERSION
# ${prefix}_MINOR_VERSION
# ${prefix}_MICRO_VERSION
+# ${prefix}_LIBRARY_AGE
+# ${prefix}_LIBRARY_REVISION
+# ${prefix}_LIBRARY_CURRENT
#
macro(autoversion config prefix)
file (READ ${config} _configure_ac)
@@ -19,7 +22,9 @@ macro(autoversion config prefix)
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}")
-
+ string (REGEX REPLACE ".*LT_AGE=([0-9]+).*" "\\1" ${prefix_upper}_LIBRARY_AGE ${_configure_ac})
+ string (REGEX REPLACE ".*LT_CURRENT=([0-9]+).*" "\\1" ${prefix_upper}_LIBRARY_CURRENT ${_configure_ac})
+ string (REGEX REPLACE ".*LT_REVISION=([0-9]+).*" "\\1" ${prefix_upper}_LIBRARY_REVISION ${_configure_ac})
endmacro()
#
diff --git a/cmake/test/CMakeLists.txt b/cmake/test/CMakeLists.txt
index 8657e4c7..13f639b1 100644
--- a/cmake/test/CMakeLists.txt
+++ b/cmake/test/CMakeLists.txt
@@ -1,7 +1,10 @@
-project(test)
add_definitions(${DBUS_INTERNAL_CLIENT_DEFINITIONS})
+include_directories(${CMAKE_SOURCE_DIR}/../test)
+
+set(DBUS_SESSION_BUS_LISTEN_ADDRESS ${TEST_LISTEN})
+
add_library(dbus-testutils STATIC
${CMAKE_SOURCE_DIR}/../test/test-utils.h
${CMAKE_SOURCE_DIR}/../test/test-utils.c
@@ -10,6 +13,10 @@ target_link_libraries(dbus-testutils ${DBUS_INTERNAL_LIBRARIES})
add_subdirectory( name-test )
+set (manual-dir-iter_SOURCES
+ ${CMAKE_SOURCE_DIR}/../test/manual-dir-iter.c
+)
+
set (test-service_SOURCES
${CMAKE_SOURCE_DIR}/../test/test-service.c
)
@@ -26,11 +33,11 @@ set (test-shell-service_SOURCES
${CMAKE_SOURCE_DIR}/../test/test-shell-service.c
)
-set (shell-test_SOURCES
+set (test-shell_SOURCES
${CMAKE_SOURCE_DIR}/../test/shell-test.c
)
-set (spawn-test_SOURCES
+set (test-spawn_SOURCES
${CMAKE_SOURCE_DIR}/../test/spawn-test.c
)
@@ -46,30 +53,41 @@ set (test-sleep-forever_SOURCES
${CMAKE_SOURCE_DIR}/../test/test-sleep-forever.c
)
-add_executable(test-service ${test-service_SOURCES})
-target_link_libraries(test-service dbus-testutils)
-
-add_executable(test-names ${test-names_SOURCES})
-target_link_libraries(test-names dbus-testutils)
-
-add_executable(shell-test ${shell-test_SOURCES})
-target_link_libraries(shell-test ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(shell-test ${EXECUTABLE_OUTPUT_PATH}/shell-test${EXEEXT})
-
-add_executable(test-shell-service ${test-shell-service_SOURCES})
-target_link_libraries(test-shell-service dbus-testutils)
-
-add_executable(spawn-test ${spawn-test_SOURCES})
-target_link_libraries(spawn-test ${DBUS_INTERNAL_LIBRARIES})
-
-add_executable(test-exit ${test-exit_SOURCES})
-target_link_libraries(test-exit ${DBUS_INTERNAL_LIBRARIES})
-
-add_executable(test-segfault ${test-segfault_SOURCES})
-target_link_libraries(test-segfault ${DBUS_INTERNAL_LIBRARIES})
-
-add_executable(test-sleep-forever ${test-sleep-forever_SOURCES})
-target_link_libraries(test-sleep-forever ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(manual-dir-iter ${manual-dir-iter_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-service ${test-service_SOURCES} dbus-testutils)
+add_helper_executable(test-names ${test-names_SOURCES} dbus-testutils)
+add_test_executable(test-shell ${test-shell_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
+add_test_executable(test-printf ${CMAKE_SOURCE_DIR}/../test/internals/printf.c dbus-testutils)
+add_helper_executable(test-shell-service ${test-shell-service_SOURCES} dbus-testutils)
+add_helper_executable(test-spawn ${test-spawn_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-exit ${test-exit_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-segfault ${test-segfault_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-sleep-forever ${test-sleep-forever_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
+
+if(DBUS_WITH_GLIB)
+ message(STATUS "with glib test apps")
+ add_definitions(
+ ${GLIB2_DEFINITIONS}
+ ${GOBJECT_DEFINITIONS}
+ )
+ include_directories(
+ ${GLIB2_INCLUDE_DIR}
+ ${GOBJECT_INCLUDE_DIR}
+ ${CMAKE_SOURCE_DIR}/../test
+ )
+ set(TEST_LIBRARIES ${DBUS_INTERNAL_LIBRARIES} dbus-testutils ${GLIB2_LIBRARIES} ${GOBJECT_LIBRARIES})
+
+ add_test_executable(test-corrupt ${CMAKE_SOURCE_DIR}/../test/corrupt.c ${TEST_LIBRARIES})
+ add_test_executable(test-dbus-daemon ${CMAKE_SOURCE_DIR}/../test/dbus-daemon.c ${TEST_LIBRARIES})
+ add_test_executable(test-dbus-daemon-eavesdrop ${CMAKE_SOURCE_DIR}/../test/dbus-daemon-eavesdrop.c ${TEST_LIBRARIES})
+ add_test_executable(test-loopback ${CMAKE_SOURCE_DIR}/../test/loopback.c ${TEST_LIBRARIES})
+ add_test_executable(test-marshal ${CMAKE_SOURCE_DIR}/../test/marshal.c ${TEST_LIBRARIES})
+ add_test_executable(test-refs ${CMAKE_SOURCE_DIR}/../test/internals/refs.c ${TEST_LIBRARIES})
+ add_test_executable(test-relay ${CMAKE_SOURCE_DIR}/../test/relay.c ${TEST_LIBRARIES})
+ add_test_executable(test-syntax ${CMAKE_SOURCE_DIR}/../test/syntax.c ${TEST_LIBRARIES})
+ add_test_executable(test-syslog ${CMAKE_SOURCE_DIR}/../test/internals/syslog.c ${TEST_LIBRARIES})
+ add_helper_executable(manual-authz ${CMAKE_SOURCE_DIR}/../test/manual-authz.c ${TEST_LIBRARIES})
+endif()
### keep these in creation order, i.e. uppermost dirs first
set (TESTDIRS
@@ -81,6 +99,7 @@ set (TESTDIRS
test/data/sha-1
test/data/valid-config-files
test/data/valid-config-files/basic.d
+ test/data/valid-config-files/session.d
test/data/valid-config-files/system.d
test/data/valid-config-files-system
test/data/valid-introspection-files
@@ -139,17 +158,18 @@ ENDFOREACH(FILE_TYPE)
MESSAGE(STATUS "Copying generated bus config files to test directory")
set (OUTDIR ${CMAKE_BINARY_DIR}/test/data/valid-config-files)
-FILE(GLOB FILES "${CMAKE_BINARY_DIR}/bus/*.conf" )
+FILE(GLOB FILES "${CMAKE_SOURCE_DIR}/../bus/*.conf.in" )
FILE(MAKE_DIRECTORY ${OUTDIR})
FOREACH(FILE ${FILES})
GET_FILENAME_COMPONENT(FILENAME ${FILE} NAME)
+ STRING(REGEX REPLACE "\\.in$" "" FILENAME ${FILENAME})
SET (TARGET ${OUTDIR}/${FILENAME})
- configure_file(${FILE} ${TARGET} COPYONLY)
+ configure_file(${FILE} ${TARGET} @ONLY)
IF (CONFIG_VERBOSE)
MESSAGE("FROM: ${FILE}\nTO: ${TARGET}\n")
ENDIF (CONFIG_VERBOSE)
ENDFOREACH(FILE)
-# todo: for installation the TEST_..._BINARY variables must reflect the
-# installation dir or has to be defined relative
-#
+add_custom_target(check
+ COMMAND ctest -R ^test-.*
+)
diff --git a/cmake/test/name-test/CMakeLists.txt b/cmake/test/name-test/CMakeLists.txt
index bf096ba7..befb28f9 100644
--- a/cmake/test/name-test/CMakeLists.txt
+++ b/cmake/test/name-test/CMakeLists.txt
@@ -4,36 +4,12 @@ set (NAMEtest-DIR ../../../test/name-test)
add_definitions(${DBUS_INTERNAL_CLIENT_DEFINITIONS})
-add_executable(test-pending-call-dispatch ${NAMEtest-DIR}/test-pending-call-dispatch.c)
-target_link_libraries(test-pending-call-dispatch ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(test-pending-call-dispatch ${EXECUTABLE_OUTPUT_PATH}/test-pending-call-dispatch)
-
-add_executable(test-pending-call-timeout ${NAMEtest-DIR}/test-pending-call-timeout.c)
-target_link_libraries(test-pending-call-timeout ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(test-pending-call-timeout ${EXECUTABLE_OUTPUT_PATH}/test-pending-call-timeout)
-
-add_executable(test-thread-init ${NAMEtest-DIR}/test-threads-init.c)
-target_link_libraries(test-thread-init ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(test-thread-init ${EXECUTABLE_OUTPUT_PATH}/test-thread-init)
-
-add_executable(test-ids ${NAMEtest-DIR}/test-ids.c)
-target_link_libraries(test-ids ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(test-ids ${EXECUTABLE_OUTPUT_PATH}/test-ids)
-
-add_executable(test-shutdown ${NAMEtest-DIR}/test-shutdown.c)
-target_link_libraries(test-shutdown dbus-testutils)
-ADD_TEST(test-shutdown ${EXECUTABLE_OUTPUT_PATH}/test-shutdown)
-
-add_executable(test-privserver ${NAMEtest-DIR}/test-privserver.c)
-target_link_libraries(test-privserver dbus-testutils)
-ADD_TEST(test-privserver ${EXECUTABLE_OUTPUT_PATH}/test-privserver)
-
-add_executable(test-privserver-client ${NAMEtest-DIR}/test-privserver-client.c)
-target_link_libraries(test-privserver-client dbus-testutils)
-ADD_TEST(test-privserver-client ${EXECUTABLE_OUTPUT_PATH}/test-privserver-client)
-
-add_executable(test-autolaunch ${NAMEtest-DIR}/test-autolaunch.c)
-target_link_libraries(test-autolaunch dbus-testutils)
-ADD_TEST(test-autolaunch ${EXECUTABLE_OUTPUT_PATH}/test-autolaunch)
-
+add_helper_executable(test-pending-call-dispatch ${NAMEtest-DIR}/test-pending-call-dispatch.c ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-pending-call-timeout ${NAMEtest-DIR}/test-pending-call-timeout.c ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-thread-init ${NAMEtest-DIR}/test-threads-init.c ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-ids ${NAMEtest-DIR}/test-ids.c ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-shutdown ${NAMEtest-DIR}/test-shutdown.c dbus-testutils)
+add_helper_executable(test-privserver ${NAMEtest-DIR}/test-privserver.c dbus-testutils)
+add_helper_executable(test-privserver-client ${NAMEtest-DIR}/test-privserver-client.c dbus-testutils)
+add_helper_executable(test-autolaunch ${NAMEtest-DIR}/test-autolaunch.c dbus-testutils)
endif (DBUS_ENABLE_EMBEDDED_TESTS)
diff --git a/cmake/tools/CMakeLists.txt b/cmake/tools/CMakeLists.txt
index 101c7e60..9f363b7a 100644
--- a/cmake/tools/CMakeLists.txt
+++ b/cmake/tools/CMakeLists.txt
@@ -1,5 +1,3 @@
-project(tools)
-
set (dbus_send_SOURCES
../../tools/dbus-print-message.c
../../tools/dbus-print-message.h
@@ -47,3 +45,6 @@ install_targets(/bin dbus-launch )
add_executable(dbus-monitor ${dbus_monitor_SOURCES})
target_link_libraries(dbus-monitor ${DBUS_LIBRARIES})
install_targets(/bin dbus-monitor )
+
+# create the /var/lib/dbus directory for dbus-uuidgen
+install(DIRECTORY DESTINATION var/lib/dbus)