Index: code/branches/core4/cmake/GenerateToluaBindings.cmake
===================================================================
--- code/branches/core4/cmake/GenerateToluaBindings.cmake	(revision 3250)
+++ code/branches/core4/cmake/GenerateToluaBindings.cmake	(revision 3251)
@@ -53,8 +53,9 @@
   ENDIF()
 
-  # Create temporary package file
+  # Create temporary package file and implicit dependencies
   FILE(REMOVE ${_tolua_pkgfile})
   FOREACH(_tolua_inputfile ${_tolua_inputfiles})
     FILE(APPEND ${_tolua_pkgfile} "\$cfile \"${_tolua_inputfile}\"\n")
+    LIST(APPEND _implicit_dependencies CXX ${_tolua_inputfile})
   ENDFOREACH(_tolua_inputfile)
 
@@ -67,7 +68,7 @@
                                -s ${TOLUA_PARSER_SOURCE}
                                   ${_tolua_pkgfile}
-    DEPENDS              ${TOLUA_PARSER_DEPENDENCIES}
-    IMPLICIT_DEPENDS CXX ${_tolua_inputfiles}
-    WORKING_DIRECTORY    ${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}
+    DEPENDS           ${TOLUA_PARSER_DEPENDENCIES}
+    IMPLICIT_DEPENDS  ${_implicit_dependencies}
+    WORKING_DIRECTORY ${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}
     COMMENT "Generating tolua bind files for package ${_tolua_package}"
   )
Index: code/branches/core4/cmake/PrecompiledHeaderFiles.cmake
===================================================================
--- code/branches/core4/cmake/PrecompiledHeaderFiles.cmake	(revision 3250)
+++ code/branches/core4/cmake/PrecompiledHeaderFiles.cmake	(revision 3251)
@@ -110,6 +110,6 @@
     GET_GCC_COMPILER_FLAGS(${_target_name} _pch_gcc_flags)
     # Make sure we recompile the pch file even if only the flags change
-    IF(NOT "${_pch_gcc_flags}" STREQUAL "${_INTERNAL_PCH_GCC_FLAGS}")
-      SET(_INTERNAL_PCH_GCC_FLAGS "${_pch_gcc_flags}" CACHE INTERNAL "")
+    IF(NOT "${_pch_gcc_flags}" STREQUAL "${_INTERNAL_${_target_name}_PCH_GCC_FLAGS}")
+      SET(_INTERNAL_${_target_name}_PCH_GCC_FLAGS "${_pch_gcc_flags}" CACHE INTERNAL "")
       FILE(WRITE ${_pch_dep_helper_file} "/* ${_pch_gcc_flags} */")
     ENDIF()
Index: code/branches/netp6/cmake/GenerateToluaBindings.cmake
===================================================================
--- code/branches/netp6/cmake/GenerateToluaBindings.cmake	(revision 3250)
+++ code/branches/netp6/cmake/GenerateToluaBindings.cmake	(revision 3251)
@@ -53,8 +53,9 @@
   ENDIF()
 
-  # Create temporary package file
+  # Create temporary package file and implicit dependencies
   FILE(REMOVE ${_tolua_pkgfile})
   FOREACH(_tolua_inputfile ${_tolua_inputfiles})
     FILE(APPEND ${_tolua_pkgfile} "\$cfile \"${_tolua_inputfile}\"\n")
+    LIST(APPEND _implicit_dependencies CXX ${_tolua_inputfile})
   ENDFOREACH(_tolua_inputfile)
 
@@ -67,7 +68,7 @@
                                -s ${TOLUA_PARSER_SOURCE}
                                   ${_tolua_pkgfile}
-    DEPENDS              ${TOLUA_PARSER_DEPENDENCIES}
-    IMPLICIT_DEPENDS CXX ${_tolua_inputfiles}
-    WORKING_DIRECTORY    ${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}
+    DEPENDS           ${TOLUA_PARSER_DEPENDENCIES}
+    IMPLICIT_DEPENDS  ${_implicit_dependencies}
+    WORKING_DIRECTORY ${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}
     COMMENT "Generating tolua bind files for package ${_tolua_package}"
   )
Index: code/branches/netp6/cmake/PrecompiledHeaderFiles.cmake
===================================================================
--- code/branches/netp6/cmake/PrecompiledHeaderFiles.cmake	(revision 3250)
+++ code/branches/netp6/cmake/PrecompiledHeaderFiles.cmake	(revision 3251)
@@ -110,6 +110,6 @@
     GET_GCC_COMPILER_FLAGS(${_target_name} _pch_gcc_flags)
     # Make sure we recompile the pch file even if only the flags change
-    IF(NOT "${_pch_gcc_flags}" STREQUAL "${_INTERNAL_PCH_GCC_FLAGS}")
-      SET(_INTERNAL_PCH_GCC_FLAGS "${_pch_gcc_flags}" CACHE INTERNAL "")
+    IF(NOT "${_pch_gcc_flags}" STREQUAL "${_INTERNAL_${_target_name}_PCH_GCC_FLAGS}")
+      SET(_INTERNAL_${_target_name}_PCH_GCC_FLAGS "${_pch_gcc_flags}" CACHE INTERNAL "")
       FILE(WRITE ${_pch_dep_helper_file} "/* ${_pch_gcc_flags} */")
     ENDIF()
Index: code/trunk/cmake/PrecompiledHeaderFiles.cmake
===================================================================
--- code/trunk/cmake/PrecompiledHeaderFiles.cmake	(revision 3250)
+++ code/trunk/cmake/PrecompiledHeaderFiles.cmake	(revision 3251)
@@ -110,6 +110,6 @@
     GET_GCC_COMPILER_FLAGS(${_target_name} _pch_gcc_flags)
     # Make sure we recompile the pch file even if only the flags change
-    IF(NOT "${_pch_gcc_flags}" STREQUAL "${_INTERNAL_PCH_GCC_FLAGS}")
-      SET(_INTERNAL_PCH_GCC_FLAGS "${_pch_gcc_flags}" CACHE INTERNAL "")
+    IF(NOT "${_pch_gcc_flags}" STREQUAL "${_INTERNAL_${_target_name}_PCH_GCC_FLAGS}")
+      SET(_INTERNAL_${_target_name}_PCH_GCC_FLAGS "${_pch_gcc_flags}" CACHE INTERNAL "")
       FILE(WRITE ${_pch_dep_helper_file} "/* ${_pch_gcc_flags} */")
     ENDIF()
@@ -153,6 +153,6 @@
         ARGS ${pchsupport_compiler_cxx_arg1} ${_pch_gcc_flags} -c -x c++-header -o ${_pch_file} ${_pch_header_file}
 	WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-        DEPENDS ${_pch_header_file} ${_pch_dep_helper_file}
-        IMPLICIT_DEPENDS ${_pch_header_file}
+        DEPENDS ${_pch_dep_helper_file}
+        IMPLICIT_DEPENDS CXX ${_pch_header_file}
         VERBATIM
       )
