Index: CMakeLists.txt.qtruby
===================================================================
--- CMakeLists.txt.qtruby (revision 1085214)
+++ CMakeLists.txt.qtruby (working copy)
@@ -60,7 +60,6 @@
 
 include (MacroOptionalFindPackage)
 
-FIND_PACKAGE(Perl REQUIRED)
 FIND_PACKAGE (Qt4 REQUIRED)
 
 add_definitions (${QT_DEFINITIONS}  -DHAVE_CONFIG_H=1)
@@ -69,6 +68,7 @@
 FIND_PACKAGE (RUBY REQUIRED)
 FIND_PACKAGE (OpenGL REQUIRED)
 
+add_subdirectory(generator)
 add_subdirectory(smoke)
 
 if(RUBY_EXECUTABLE)
Index: generator/parser/CMakeLists.txt
===================================================================
--- generator/parser/CMakeLists.txt (revision 1085214)
+++ generator/parser/CMakeLists.txt (working copy)
@@ -38,4 +38,4 @@
 add_library(cppparser SHARED ${cppparser_LIB_SRCS})
 target_link_libraries(cppparser ${QT_QTCORE_LIBRARY})
 
-install(TARGETS cppparser LIBRARY DESTINATION ${LIB_INSTALL_DIR})
+install(TARGETS cppparser DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} )
\ No newline at end of file
Index: ruby/qtruby/src/CMakeLists.txt
===================================================================
--- ruby/qtruby/src/CMakeLists.txt (revision 1085214)
+++ ruby/qtruby/src/CMakeLists.txt (working copy)
@@ -30,24 +30,54 @@
 add_library(qtruby4shared SHARED ${qtrubyshared_LIB_SRCS})
 add_library(qtruby4 MODULE ${qtruby_LIB_SRCS})
 
-target_link_libraries(  qtruby4shared
-                            ${QT_QTCORE_LIBRARY}
-                            ${QT_QTGUI_LIBRARY}
-                            ${RUBY_LIBRARY}
-                            ${QT_QTNETWORK_LIBRARY}
-                            smokeqtcore
-                            smokeqtgui
-                            smokeqtxml
-                            smokeqtopengl
-                            smokeqtsql
-                            smokeqtnetwork
-                            smokeqtdbus
-                            smokeqtsvg )
+if(QT_QTDBUS_FOUND)
+  target_link_libraries(  qtruby4shared
+                              ${QT_QTCORE_LIBRARY}
+                              ${QT_QTGUI_LIBRARY}
+                              ${RUBY_LIBRARY}
+                              ${QT_QTNETWORK_LIBRARY}
+                              smokeqtcore
+                              smokeqtgui
+                              smokeqtxml
+                              smokeqtopengl
+                              smokeqtsql
+                              smokeqtnetwork
+                              smokeqtdbus
+                              smokeqtsvg )
+                              
+  target_link_libraries(  qtruby4
+                              ${QT_QTCORE_LIBRARY}
+                              ${QT_QTGUI_LIBRARY}
+                              ${QT_QTDBUS_LIBRARY}
+                              ${RUBY_LIBRARY}
+                              ${QT_QTNETWORK_LIBRARY}
+                              smokeqtcore
+                              smokeqtgui
+                              smokeqtxml
+                              smokeqtopengl
+                              smokeqtsql
+                              smokeqtnetwork
+                              smokeqtdbus
+                              smokeqtsvg
+                              qtruby4shared )
 
+else(QT_QTDBUS_FOUND)
+  target_link_libraries(  qtruby4shared
+                              ${QT_QTCORE_LIBRARY}
+                              ${QT_QTGUI_LIBRARY}
+                              ${RUBY_LIBRARY}
+                              ${QT_QTNETWORK_LIBRARY}
+                              smokeqtcore
+                              smokeqtgui
+                              smokeqtxml
+                              smokeqtopengl
+                              smokeqtsql
+                              smokeqtnetwork
+                              smokeqtsvg )
+                              
 target_link_libraries(  qtruby4
                             ${QT_QTCORE_LIBRARY}
-                            ${QT_QTGUI_LIBRARY}
-                            ${QT_QTDBUS_LIBRARY}
+                            ${QT_QTGUI_LIBRARY}
                             ${RUBY_LIBRARY}
                             ${QT_QTNETWORK_LIBRARY}
                             smokeqtcore
@@ -55,10 +85,10 @@
                             smokeqtxml
                             smokeqtopengl
                             smokeqtsql
-                            smokeqtnetwork
-                            smokeqtdbus
+                            smokeqtnetwork
                             smokeqtsvg
-                            qtruby4shared )
+                            qtruby4shared )  
+endif(QT_QTDBUS_FOUND)
 
 # target_link_libraries(qtrubyinternal ${QT_QTCORE_LIBRARY} ${RUBY_LIBRARY} ${QT_QTNETWORK_LIBRARY})
 
