Index: /code/branches/buildsystem/cmake/CheckOrxonoxWinDeps.cmake
===================================================================
--- /code/branches/buildsystem/cmake/CheckOrxonoxWinDeps.cmake	(revision 2317)
+++ /code/branches/buildsystem/cmake/CheckOrxonoxWinDeps.cmake	(revision 2318)
@@ -33,15 +33,20 @@
 IF (MINGW)
   MESSAGE(STATUS "Running on MinGW. Using customized paths.")
-  SET(MINGW_LIBRARY_DIR "../libs")
+  SET(MINGW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/../libs")
   #SET(Boost_ADDITIONAL_VERSIONS "1.36")
-  SET(BOOST_INCLUDEDIR ".${MINGW_LIBRARY_DIR}/boost_1_34_1")
-  SET(BOOST_LIBRARYDIR ".${MINGW_LIBRARY_DIR}/boost_1_34_1/stage/lib")
-  SET(ENV{ENETDIR} ".${MINGW_LIBRARY_DIR}/enet-1.1")
-  SET(ENV{ALUTDIR} ".${MINGW_LIBRARY_DIR}/freealut-1.1.0")
-  SET(ENV{OPENALDIR} ".${MINGW_LIBRARY_DIR}/openal-0.0.8/common")
-  SET(ENV{LUA_DIR} ".${MINGW_LIBRARY_DIR}/lua-5.1.3")
-  SET(ENV{OGGVORBISDIR} ".${MINGW_LIBRARY_DIR}/libogg-1.1.3")
+  SET(BOOST_INCLUDEDIR "${MINGW_LIBRARY_DIR}/boost_1_34_1")
+  SET(BOOST_LIBRARYDIR "${MINGW_LIBRARY_DIR}/boost_1_34_1/stage/lib")
+  SET(ENV{ENETDIR} "${MINGW_LIBRARY_DIR}/enet-1.1")
+  SET(ENV{ALUTDIR} "${MINGW_LIBRARY_DIR}/freealut-1.1.0")
+  SET(ENV{OPENALDIR} "${MINGW_LIBRARY_DIR}/openal-0.0.8/common")
+  SET(ENV{LUA_DIR} "${MINGW_LIBRARY_DIR}/lua-5.1.3")
+  SET(ENV{OGGVORBISDIR} "${MINGW_LIBRARY_DIR}/libogg-1.1.3")
   #SET(TCL_INCLUDE_PATH "/usr/pack/tcltk-8.4.9.linux-mo/include")
-  SET(ENV{CEGUIDIR} ".${MINGW_LIBRARY_DIR}/cegui-0.6.1")
-  SET(ENV{OGREDIR} ".${MINGW_LIBRARY_DIR}/ogre/OgreMain;.${MINGW_LIBRARY_DIR}/ogre/Samples/Common/bin/Release")
+  SET(ENV{CEGUIDIR} "${MINGW_LIBRARY_DIR}/cegui-0.6.1")
+  SET(ENV{OGREDIR} "${MINGW_LIBRARY_DIR}/ogre/OgreMain;${MINGW_LIBRARY_DIR}/ogre/Samples/Common/bin/Release")
+  #IF (NOT ENV{DXSDK_DIR})
+  #  SET(ENV{DXSDK_DIR} "${MINGW_LIBRARY_DIR}/DXSDK")
+  #ENDIF (NOT ENV{DXSDK_DIR})
 ENDIF (MINGW)
+
+#MARK_AS_ADVANCED(MINGW_LIBRARY_DIR)
Index: /code/branches/buildsystem/cmake/FindCEGUI.cmake
===================================================================
--- /code/branches/buildsystem/cmake/FindCEGUI.cmake	(revision 2317)
+++ /code/branches/buildsystem/cmake/FindCEGUI.cmake	(revision 2318)
@@ -29,13 +29,34 @@
 )
 
