[cmake-commits] alex committed cmIfCommand.cxx 1.78 1.79 cmIfCommand.h 1.41 1.42

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Jun 6 08:49:20 EDT 2007


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv11335

Modified Files:
	cmIfCommand.cxx cmIfCommand.h 
Log Message:

ENH: add IF(IS_ABSOLUTE path), so no regex matching is required in the cmake scripts

Alex


Index: cmIfCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.cxx,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- cmIfCommand.cxx	17 May 2007 21:40:59 -0000	1.78
+++ cmIfCommand.cxx	6 Jun 2007 12:49:18 -0000	1.79
@@ -287,6 +287,22 @@
         IncrementArguments(newArgs,argP1,argP2);
         reducible = 1;
         }
+      // is the given path an absolute path ?
+      if (*arg == "IS_ABSOLUTE" && argP1  != newArgs.end())
+        {
+        if(cmSystemTools::FileIsFullPath((argP1)->c_str()))
+          {
+          *arg = "1";
+          }
+        else 
+          {
+          *arg = "0";
+          }
+        newArgs.erase(argP1);
+        argP1 = arg;
+        IncrementArguments(newArgs,argP1,argP2);
+        reducible = 1;
+        }
       // does a command exist
       if (*arg == "COMMAND" && argP1  != newArgs.end())
         {

Index: cmIfCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- cmIfCommand.h	26 Jan 2007 20:06:07 -0000	1.41
+++ cmIfCommand.h	6 Jun 2007 12:49:18 -0000	1.42
@@ -143,6 +143,8 @@
       "  IF(IS_DIRECTORY directory-name)\n"
       "True if the given name is a directory.  "
       "Behavior is well-defined only for full paths.\n"
+      "  IF(IS_ABSOLUTE path)\n"
+      "True if the given path is an absolute path.\n "
       "  IF(variable MATCHES regex)\n"
       "  IF(string MATCHES regex)\n"
       "True if the given string or variable's value matches the given "



More information about the Cmake-commits mailing list