ENH: mark some vars as advanced (and resort the list)
[cmake.git] / Source / cmAddDependenciesCommand.cxx
blob14c6da21e2bcd58cba0881949afafb24c26becf8
1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmAddDependenciesCommand.cxx,v $
5 Language: C++
6 Date: $Date: 2002-09-27 20:22:05 $
7 Version: $Revision: 1.9 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #include "cmAddDependenciesCommand.h"
19 // cmDependenciesCommand
20 bool cmAddDependenciesCommand::InitialPass(std::vector<std::string> const& argsIn)
22 if(argsIn.size() < 2 )
24 this->SetError("called with incorrect number of arguments");
25 return false;
27 std::vector<std::string> args;
28 cmSystemTools::ExpandListArguments(argsIn, args);
30 std::string target_name = args[0];
32 cmTargets &tgts = m_Makefile->GetTargets();
33 if (tgts.find(target_name) != tgts.end())
35 std::vector<std::string>::const_iterator s = args.begin();
36 ++s;
37 for (; s != args.end(); ++s)
39 tgts[target_name].AddUtility(s->c_str());
42 else
44 std::string error = "Adding dependency to non-existent target: ";
45 error += target_name;
46 this->SetError(error.c_str());
47 return false;
51 return true;