summaryrefslogtreecommitdiffstats
path: root/Source/cmGetTestPropertyCommand.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-07-31 15:51:42 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-07-31 15:51:42 (GMT)
commitbebc745824920465c9df5fee9baf9b6f8a35d34f (patch)
tree958f9a784bd1aa1960fcd318d6123b5c928a0dc0 /Source/cmGetTestPropertyCommand.cxx
parentec3f3b5a2db2c0d60fe2dbe31b21cf937fc8264e (diff)
downloadCMake-bebc745824920465c9df5fee9baf9b6f8a35d34f.zip
CMake-bebc745824920465c9df5fee9baf9b6f8a35d34f.tar.gz
CMake-bebc745824920465c9df5fee9baf9b6f8a35d34f.tar.bz2
ENH: Add set and get test propety command
Diffstat (limited to 'Source/cmGetTestPropertyCommand.cxx')
-rw-r--r--Source/cmGetTestPropertyCommand.cxx47
1 files changed, 47 insertions, 0 deletions
diff --git a/Source/cmGetTestPropertyCommand.cxx b/Source/cmGetTestPropertyCommand.cxx
new file mode 100644
index 0000000..3e75f88
--- /dev/null
+++ b/Source/cmGetTestPropertyCommand.cxx
@@ -0,0 +1,47 @@
+/*=========================================================================
+
+ Program: CMake - Cross-Platform Makefile Generator
+ Module: $RCSfile$
+ Language: C++
+ Date: $Date$
+ Version: $Revision$
+
+ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
+ See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+#include "cmGetTestPropertyCommand.h"
+
+#include "cmake.h"
+#include "cmTest.h"
+
+// cmGetTestPropertyCommand
+bool cmGetTestPropertyCommand::InitialPass(
+ std::vector<std::string> const& args)
+{
+ if(args.size() < 3 )
+ {
+ this->SetError("called with incorrect number of arguments");
+ return false;
+ }
+
+ std::string testName = args[0];
+ std::string var = args[1];
+ cmTest *test = m_Makefile->GetTest(testName.c_str());
+ if (test)
+ {
+ const char *prop = test->GetProperty(args[2].c_str());
+ if (prop)
+ {
+ m_Makefile->AddDefinition(var.c_str(), prop);
+ return true;
+ }
+ }
+ m_Makefile->AddDefinition(var.c_str(), "NOTFOUND");
+ return true;
+}
+