Index: code/branches/pickup2/cmake/CompilerConfigMSVC.cmake
===================================================================
--- code/branches/pickup2/cmake/CompilerConfigMSVC.cmake	(revision 5942)
+++ code/branches/pickup2/cmake/CompilerConfigMSVC.cmake	(revision 6412)
@@ -149,4 +149,5 @@
 # Use Link time code generation for Release config if ORXONOX_RELEASE is defined
 IF(ORXONOX_RELEASE)
+  REMOVE_COMPILER_FLAGS("-INCREMENTAL:YES" ReleaseAll CACHE)
   ADD_LINKER_FLAGS("-LTCG" ReleaseAll CACHE)
 ENDIF()
Index: code/branches/pickup2/cmake/FindLua.cmake
===================================================================
--- code/branches/pickup2/cmake/FindLua.cmake	(revision 5942)
+++ code/branches/pickup2/cmake/FindLua.cmake	(revision 6412)
@@ -136,5 +136,5 @@
       ENDIF()
     ENDIF(${LUA_5.0_LUA_LIBRARY} MATCHES "framework")
-    
+
     IF(LUA_5.0_LIBRARIES)
       SET(LUA_5.0_FOUND TRUE)
Index: code/branches/pickup2/cmake/FindPackageHandleAdvancedArgs.cmake
===================================================================
--- code/branches/pickup2/cmake/FindPackageHandleAdvancedArgs.cmake	(revision 5942)
+++ code/branches/pickup2/cmake/FindPackageHandleAdvancedArgs.cmake	(revision 6412)
@@ -25,5 +25,5 @@
  #    EXACT keyword if specified in FIND_PACKAGE(...).
  #
- 
+
 INCLUDE(FindPackageHandleStandardArgs)
 INCLUDE(CompareVersionStrings)
Index: code/branches/pickup2/cmake/LibraryConfig.cmake
===================================================================
--- code/branches/pickup2/cmake/LibraryConfig.cmake	(revision 5942)
+++ code/branches/pickup2/cmake/LibraryConfig.cmake	(revision 6412)
@@ -25,5 +25,5 @@
  #    for certain libraries (Boost, OpenAL, TCL)
  #
- 
+
 INCLUDE(CompareVersionStrings)
 INCLUDE(FindPackageHandleStandardArgs)
Index: code/branches/pickup2/cmake/LibraryConfigApple.cmake
===================================================================
--- code/branches/pickup2/cmake/LibraryConfigApple.cmake	(revision 5942)
+++ code/branches/pickup2/cmake/LibraryConfigApple.cmake	(revision 6412)
@@ -23,5 +23,5 @@
  #    Sets necessary library options and paths on Mac.
  #
- 
+
 IF(APPLE)
   MESSAGE(STATUS "Running on Apple. Using customized paths and options.")
Index: code/branches/pickup2/cmake/PrecompiledHeaderFiles.cmake
===================================================================
--- code/branches/pickup2/cmake/PrecompiledHeaderFiles.cmake	(revision 5942)
+++ code/branches/pickup2/cmake/PrecompiledHeaderFiles.cmake	(revision 6412)
@@ -23,5 +23,5 @@
 
 INCLUDE(GetGCCCompilerFlags)
- 
+
 MACRO(PRECOMPILED_HEADER_FILES_PRE_TARGET _target_name _header_file_arg _sourcefile_var)
 
@@ -94,5 +94,5 @@
           SET(_old_flags "")
         ENDIF()
-	SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES COMPILE_FLAGS "${_old_flags} /FI\"${_pch_header_file}\" /Yu\"${_pch_header_file}\" /Fp\"${_pch_file}\"")
+        SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES COMPILE_FLAGS "${_old_flags} /FI\"${_pch_header_file}\" /Yu\"${_pch_header_file}\" /Fp\"${_pch_file}\"")
       ENDIF(NOT _is_header)
     ENDFOREACH(_file)
@@ -152,5 +152,5 @@
         COMMAND ${CMAKE_CXX_COMPILER}
         ARGS ${pchsupport_compiler_cxx_arg1} ${_pch_gcc_flags} -c -x c++-header -o ${_pch_file} ${_pch_header_file}
-	WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
         DEPENDS ${_pch_dep_helper_file}
         IMPLICIT_DEPENDS CXX ${_pch_header_file}
Index: code/branches/pickup2/cmake/SourceFileUtilities.cmake
===================================================================
--- code/branches/pickup2/cmake/SourceFileUtilities.cmake	(revision 5942)
+++ code/branches/pickup2/cmake/SourceFileUtilities.cmake	(revision 6412)
@@ -48,15 +48,21 @@
       ENDIF()
       IF(NOT DISABLE_COMPILATIONS)
+        SET(_compilation_file ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name})
         SET(_include_string)
         FOREACH(_file2 ${_compilation})
           SET(_include_string "${_include_string}#include \"${_file2}\"\n")
         ENDFOREACH(_file2)
-        IF(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name})
-          FILE(READ ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name} _include_string_file)
+        IF(EXISTS ${_compilation_file})
+          FILE(READ ${_compilation_file} _include_string_file)
         ENDIF()
         IF(NOT _include_string STREQUAL "${_include_string_file}")
-          FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name} "${_include_string}")
+          FILE(WRITE ${_compilation_file} "${_include_string}")
         ENDIF()
-        LIST(APPEND _fullpath_sources ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name})
+        LIST(APPEND _fullpath_sources ${_compilation_file})
+        # MSVC hack that excludes the compilations from the intellisense database
+        # (There is a bug with the "-" instead of "/". Only works for "Zm#" argument)
+        IF(MSVC)
+          SET_SOURCE_FILES_PROPERTIES(${_compilation_file} PROPERTIES COMPILE_FLAGS "-Zm1000")
+        ENDIF()
       ENDIF()
       SET(_compilation_name)
@@ -69,5 +75,5 @@
       IF(_compile AND NOT DISABLE_COMPILATIONS)
         LIST(APPEND _compilation ${_filepath})
-	LIST(APPEND _fullpath_sources "H")
+        LIST(APPEND _fullpath_sources "H")
       ENDIF()
     ENDIF()
Index: code/branches/pickup2/cmake/TargetUtilities.cmake
===================================================================
--- code/branches/pickup2/cmake/TargetUtilities.cmake	(revision 5942)
+++ code/branches/pickup2/cmake/TargetUtilities.cmake	(revision 6412)
@@ -181,4 +181,6 @@
   ENDFOREACH(_file)
 
+
+
   # Add the library/executable
   IF("${_target_type}" STREQUAL "LIBRARY")
@@ -190,4 +192,6 @@
   ENDIF()
 
+
+
   # Change library prefix to "lib"
   IF(MSVC AND ${_target_type} STREQUAL "LIBRARY")
@@ -195,4 +199,11 @@
       PREFIX "lib"
     )
+  ENDIF()
+
+  # MSVC hack to exclude external library sources from the intellisense database
+  # (IntelliSense stops working when adding "-Zm1000" as compile flag. "/Zm1000"
+  # would not work because of the slash)
+  IF(_arg_ORXONOX_EXTERNAL AND MSVC)
+    SET_TARGET_PROPERTIES(${_target_name} PROPERTIES COMPILE_FLAGS "-Zm1000")
   ENDIF()
 
