ENH: make sure GUIDs for filters are cached
This commit is contained in:
parent
1be805609c
commit
300514fd25
|
@ -259,7 +259,9 @@ public:
|
||||||
bool BinaryDirectoryIsNew(const char* dir)
|
bool BinaryDirectoryIsNew(const char* dir)
|
||||||
{
|
{
|
||||||
return this->BinaryDirectories.insert(dir).second;
|
return this->BinaryDirectories.insert(dir).second;
|
||||||
}
|
}
|
||||||
|
/** Supported systems creates a GUID for the given name */
|
||||||
|
virtual void CreateGUID(const char*) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// for a project collect all its targets by following depend
|
// for a project collect all its targets by following depend
|
||||||
|
|
|
@ -69,7 +69,6 @@ public:
|
||||||
const char* GetUtilityForTarget(cmTarget& target, const char*);
|
const char* GetUtilityForTarget(cmTarget& target, const char*);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void CreateGUID(const char*) {}
|
|
||||||
void FixUtilityDepends();
|
void FixUtilityDepends();
|
||||||
|
|
||||||
// Does this VS version link targets to each other if there are
|
// Does this VS version link targets to each other if there are
|
||||||
|
|
|
@ -43,8 +43,7 @@
|
||||||
|
|
||||||
cmLocalGenerator::cmLocalGenerator()
|
cmLocalGenerator::cmLocalGenerator()
|
||||||
{
|
{
|
||||||
this->Makefile = new cmMakefile;
|
this->Makefile = 0; // moved to after set on global
|
||||||
this->Makefile->SetLocalGenerator(this);
|
|
||||||
this->Parent = 0;
|
this->Parent = 0;
|
||||||
this->WindowsShell = false;
|
this->WindowsShell = false;
|
||||||
this->WindowsVSIDE = false;
|
this->WindowsVSIDE = false;
|
||||||
|
@ -173,6 +172,8 @@ void cmLocalGenerator::SetupPathConversions()
|
||||||
void cmLocalGenerator::SetGlobalGenerator(cmGlobalGenerator *gg)
|
void cmLocalGenerator::SetGlobalGenerator(cmGlobalGenerator *gg)
|
||||||
{
|
{
|
||||||
this->GlobalGenerator = gg;
|
this->GlobalGenerator = gg;
|
||||||
|
this->Makefile = new cmMakefile;
|
||||||
|
this->Makefile->SetLocalGenerator(this);
|
||||||
|
|
||||||
// setup the home directories
|
// setup the home directories
|
||||||
this->Makefile->GetProperties().SetCMakeInstance(gg->GetCMakeInstance());
|
this->Makefile->GetProperties().SetCMakeInstance(gg->GetCMakeInstance());
|
||||||
|
|
|
@ -80,17 +80,6 @@ cmMakefile::cmMakefile()
|
||||||
this->DefineFlags = " ";
|
this->DefineFlags = " ";
|
||||||
this->LocalGenerator = 0;
|
this->LocalGenerator = 0;
|
||||||
|
|
||||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
|
||||||
this->AddSourceGroup("", "^.*$");
|
|
||||||
this->AddSourceGroup
|
|
||||||
("Source Files",
|
|
||||||
"\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|f90|for|fpp"
|
|
||||||
"|ftn|m|mm|rc|def|r|odl|idl|hpj|bat)$");
|
|
||||||
this->AddSourceGroup("Header Files",
|
|
||||||
"\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$");
|
|
||||||
this->AddSourceGroup("CMake Rules", "\\.rule$");
|
|
||||||
this->AddSourceGroup("Resources", "\\.plist$");
|
|
||||||
#endif
|
|
||||||
this->AddDefaultDefinitions();
|
this->AddDefaultDefinitions();
|
||||||
this->Initialize();
|
this->Initialize();
|
||||||
this->PreOrder = false;
|
this->PreOrder = false;
|
||||||
|
@ -755,6 +744,20 @@ void cmMakefile::AddCommand(cmCommand* wg)
|
||||||
void cmMakefile::SetLocalGenerator(cmLocalGenerator* lg)
|
void cmMakefile::SetLocalGenerator(cmLocalGenerator* lg)
|
||||||
{
|
{
|
||||||
this->LocalGenerator = lg;
|
this->LocalGenerator = lg;
|
||||||
|
// the source groups need to access the global generator
|
||||||
|
// so don't create them until the lg is set
|
||||||
|
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||||
|
this->AddSourceGroup("", "^.*$");
|
||||||
|
this->AddSourceGroup
|
||||||
|
("Source Files",
|
||||||
|
"\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|f90|for|fpp"
|
||||||
|
"|ftn|m|mm|rc|def|r|odl|idl|hpj|bat)$");
|
||||||
|
this->AddSourceGroup("Header Files",
|
||||||
|
"\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$");
|
||||||
|
this->AddSourceGroup("CMake Rules", "\\.rule$");
|
||||||
|
this->AddSourceGroup("Resources", "\\.plist$");
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmMakefile::NeedBackwardsCompatibility(unsigned int major,
|
bool cmMakefile::NeedBackwardsCompatibility(unsigned int major,
|
||||||
|
@ -1956,10 +1959,25 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name,
|
||||||
}
|
}
|
||||||
|
|
||||||
// build the whole source group path
|
// build the whole source group path
|
||||||
|
const char* fullname = sg->GetFullName();
|
||||||
|
cmGlobalGenerator* gg = this->LocalGenerator->GetGlobalGenerator();
|
||||||
|
if(strlen(fullname))
|
||||||
|
{
|
||||||
|
std::string guidName = "SG_Filter_";
|
||||||
|
guidName += fullname;
|
||||||
|
gg->CreateGUID(guidName.c_str());
|
||||||
|
}
|
||||||
for(++i; i<=lastElement; ++i)
|
for(++i; i<=lastElement; ++i)
|
||||||
{
|
{
|
||||||
sg->AddChild(cmSourceGroup(name[i].c_str(), 0, sg->GetFullName()));
|
sg->AddChild(cmSourceGroup(name[i].c_str(), 0, sg->GetFullName()));
|
||||||
sg = sg->lookupChild(name[i].c_str());
|
sg = sg->lookupChild(name[i].c_str());
|
||||||
|
fullname = sg->GetFullName();
|
||||||
|
if(strlen(fullname))
|
||||||
|
{
|
||||||
|
std::string guidName = "SG_Filter_";
|
||||||
|
guidName += fullname;
|
||||||
|
gg->CreateGUID(guidName.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sg->SetGroupRegex(regex);
|
sg->SetGroupRegex(regex);
|
||||||
|
|
Loading…
Reference in New Issue