Index: ruby/qtruby/src/marshall_primitives.h
===================================================================
--- ruby/qtruby/src/marshall_primitives.h (revision 1085214)
+++ ruby/qtruby/src/marshall_primitives.h (working copy)
@@ -250,7 +250,7 @@
 
 #if defined(Q_OS_WIN32)
 template <>
-static WId ruby_to_primitive<WId>(VALUE v)
+WId ruby_to_primitive<WId>(VALUE v)
 {
  if(v == Qnil)
  return 0;
@@ -262,7 +262,7 @@
 }
 
 template <>
-static VALUE primitive_to_ruby<WId>(WId sv)
+VALUE primitive_to_ruby<WId>(WId sv)
 {
 #ifdef Q_WS_MAC32
  return INT2NUM((unsigned long) sv);
@@ -272,7 +272,7 @@
 }
 
 template <>
-static Q_PID ruby_to_primitive<Q_PID>(VALUE v)
+Q_PID ruby_to_primitive<Q_PID>(VALUE v)
 {
  if(v == Qnil)
  return 0;
@@ -281,7 +281,7 @@
 }
 
 template <>
-static VALUE primitive_to_ruby<Q_PID>(Q_PID sv)
+VALUE primitive_to_ruby<Q_PID>(Q_PID sv)
 {
  return ULONG2NUM((unsigned long) sv);
 }
Index: ruby/qtruby/src/qtruby.cpp
===================================================================
--- ruby/qtruby/src/qtruby.cpp (revision 1085214)
+++ ruby/qtruby/src/qtruby.cpp (working copy)
@@ -52,9 +52,16 @@
 #include <smoke/qtopengl_smoke.h>
 #include <smoke/qtnetwork_smoke.h>
 #include <smoke/qtsvg_smoke.h>
+
+#ifdef QT_QTDBUS
 #include <smoke/qtdbus_smoke.h>
+#endif
 
 #include <ruby.h>
+#undef read
+#undef write
+#undef connect
+#undef accept
 
 #include "marshall_types.h"
 #include "qtruby.h"
@@ -2124,11 +2131,13 @@
             rb_ary_push(class_list, rb_str_new2(qtsvg_Smoke->classes[i].className));
     }
 
+#ifdef QT_QTDBUS
     for (int i = 1; i <= qtsvg_Smoke->numClasses; i++) {
         if (qtdbus_Smoke->classes[i].className && !qtdbus_Smoke->classes[i].external)
             rb_ary_push(class_list, rb_str_new2(qtdbus_Smoke->classes[i].className));
     }
-
+#endif
+    
     return class_list;
 }
 
@@ -2338,8 +2347,9 @@
     init_qtopengl_Smoke();
     init_qtnetwork_Smoke();
     init_qtsvg_Smoke();
+#ifdef QT_QTDBUS  
     init_qtdbus_Smoke();
-
+#endif
     install_handlers(Qt_handlers);
 
     INIT_BINDING(qtcore)
@@ -2349,7 +2359,9 @@
     INIT_BINDING(qtopengl)
     INIT_BINDING(qtnetwork)
     INIT_BINDING(qtsvg)
+#ifdef QT_QTDBUS
     INIT_BINDING(qtdbus)
