1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #include "cmGetCMakePropertyCommand.h"
14 #include "cmGlobalGenerator.h"
15 #include "cmLocalGenerator.h"
18 // cmGetCMakePropertyCommand
19 bool cmGetCMakePropertyCommand
20 ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
24 this->SetError("called with incorrect number of arguments");
28 std::vector<std::string>::size_type cc;
29 std::string variable = args[0];
30 std::string output = "NOTFOUND";
32 if ( args[1] == "VARIABLES" )
35 std::vector<std::string> vars = this->Makefile->GetDefinitions(cacheonly);
40 for ( cc = 1; cc < vars.size(); ++cc )
46 else if ( args[1] == "MACROS" )
48 this->Makefile->GetListOfMacros(output);
50 else if ( args[1] == "COMPONENTS" )
52 const std::set<cmStdString>* components
53 = this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
54 ->GetInstallComponents();
55 std::set<cmStdString>::const_iterator compIt;
57 for (compIt = components->begin(); compIt != components->end(); ++compIt)
59 if (compIt != components->begin())
69 this->Makefile->GetCMakeInstance()->GetProperty(args[1].c_str());
76 this->Makefile->AddDefinition(variable.c_str(), output.c_str());