1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmInstallTargetsCommand.cxx,v $
6 <<<<<<< cmInstallTargetsCommand.cxx
7 Date: $Date: 2008/01/23 15:27:59 $
8 Version: $Revision: 1.15 $
10 Date: $Date: 2008-07-08 15:52:25 $
11 Version: $Revision: 1.16 $
14 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
15 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
17 This software is distributed WITHOUT ANY WARRANTY; without even
18 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
19 PURPOSE. See the above copyright notices for more information.
21 =========================================================================*/
22 #include "cmInstallTargetsCommand.h"
24 // cmExecutableCommand
25 bool cmInstallTargetsCommand
26 ::InitialPass(std::vector
<std::string
> const& args
, cmExecutionStatus
&)
30 this->SetError("called with incorrect number of arguments");
34 // Enable the install target.
35 this->Makefile
->GetLocalGenerator()
36 ->GetGlobalGenerator()->EnableInstallTarget();
38 cmTargets
&tgts
= this->Makefile
->GetTargets();
39 std::vector
<std::string
>::const_iterator s
= args
.begin();
41 std::string runtime_dir
= "/bin";
42 for (;s
!= args
.end(); ++s
)
44 if (*s
== "RUNTIME_DIRECTORY")
47 if ( s
== args
.end() )
49 this->SetError("called with RUNTIME_DIRECTORY but no actual "
56 else if (tgts
.find(*s
) != tgts
.end())
58 tgts
[*s
].SetInstallPath(args
[0].c_str());
59 tgts
[*s
].SetRuntimeInstallPath(runtime_dir
.c_str());
60 tgts
[*s
].SetHaveInstallRule(true);
64 std::string str
= "Cannot find target: \"" + *s
+ "\" to install.";
65 this->SetError(str
.c_str());
70 this->Makefile
->GetLocalGenerator()->GetGlobalGenerator()
71 ->AddInstallComponent("Unspecified");