diff --git CMakeLists.txt CMakeLists.txt
index e23ca50..c909d11 100644
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -114,8 +114,12 @@ set(SIP_CONCAT_PARTS 8)
 if (WIN32)
     set(SIP_TAGS ALL WS_WIN ${PYQT4_VERSION_TAG})
 else ()
-    set(SIP_TAGS ALL WS_X11 ${PYQT4_VERSION_TAG})
-endif ()
+    if (APPLE)
+        set(SIP_TAGS ALL WS_MACX ${PYQT4_VERSION_TAG})
+    else ()
+        set(SIP_TAGS ALL WS_X11 ${PYQT4_VERSION_TAG})
+    endif (APPLE)
+endif (WIN32)
 set(SIP_DISABLE_FEATURES VendorID PyQt_NoPrintRangeBug ${SIP_ARM_HACK})
 
 set(SIP_FILES_INSTALL_DIR ${SHARE_INSTALL_PREFIX}/sip)
diff --git CMakeLists.txt.orig CMakeLists.txt.orig
deleted file mode 100644
index 2de35b4..0000000
--- CMakeLists.txt.orig
+++ /dev/null
@@ -1,283 +0,0 @@
-project(pykde4)
-
-cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR)
-
-# search packages used by KDE
-find_package(KDE4 4.9.4 REQUIRED)
-
-# Match what's used in the main macros
-cmake_policy(SET CMP0002 OLD)
-find_package(PythonLibrary)
-
-include(KDE4Defaults)
-include(MacroLibrary)
-include(PythonMacros)
-include(FeatureSummary)
-find_package(PkgConfig REQUIRED)
-# this doesn't work ...
-pkg_check_modules(PYTHON xpython${_CURRENT_VERSION})
-
-option(PYKDEUIC4_ALTINSTALL "Enable parallel-installation of the PyKDE4 tools" FALSE)
-
-set(CMAKE_MODULE_PATH ${pykde4_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
-
-find_package(PythonLibrary)
-
-set_package_properties(KDE4 PROPERTIES DESCRIPTION "The KDE libraries"
-                       URL "http://www.kde.org" TYPE REQUIRED
-                       PURPOSE "Required to build PyKDE4")
-set_package_properties(PythonLibrary PROPERTIES DESCRIPTION
-                       "The Python Library" URL "http://www.python.org"
-                       TYPE REQUIRED PURPOSE "Required to build PyKDE4")
-set_package_properties(PythonInterp PROPERTIES
-                       DESCRIPTION "The Python interpreter"
-                       URL "http://www.python.org" TYPE REQUIRED
-                       PURPOSE "Required to build PyKDE4")
-
-include_directories(${KDE4_INCLUDES})
-
-add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -DQT3_SUPPORT)
-
-find_package(SIP)
-set_package_properties(SIP PROPERTIES DESCRIPTION "The SIP binding generator"
-                       URL "http://riverbankcomputing.com" TYPE REQUIRED
-                       PURPOSE "Required to build PyKDE4")
-
-include(SIPMacros)
-
-if(SIP_VERSION STRLESS "040e00")    # These version numbers also appear in ../CMakeLists.txt
-    message(FATAL_ERROR "The version of SIP found is too old. 4.14 or later is needed.")
-endif()
-
-find_package(PyQt4)
-set_package_properties(PyQt4 PROPERTIES DESCRIPTION "The PyQt bindings"
-                       URL "http://riverbankcomputing.com" TYPE REQUIRED
-                       PURPOSE "Required to build PyKDE4")
-
-if(PYQT4_VERSION STRLESS "040905")  # These version numbers also appear in ../CMakeLists.txt
-    message(FATAL_ERROR "The version of PyQt found is too old. 4.9 or later is required.")
-endif()
-
-macro_optional_find_package(Soprano)
-set_package_properties(Soprano PROPERTIES DESCRIPTION "The Soprano libraries"
-                       URL "http://projects.kde.org/kdesupport/soprano"
-                       TYPE OPTIONAL PURPOSE
-                       "Required for Soprano Python bindings")
-
-macro_optional_find_package(Nepomuk)
-set_package_properties(Nepomuk PROPERTIES DESCRIPTION "The Nepomuk libraries"
-                       URL "http://projects.kde.org/kde/kdelibs/" TYPE OPTIONAL
-                       PURPOSE "Required for Nepomuk Python bindings")
-
-macro_optional_find_package(KdepimLibs)
-set_package_properties(KdepimLibs PROPERTIES DESCRIPTION "The KDE PIM libraries"
-                       URL "http://projects.kde.org/kde/kdepimlibs" TYPE OPTIONAL
-                       PURPOSE "Required for the Akonadi Python bindings")
-
-macro_optional_find_package(PolkitQt)
-set_package_properties(PolkitQt PROPERTIES DESCRIPTION "Qt wrapper around Polkit"
-                       TYPE OPTIONAL PURPOSE
-                       "Required to build Python Polkit bindings")
-
-include_directories(
-    ${PYTHON_INCLUDE_PATH}
-    ${SIP_INCLUDE_DIR}
-    ${QT_INCLUDE_DIR}
-    ${QT_QT_INCLUDE_DIR}
-    ${QT_QTCORE_INCLUDE_DIR}
-    ${QT_QTDESIGNER_INCLUDE_DIR}
-    ${QT_QTGUI_INCLUDE_DIR}
-    ${QT_QTNETWORK_INCLUDE_DIR}
-    ${QT_QTOPENGL_INCLUDE_DIR}
-    ${QT_QTSQL_INCLUDE_DIR}
-    ${QT_QTXML_INCLUDE_DIR}
-    ${QT_QTSVG_INCLUDE_DIR}
-    ${QT_QTWEBKIT_INCLUDE_DIR}
-    ${KDE4_INCLUDE_DIR}
-    ${KDE4_INCLUDE_DIR}/solid
-    ${KDE4_INCLUDE_DIR}/kio
-    ${KDE4_INCLUDE_DIR}/dom
-    ${KDE4_INCLUDE_DIR}/ksettings
-    ${KDE4_INCLUDE_DIR}/knewstuff2
-    ${KDE4_INCLUDE_DIR}/dnssd
-    ${KDE4_PHONON_INCLUDES}
-    ${KDEPIMLIBS_INCLUDE_DIRS}
-)
-
-# Pull in ARM configuration options if needed
-STRING(REGEX MATCH "PyQt_qreal_double" SIP_ARM_HACK ${PYQT4_SIP_FLAGS} "")
-
-set(SIP_INCLUDES ${CMAKE_BINARY_DIR} ${PYQT4_SIP_DIR} sip)
-set(SIP_CONCAT_PARTS 8)
-if (WIN32)
-    set(SIP_TAGS ALL WS_WIN ${PYQT4_VERSION_TAG})
-else ()
-    set(SIP_TAGS ALL WS_X11 ${PYQT4_VERSION_TAG})
-endif ()
-set(SIP_DISABLE_FEATURES VendorID PyQt_NoPrintRangeBug ${SIP_ARM_HACK})
-
-set(SIP_FILES_INSTALL_DIR ${SHARE_INSTALL_PREFIX}/sip)
-
-# Use an extra option when compiling on Python 3.
-if (PYTHON_VERSION_MAJOR GREATER 2)
-    if(PYQT4_VERSION STRGREATER "040904")
-	    # Disable for features in newer Qt
-        if (PYQT4_VERSION STRGREATER "040a04")
-            # GLuint + QVector (PyQt > 4.11)
-            set(SIP_EXTRA_OPTIONS -P -g -x PyKDE_QVector -x PyKDE_GLuint)
-        else ()
-            # QVector (PyQt < 4.11)
-            set(SIP_EXTRA_OPTIONS -P -g -x PyKDE_QVector)
-        endif ()
-    else ()
-	    set(SIP_EXTRA_OPTIONS -g)
-    endif()
-else (PYTHON_VERSION_MAJOR GREATER 2)
-    if(PYQT4_VERSION STRGREATER "040904")
-	# Disable for newer PyQt
-        if (PYQT4_VERSION STRGREATER "040a04")
-            # GLuint + QVector (PyQt > 4.11)
-            set(SIP_EXTRA_OPTIONS -P -g -x PyKDE_QVector -x Py_v3 -x PyKDE_GLuint)
-        else ()
-            # QVector (PyQt < 4.11)
-            set(SIP_EXTRA_OPTIONS -P -g -x PyKDE_QVector -x Py_v3)
-        endif ()
-    else ()
-	    set(SIP_EXTRA_OPTIONS -g -x Py_v3)
-    endif()
-endif ()
-
-add_definitions(-D_REENTRANT -DQT_CORE_LIB -DQT_GUI_LIB -DUSING_SOPRANO_NRLMODEL_UNSTABLE_API -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public)
-
-include(PyKDEConfigurationInformation.cmake)
-
-# Only install pykdeconfig.py if PyQt itself has installed pyqtconfig.py, since
-# its absence indicates PyQt was built with the new build system and
-# pykdeconfig will not work.
-execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "import PyQt4.pyqtconfig"
-                RESULT_VARIABLE _exit_code OUTPUT_QUIET ERROR_QUIET)
-if (NOT _exit_code)
-    python_install(${CMAKE_CURRENT_BINARY_DIR}/pykdeconfig.py ${PYTHON_SITE_PACKAGES_INSTALL_DIR}/PyKDE4)
-endif ()
-
-# Do not use --no-undefined for python modules.
-STRING(REPLACE -Wl,--no-undefined "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
-
-file(GLOB kdecore_files_sip sip/kdecore/*.sip)
-set(SIP_EXTRA_FILES_DEPEND ${kdecore_files_sip})
-add_sip_python_module(PyKDE4.kdecore sip/kdecore/kdecoremod.sip ${KDE4_KDECORE_LIBS} ${KDE4_KPTY_LIBS} ${QT_QTNETWORK_LIBRARY})
-
-file(GLOB solid_files_sip sip/solid/*.sip)
-set(SIP_EXTRA_FILES_DEPEND ${solid_files_sip})
-add_sip_python_module(PyKDE4.solid sip/solid/solidmod.sip ${KDE4_SOLID_LIBS} ${QT_QTCORE_LIBRARY})
-
-file(GLOB kdeui_files_sip sip/kdeui/*.sip)
-set(SIP_EXTRA_FILES_DEPEND ${kdeui_files_sip})
-add_sip_python_module(PyKDE4.kdeui sip/kdeui/kdeuimod.sip ${KDE4_KDEUI_LIBS} ${QT_QTXML_LIBRARY})
-
-file(GLOB kio_files_sip sip/kio/*.sip)
-set(SIP_EXTRA_FILES_DEPEND ${kio_files_sip})
-add_sip_python_module(PyKDE4.kio sip/kio/kiomod.sip ${KDE4_KIO_LIBS} ${KDE4_KFILE_LIBS})
-
-file(GLOB kutils_files_sip sip/kutils/*.sip)
-set(SIP_EXTRA_FILES_DEPEND ${kutils_files_sip})
-add_sip_python_module(PyKDE4.kutils sip/kutils/kutilsmod.sip ${KDE4_KUTILS_LIBS} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${KDE4_KDEUI_LIBS})
-
-file(GLOB kparts_files_sip sip/kparts/*.sip)
-set(SIP_EXTRA_FILES_DEPEND ${kparts_files_sip})
-add_sip_python_module(PyKDE4.kparts sip/kparts/kpartsmod.sip ${KDE4_KPARTS_LIBS})
-
-file(GLOB ktexteditor_files_sip sip/ktexteditor/*.sip)
-set(SIP_EXTRA_FILES_DEPEND ${ktexteditor_files_sip})
-add_sip_python_module(PyKDE4.ktexteditor sip/ktexteditor/ktexteditormod.sip ${KDE4_KTEXTEDITOR_LIBS} ${KDE4_KPARTS_LIBS} ${KDE4_KDEUI_LIBS} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
-
-file(GLOB khtml_files_sip sip/khtml/*.sip)
-set(SIP_EXTRA_FILES_DEPEND ${khtml_files_sip})
-add_sip_python_module(PyKDE4.khtml sip/khtml/khtmlmod.sip ${KDE4_KHTML_LIBS})
-
-file(GLOB knewstuff_files_sip sip/knewstuff/*.sip)
-set(SIP_EXTRA_FILES_DEPEND ${knewstuff_files_sip})
-add_sip_python_module(PyKDE4.knewstuff sip/knewstuff/knewstuffmod.sip ${KDE4_KNEWSTUFF2_LIBS} ${KDE4_KNEWSTUFF3_LIBS} ${QT_QTCORE_LIBRARY})
-
-file(GLOB dnssd_files_sip sip/dnssd/*.sip)
-set(SIP_EXTRA_FILES_DEPEND ${dnssd_files_sip})
-add_sip_python_module(PyKDE4.dnssd sip/dnssd/dnssdmod.sip ${KDE4_KDNSSD_LIBS} ${QT_QTCORE_LIBRARY})
-
-file(GLOB phonon_files_sip sip/phonon/*.sip)
-set(SIP_EXTRA_FILES_DEPEND ${phonon_files_sip})
-add_sip_python_module(PyKDE4.phonon sip/phonon/phononmod.sip ${PHONON_LIBS} ${QT_QTDBUS_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
-
-file(GLOB plasma_files_sip sip/plasma/*.sip)
-set(SIP_EXTRA_FILES_DEPEND ${plasma_files_sip})
-add_sip_python_module(PyKDE4.plasma sip/plasma/plasmamod.sip ${KDE4_PLASMA_LIBS} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTUITOOLS_LIBRARY} ${KDE4_KIO_LIBRARY} ${KDE4_KDECORE_LIBRARY} ${KDE4_KDEUI_LIBRARY})
-
-file(GLOB kterminal_files_sip sip/kterminal/*.sip)
-set(SIP_EXTRA_FILES_DEPEND ${kterminal_files_sip})
-add_sip_python_module(PyKDE4.kterminal sip/kterminal/kterminalmod.sip ${KDE4_TERMINAL_LIBS} ${KDE4_KPARTS_LIBS} ${KDE4_KDEUI_LIBS} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
-
-set(PYKDE_MODULES "kdecore solid kdeui kio kutils kparts ktexteditor dnssd phonon plasma kterminal")
-
-if(Soprano_FOUND)
-    include_directories(${SOPRANO_INCLUDE_DIR})
-    file(GLOB soprano_files_sip sip/soprano/*.sip)
-    set(SIP_EXTRA_FILES_DEPEND ${soprano_files_sip})
-    add_sip_python_module(PyKDE4.soprano sip/soprano/sopranomod.sip ${SOPRANO_LIBRARIES} ${SOPRANO_CLIENT_LIBRARIES} ${SOPRANO_SERVER_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY})
-    set(PYKDE_MODULES "${PYKDE_MODULES} soprano")
-endif()
-
-if(Nepomuk_FOUND)
-    include_directories(${NEPOMUK_INCLUDE_DIR})
-    file(GLOB nepomuk_files_sip sip/nepomuk/*.sip)
-    set(SIP_EXTRA_FILES_DEPEND ${nepomuk_files_sip})
-    add_sip_python_module(PyKDE4.nepomuk sip/nepomuk/nepomukmod.sip ${NEPOMUK_LIBRARIES} ${NEPOMUK_QUERY_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${SOPRANO_LIBRARIES} ${KDE4_KIO_LIBS})
-    set(PYKDE_MODULES "${PYKDE_MODULES} nepomuk")
-endif()
-
-if(KdepimLibs_FOUND)
-    find_package(Boost 1.34.0)
-    set_package_properties(Boost PROPERTIES DESCRIPTION "Boost C++ Libraries"
-                           URL "http://www.boost.org" TYPE REQUIRED
-                           PURPOSE "Boost is required by Akonadi")
-    include_directories(${KDEPIMLIBS_INCLUDE_DIRS})
-    file(GLOB akonadi_files_sip sip/akonadi/*.sip)
-    set(SIP_EXTRA_FILES_DEPEND ${akonadi_files_sip})
-    add_sip_python_module(PyKDE4.akonadi sip/akonadi/akonadimod.sip ${KDE4_AKONADI_LIBS} ${KDE4_AKONADI_KMIME_LIBS} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS})
-    set(PYKDE_MODULES "${PYKDE_MODULES} akonadi")
-endif()
-
-if(POLKITQT_FOUND)
-    include_directories(${POLKITQT_INCLUDE_DIR})
-
-    file(GLOB pollkitqt_files_sip sip/polkitqt/*.sip)
-
-    # ${POLKITQT_INCLUDE_DIR} -- We don't use this directly, because we need the #includes
-    # in the .sip file to be more specific otherwise they pick up the wrong action.h etc.
-
-    set(SIP_EXTRA_FILES_DEPEND ${pollkitqt_files_sip})
-    add_sip_python_module(PyKDE4.polkitqt sip/polkitqt/polkitqtmod.sip ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${POLKITQT_LIBRARIES})
-    set(PYKDE_MODULES "${PYKDE_MODULES} polkitqt")
-endif()
-
-python_install(__init__.py ${PYTHON_SITE_PACKAGES_INSTALL_DIR}/PyKDE4)
-
-# Install the .sip files for anyone that wants to build bindings on top of PyKDE4.
-# (Don't forget the / at the end of sip/.)
-install(FILES ${CMAKE_BINARY_DIR}/pykde_config.sip DESTINATION ${SIP_FILES_INSTALL_DIR}/PyKDE4/)
-if(DEFAULT_PYTHON_VERSION)
-  install(DIRECTORY sip/ DESTINATION ${SIP_FILES_INSTALL_DIR}/PyKDE4
-        PATTERN "*~" EXCLUDE    # This sucks, why can't I just whitelist what I _do_ want?
-        PATTERN ".svn" EXCLUDE
-        PATTERN "*.in" EXCLUDE)
-   message("Installing sip files in this build pass")
-else(DEFAULT_PYTHON_VERSION)
-   message("Not installing sip files in this build pass")
-endif(DEFAULT_PYTHON_VERSION)
-
-add_subdirectory(tools)
-#add_subdirectory(docs)
-add_subdirectory(examples)
-if (PYTHON_VERSION_MAJOR LESS 3 AND DEFAULT_PYTHON_VERSION)
-    add_subdirectory(kpythonpluginfactory)
-endif (PYTHON_VERSION_MAJOR LESS 3 AND DEFAULT_PYTHON_VERSION)
-
-feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git cmake/modules/FindPolkitQt.cmake cmake/modules/FindPolkitQt.cmake
index b6f883f..4bff590 100644
--- cmake/modules/FindPolkitQt.cmake
+++ cmake/modules/FindPolkitQt.cmake
@@ -28,13 +28,13 @@ if (NOT POLKITQT_MIN_VERSION)
   set(POLKITQT_MIN_VERSION "0.9.3")
 endif (NOT POLKITQT_MIN_VERSION)
 
-if (NOT WIN32)
+if (NOT WIN32 AND NOT APPLE)
    # use pkg-config to get the directories and then use these values
    # in the FIND_PATH() and FIND_LIBRARY() calls
    find_package(PkgConfig)
    pkg_check_modules(PC_POLKITQT QUIET polkit-qt)
    set(POLKITQT_DEFINITIONS ${PC_POLKITQT_CFLAGS_OTHER})
-endif (NOT WIN32)
+endif (NOT WIN32 AND NOT APPLE)
 
 find_path( POLKITQT_INCLUDE_DIR
      NAMES polkit-qt/auth.h
diff --git sip/kdecore/ktempdir.sip sip/kdecore/ktempdir.sip
index ea912aa..479c27f 100644
--- sip/kdecore/ktempdir.sip
+++ sip/kdecore/ktempdir.sip
@@ -24,7 +24,9 @@ class KTempDir
 {
 %TypeHeaderCode
 #include <ktempdir.h>
+#ifdef Q_WS_X11
 #include <fixx11h.h>
+#endif
 %End
 
 
