Index: /code/branches/buildsystem2/cmake/LibraryConfigMSVC.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/LibraryConfigMSVC.cmake	(revision 2628)
+++ /code/branches/buildsystem2/cmake/LibraryConfigMSVC.cmake	(revision 2629)
@@ -32,34 +32,46 @@
 
   # Determine library directory
-  IF(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8)
-    SET(MSVC_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8")
-  ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/../lib_dist/vc8/dependencies/orxonox_vc8)
-    SET(MSVC_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/../lib_dist/vc8/dependencies/orxonox_vc8")
+  IF(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/include)
+    SET(DEPENDENCY_DIR "${CMAKE_SOURCE_DIR}/dependencies")
+  ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/../dependencies/include)
+    SET(DEPENDENCY_DIR "${CMAKE_SOURCE_DIR}/../dependencies/include")
+  ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/../lib_dist/dependencies/include)
+    SET(DEPENDENCY_DIR "${CMAKE_SOURCE_DIR}/../lib_dist/dependencies/include")
   ELSE()
     MESSAGE(FATAL_ERROR "Could not find dependency directory for the Visual Studio libraries")
   ENDIF()
-  SET(ORXONOX_RUNTIME_LIBRARY_DIRECTORY ${MSVC_LIBRARY_DIR}/bin)
+
+  # 64 bit system?
+  IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+    SET(MSVC_MACHINE_POSTFIX x64)
+  ELSE()
+    SET(MSVC_MACHINE_POSTFIX x86)
+  ENDIF()
+  SET(MSVC_INCLUDE_DIR   ${DEPENDENCY_DIR}/include)
+  SET(MSVC_LIBRARY_DIR   ${DEPENDENCY_DIR}/lib/msvc8-${MSVC_MACHINE_POSTFIX})
+  SET(MSVC_BINARY_DIR    ${DEPENDENCY_DIR}/bin/msvc8-${MSVC_MACHINE_POSTFIX})
+  SET(CMAKE_LIBRARY_PATH ${MSVC_LIBRARY_DIR})
+  SET(ORXONOX_RUNTIME_LIBRARY_DIRECTORY ${MSVC_BINARY_DIR})
 
   # Set variables for the include directories and the libraries
   # Note: When setting ENV${} variables, make sure to use quotes when
   #       having multiple directories.
-  SET(ENV{BOOST_ROOT}        ${MSVC_LIBRARY_DIR}/boost-1.35.0)
-  SET(ENV{CEGUIDIR}          ${MSVC_LIBRARY_DIR}/cegui-0.6.1)
-  SET(ENV{ENETDIR}           ${MSVC_LIBRARY_DIR}/enet-1.2)
-  SET(ENV{ALUTDIR}           ${MSVC_LIBRARY_DIR}/freealut-1.1.0)
-  SET(ENV{OGGDIR}            ${MSVC_LIBRARY_DIR}/libogg-1.1.3)
-  SET(ENV{VORBISDIR}         ${MSVC_LIBRARY_DIR}/libvorbis-1.2.0)
-  SET(ENV{OPENALDIR}         ${MSVC_LIBRARY_DIR}/openal-1.1)
-  SET(ENV{LUA_DIR}           ${MSVC_LIBRARY_DIR}/lua-5.1.3)
-  SET(ENV{OGRE_HOME}         ${MSVC_LIBRARY_DIR}/ogre-1.4.9)
-  SET(ENV{OGRE_PLUGIN_DIR}   ${MSVC_LIBRARY_DIR}/bin)
-  SET(TCL_INCLUDE_PATH       ${MSVC_LIBRARY_DIR}/tcl-8.5.5/include)
-  SET(TCL_LIBRARY            ${MSVC_LIBRARY_DIR}/tcl-8.5.5/lib/tcl85.lib)
-  SET(ZLIB_INCLUDE_DIR       ${MSVC_LIBRARY_DIR}/zlib-1.2.3/include)
-  SET(ZLIB_LIBRARY optimized ${MSVC_LIBRARY_DIR}/zlib-1.2.3/lib/zlib.lib
-                   debug     ${MSVC_LIBRARY_DIR}/zlib-1.2.3/lib/zlib_d.lib)
+  SET(ENV{ALUTDIR}               ${MSVC_INCLUDE_DIR}/freealut-1.1.0)
+  SET(ENV{BOOST_ROOT}            ${MSVC_INCLUDE_DIR}/boost-1.35.0)
+  SET(ENV{CEGUIDIR}              ${MSVC_INCLUDE_DIR}/cegui-0.6.1)
   IF($ENV{DXSDK_DIR} STREQUAL "")
