Index: selftests/qdbusinterface/CMakeLists.txt
===================================================================
--- selftests/qdbusinterface/CMakeLists.txt	(revision 547069)
+++ selftests/qdbusinterface/CMakeLists.txt	(working copy)
@@ -10,3 +10,5 @@
 MY_AUTOMOC(tst_qdbusinterface.cpp)
 TARGET_LINK_LIBRARIES(tst_qdbusinterface dbus-qt4-1
 	             ${QTTEST} )
+
+ADD_TEST(tst_qdbusinterface ${EXECUTABLE_OUTPUT_PATH}/tst_qdbusinterface)
Index: selftests/qdbusmarshall/ping/CMakeLists.txt
===================================================================
--- selftests/qdbusmarshall/ping/CMakeLists.txt	(revision 547069)
+++ selftests/qdbusmarshall/ping/CMakeLists.txt	(working copy)
@@ -1,4 +1,4 @@
-PROJECT(ping)
+PROJECT(qping)
 
 INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}
 	             ${CMAKE_CURRENT_BINARY_DIR}
@@ -6,7 +6,9 @@
 		     ${QT_INCLUDE_DIR}
 		     ${QT_QTCORE_INCLUDE_DIR}
 		     ${QT_QTTEST_INCLUDE_DIR} )
-ADD_EXECUTABLE(ping ping.cpp)
+ADD_EXECUTABLE(qping ping.cpp)
 MY_AUTOMOC(ping.cpp)
-TARGET_LINK_LIBRARIES(ping dbus-qt4-1
+TARGET_LINK_LIBRARIES(qping dbus-qt4-1
 	             ${QT_QTTEST_LIBRARY_DEBUG} )
+
+ADD_TEST(tst_qdbusmarshall ${EXECUTABLE_OUTPUT_PATH}/qping)
\ No newline at end of file
Index: selftests/qdbusmarshall/ping/ping.cpp
===================================================================
--- selftests/qdbusmarshall/ping/ping.cpp	(revision 547069)
+++ selftests/qdbusmarshall/ping/ping.cpp	(working copy)
@@ -39,7 +39,7 @@
 
 void Ping::initTestCase()
 {
-    proc.start("../qpong/qpong");
+    proc.start("bin/qpong");
     QVERIFY(proc.waitForStarted());
     QTest::qWait(2000);
 }
Index: selftests/hal/CMakeLists.txt
===================================================================
--- selftests/hal/CMakeLists.txt	(revision 547069)
+++ selftests/hal/CMakeLists.txt	(working copy)
@@ -11,3 +11,4 @@
 TARGET_LINK_LIBRARIES(tst_hal dbus-qt4-1
 	             ${QTTEST} )
 
+ADD_TEST(tst_hal ${EXECUTABLE_OUTPUT_PATH}/tst_hal)
\ No newline at end of file
Index: selftests/qdbusxmlparser/CMakeLists.txt
===================================================================
--- selftests/qdbusxmlparser/CMakeLists.txt	(revision 547069)
+++ selftests/qdbusxmlparser/CMakeLists.txt	(working copy)
@@ -10,3 +10,5 @@
 MY_AUTOMOC(tst_qdbusxmlparser.cpp)
 TARGET_LINK_LIBRARIES(tst_qdbusxmlparser dbus-qt4-1
 	             ${QTTEST} )
+
+ADD_TEST(tst_qdbusxmlparser ${EXECUTABLE_OUTPUT_PATH}/tst_qdbusxmlparser)
\ No newline at end of file
Index: selftests/qdbusabstractadaptor/CMakeLists.txt
===================================================================
--- selftests/qdbusabstractadaptor/CMakeLists.txt	(revision 547069)
+++ selftests/qdbusabstractadaptor/CMakeLists.txt	(working copy)
@@ -10,3 +10,5 @@
 MY_AUTOMOC(tst_qdbusabstractadaptor.cpp)
 TARGET_LINK_LIBRARIES(tst_qdbusabstractadaptor dbus-qt4-1
 	             ${QTTEST} )
+
+ADD_TEST(tst_qdbusabstractadaptor ${EXECUTABLE_OUTPUT_PATH}/tst_qdbusabstractadaptor)
Index: selftests/qdbusconnection/CMakeLists.txt
===================================================================
--- selftests/qdbusconnection/CMakeLists.txt	(revision 547069)
+++ selftests/qdbusconnection/CMakeLists.txt	(working copy)
@@ -11,3 +11,4 @@
 TARGET_LINK_LIBRARIES(tst_qdbusconnection dbus-qt4-1
 	             ${QTTEST} )
 
+ADD_TEST(tst_qdbusconnection ${EXECUTABLE_OUTPUT_PATH}/tst_qdbusconnection)
\ No newline at end of file
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 547069)
+++ CMakeLists.txt	(working copy)
@@ -2,7 +2,21 @@
 SET(VERSION 0.8)
 
 OPTION(QDBUS_NODEBUG "Disable debug output")
