summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-01-26 15:10:41 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-01-26 15:10:41 (GMT)
commitf7063fc6612ad461e0d1a6dbc5a6da2366c0812e (patch)
tree8da6d57c76a902acc2fb253fb7e8030a41a0f799 /Source
parentcbe845f7ef7a998a3b41f42ac5696432176a0a21 (diff)
downloadCMake-f7063fc6612ad461e0d1a6dbc5a6da2366c0812e.zip
CMake-f7063fc6612ad461e0d1a6dbc5a6da2366c0812e.tar.gz
CMake-f7063fc6612ad461e0d1a6dbc5a6da2366c0812e.tar.bz2
ENH: Add method to populate custom integers
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCTest.cxx14
-rw-r--r--Source/cmCTest.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 4080811..302ba52 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 2039350..2fdb033 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();