+#endif
 
  if (qt_module == Qnil) {
  qt_module = rb_define_module("Qt");
Index: ruby/qtruby/tools/rbuic/ui4.h
===================================================================
--- ruby/qtruby/tools/rbuic/ui4.h (revision 1085214)
+++ ruby/qtruby/tools/rbuic/ui4.h (working copy)
@@ -70,8 +70,13 @@
 class QDomDocument;
 class QDomElement;
 
-#define QDESIGNER_UILIB_EXTERN Q_DECL_EXPORT
-#define QDESIGNER_UILIB_IMPORT Q_DECL_IMPORT
+#ifdef Q_OS_WIN
+  #define QDESIGNER_UILIB_EXTERN
+  #define QDESIGNER_UILIB_IMPORT
+#else
+  #define QDESIGNER_UILIB_EXTERN Q_DECL_EXPORT
+  #define QDESIGNER_UILIB_IMPORT Q_DECL_IMPORT
+#endif
 
 #if defined(QT_DESIGNER_STATIC) || defined(QT_UIC) || defined(QT_UIC3)
 #  define QDESIGNER_UILIB_EXPORT
Index: ruby/qtscript/qtscript.cpp
===================================================================
--- ruby/qtscript/qtscript.cpp (revision 1085214)
+++ ruby/qtscript/qtscript.cpp (working copy)
@@ -16,6 +16,10 @@
  ***************************************************************************/
 
 #include <ruby.h>
+#undef read
+#undef write
+#undef connect
+#undef accept
 
 #include <QHash>
 #include <QList>
Index: ruby/qtscript/qtscripthandlers.cpp
===================================================================
--- ruby/qtscript/qtscripthandlers.cpp (revision 1085214)
+++ ruby/qtscript/qtscripthandlers.cpp (working copy)
@@ -16,6 +16,10 @@
  ***************************************************************************/
 
 #include <ruby.h>
+#undef read
+#undef write
+#undef connect
+#undef accept
 
 #include <qtruby.h>
 #include <smokeruby.h>
Index: ruby/qttest/qttest.cpp
===================================================================
--- ruby/qttest/qttest.cpp (revision 1085214)
+++ ruby/qttest/qttest.cpp (working copy)
@@ -16,6 +16,10 @@
  ***************************************************************************/
 
 #include <ruby.h>
+#undef read
+#undef write
+#undef connect
+#undef accept
 
 #include <QHash>
 #include <QList>
Index: ruby/qttest/qttesthandlers.cpp
===================================================================
--- ruby/qttest/qttesthandlers.cpp (revision 1085214)
+++ ruby/qttest/qttesthandlers.cpp (working copy)
@@ -16,6 +16,10 @@
  ***************************************************************************/
 
 #include <ruby.h>
+#undef read
+#undef write
+#undef connect
+#undef accept
 
 #include <qtruby.h>
 #include <smokeruby.h>
Index: ruby/qtuitools/qtuitools.cpp
===================================================================
--- ruby/qtuitools/qtuitools.cpp (revision 1085214)
+++ ruby/qtuitools/qtuitools.cpp (working copy)
@@ -16,6 +16,10 @@
  ***************************************************************************/
 
 #include <ruby.h>
+#undef read
+#undef write
+#undef connect
+#undef accept
 
 #include <QHash>
 #include <QList>
Index: ruby/qtuitools/qtuitoolshandlers.cpp
===================================================================
--- ruby/qtuitools/qtuitoolshandlers.cpp (revision 1085214)
+++ ruby/qtuitools/qtuitoolshandlers.cpp (working copy)
@@ -16,6 +16,10 @@
  ***************************************************************************/
 
 #include <ruby.h>
+#undef read
+#undef write
+#undef connect
+#undef accept
 
 #include <qtruby.h>
 #include <smokeruby.h>
Index: ruby/qtwebkit/qtwebkit.cpp
===================================================================
--- ruby/qtwebkit/qtwebkit.cpp (revision 1085214)
+++ ruby/qtwebkit/qtwebkit.cpp (working copy)
@@ -1,4 +1,8 @@
 #include <ruby.h>
+#undef read
+#undef write
+#undef connect
+#undef accept
 
 #include <QHash>
 #include <QList>
Index: ruby/qtwebkit/qtwebkithandlers.cpp
===================================================================
--- ruby/qtwebkit/qtwebkithandlers.cpp (revision 1085214)
+++ ruby/qtwebkit/qtwebkithandlers.cpp (working copy)
@@ -16,6 +16,10 @@
  ***************************************************************************/
 
 #include <ruby.h>
+#undef read
+#undef write
+#undef connect
+#undef accept
 
 #include <qtruby.h>
 #include <smokeruby.h>
Index: smoke/qt/CMakeLists.txt
===================================================================
--- smoke/qt/CMakeLists.txt (revision 1085214)
+++ smoke/qt/CMakeLists.txt (working copy)
@@ -77,14 +77,24 @@
 # kde4_add_library(smokeqt SHARED ${smokeqt_LIB_SRCS})
 add_library(smokeqt SHARED ${smokeqt_LIB_SRCS})
 
-target_link_libraries(smokeqt ${QT_QTCORE_LIBRARY}
-                              ${QT_QTGUI_LIBRARY}
-                              ${QT_QTNETWORK_LIBRARY}
-                              ${QT_QTOPENGL_LIBRARY}
-                              ${QT_QTDBUS_LIBRARY}
-                              ${QT_QTSQL_LIBRARY}
-                              ${QT_QTSVG_LIBRARY}
-                              ${QT_QTXML_LIBRARY} )
+if(QT_QTDBUS_FOUND)
+  target_link_libraries(smokeqt ${QT_QTCORE_LIBRARY}
+                                ${QT_QTGUI_LIBRARY}
+                                ${QT_QTNETWORK_LIBRARY}
+                                ${QT_QTOPENGL_LIBRARY}
+                                ${QT_QTDBUS_LIBRARY}
+                                ${QT_QTSQL_LIBRARY}
+                                ${QT_QTSVG_LIBRARY}
+                                ${QT_QTXML_LIBRARY} )                                
+else(QT_QTDBUS_FOUND)
+  target_link_libraries(smokeqt ${QT_QTCORE_LIBRARY}
+                                ${QT_QTGUI_LIBRARY}
+                                ${QT_QTNETWORK_LIBRARY}
+                                ${QT_QTOPENGL_LIBRARY}
+                                ${QT_QTSQL_LIBRARY}
+                                ${QT_QTSVG_LIBRARY}
+                                ${QT_QTXML_LIBRARY} )
+endif(QT_QTDBUS_FOUND)
 
 set_target_properties(smokeqt PROPERTIES VERSION 3.0.0 SOVERSION 3 )
 
Index: smoke/qt/qt_includes.h
===================================================================
--- smoke/qt/qt_includes.h (revision 1085214)
+++ smoke/qt/qt_includes.h (working copy)
@@ -15,5 +15,7 @@
 // some MS headers do
 // #define interface struct
 // un-define it here so QtDBus will build correctly
+#ifdef QT_QTDBUS
 #undef interface
 #include <QtDBus/QtDBus>
+#endif
Index: smoke/qt/QtGuess.txt
===================================================================
--- smoke/qt/QtGuess.txt (revision 1085214)
+++ smoke/qt/QtGuess.txt (working copy)
@@ -106,10 +106,16 @@
   endif(${${test_entry}} GREATER ${qt_test_threshold})
 endforeach(test_entry ${define_tests})
 
-file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qglobal.h" qglobal_h NEWLINE_CONSUME)
-file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qconfig.h" qconfig_h NEWLINE_CONSUME)
-file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qfeatures.h" qfeatures_h NEWLINE_CONSUME)
-set(qtheaders "${qglobal_h}\n${qconfig_h}\n${qfeatures}")
+if(WIN32)
+  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/../../src/corelib/global/qglobal.h" qglobal_h NEWLINE_CONSUME)
+  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/../../src/corelib/global/qconfig.h" qconfig_h NEWLINE_CONSUME)
+  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/../../src/corelib/global/qfeatures.h" qfeatures_h NEWLINE_CONSUME)
+else(WIN32)
+  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qglobal.h" qglobal_h NEWLINE_CONSUME)
+  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qconfig.h" qconfig_h NEWLINE_CONSUME)
+  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qfeatures.h" qfeatures_h NEWLINE_CONSUME)
+endif(WIN32)
+set(qtheaders "${qglobal_h}\n${qconfig_h}\n${qfeatures_h}")
 string(REGEX REPLACE "\n" ";" qtheaders "${qtheaders}")
 
 file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/qtdefines.cpp ${CMAKE_CURRENT_BINARY_DIR}/qtdefines)