+OPTION(DEBUG "enable debug mode")
 
+if (WIN32)
+	set (LIBRARY_OUTPUT_PATH  ${CMAKE_BINARY_DIR}/bin)
+else (WIN32)
+	set (LIBRARY_OUTPUT_PATH  ${CMAKE_BINARY_DIR}/lib)
+endif (WIN32)
+
+set (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
+
+if (DEBUG)
+	add_definitions(-g)
+	MESSAGE(STATUS "debug mode enabled")
+endif(DEBUG)
+
 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 set(CMAKE_COLOR_MAKEFILE ON)
 
@@ -37,11 +51,14 @@
   SET(qt_depends "QtCore_debug >= ${QT_MIN_VERSION} QtXml_debug >= ${QT_MIN_VERSION}")
 ENDIF (QDBUS_NODEBUG)
 
+ 
 INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}
 	${CMAKE_CURRENT_BINARY_DIR} ${QT_INCLUDE_DIR}
 	${QT_QTCORE_INCLUDE_DIR} ${QT_QTXML_INCLUDE_DIR} 
 	${KDEWIN32_INCLUDES} )
 
+ENABLE_TESTING()
+
 ADD_SUBDIRECTORY( src )
 ADD_SUBDIRECTORY( tools )
 ADD_SUBDIRECTORY( examples )
@@ -52,7 +69,7 @@
 set(prefix              ${CMAKE_INSTALL_PREFIX})
 set(exec_prefix         ${CMAKE_INSTALL_PREFIX}/bin)
 set(libdir              ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR})
-set(includedir          ${CMAKE_INSTALL_PREFIX}/include/dbus-1.0)
+set(includedir          ${CMAKE_INSTALL_PREFIX}/include)
 
 CONFIGURE_FILE(dbus-qt4-1.pc.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-qt4-1.pc @ONLY)
 INSTALL_FILES(/lib/pkgconfig FILES dbus-qt4-1.pc)
Index: examples/CMakeLists.txt
===================================================================
--- examples/CMakeLists.txt	(revision 547069)
+++ examples/CMakeLists.txt	(working copy)
@@ -66,7 +66,7 @@
 
 ########### next target ###############
 
-if(NOT WIN32)
+#if(NOT WIN32)
 
 SET(chat_SRCS
 	chat.cpp
@@ -82,7 +82,7 @@
 		   ARGS -o chatsetnickname.h ${CMAKE_CURRENT_SOURCE_DIR}/chatsetnickname.ui
 		   DEPENDS chatsetnickname.ui)
 ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/chatinterface.cpp ${CMAKE_CURRENT_BINARY_DIR}/chatinterface.h
-		   COMMAND ${CMAKE_CURRENT_BINARY_DIR}/../tools/dbusidl2cpp
+		   COMMAND ${EXECUTABLE_OUTPUT_PATH}/dbusidl2cpp
 		   ARGS -m -p chatinterface ${CMAKE_CURRENT_SOURCE_DIR}/com.trolltech.ChatInterface.xml
 		   DEPENDS com.trolltech.ChatInterface.xml dbusidl2cpp)
 ADD_CUSTOM_COMMAND(OUTPUT chatinterface.moc
@@ -95,6 +95,6 @@
 ADD_EXECUTABLE(chat ${chat_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/chatinterface.cpp)
 TARGET_LINK_LIBRARIES(chat dbus-qt4-1 ${QTGUI})
 
-endif(NOT WIN32)
+#endif(NOT WIN32)
 
 ########### install files ###############
