1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmAddDependenciesCommand.cxx,v $
6 Date: $Date: 2008-01-28 13:38:35 $
7 Version: $Revision: 1.17 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html 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"
18 #include "cmLocalGenerator.h"
19 #include "cmGlobalGenerator.h"
21 // cmDependenciesCommand
22 bool cmAddDependenciesCommand
23 ::InitialPass(std::vector
<std::string
> const& args
, cmExecutionStatus
&)
27 this->SetError("called with incorrect number of arguments");
31 std::string target_name
= args
[0];
34 this->GetMakefile()->GetLocalGenerator()->
35 GetGlobalGenerator()->FindTarget(0, target_name
.c_str());
38 std::vector
<std::string
>::const_iterator s
= args
.begin();
39 ++s
; // skip over target_name
40 for (; s
!= args
.end(); ++s
)
42 target
->AddUtility(s
->c_str());
47 std::string error
= "Adding dependency to non-existent target: ";
49 this->SetError(error
.c_str());