Browse Source

ENH: Add method to populate custom integers

Andy Cedilnik 21 years ago
parent
commit
f7063fc661
2 changed files with 15 additions and 0 deletions
  1. 14 0
      Source/cmCTest.cxx
  2. 1 0
      Source/cmCTest.h

+ 14 - 0
Source/cmCTest.cxx

@@ -2148,6 +2148,20 @@ void cmCTest::PopulateCustomVector(cmMakefile* mf, const char* def, tm_VectorOfS
     }
 }
 
+void cmCTest::PopulateCustomInteger(cmMakefile* mf, const char* def, int& val)
+{
+  if ( !def)
+    {
+    return;
+    }
+  const char* dval = mf->GetDefinition(def);
+  if ( !dval )
+    {
+    return;
+    }
+  val = atoi(dval);
+}
+
 std::string cmCTest::GetShortPathToFile(const char* cfname)
 {
   const std::string& sourceDir = GetDartConfiguration("SourceDirectory");

+ 1 - 0
Source/cmCTest.h

@@ -172,6 +172,7 @@ public:
 
   static void PopulateCustomVector(cmMakefile* mf, const char* definition, 
                                    tm_VectorOfStrings& vec);
+  static void PopulateCustomInteger(cmMakefile* mf, const char* def, int& val);
 
   std::string GetToplevelPath();