-#SET(CEGUI_LIBRARIES debug CEGUIBase_d optimized CEGUIBase)
-FIND_LIBRARY(CEGUI_LIBRARY
-    NAMES CEGUIBase
-    PATHS
-    $ENV{CEGUIDIR}
-    /usr/local
-    /usr
-    PATH_SUFFIXES lib
-)
+IF(WIN32)
+    FIND_LIBRARY(CEGUI_LIBRARY_
+        NAMES CEGUIBase
+        PATHS
+        $ENV{CEGUIDIR}
+        PATH_SUFFIXES lib
+    )
+    FIND_LIBRARY(CEGUI_LIBRARY_d
+        NAMES CEGUIBase_d
+        PATHS
+        $ENV{CEGUIDIR}
+        PATH_SUFFIXES lib
+    )
+    IF(CEGUI_LIBRARY_)
+        IF(CEGUI_LIBRARY_d)
+            SET(CEGUI_LIBRARY optimized ${CEGUI_LIBRARY_} debug ${CEGUI_LIBRARY_d})
+        ELSE(CEGUI_LIBRARY_d)
+            SET(CEGUI_LIBRARY ${CEGUI_LIBRARY_})
+        ENDIF(CEGUI_LIBRARY_d)
+    ENDIF(CEGUI_LIBRARY_)
+ELSE(WIN32)
+    FIND_LIBRARY(CEGUI_LIBRARY
+        NAMES CEGUIBase
+        PATHS
+        $ENV{CEGUIDIR}
+        /usr/local
+        /usr
+        PATH_SUFFIXES lib
+    )
+ENDIF(WIN32)
 
 #    IF (NOT CEGUI_SCRIPT_LIBDIR)
