summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-04-05 18:28:49 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-04-05 18:28:49 (GMT)
commitca10dc47865bd764409c5600ba46d9ceb7367350 (patch)
treece6ea646502289497ae8cfd5b9b025541aced29a
parentfc6addccfdb734c48a76aaec96fef5fcad2940c9 (diff)
parent6a38cab2de2a529779c18e0c3872112e3851665b (diff)
downloadCMake-ca10dc47865bd764409c5600ba46d9ceb7367350.zip
CMake-ca10dc47865bd764409c5600ba46d9ceb7367350.tar.gz
CMake-ca10dc47865bd764409c5600ba46d9ceb7367350.tar.bz2
Merge topic 'BuiltinIncludeDirFixesForEclipse'
6a38cab Don't skip the last builtin include dir for the Eclipse project file 4371147 Fix parsing include dirs and builtin macros for CXX-only projects
-rw-r--r--Modules/CMakeFindEclipseCDT4.cmake12
1 files changed, 9 insertions, 3 deletions
diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake
index fbcdc98..a756e64 100644
--- a/Modules/CMakeFindEclipseCDT4.cmake
+++ b/Modules/CMakeFindEclipseCDT4.cmake
@@ -32,14 +32,20 @@ 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 )
FILE(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
# First find the system include dirs:
- IF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list" )
+ IF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+ *\n) *End of (search) list" )
# split the output into lines and then remove leading and trailing spaces from each of them:
STRING(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
@@ -48,7 +54,7 @@ MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
LIST(APPEND ${_resultIncludeDirs} "${_includePath}")
ENDFOREACH(nextLine)
- ENDIF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list" )
+ ENDIF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+ *\n) *End of (search) list" )
# now find the builtin macros: