1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmGetCMakePropertyCommand.cxx,v $
6 Date: $Date: 2008-07-08 15:52:25 $
7 Version: $Revision: 1.9 $
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 "cmGetCMakePropertyCommand.h"
21 // cmGetCMakePropertyCommand
22 bool cmGetCMakePropertyCommand
23 ::InitialPass(std::vector
<std::string
> const& args
, cmExecutionStatus
&)
27 this->SetError("called with incorrect number of arguments");
31 std::vector
<std::string
>::size_type cc
;
32 std::string variable
= args
[0];
33 std::string output
= "NOTFOUND";
35 if ( args
[1] == "VARIABLES")
38 std::vector
<std::string
> vars
= this->Makefile
->GetDefinitions(cacheonly
);
39 for ( cc
= 0; cc
< vars
.size(); cc
++ )
48 else if ( args
[1] == "MACROS" )
50 this->Makefile
->GetListOfMacros(output
);
52 else if ( args
[1] == "COMPONENTS" )
54 const std::set
<cmStdString
>* components
55 = this->Makefile
->GetLocalGenerator()->GetGlobalGenerator()
56 ->GetInstallComponents();
57 std::set
<cmStdString
>::const_iterator compIt
;
59 for (compIt
= components
->begin(); compIt
!= components
->end(); ++compIt
)
61 if (compIt
!= components
->begin())
71 this->Makefile
->GetCMakeInstance()->GetProperty(args
[1].c_str());
77 this->Makefile
->AddDefinition(variable
.c_str(), output
.c_str());