-    SET(ENV{DXSDK_DIR}       ${MSVC_LIBRARY_DIR}/directx-sdk-aug-2007)
+    SET(ENV{DXSDK_DIR}           ${MSVC_INCLUDE_DIR}/directx-2007.aug)
   ENDIF()
+  SET(ENV{ENETDIR}               ${MSVC_INCLUDE_DIR}/enet-1.2)
+  SET(ENV{LUA_DIR}               ${MSVC_INCLUDE_DIR}/lua-5.1.3)
+  SET(ENV{OGGDIR}                ${MSVC_INCLUDE_DIR}/libogg-1.1.3)
+  SET(ENV{OGRE_HOME}             ${MSVC_INCLUDE_DIR}/ogre-1.4.9)
+  SET(ENV{OGRE_PLUGIN_DIR}       ${MSVC_BINARY_DIR})
+  SET(ENV{OPENALDIR}             ${MSVC_INCLUDE_DIR}/openal-1.1)
+  LIST(APPEND CMAKE_INCLUDE_PATH ${MSVC_INCLUDE_DIR}/tcl-8.5.2/include)
+  SET(ENV{VORBISDIR}             ${MSVC_INCLUDE_DIR}/libvorbis-1.2.0)
+  LIST(APPEND CMAKE_INCLUDE_PATH ${MSVC_INCLUDE_DIR}/zlib-1.2.3/include)
+  SET(ZLIB_LIBRARY     optimized ${MSVC_LIBRARY_DIR}/zlib.lib
+                       debug     ${MSVC_LIBRARY_DIR}/zlib_d.lib CACHE STRING "")
 
 ENDIF(MSVC AND LIBRARY_USE_PACKAGE_IF_SUPPORTED)
Index: /code/branches/buildsystem2/cmake/LibraryConfigMinGW.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/LibraryConfigMinGW.cmake	(revision 2628)
+++ /code/branches/buildsystem2/cmake/LibraryConfigMinGW.cmake	(revision 2629)
@@ -27,38 +27,47 @@
 
 IF(MINGW AND LIBRARY_USE_PACKAGE_IF_SUPPORTED)
+
   MESSAGE(STATUS "Running on MinGW. Using customized paths and options.")
 
   # Determine library directory
-  IF(EXISTS ${CMAKE_SOURCE_DIR}/libs)
-    SET(MINGW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/libs")
-  ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/../lis)
-    SET(MINGW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/../libs")
+  IF(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/include)
+    SET(DEPENDENCY_DIR "${CMAKE_SOURCE_DIR}/dependencies")
+  ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/../dependencies/include)
+    SET(DEPENDENCY_DIR "${CMAKE_SOURCE_DIR}/../dependencies/include")
   ELSE()
     MESSAGE(FATAL_ERROR "Could not find dependency directory for the MinGW libraries")
   ENDIF()
-  SET(ORXONOX_RUNTIME_LIBRARY_DIRECTORY ${MINGW_LIBRARY_DIR})
+
+  # 64 bit system?
+  IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+    SET(MINGW_MACHINE_POSTFIX x64)
+  ELSE()
+    SET(MINGW_MACHINE_POSTFIX x86)
+  ENDIF()
+  SET(MINGW_INCLUDE_DIR  ${DEPENDENCY_DIR}/include)
+  SET(MINGW_LIBRARY_DIR  ${DEPENDENCY_DIR}/lib/mingw-${MINGW_MACHINE_POSTFIX})
+  SET(MINGW_BINARY_DIR   ${DEPENDENCY_DIR}/bin/mingw-${MINGW_MACHINE_POSTFIX})
+  SET(CMAKE_LIBRARY_PATH ${MINGW_LIBRARY_DIR} ${MINGW_BINARY_DIR})
+  SET(ORXONOX_RUNTIME_LIBRARY_DIRECTORY ${MINGW_BINARY_DIR})
 
   # Note: When setting ENV${} variables, make sure to use quotes when
   #       having multiple directories.
