summaryrefslogtreecommitdiffstats
path: root/Source/cmGetTargetPropertyCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-12-21 16:14:47 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-12-21 16:14:47 (GMT)
commit1161d76bc609840d5f7bccc8157ff6f757d9d67f (patch)
tree7f71df64885667568ea0ae15b75ffbdb9d05b746 /Source/cmGetTargetPropertyCommand.cxx
parent3859417d1a6b583b6c84806b109426a85cfface6 (diff)
downloadCMake-1161d76bc609840d5f7bccc8157ff6f757d9d67f.zip
CMake-1161d76bc609840d5f7bccc8157ff6f757d9d67f.tar.gz
CMake-1161d76bc609840d5f7bccc8157ff6f757d9d67f.tar.bz2
ENH: add target properties files
Diffstat (limited to 'Source/cmGetTargetPropertyCommand.cxx')
-rw-r--r--Source/cmGetTargetPropertyCommand.cxx45
1 files changed, 45 insertions, 0 deletions
diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx
new file mode 100644
index 0000000..21626ac
--- /dev/null
+++ b/Source/cmGetTargetPropertyCommand.cxx
@@ -0,0 +1,45 @@
+/*=========================================================================
+
+ 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 "cmGetTargetPropertyCommand.h"
+
+// cmSetTargetPropertyCommand
+bool cmGetTargetPropertyCommand::InitialPass(
+ std::vector<std::string> const& args)
+{
+ if(args.size() != 3 )
+ {
+ this->SetError("called with incorrect number of arguments");
+ return false;
+ }
+ const char* var = args[0].c_str();
+ const char* targetName = args[1].c_str();
+ cmTargets& targets = m_Makefile->GetTargets();
+ cmTargets::iterator i = targets.find(targetName);
+ if ( i != targets.end())
+ {
+ cmTarget& target = i->second;
+ const char *prop = target.GetProperty(args[2].c_str());
+ if (prop)
+ {
+ m_Makefile->AddDefinition(var, prop);
+ return true;
+ }
+ }
+ m_Makefile->AddDefinition(var, "NOT_FOUND");
+ return true;
+}
+