@@ -65,4 +86,6 @@
 MARK_AS_ADVANCED(
     CEGUI_LIBRARY
+    CEGUI_LIBRARY_
+    CEGUI_LIBRARY_d
     CEGUI_INCLUDE_DIR
     #CEGUI_SCRIPT_LIBRARIES
Index: /code/branches/buildsystem/cmake/FindDirectX.cmake
===================================================================
--- /code/branches/buildsystem/cmake/FindDirectX.cmake	(revision 2317)
+++ /code/branches/buildsystem/cmake/FindDirectX.cmake	(revision 2318)
@@ -9,41 +9,19 @@
   #                 > www.orxonox.net <
 
-  IF (DirectX_INCLUDE_DIR AND DirectX_LIB_DIR)
-    SET(DirectX_FIND_QUIETLY TRUE)
-  ENDIF (DirectX_INCLUDE_DIR AND DirectX_LIB_DIR)
-
-  set(DirectX_FOUND "NO")
-
-  FIND_PATH(DirectX_INCLUDE_DIR "dinput.h"
-    ../libs/DXSDK/Include
-    $ENV{DXSDK_DIR}/Include
+  FIND_PATH(DirectX_INCLUDE_DIR dinput.h
+    PATHS
+    $ENV{DXSDK_DIR}
+    PATH_SUFFIXES include
   )
 
-  FIND_PATH(DirectX_LIB_DIR "dinput8.lib"
-    ../libs/DXSDK/Lib
-    ../libs/DXSDK/Lib/x86
-    $ENV{DXSDK_DIR}/lib/x86
+  FIND_PATH(DirectX_LIB_DIR dinput8.lib
+    $ENV{DXSDK_DIR}
+    PATH_SUFFIXES lib lib/x86
   )
 
-  IF (DirectX_INCLUDE_DIR AND DirectX_LIB_DIR)
-    SET (DirectX_FOUND "YES")
-  ENDIF (DirectX_INCLUDE_DIR AND DirectX_LIB_DIR)
+  INCLUDE(FindPackageHandleStandardArgs)
+  FIND_PACKAGE_HANDLE_STANDARD_ARGS(DirectX DEFAULT_MSG DirectX_INCLUDE_DIR DirectX_LIB_DIR)
 
-  IF (DirectX_FOUND)
-    IF (NOT DirectX_FIND_QUIETLY)
-      MESSAGE(STATUS "DirectX was found.")
-      IF (VERBOSE_FIND)
-        MESSAGE (STATUS "  include path: ${DirectX_INCLUDE_DIR}")
-        MESSAGE (STATUS "  library path: ${DirectX_LIB_DIR}")
-        MESSAGE (STATUS "  libraries:    dinput8.lib")
-      ENDIF (VERBOSE_FIND)
-    ENDIF (NOT DirectX_FIND_QUIETLY)
-  ELSE (DirectX_FOUND)
-    IF (NOT DirectX_INCLUDE_DIR)
-      MESSAGE(SEND_ERROR "DirectX include path was not found.")
-    ENDIF (NOT DirectX_INCLUDE_DIR)
-    IF (NOT DirectX_LIB_DIR)
-      MESSAGE(SEND_ERROR "DirectX library was not found.")
-    ENDIF (NOT DirectX_LIB_DIR)
-  ENDIF (DirectX_FOUND)
 ENDIF(WIN32)
+
+MARK_AS_ADVANCED(DirectX_INCLUDE_DIR DirectX_LIB_DIR)
Index: /code/branches/buildsystem/cmake/FindENet.cmake
===================================================================
--- /code/branches/buildsystem/cmake/FindENet.cmake	(revision 2317)
+++ /code/branches/buildsystem/cmake/FindENet.cmake	(revision 2318)
@@ -46,3 +46,3 @@
 ENDIF (ENET_FOUND)
 
-MARK_AS_ADVANCED(ENet_LIBRARY ENet_INCLUDE_DIR)
+MARK_AS_ADVANCED(ENet_LIBRARY ENet_LIBRARIES ENet_INCLUDE_DIR)
Index: /code/branches/buildsystem/cmake/FindOGRE.cmake
===================================================================
--- /code/branches/buildsystem/cmake/FindOGRE.cmake	(revision 2317)
+++ /code/branches/buildsystem/cmake/FindOGRE.cmake	(revision 2318)
@@ -23,13 +23,34 @@
 )
 
-#SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)
-FIND_LIBRARY(OGRE_LIBRARY
-    NAMES OgreMain
-    PATHS
-    $ENV{OGREDIR}
-    /usr/local
-    /usr
-    PATH_SUFFIXES lib
-)
+IF(WIN32)
+    FIND_LIBRARY(OGRE_LIBRARY_
+        NAMES OgreMain
+        PATHS
+        $ENV{OGREDIR}
+        PATH_SUFFIXES lib
+    )
+    FIND_LIBRARY(OGRE_LIBRARY_d
+        NAMES OgreMain_d
+        PATHS
+        $ENV{OGREDIR}
+        PATH_SUFFIXES lib
+    )
+    IF(OGRE_LIBRARY_)
+        IF(OGRE_LIBRARY_d)
+            SET(OGRE_LIBRARY optimized ${OGRE_LIBRARY_} debug ${OGRE_LIBRARY_d})
+        ELSE(OGRE_LIBRARY_d)
+            SET(OGRE_LIBRARY ${OGRE_LIBRARY_})
+        ENDIF(OGRE_LIBRARY_d)
+    ENDIF(OGRE_LIBRARY_)
+ELSE(WIN32)
+    FIND_LIBRARY(OGRE_LIBRARY
+        NAMES OgreMain
+        PATHS
+        $ENV{OGREDIR}
+        /usr/local
+        /usr
+        PATH_SUFFIXES lib
+    )
+ENDIF(WIN32)
 
 INCLUDE(FindPackageHandleStandardArgs)
@@ -41,4 +62,6 @@
 MARK_AS_ADVANCED(
     OGRE_LIBRARY
+    OGRE_LIBRARY_
+    OGRE_LIBRARY_d
     OGRE_INCLUDE_DIR
 )
Index: /code/branches/buildsystem/cmake/FindOggVorbis.cmake
===================================================================
--- /code/branches/buildsystem/cmake/FindOggVorbis.cmake	(revision 2317)
+++ /code/branches/buildsystem/cmake/FindOggVorbis.cmake	(revision 2318)
@@ -73,4 +73,5 @@
   VORBIS_LIBRARY
   VORBISFILE_LIBRARY
+  #VORBISENC_LIBRARY
   VORBIS_INCLUDE_DIR
 )
Index: /code/branches/buildsystem/src/CMakeLists.txt
===================================================================
--- /code/branches/buildsystem/src/CMakeLists.txt	(revision 2317)
+++ /code/branches/buildsystem/src/CMakeLists.txt	(revision 2318)
@@ -33,5 +33,5 @@
 ADD_SUBDIRECTORY(tolua)
 
-# TODO: write include file for this stuff
+# TODO: FIXME
 # Some people may not have CEGUILua installed, espc. with version 0.5
 # And we don't know what lua version it was linked against, so we compile
