updated to match the SET

This commit is contained in:
Ken Martin 2002-08-26 15:22:31 -04:00
parent ae6e90e872
commit b8be208408
2 changed files with 14 additions and 23 deletions

View File

@ -17,8 +17,8 @@
#include "cmGetSourceFilePropertyCommand.h" #include "cmGetSourceFilePropertyCommand.h"
// cmSetSourceFilePropertyCommand // cmSetSourceFilePropertyCommand
bool cmGetSourceFilePropertyCommand::InitialPass(std::vector<std::string> const& bool cmGetSourceFilePropertyCommand::InitialPass(
args) std::vector<std::string> const& args)
{ {
if(args.size() != 3 ) if(args.size() != 3 )
{ {
@ -28,28 +28,18 @@ bool cmGetSourceFilePropertyCommand::InitialPass(std::vector<std::string> const&
const char* var = args[0].c_str(); const char* var = args[0].c_str();
const char* file = args[1].c_str(); const char* file = args[1].c_str();
cmSourceFile* sf = m_Makefile->GetSource(file); cmSourceFile* sf = m_Makefile->GetSource(file);
if(sf) if(sf)
{ {
if(args[2] == "ABSTRACT") const char *prop = sf->GetProperty(args[2].c_str());
if (prop)
{ {
m_Makefile->AddDefinition(var, sf->GetPropertyAsBool("ABSTRACT")); m_Makefile->AddDefinition(var, prop);
} return true;
if(args[2] == "WRAP_EXCLUDE")
{
m_Makefile->AddDefinition(var, sf->GetPropertyAsBool("WRAP_EXCLUDE"));
}
if(args[2] == "COMPILE_FLAGS")
{
m_Makefile->AddDefinition(var, sf->GetProperty("COMPILE_FLAGS"));
} }
} }
else
{ m_Makefile->AddDefinition(var, "NOT_FOUND");
std::string m = "Could not find source file: ";
m += file;
this->SetError(m.c_str());
return false;
}
return true; return true;
} }

View File

@ -44,7 +44,7 @@ public:
*/ */
virtual const char* GetTerseDocumentation() virtual const char* GetTerseDocumentation()
{ {
return "Set attributes for a specific list of files."; return "Get a property for a file";
} }
/** /**
@ -53,9 +53,10 @@ public:
virtual const char* GetFullDocumentation() virtual const char* GetFullDocumentation()
{ {
return return
"GET_SOURCE_FILE_PROPERTY(VAR file [ABSTRACT|WRAP_EXCLUDE|COMPILE_FLAGS]) " "GET_SOURCE_FILE_PROPERTY(VAR file property) "
"Get a property from a source file. The value of the property is stored " "Get a property from a source file. The value of the property is "
"in the variable VAR."; " stored in the variable VAR. If the property is not found, var "
"will be set to NOT_FOUND";
} }
cmTypeMacro(cmGetSourceFilePropertyCommand, cmCommand); cmTypeMacro(cmGetSourceFilePropertyCommand, cmCommand);