36,38c36,41
<     SET(${_result} ${CMAKE_MATCH_1})
<     STRING(REPLACE "\n" " " ${_result} "${${_result}}")
<     SEPARATE_ARGUMENTS(${_result})
---
>     STRING(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
> 	
>     FOREACH(nextline ${_includeLines})
>       STRING(STRIP ${nextline} _includePath)
>       LIST(APPEND ${_result} "${_includePath}")
>     ENDFOREACH(nextline)
41,52c44,58
<   IF( "${_gccStdout}" MATCHES "built-in>\"\n(.+)# 1 +\"dummy\"" )
<     SET(_builtinDefines ${CMAKE_MATCH_1})
<     # Remove the '# 1 "<command-line>"' lines
<     STRING(REGEX REPLACE "# 1[^\n]+\n" "" _filteredOutput "${_builtinDefines}")
<     # Remove the "#define " parts from the output:
<     STRING(REGEX REPLACE "#define " "" _defineRemoved "${_filteredOutput}")
<     # Replace the line breaks with spaces, so we can use separate arguments afterwards
<     STRING(REGEX REPLACE "\n" " " _defineRemoved "${_defineRemoved}")
<     # Remove space at the end, this would produce empty list items
<     STRING(REGEX REPLACE " +$" "" ${_resultDefines} "${_defineRemoved}")
<     SEPARATE_ARGUMENTS(${_resultDefines})
<   ENDIF( "${_gccStdout}" MATCHES "built-in>\"\n(.+)# 1 +\"dummy\"" )
---
>   STRING(REGEX MATCHALL "#define[^\n]+\n" _defineLines "${_gccStdout}")
> 
>   FOREACH(nextline ${_defineLines})
>     STRING(REGEX REPLACE "#define " "" _defineRemoved "${nextline}")
>     STRING(REGEX MATCH "[A-Za-z_][A-Za-z0-9_]*|[A-Za-z_][A-Za-z0-9_]*\\([A-Za-z0-9_, ]*\\)" _name "${_defineRemoved}")
> 	STRING(STRIP ${_name} _name)
>     LIST(APPEND ${_resultDefines} "${_name}")
>     STRING(REPLACE ${_name} "" _nameRemoved "${_defineRemoved}")
>     STRING(STRIP ${_nameRemoved} _value)
>     IF(_value)
>       LIST(APPEND ${_resultDefines} "${_value}")
>     ELSE()
>       LIST(APPEND ${_resultDefines} " ")
>     ENDIF()
>   ENDFOREACH(nextline)
