[Orxonox-commit 97] r2792 - trunk/cmake

rgrieder at orxonox.net rgrieder at orxonox.net
Mon Mar 16 22:42:10 CET 2009


Author: rgrieder
Date: 2009-03-16 21:42:09 +0000 (Mon, 16 Mar 2009)
New Revision: 2792

Modified:
   trunk/cmake/FlagUtilities.cmake
Log:
Finally found the MSVC IntelliSense bug! It wasn't working at all, so there was helping information about any symbol, class, function or macro. That was very annoying...
Turned out the compiler likes "-" to start a compiler switch, but IntelliSense doesn't like that at all. Using "/" instead.

Modified: trunk/cmake/FlagUtilities.cmake
===================================================================
--- trunk/cmake/FlagUtilities.cmake	2009-03-16 12:21:57 UTC (rev 2791)
+++ trunk/cmake/FlagUtilities.cmake	2009-03-16 21:42:09 UTC (rev 2792)
@@ -53,6 +53,14 @@
   ENDIF()
 ENDMACRO(SET_CACHE)
 
+# Visual studio (esp. IntelliSense) doesn't like dashes to specify arguments
+# Always use foward slashes instead
+IF(MSVC)
+  SET(ARGUMENT_STARTER "/")
+ELSE()
+  SET(ARGUMENT_STARTER "-")
+ENDIF(MSVC)
+
 # Separates a string of flags. " -" or " /" denotes the start of a flag.
 # The same sequence inside double quotation marks is ignored.
 # Spaces not within quotes are cleaned meaningfully.
@@ -70,7 +78,7 @@
            "\\1 at 39535493@\\3" _flag_string "${_flag_string}")
     # Extract one flag if possible
     SET(_flag)
-    STRING(REGEX REPLACE "^.* [/-](.+)( [/-].*$)" "-\\1" _flag "${_flag_string}")
+    STRING(REGEX REPLACE "^.* [/-](.+)( [/-].*$)" "${ARGUMENT_STARTER}\\1" _flag "${_flag_string}")
     STRING(REGEX REPLACE "^.* [/-](.+)( [/-].*$)" "\\2"  _flag_string "${_flag_string}")
     IF(NOT _flag STREQUAL _flag_string)
       LIST(APPEND _parsed_flags "${_flag}")




More information about the Orxonox-commit mailing list