From f7063fc6612ad461e0d1a6dbc5a6da2366c0812e Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 26 Jan 2005 10:10:41 -0500 Subject: [PATCH] ENH: Add method to populate custom integers --- Source/cmCTest.cxx | 14 ++++++++++++++ Source/cmCTest.h | 1 + 2 files changed, 15 insertions(+) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 4080811cf..302ba52d6 100644 --- a/Source/cmCTest.cxx +++ b/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"); diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 2039350f1..2fdb0330a 100644 --- a/Source/cmCTest.h +++ b/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();