@@ -139,8 +145,13 @@
 
 include (HandleImportedTargetsInCMakeRequiredLibraries)
 set(CMAKE_REQUIRED_INCLUDES ${CMAKE_SYSTEM_INCLUDE_PATH} ${QT_INCLUDE_DIR})
-set(CMAKE_REQUIRED_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTSVG_LIBRARY})
-HANDLE_IMPORTED_TARGETS_IN_CMAKE_REQUIRED_LIBRARIES(_CMAKE_REQUIRED_LIBRARIES)
+if(QT_QTDBUS_FOUND)
+  set(CMAKE_REQUIRED_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTSVG_LIBRARY})
+  HANDLE_IMPORTED_TARGETS_IN_CMAKE_REQUIRED_LIBRARIES(_CMAKE_REQUIRED_LIBRARIES)
+else(QT_QTDBUS_FOUND)
+  set(CMAKE_REQUIRED_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTSVG_LIBRARY})
+  HANDLE_IMPORTED_TARGETS_IN_CMAKE_REQUIRED_LIBRARIES(_CMAKE_REQUIRED_LIBRARIES)  
+endif(QT_QTDBUS_FOUND)
 
 foreach(test_target ${test_targets})
   file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/test-${test_target})
Index: smoke/qtcore/QtGuess.txt
===================================================================
--- smoke/qtcore/QtGuess.txt (revision 1085214)
+++ smoke/qtcore/QtGuess.txt (working copy)
@@ -106,10 +106,16 @@
   endif(${${test_entry}} GREATER ${qt_test_threshold})
 endforeach(test_entry ${define_tests})
 
