1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmInstallTargetsCommand.cxx,v $
6 Date: $Date: 2008-07-08 15:52:25 $
7 Version: $Revision: 1.16 $
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 "cmInstallTargetsCommand.h"
19 // cmExecutableCommand
20 bool cmInstallTargetsCommand
21 ::InitialPass(std::vector
<std::string
> const& args
, cmExecutionStatus
&)
25 this->SetError("called with incorrect number of arguments");
29 // Enable the install target.
30 this->Makefile
->GetLocalGenerator()
31 ->GetGlobalGenerator()->EnableInstallTarget();
33 cmTargets
&tgts
= this->Makefile
->GetTargets();
34 std::vector
<std::string
>::const_iterator s
= args
.begin();
36 std::string runtime_dir
= "/bin";
37 for (;s
!= args
.end(); ++s
)
39 if (*s
== "RUNTIME_DIRECTORY")
42 if ( s
== args
.end() )
44 this->SetError("called with RUNTIME_DIRECTORY but no actual "
51 else if (tgts
.find(*s
) != tgts
.end())
53 tgts
[*s
].SetInstallPath(args
[0].c_str());
54 tgts
[*s
].SetRuntimeInstallPath(runtime_dir
.c_str());
55 tgts
[*s
].SetHaveInstallRule(true);
59 std::string str
= "Cannot find target: \"" + *s
+ "\" to install.";
60 this->SetError(str
.c_str());
65 this->Makefile
->GetLocalGenerator()->GetGlobalGenerator()
66 ->AddInstallComponent("Unspecified");