1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #include "cmAddDependenciesCommand.h"
13 #include "cmLocalGenerator.h"
14 #include "cmGlobalGenerator.h"
16 // cmDependenciesCommand
17 bool cmAddDependenciesCommand
18 ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
22 this->SetError("called with incorrect number of arguments");
26 std::string target_name = args[0];
27 if(cmTarget* target = this->Makefile->FindTargetToUse(target_name.c_str()))
29 std::vector<std::string>::const_iterator s = args.begin();
30 ++s; // skip over target_name
31 for (; s != args.end(); ++s)
33 target->AddUtility(s->c_str());
38 std::string error = "Adding dependency to non-existent target: ";
40 this->SetError(error.c_str());