-  # Using BOOST_ROOT only does not work with CMake 2.6.0 (2.6.2 works though)
-  SET(BOOST_INCLUDEDIR      "${MINGW_LIBRARY_DIR}/boost_1_34_1")
-  SET(BOOST_LIBRARYDIR      "${MINGW_LIBRARY_DIR}/boost_1_34_1/stage/lib")
-  SET(ENV{CEGUIDIR}         "${MINGW_LIBRARY_DIR}/cegui-0.6.1")
-  SET(ENV{ENETDIR}          "${MINGW_LIBRARY_DIR}/enet-1.1")
-  SET(LINK_ENET_DYNAMIC     FALSE)
-  SET(ENV{ALUTDIR}          "${MINGW_LIBRARY_DIR}/freealut-1.1.0")
-  SET(ENV{OGGDIR}           "${MINGW_LIBRARY_DIR}/libogg-1.1.3;${MINGW_LIBRARY_DIR}/libogg-1.1.3/src/.libs")
-  SET(ENV{VORBISDIR}        "${MINGW_LIBRARY_DIR}/libvorbis-1.2.0;${MINGW_LIBRARY_DIR}/libvorbis-1.2.0/lib/.libs")
-  SET(ENV{OPENALDIR}        "${MINGW_LIBRARY_DIR}/openal-0.0.8/common;${MINGW_LIBRARY_DIR}/openal-0.0.8/src/.libs")
-  SET(ENV{LUA_DIR}          "${MINGW_LIBRARY_DIR}/lua-5.1.3")
-  SET(ENV{OGRE_HOME}        "${MINGW_LIBRARY_DIR}/ogre/OgreMain;${MINGW_LIBRARY_DIR}")
-  SET(ENV{OGRE_PLUGIN_DIR}  "${MINGW_LIBRARY_DIR}/ogre/Samples/Common")
-  SET(TCL_INCLUDE_PATH      "${MINGW_LIBRARY_DIR}/tcl8.5.2/generic")
-  SET(TCL_LIBRARY           "${MINGW_LIBRARY_DIR}/tcl8.5.2/win/tcl85.dll")
-  SET(ZLIB_INCLUDE_DIR      "${MINGW_LIBRARY_DIR}/zlib/include")
-  SET(ZLIB_LIBRARY          "${MINGW_LIBRARY_DIR}/zlib/libzlib.a")
-  SET(LINK_ZLIB_DYNAMIC    FALSE)
+  SET(ENV{ALUTDIR}               ${MINGW_INCLUDE_DIR}/freealut-1.1.0)
+  SET(ENV{BOOST_ROOT}            ${MINGW_INCLUDE_DIR}/boost-1.34.1)
+  SET(ENV{CEGUIDIR}              ${MINGW_INCLUDE_DIR}/cegui-0.6.1)
   IF($ENV{DXSDK_DIR} STREQUAL "")
-    SET(ENV{DXSDK_DIR}      "${MINGW_LIBRARY_DIR}/DXSDK")
+    SET(ENV{DXSDK_DIR}           ${MINGW_INCLUDE_DIR}/directx-2007.aug)
   ENDIF()
+  SET(ENV{ENETDIR}               ${MINGW_INCLUDE_DIR}/enet-1.1)
+  SET(LINK_ENET_DYNAMIC FALSE)
+  SET(ENV{LUA_DIR}               ${MINGW_INCLUDE_DIR}/lua-5.1.3)
+  SET(ENV{OGGDIR}                ${MINGW_INCLUDE_DIR}/libogg-1.1.3)
+  SET(ENV{OGRE_HOME}             ${MINGW_INCLUDE_DIR}/ogre-1.4.8)
+  SET(ENV{OGRE_PLUGIN_DIR}       ${MINGW_BINARY_DIR})
+  SET(ENV{OPENALDIR}             ${MINGW_INCLUDE_DIR}/openal-0.0.8)
+  LIST(APPEND CMAKE_INCLUDE_PATH ${MINGW_INCLUDE_DIR}/tcl-8.5.2/include)
+  SET(ENV{VORBISDIR}             ${MINGW_INCLUDE_DIR}/libvorbis-1.2.0)
+  LIST(APPEND CMAKE_INCLUDE_PATH ${MINGW_INCLUDE_DIR}/zlib-1.2.3/include)
+  SET(LINK_ZLIB_DYNAMIC FALSE)
+
 ENDIF(MINGW AND LIBRARY_USE_PACKAGE_IF_SUPPORTED)
