Fix parsing include dirs and builtin macros for CXX-only projects

Alex
This commit is contained in:
Alex Neundorf 2011-04-03 18:00:35 +02:00
parent 4ccb44e7c5
commit 4371147ef4

View File

@ -32,7 +32,13 @@ MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
SET(${_resultIncludeDirs})
SET(_gccOutput)
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -v -E -x ${_lang} -dD dummy
IF (${_lang} STREQUAL "c++")
SET(_compilerExecutable "${CMAKE_CXX_COMPILER}")
ELSE (${_lang} STREQUAL "c++")
SET(_compilerExecutable "${CMAKE_C_COMPILER}")
ENDIF (${_lang} STREQUAL "c++")
EXECUTE_PROCESS(COMMAND ${_compilerExecutable} -v -E -x ${_lang} -dD dummy
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
ERROR_VARIABLE _gccOutput
OUTPUT_VARIABLE _gccStdout )