-file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qglobal.h" qglobal_h NEWLINE_CONSUME)
-file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qconfig.h" qconfig_h NEWLINE_CONSUME)
-file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qfeatures.h" qfeatures_h NEWLINE_CONSUME)
-set(qtheaders "${qglobal_h}\n${qconfig_h}\n${qfeatures}")
+if(WIN32)
+  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/../../src/corelib/global/qglobal.h" qglobal_h NEWLINE_CONSUME)
+  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/../../src/corelib/global/qconfig.h" qconfig_h NEWLINE_CONSUME)
+  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/../../src/corelib/global/qfeatures.h" qfeatures_h NEWLINE_CONSUME)
+else(WIN32)
+  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qglobal.h" qglobal_h NEWLINE_CONSUME)
+  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qconfig.h" qconfig_h NEWLINE_CONSUME)
+  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qfeatures.h" qfeatures_h NEWLINE_CONSUME)
+endif(WIN32)
+set(qtheaders "${qglobal_h}\n${qconfig_h}\n${qfeatures_h}")
 string(REGEX REPLACE "\n" ";" qtheaders "${qtheaders}")
 
 file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/qtdefines.cpp ${CMAKE_CURRENT_BINARY_DIR}/qtdefines)
@@ -138,11 +144,19 @@
 message(STATUS "Threshold is set to ${qt_test_threshold}")
 foreach(test_target ${test_targets})
   file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/test-${test_target})
-  try_compile(test_result "${CMAKE_CURRENT_BINARY_DIR}/test-${test_target}"
-    ${CMAKE_CURRENT_SOURCE_DIR}/tests/test.cpp
-    COMPILE_DEFINITIONS -DTEST_${test_target}
-    CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_SYSTEM_INCLUDE_PATH};${QT_INCLUDE_DIR}"
-    "-DLINK_LIBRARIES:STRING=${QT_QTCORE_LIBRARY};${QT_QTDBUS_LIBRARY};${QT_QTGUI_LIBRARY};${QT_QTNETWORK_LIBRARY};${QT_QTOPENGL_LIBRARY};${QT_QTXML_LIBRARY};${QT_QTSVG_LIBRARY}")
+  if(QT_QTDBUS_FOUND)
+    try_compile(test_result "${CMAKE_CURRENT_BINARY_DIR}/test-${test_target}"
+      ${CMAKE_CURRENT_SOURCE_DIR}/tests/test.cpp
+      COMPILE_DEFINITIONS -DTEST_${test_target}
+      CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_SYSTEM_INCLUDE_PATH};${QT_INCLUDE_DIR}"
+      "-DLINK_LIBRARIES:STRING=${QT_QTCORE_LIBRARY};${QT_QTDBUS_LIBRARY};${QT_QTGUI_LIBRARY};${QT_QTNETWORK_LIBRARY};${QT_QTOPENGL_LIBRARY};${QT_QTXML_LIBRARY};${QT_QTSVG_LIBRARY}")    
+  else(QT_QTDBUS_FOUND)
+    try_compile(test_result "${CMAKE_CURRENT_BINARY_DIR}/test-${test_target}"
+      ${CMAKE_CURRENT_SOURCE_DIR}/tests/test.cpp
+      COMPILE_DEFINITIONS -DTEST_${test_target}
+      CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_SYSTEM_INCLUDE_PATH};${QT_INCLUDE_DIR}"
+      "-DLINK_LIBRARIES:STRING=${QT_QTCORE_LIBRARY};${QT_QTGUI_LIBRARY};${QT_QTNETWORK_LIBRARY};${QT_QTOPENGL_LIBRARY};${QT_QTXML_LIBRARY};${QT_QTSVG_LIBRARY}")    
+  endif(QT_QTDBUS_FOUND)
   if(test_result)
     message(STATUS "${test_target} *Undefined*")
   else(test_result) 

