Commit 46684804 authored by Christian Ehrlicher's avatar Christian Ehrlicher Committed by unknown

merge changes done to the cmake-buildsystem from the sf.net windbus-svn trunk....

merge changes done to the cmake-buildsystem from the sf.net windbus-svn trunk. tested and works fine with at least msvc2008. (cherry picked from commit 45c168fd61e3f6447e014df4bb6417efbe725ccd)
parent a83b7cb8
This diff is collapsed.
include_directories(${CMAKE_SOURCE_DIR}/..)
include_directories( ${CMAKE_INCLUDE_PATH} )
project(bus)
add_definitions(-DDBUS_COMPILATION)
......@@ -45,8 +43,11 @@ set (BUS_SOURCES
${BUS_DIR}/bus.c
${BUS_DIR}/bus.h
${BUS_DIR}/config-parser.c
${BUS_DIR}/config-parser.h
${BUS_DIR}/connection.c
${BUS_DIR}/config-parser.h
${BUS_DIR}/config-parser-common.c
${BUS_DIR}/config-parser-common.h
# ${BUS_DIR}/config-parser-trivial.c
${BUS_DIR}/connection.c
${BUS_DIR}/connection.h
${BUS_DIR}/desktop-file.c
${BUS_DIR}/desktop-file.h
......@@ -74,30 +75,34 @@ set (BUS_SOURCES
${DIR_WATCH_SOURCE}
)
set (dbus_daemon_SOURCES
${BUS_SOURCES}
${BUS_DIR}/main.c
)
include_directories(${XML_INCLUDE_DIR})
SET (LIBS ${XML_LIBRARY})
add_executable(dbus-daemon${CMAKE_EXE_POSTFIX} ${dbus_daemon_SOURCES})
target_link_libraries(dbus-daemon${CMAKE_EXE_POSTFIX} dbus-1 ${LIBS})
install_targets(/bin dbus-daemon${CMAKE_EXE_POSTFIX} )
if(splitlib AND MSVC)
add_library(bus-lib STATIC ${BUS_SOURCES})
add_executable(dbus-daemon ${BUS_DIR}/main.c)
target_link_libraries(dbus-daemon ${DBUS_1} ${LIBS} bus-lib)
else(splitlib AND MSVC)
add_executable(dbus-daemon ${BUS_SOURCES} ${BUS_DIR}/main.c)
target_link_libraries(dbus-daemon ${DBUS_1} ${LIBS})
endif(splitlib AND MSVC)
set_target_properties(dbus-daemon PROPERTIES DEBUG_POSTFIX d)
install_targets(/bin dbus-daemon)
install_files(/etc FILES ${config_DATA})
if (DBUS_SERVICE)
set (dbus_service_SOURCES
${BUS_DIR}/bus-service-win.c
# TODO: add additional files
# TODO: add additional files
# ${BUS_DIR}/service-main.c
# ${BUS_SOURCES}
)
add_executable(dbus-service${CMAKE_EXE_POSTFIX} ${dbus_service_SOURCES} )
target_link_libraries(dbus-service${CMAKE_EXE_POSTFIX} dbus-1 ${LIBS})
install_targets(/bin dbus-service${CMAKE_EXE_POSTFIX} )
add_executable(dbus-service ${dbus_service_SOURCES} )
target_link_libraries(dbus-service ${DBUS_1} ${LIBS})
install_targets(/bin dbus-service )
set_target_properties(dbus-service PROPERTIES DEBUG_POSTFIX d)
endif (DBUS_SERVICE)
......@@ -115,14 +120,14 @@ endif (DBUS_SERVICE)
## even when not doing "make check"
#noinst_PROGRAMS=$(TESTS)
set (bus_test_SOURCES
${BUS_SOURCES}
${BUS_DIR}/test-main.c
)
if (DBUS_BUILD_TESTS)
add_executable(bus-test ${bus_test_SOURCES})
target_link_libraries(bus-test dbus-1 ${LIBS} )
if(splitlib AND MSVC)
add_executable(bus-test ${BUS_DIR}/test-main.c)
target_link_libraries(bus-test ${DBUS_1} ${LIBS} bus-lib)
else(splitlib AND MSVC)
add_executable(bus-test ${BUS_SOURCES} ${BUS_DIR}/test-main.c)
target_link_libraries(bus-test ${DBUS_1} ${LIBS})
endif(splitlib AND MSVC)
#install_targets(/bin bus-test)
add_test(bus-test ${EXECUTABLE_OUTPUT_PATH}/bus-test ${CMAKE_SOURCE_DIR}/../test/data)
endif (DBUS_BUILD_TESTS)
......
......@@ -19,6 +19,12 @@
#cmakedefine PACKAGE "@PACKAGE@"
/* Version number of package */
#cmakedefine VERSION "@VERSION@"
#cmakedefine DBUS_MAJOR_VERSION ${VERSION_MAJOR}
#cmakedefine DBUS_MINOR_VERSION ${VERSION_MINOR}
#cmakedefine DBUS_MICRO_VERSION ${VERSION_RELEASE}
#cmakedefine DBUS_VERSION ((@VERSION_MAJOR@ << 16) | (@VERSION_MINOR@ << 8) | (@VERSION_RELEASE@))
#cmakedefine DBUS_VERSION_STRING "@VERSION@"
// test binaries
/* Full path to test file test/test-exit in builddir */
#define TEST_BUS_BINARY "@TEST_BUS_BINARY@"
......
project(dbus)
project(dbus-lib)
#INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) -DDBUS_COMPILATION
include_directories(${CMAKE_SOURCE_DIR}/..)
SET(DBUS_DIR ${CMAKE_SOURCE_DIR}/../dbus)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dbus-arch-deps.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/dbus-arch-deps.h )
......@@ -24,6 +23,7 @@ set (dbusinclude_HEADERS
${DBUS_DIR}/dbus-server.h
${DBUS_DIR}/dbus-shared.h
${DBUS_DIR}/dbus-signature.h
${DBUS_DIR}/dbus-spawn.h
${DBUS_DIR}/dbus-threads.h
${DBUS_DIR}/dbus-types.h
dbus-arch-deps.h
......@@ -64,6 +64,8 @@ set (DBUS_LIB_SOURCES
# find a clean Windows implementation
# and move code to a *-win.c file
)
if(UNIX)
set (DBUS_LIB_SOURCES ${DBUS_LIB_SOURCES}
${DBUS_DIR}/dbus-transport-unix.c
......@@ -225,17 +227,57 @@ set(libdbus_HEADERS
${DBUS_UTIL_HEADERS}
)
if(MSVC)
add_library(dbus-1 STATIC ${libdbus_SOURCES} ${libdbus_HEADERS} )
project_source_group(${GROUP_CODE} libdbus_SOURCES libdbus_HEADERS)
else(MSVC)
add_library(dbus-1 ${libdbus_SOURCES} ${libdbus_HEADERS} )
endif(MSVC)
if(MSVC AND splitlib)
set(DBUS_LIB_TYPE STATIC)
elseif(MSVC AND splitlib)
set(DBUS_LIB_TYPE SHARED)
endif(MSVC AND splitlib)
if(splitlib AND MSVC)
# code for the client library and daemon/tests
add_library(dbus-lib-generic ${DBUS_LIB_TYPE} ${DBUS_SHARED_SOURCES} ${DBUS_SHARED_HEADERS})
# code only for daemon/tests
add_library(dbus-lib-util ${DBUS_LIB_TYPE} ${DBUS_UTIL_SOURCES} ${DBUS_UTIL_HEADERS})
# code for the client library
add_library(dbus-lib-client ${DBUS_LIB_TYPE} ${DBUS_LIB_SOURCES} ${DBUS_LIB_HEADERS})
target_link_libraries(dbus-lib-generic ${LIBS})
target_link_libraries(dbus-lib-util ${LIBS})
target_link_libraries(dbus-lib-client ${LIBS})
if(MSVC_IDE)
project_source_group(${GROUP_CODE} DBUS_LIB_SOURCES DBUS_LIB_HEADERS)
project_source_group(${GROUP_CODE} DBUS_SHARED_SOURCES DBUS_SHARED_HEADERS)
project_source_group(${GROUP_CODE} DBUS_UTIL_SOURCES DBUS_UTIL_SOURCES)
endif(MSVC_IDE)
else(splitlib AND MSVC)
# all code into one library
add_library(dbus-1 ${DBUS_LIB_TYPE} ${libdbus_SOURCES} ${libdbus_HEADERS} )
target_link_libraries(dbus-1 ${LIBS})
if(MSVC)
set(DEF_LIBRARY_NAME dbus-1.dll)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/dbus-1.def.cmake" "${CMAKE_BINARY_DIR}/dbus-1.def")
set(DEF_LIBRARY_NAME dbus-1d.dll)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/dbus-1.def.cmake" "${CMAKE_BINARY_DIR}/dbus-1d.def")
set_target_properties(dbus-1 PROPERTIES LINK_FLAGS_RELWITHDEBINFO /def:"${CMAKE_BINARY_DIR}/dbus-1.def")
set_target_properties(dbus-1 PROPERTIES LINK_FLAGS_RELEASE /def:"${CMAKE_BINARY_DIR}/dbus-1.def")
set_target_properties(dbus-1 PROPERTIES LINK_FLAGS_MINSIZEREL /def:"${CMAKE_BINARY_DIR}/dbus-1.def")
set_target_properties(dbus-1 PROPERTIES LINK_FLAGS_DEBUG /def:"${CMAKE_BINARY_DIR}/dbus-1d.def")
endif(MSVC)
if(MSVC_IDE)
project_source_group(${GROUP_CODE} libdbus_SOURCES libdbus_HEADERS)
endif(MSVC_IDE)
endif(splitlib AND MSVC)
target_link_libraries(dbus-1 ${LIBS} )
install_targets(/lib dbus-1 )
install_files(/include/dbus FILES ${dbusinclude_HEADERS})
if(NOT splitlib)
install_targets(/lib dbus-1 )
install_files(/include/dbus FILES ${dbusinclude_HEADERS})
endif(NOT splitlib)
#ADD_EXECUTABLE(dbus-example dbus-example.c)
#target_link_libraries(${CMAKE_SOURCE_DIR}/../dbus/dbus-example dbus-1)
......@@ -254,7 +296,7 @@ install_files(/include/dbus FILES ${dbusinclude_HEADERS})
if (DBUS_BUILD_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-1 ${LIBS})
target_link_libraries(dbus-test ${DBUS_1} ${LIBS})
add_test(dbus-test ${EXECUTABLE_OUTPUT_PATH}/dbus-test ${CMAKE_SOURCE_DIR}/../test/data)
#install_targets(/bin dbus-test)
ENDIF (DBUS_BUILD_TESTS)
......
This diff is collapsed.
project(test)
#if HAVE_GLIB
# GLIB_SUBDIR=glib
......@@ -16,9 +17,6 @@ add_subdirectory( name-test )
#INCLUDES=-I$(top_srcdir) $(DBUS_test-CFLAGS)
include_directories( ${CMAKE_SOURCE_DIR}/.. )
include_directories( ${CMAKE_INCLUDE_PATH} )
if (WIN32)
add_definitions(-Dsleep=_sleep)
endif (WIN32)
......@@ -89,7 +87,7 @@ set (decode_gcov_SOURCES
)
add_executable(test-service ${test-service_SOURCES})
target_link_libraries(test-service dbus-1)
target_link_libraries(test-service ${DBUS_1})
#install_targets(/bin test-service)
# (rh) does not work at now
......@@ -98,63 +96,68 @@ ADD_TEST(test-service ${EXECUTABLE_OUTPUT_PATH}/test-service${EXT})
add_executable(test-names ${test-names_SOURCES})
target_link_libraries(test-names dbus-1)
target_link_libraries(test-names ${DBUS_1})
#install_targets(/bin test-names)
ADD_TEST(test-names ${EXECUTABLE_OUTPUT_PATH}/test-names${EXT})
add_executable(test-shell ${test-shell_SOURCES})
target_link_libraries(test-shell dbus-1)
target_link_libraries(test-shell ${DBUS_1})
#install_targets(/bin test-shell)
ADD_TEST(test-shell ${EXECUTABLE_OUTPUT_PATH}/test-shell${EXT})
add_executable(test-shell-service ${test-shell_SOURCES})
target_link_libraries(test-shell-service dbus-1)
target_link_libraries(test-shell-service ${DBUS_1})
#install_targets(/bin test-shell-service)
ADD_TEST(test-shell-service ${EXECUTABLE_OUTPUT_PATH}/test-shell-service${EXT})
add_executable(test-spawn ${test-spawn_SOURCES})
target_link_libraries(test-spawn dbus-1)
target_link_libraries(test-spawn ${DBUS_1})
# (rh) does not work now
#ADD_TEST(test-spawn ${EXECUTABLE_OUTPUT_PATH}/test-spawn${EXT})
add_executable(test-exit ${test-exit_SOURCES})
target_link_libraries(test-exit dbus-1)
target_link_libraries(test-exit ${DBUS_1})
#install_targets(/bin test-exit)
ADD_TEST(test-exit ${EXECUTABLE_OUTPUT_PATH}/test-exit${EXT})
add_executable(test-segfault ${test-segfault_SOURCES})
target_link_libraries(test-segfault dbus-1)
target_link_libraries(test-segfault ${DBUS_1})
#install_targets(/bin test-segfault)
ADD_TEST(test-segfault ${EXECUTABLE_OUTPUT_PATH}/test-segfault${EXT})
add_executable(test-sleep-forever ${test-sleep-forever_SOURCES})
target_link_libraries(test-sleep-forever dbus-1)
target_link_libraries(test-sleep-forever ${DBUS_1})
# (rh) don't know for what this test is good
#ADD_TEST(test-sleep-forever ${EXECUTABLE_OUTPUT_PATH}/test-sleep-forever${EXT})
#add_executable(decode-gcov ${decode_gcov_SOURCES})
#target_link_libraries(decode-gcov dbus-1)
#target_link_libraries(decode-gcov ${DBUS_1})
#EXTRA_DIST=
#
### keep these in creation order, i.e. uppermost dirs first
set (TESTDIRS
test/data
test/data/valid-messages
test/data/invalid-messages
test/data/incomplete-messages
test/data/auth
test/data/sha-1
test/data/valid-config-files
test/data/valid-config-files/basic.d
test/data/valid-config-files/system.d
test/data/valid-service-files
test/data/invalid-config-files
test/data/equiv-config-files
test/data/equiv-config-files/basic
test/data/equiv-config-files/basic/basic.d
test/data/equiv-config-files/entities
test/data/auth
test/data/equiv-config-files
test/data/equiv-config-files/basic
test/data/equiv-config-files/basic/basic.d
test/data/equiv-config-files/entities
test/data/equiv-config-files/entities/basic.d
test/data/incomplete-messages
test/data/invalid-config-files
test/data/invalid-config-files-system
test/data/invalid-messages
test/data/invalid-service-files-system
test/data/sha-1
test/data/valid-config-files
test/data/valid-config-files/basic.d
test/data/valid-config-files/system.d
test/data/valid-config-files-system
test/data/valid-introspection-files
test/data/valid-messages
test/data/valid-service-files
test/data/valid-service-files-system
)
set (CONFIG_VERBOSE 0)
......
......@@ -2,23 +2,21 @@ if (DBUS_BUILD_TESTS)
set (NAMEtest-DIR ../../../test/name-test)
include_directories( ${CMAKE_SOURCE_DIR}/.. )
include_directories( ${CMAKE_INCLUDE_PATH} )
add_definitions(-DDBUS_COMPILATION)
# there is also a test-names executable, don't know if this is the same
add_executable(test-names1 ${NAMEtest-DIR}/test-names.c)
target_link_libraries(test-names1 dbus-1)
target_link_libraries(test-names1 ${DBUS_1})
#install_targets(/bin test-names1)
ADD_TEST(test-names ${EXECUTABLE_OUTPUT_PATH}/test-names1)
add_executable(test-pending-call-dispatch ${NAMEtest-DIR}/test-pending-call-dispatch.c)
target_link_libraries(test-pending-call-dispatch dbus-1)
target_link_libraries(test-pending-call-dispatch ${DBUS_1})
#install_targets(/bin test-pending-call-dispatch)
ADD_TEST(test-pending-call-dispatch ${EXECUTABLE_OUTPUT_PATH}/test-pending_call-dispatch)
add_executable(test-thread-init ${NAMEtest-DIR}/test-threads-init.c)
target_link_libraries(test-thread-init dbus-1)
target_link_libraries(test-thread-init ${DBUS_1})
#install_targets(/bin test-thread-init)
ADD_TEST(test-names ${EXECUTABLE_OUTPUT_PATH}/test-thread-init)
......
include_directories(${CMAKE_SOURCE_DIR}/..)
#nodist_libdbus_glib_HEADERS = dbus-glib-bindings.h
#libdbus_glibdir = $(includedir)/dbus-1.0/dbus
#dbus-glib-bindings.h: dbus-bus-introspect.xml $(top_builddir)/glib/dbus-binding-tool$(EXEEXT)
# $(top_builddir)/glib/dbus-binding-tool --mode=glib-client --output=dbus-glib-bindings.h dbus-bus-introspect.xml
#BUILT_SOURCES = dbus-glib-bindings.h dbus-bus-introspect.xml
#else
#GLIB_TOOLS=
#endif
#if HAVE_GTK
#GTK_TOOLS=dbus-viewer
#else
#GTK_TOOLS=
#endif
#if HAVE_GLIB
#dbus-bus-introspect.xml: $(top_builddir)/bus/dbus-daemon$(EXEEXT) dbus-launch$(EXEEXT) dbus-send$(EXEEXT) $(top_builddir)/bus/dbus-daemon$(EXEEXT) Makefile
# DBUS_TOP_BUILDDIR=$(top_builddir) $(srcdir)/run-with-tmp-session-bus.sh ./dbus-send --print-reply=literal --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.Introspectable.Introspect > dbus-bus-introspect.xml.tmp && mv dbus-bus-introspect.xml.tmp dbus-bus-introspect.xml
#endif
#bin_PROGRAMS=dbus-send $(GLIB_TOOLS) dbus-launch dbus-cleanup-sockets $(GTK_TOOLS)
project(tools)
set (dbus_send_SOURCES
../../tools/dbus-print-message.c
......@@ -60,29 +34,16 @@ set (dbus_viewer_SOURCES
../../tools/dbus-viewer.c
)
add_executable(dbus-send${CMAKE_EXE_POSTFIX} ${dbus_send_SOURCES})
target_link_libraries(dbus-send${CMAKE_EXE_POSTFIX} dbus-1)
install_targets(/bin dbus-send${CMAKE_EXE_POSTFIX} )
# glib required
#add_executable(dbus_launch${CMAKE_EXE_POSTFIX} ${dbus_launch_SOURCES})
add_executable(dbus-launch${CMAKE_EXE_POSTFIX} ${dbus_launch_SOURCES})
target_link_libraries(dbus-launch${CMAKE_EXE_POSTFIX} )
install_targets(/bin dbus-launch${CMAKE_EXE_POSTFIX} )
add_executable(dbus-send ${dbus_send_SOURCES})
target_link_libraries(dbus-send ${DBUS_1})
install_targets(/bin dbus-send )
add_executable(dbus-monitor${CMAKE_EXE_POSTFIX} ${dbus_monitor_SOURCES})
target_link_libraries(dbus-monitor${CMAKE_EXE_POSTFIX} dbus-1)
install_targets(/bin dbus-monitor${CMAKE_EXE_POSTFIX} )
add_executable(dbus-launch ${dbus_launch_SOURCES})
target_link_libraries(dbus-launch )
install_targets(/bin dbus-launch )
#dbus_send_LDADD= $(top_builddir)/dbus/libdbus-1.la
#dbus_monitor_LDADD= $(top_builddir)/glib/libdbus-glib-1.la
#dbus_launch_LDADD= $(DBUS_X_LIBS)
#dbus_viewer_LDADD= $(top_builddir)/glib/libdbus-gtool.la $(DBUS_GTK_THREADS_LIBS) $(DBUS_GLIB_TOOL_LIBS)
add_executable(dbus-monitor ${dbus_monitor_SOURCES})
target_link_libraries(dbus-monitor ${DBUS_1})
install_targets(/bin dbus-monitor )
#man_MANS = dbus-send.1 dbus-monitor.1 dbus-launch.1 dbus-cleanup-sockets.1
#EXTRA_DIST = $(man_MANS) run-with-tmp-session-bus.sh
#CLEANFILES =
# run-with-tmp-session-bus.conf
# dbus-bus-introspect.xml
# dbus-glib-bindings.h
set_target_properties(dbus-send dbus-launch dbus-monitor PROPERTIES DEBUG_POSTFIX d)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment