1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmGetCMakePropertyCommand.cxx,v $
6 <<<<<<< cmGetCMakePropertyCommand.cxx
7 Date: $Date: 2008/01/23 15:27:59 $
8 Version: $Revision: 1.8 $
10 Date: $Date: 2008-07-08 15:52:25 $
11 Version: $Revision: 1.9 $
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 "cmGetCMakePropertyCommand.h"
26 // cmGetCMakePropertyCommand
27 bool cmGetCMakePropertyCommand
28 ::InitialPass(std::vector
<std::string
> const& args
, cmExecutionStatus
&)
32 this->SetError("called with incorrect number of arguments");
36 std::vector
<std::string
>::size_type cc
;
37 std::string variable
= args
[0];
38 std::string output
= "NOTFOUND";
40 if ( args
[1] == "VARIABLES")
43 std::vector
<std::string
> vars
= this->Makefile
->GetDefinitions(cacheonly
);
44 for ( cc
= 0; cc
< vars
.size(); cc
++ )
53 else if ( args
[1] == "MACROS" )
55 this->Makefile
->GetListOfMacros(output
);
57 else if ( args
[1] == "COMPONENTS" )
59 const std::set
<cmStdString
>* components
60 = this->Makefile
->GetLocalGenerator()->GetGlobalGenerator()
61 ->GetInstallComponents();
62 std::set
<cmStdString
>::const_iterator compIt
;
64 for (compIt
= components
->begin(); compIt
!= components
->end(); ++compIt
)
66 if (compIt
!= components
->begin())
76 this->Makefile
->GetCMakeInstance()->GetProperty(args
[1].c_str());
82 this->Makefile
->AddDefinition(variable
.c_str(), output
.c_str());