Index: code/branches/resource3/cmake/ParseMacroArguments.cmake
===================================================================
--- code/branches/resource3/cmake/ParseMacroArguments.cmake	(revision 5673)
+++ code/branches/resource3/cmake/ParseMacroArguments.cmake	(revision 5676)
@@ -36,33 +36,42 @@
 
 MACRO(PARSE_MACRO_ARGUMENTS _switches _list_names)
+
+  # Using LIST(FIND ...) speeds up the process
+  SET(_keywords ${_switches} ${_list_names})
+
   # Parse all the arguments and set the corresponding variable
   # If the option is just a switch, set the variable to its name for later use
   FOREACH(_arg ${ARGN})
-    SET(_arg_found FALSE)
 
-    # Switches
-    FOREACH(_switch ${_switches})
-      IF(${_switch} STREQUAL ${_arg})
-        SET(_arg_${_switch} ${_switch})
-	SET(_arg_found TRUE)
-        # Avoid interpreting arguments after this one as options args for the previous one
-	SET(_storage_var)
-        BREAK()
-      ENDIF()
-    ENDFOREACH(_switch)
+    # Is the argument a keyword?
+    LIST(FIND _keywords ${_arg} _keyword_index)
+    IF(NOT _keyword_index EQUAL -1)
 
-    # Input options
-    IF(NOT _arg_found)
-      FOREACH(_list_name ${_list_names})
-        IF(${_list_name} STREQUAL ${_arg})
-          SET(_storage_var _arg_${_list_name})
-	  SET(_arg_found TRUE)
+      # Another optimisation
+      SET(_arg_found FALSE)
+      # Switches
+      FOREACH(_switch ${_switches})
+        IF(${_switch} STREQUAL ${_arg})
+          SET(_arg_${_switch} ${_switch})
+          SET(_arg_found TRUE)
+          # Avoid interpreting arguments after this one as options args for the previous one
+          SET(_storage_var)
           BREAK()
         ENDIF()
-      ENDFOREACH(_list_name)
-    ENDIF(NOT _arg_found)
+      ENDFOREACH(_switch)
 
-    # Arguments of an input option (like source files for SOURCE_FILES)
-    IF(NOT _arg_found)
+      # Input options
+      IF(NOT _arg_found)
+        FOREACH(_list_name ${_list_names})
+          IF(${_list_name} STREQUAL ${_arg})
+            SET(_storage_var _arg_${_list_name})
+            BREAK()
+          ENDIF()
+        ENDFOREACH(_list_name)
+      ENDIF(NOT _arg_found)
+
+    ELSE()
+
+      # Arguments of an input option (like source files for SOURCE_FILES)
       IF(_storage_var)
         # Store in variable define above in the foreach loop
@@ -71,5 +80,6 @@
         MESSAGE(FATAL_ERROR "ORXONOX_ADD_${_target_type} was given a non compliant argument: ${_arg}")
       ENDIF(_storage_var)
-    ENDIF(NOT _arg_found)
+
+    ENDIF()
 
   ENDFOREACH(_arg)
Index: code/branches/resource3/src/network/CMakeLists.txt
===================================================================
--- code/branches/resource3/src/network/CMakeLists.txt	(revision 5673)
+++ code/branches/resource3/src/network/CMakeLists.txt	(revision 5676)
@@ -35,9 +35,29 @@
   TrafficControl.cc
 )
+
+SET_SOURCE_FILES(NETWORK_HDR_FILES
+  ChatListener.h
+  Client.h
+  ClientConnection.h
+  ClientConnectionListener.h
+  ClientInformation.h
+  Connection.h
+  FunctionCallManager.h
+  GamestateClient.h
+  GamestateHandler.h
+  GamestateManager.h
+  Host.h
+  NetworkFunction.h
+  NetworkPrecompiledHeaders.h
+  NetworkPrereqs.h
+  Server.h
+  ServerConnection.h
+  TrafficControl.h
+)
+
 ADD_SUBDIRECTORY(packet)
 ADD_SUBDIRECTORY(synchronisable)
 
 ORXONOX_ADD_LIBRARY(network
-  FIND_HEADER_FILES
   DEFINE_SYMBOL
     "NETWORK_SHARED_BUILD"
@@ -51,4 +71,4 @@
     core
   SOURCE_FILES
-    ${NETWORK_SRC_FILES}
+    ${NETWORK_SRC_FILES} ${NETWORK_HDR_FILES}
 )
Index: code/branches/resource3/src/network/packet/CMakeLists.txt
===================================================================
--- code/branches/resource3/src/network/packet/CMakeLists.txt	(revision 5673)
+++ code/branches/resource3/src/network/packet/CMakeLists.txt	(revision 5676)
@@ -1,4 +1,3 @@
 ADD_SOURCE_FILES(NETWORK_SRC_FILES
-  Packet.cc
   Acknowledgement.cc
   Chat.cc
@@ -8,4 +7,18 @@
   FunctionCalls.cc
   Gamestate.cc
+  Packet.cc
   Welcome.cc
 )
+
+ADD_SOURCE_FILES(NETWORK_HDR_FILES
+  Acknowledgement.h
+  Chat.cc
+  Chat.h
+  ClassID.h
+  DeleteObjects.h
+  FunctionCalls.h
+  FunctionIDs.h
+  Gamestate.h
+  Packet.h
+  Welcome.h
+)
Index: code/branches/resource3/src/network/synchronisable/CMakeLists.txt
===================================================================
--- code/branches/resource3/src/network/synchronisable/CMakeLists.txt	(revision 5673)
+++ code/branches/resource3/src/network/synchronisable/CMakeLists.txt	(revision 5676)
@@ -5,2 +5,9 @@
   SynchronisableVariable.cc
 )
+
+ADD_SOURCE_FILES(NETWORK_HDR_FILES
+  NetworkCallback.h
+  NetworkCallbackManager.h
+  Synchronisable.h
+  SynchronisableVariable.h
+)
Index: code/branches/resource3/src/util/CMakeLists.txt
===================================================================
--- code/branches/resource3/src/util/CMakeLists.txt	(revision 5673)
+++ code/branches/resource3/src/util/CMakeLists.txt	(revision 5676)
@@ -33,4 +33,35 @@
 )
 
+SET_SOURCE_FILES(UTIL_HDR_FILES
+  CRC32.h
+  Clipboard.h
+  Convert.h
+  Debug.h
+  Exception.h
+  ExprParser.h
+  Math.h
+  MathConvert.h
+  mbool.h
+  MultiType.h
+  MultiTypeValue.h
+  OgreForwardRefs.h
+  OrxAssert.h
+  OrxEnum.h
+  OutputBuffer.h
+  OutputHandler.h
+  RefToValue.h
+  ScopeGuard.h
+  Serialise.h
+  SignalHandler.h
+  Singleton.h
+  Sleep.h
+  StringUtils.h
+  SubString.h
+  TemplateUtils.h
+  TypeTraits.h
+  UTFStringConversions.h
+  UtilPrereqs.h
+)
+
 IF(GCC_NO_SYSTEM_HEADER_SUPPORT)
   # Get around displaying a few hundred lines of warning code
@@ -39,5 +70,4 @@
 
 ORXONOX_ADD_LIBRARY(util
-  FIND_HEADER_FILES
   DEFINE_SYMBOL
     "UTIL_SHARED_BUILD"
@@ -45,4 +75,4 @@
     ${OGRE_LIBRARY}
   SOURCE_FILES
-    ${UTIL_SRC_FILES}
+    ${UTIL_SRC_FILES} ${UTIL_HDR_FILES}
 )
