summaryrefslogtreecommitdiffstats
path: root/Source/cmDefinePropertyCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2006-12-07 14:45:32 (GMT)
committerKen Martin <ken.martin@kitware.com>2006-12-07 14:45:32 (GMT)
commit27379d7b081be852c2b290a98db548cffffbff04 (patch)
treefcc9e19282bdfb71bf4bf9b1f8fcea1401c2fbd5 /Source/cmDefinePropertyCommand.cxx
parent833548f53a2ed799bb0df23fd7d973c30b423d1b (diff)
downloadCMake-27379d7b081be852c2b290a98db548cffffbff04.zip
CMake-27379d7b081be852c2b290a98db548cffffbff04.tar.gz
CMake-27379d7b081be852c2b290a98db548cffffbff04.tar.bz2
ENH: make properties a bit more formal with documentation and chaining
Diffstat (limited to 'Source/cmDefinePropertyCommand.cxx')
-rw-r--r--Source/cmDefinePropertyCommand.cxx64
1 files changed, 64 insertions, 0 deletions
diff --git a/Source/cmDefinePropertyCommand.cxx b/Source/cmDefinePropertyCommand.cxx
new file mode 100644
index 0000000..15a8cf5
--- /dev/null
+++ b/Source/cmDefinePropertyCommand.cxx
@@ -0,0 +1,64 @@
+/*=========================================================================
+
+ 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 "cmDefinePropertyCommand.h"
+#include "cmake.h"
+
+// cmDefinePropertiesCommand
+bool cmDefinePropertyCommand::InitialPass(
+ std::vector<std::string> const& args)
+{
+ if(args.size() < 5 )
+ {
+ this->SetError("called with incorrect number of arguments");
+ return false;
+ }
+
+ // determine the scope
+ cmProperty::ScopeType scope;
+ if (args[1] == "GLOBAL")
+ {
+ scope = cmProperty::GLOBAL;
+ }
+ else if (args[1] == "DIRECTORY")
+ {
+ scope = cmProperty::DIRECTORY;
+ }
+ else if (args[1] == "TARGET")
+ {
+ scope = cmProperty::TARGET;
+ }
+ else if (args[1] == "SOURCE_FILE")
+ {
+ scope = cmProperty::SOURCE_FILE;
+ }
+ else if (args[1] == "TEST")
+ {
+ scope = cmProperty::TEST;
+ }
+ else
+ {
+ this->SetError("called with illegal arguments.");
+ return false;
+ }
+
+ this->Makefile->GetCMakeInstance()->DefineProperty
+ (args[0].c_str(), scope,args[2].c_str(), args[3].c_str(),
+ cmSystemTools::IsOn(args[4].c_str()));
+
+ return true;
+}
+