[cmake-commits] alex committed cmMakefile.cxx 1.403 1.404
cmake-commits at cmake.org
cmake-commits at cmake.org
Mon Jul 16 13:26:58 EDT 2007
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv12443/Source
Modified Files:
cmMakefile.cxx
Log Message:
BUG: GET_DIRECTORY_PROPERTY(INCLUDE_DIRECTORIES|LINK_DIRECTORIES) wasn't
working, for both the result was always empty, since
cmMakefile::GetProperty() recognized it as a special property, constructed a
correct return value and called cmMakefile::SetProperty() with this list of
directories, which then didn't actually set the property, but applied it to
the internal vector of include/link directories. The following
getPropertyValue in cmMakefile::GetProperty() then still didn't find it and
returned nothing. Now for all special property the static string output is
used and its content is returned. I'm not sure it is the right way to fix
this problem but at least it seems to work and it fixes the Paraview3 build
Alex
Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.403
retrieving revision 1.404
diff -u -d -r1.403 -r1.404
--- cmMakefile.cxx 11 Jul 2007 19:50:32 -0000 1.403
+++ cmMakefile.cxx 16 Jul 2007 17:26:56 -0000 1.404
@@ -2592,30 +2592,33 @@
cmProperty::ScopeType scope)
{
// watch for specific properties
+ static std::string output;
+ output = "";
if (!strcmp("PARENT_DIRECTORY",prop))
{
- return this->LocalGenerator->GetParent()
+ output = this->LocalGenerator->GetParent()
->GetMakefile()->GetStartDirectory();
+ return output.c_str();
}
- // watch for specific properties
- if (!strcmp("LISTFILE_STACK",prop))
+ else if (!strcmp("INCLUDE_REGULAR_EXPRESSION",prop) )
{
- std::string tmp;
- for (std::deque<cmStdString>::iterator i = this->ListFileStack.begin();
+ output = this->GetIncludeRegularExpression();
+ return output.c_str();
+ }
+ else if (!strcmp("LISTFILE_STACK",prop))
+ {
+ for (std::deque<cmStdString>::const_iterator i = this->ListFileStack.begin();
i != this->ListFileStack.end(); ++i)
{
if (i != this->ListFileStack.begin())
{
- tmp += ";";
+ output += ";";
}
- tmp += *i;
+ output += *i;
}
- this->SetProperty("LISTFILE_STACK",tmp.c_str());
+ return output.c_str();
}
-
- // some other special properties sigh
- std::string output = "";
- if (!strcmp("VARIABLES",prop) || !strcmp("CACHE_VARIABLES",prop))
+ else if (!strcmp("VARIABLES",prop) || !strcmp("CACHE_VARIABLES",prop))
{
int cacheonly = 0;
if ( !strcmp("CACHE_VARIABLES",prop) )
@@ -2631,59 +2634,51 @@
}
output += vars[cc];
}
- this->SetProperty(prop, output.c_str());
+ return output.c_str();
}
else if (!strcmp("MACROS",prop))
{
this->GetListOfMacros(output);
- this->SetProperty(prop, output.c_str());
+ return output.c_str();
}
else if (!strcmp("DEFINITIONS",prop))
{
output = this->GetDefineFlags();
- this->SetProperty(prop, output.c_str());
+ return output.c_str();
}
else if (!strcmp("INCLUDE_DIRECTORIES",prop) )
{
- std::vector<std::string>::iterator it;
- int first = 1;
cmOStringStream str;
- for ( it = this->GetIncludeDirectories().begin();
- it != this->GetIncludeDirectories().end();
- ++ it )
+ for (std::vector<std::string>::const_iterator
+ it = this->GetIncludeDirectories().begin();
+ it != this->GetIncludeDirectories().end();
+ ++ it )
{
- if ( !first )
+ if ( it != this->GetIncludeDirectories().begin())
{
str << ";";
}
str << it->c_str();
- first = 0;
}
output = str.str();
- this->SetProperty(prop, output.c_str());
- }
- else if (!strcmp("INCLUDE_REGULAR_EXPRESSION",prop) )
- {
- return this->GetIncludeRegularExpression();
+ return output.c_str();
}
else if (!strcmp("LINK_DIRECTORIES",prop))
{
- std::vector<std::string>::iterator it;
- int first = 1;
cmOStringStream str;
- for ( it = this->GetLinkDirectories().begin();
- it != this->GetLinkDirectories().end();
- ++ it )
+ for (std::vector<std::string>::const_iterator
+ it = this->GetLinkDirectories().begin();
+ it != this->GetLinkDirectories().end();
+ ++ it )
{
- if ( !first )
+ if ( it != this->GetLinkDirectories().begin())
{
str << ";";
}
str << it->c_str();
- first = 0;
}
output = str.str();
- this->SetProperty(prop, output.c_str());
+ return output.c_str();
}
bool chain = false;
More information about the Cmake-commits
mailing list