[Cmake-commits] CMake branch, next, updated. v2.8.2-502-gd9e939f

Alexander Neundorf neundorf at kde.org
Mon Aug 23 14:57:28 EDT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  d9e939f20cc9ea420f85bdba74ad3824ed2193c2 (commit)
       via  9fd4e1814b34da46a5a8b50c3492a68a1b5be3af (commit)
      from  c7c6e5e48e885077898b998b3cd234cb38ca1a35 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d9e939f20cc9ea420f85bdba74ad3824ed2193c2
commit d9e939f20cc9ea420f85bdba74ad3824ed2193c2
Merge: c7c6e5e 9fd4e18
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Mon Aug 23 20:55:58 2010 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Mon Aug 23 20:55:58 2010 +0200

    Merge branch 'FixEclipseIncludePathParsingWithSpaces' into next


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9fd4e1814b34da46a5a8b50c3492a68a1b5be3af
commit 9fd4e1814b34da46a5a8b50c3492a68a1b5be3af
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Mon Aug 23 20:54:35 2010 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Mon Aug 23 20:54:35 2010 +0200

    Fix parsing of builtin macros so Eclipse handles them properly (#10868)
    
    Alex

diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake
index 9cb7bed..836e4c9 100644
--- a/Modules/CMakeFindEclipseCDT4.cmake
+++ b/Modules/CMakeFindEclipseCDT4.cmake
@@ -47,16 +47,21 @@ MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
 
   # now find the builtin macros:
   STRING(REGEX MATCHALL "#define[^\n]+\n" _defineLines "${_gccStdout}")
+# A few example lines which the regexp below has to match properly:
+#  #define   MAX(a,b) ((a) > (b) ? (a) : (b))
+#  #define __fastcall __attribute__((__fastcall__))
+#  #define   FOO (23)
+#  #define __UINTMAX_TYPE__ long long unsigned int
+#  #define __UINTMAX_TYPE__ long long unsigned int
+#  #define __i386__  1
 
   FOREACH(nextLine ${_defineLines})
-    STRING(REGEX REPLACE "#define " "" _defineRemoved "${nextLine}")
-# not sure why this longer regexp was in the patch, the shorter one in the line below seems to work just fine:
-#   STRING(REGEX MATCH "[A-Za-z_][A-Za-z0-9_]*|[A-Za-z_][A-Za-z0-9_]*\\([A-Za-z0-9_, ]*\\)" _name "${_defineRemoved}")
-    STRING(REGEX MATCH "[A-Za-z_][A-Za-z0-9_]*" _name "${_defineRemoved}")
-    LIST(APPEND ${_resultDefines} "${_name}")
+    STRING(REGEX MATCH "^#define +([A-Za-z_][A-Za-z0-9_]*)(\\([^\\)]+\\))? +(.+) *$" _dummy "${nextLine}")
+    SET(_name "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
+    STRING(STRIP "${CMAKE_MATCH_3}" _value)
+    #MESSAGE(STATUS "m1: -${CMAKE_MATCH_1}- m2: -${CMAKE_MATCH_2}- m3: -${CMAKE_MATCH_3}-")
 
-    STRING(REPLACE ${_name} "" _nameRemoved "${_defineRemoved}")
-    STRING(STRIP "${_nameRemoved}" _value)
+    LIST(APPEND ${_resultDefines} "${_name}")
     IF(_value)
       LIST(APPEND ${_resultDefines} "${_value}")
     ELSE()

-----------------------------------------------------------------------

Summary of changes:
 Modules/CMakeFindEclipseCDT4.cmake |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list