summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmGlobalGenerator.h4
-rw-r--r--Source/cmGlobalVisualStudioGenerator.h1
-rw-r--r--Source/cmLocalGenerator.cxx5
-rw-r--r--Source/cmMakefile.cxx40
4 files changed, 35 insertions, 15 deletions
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 4df2d39..914e1da 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -259,7 +259,9 @@ public:
bool BinaryDirectoryIsNew(const char* dir)
{
return this->BinaryDirectories.insert(dir).second;
- }
+ }
+ /** Supported systems creates a GUID for the given name */
+ virtual void CreateGUID(const char*) {}
protected:
// for a project collect all its targets by following depend
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index 408118a..e7b8e46 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -69,7 +69,6 @@ public:
const char* GetUtilityForTarget(cmTarget& target, const char*);
protected:
- virtual void CreateGUID(const char*) {}
void FixUtilityDepends();
// Does this VS version link targets to each other if there are
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 67fa280..fcbb566 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -43,8 +43,7 @@
cmLocalGenerator::cmLocalGenerator()
{
- this->Makefile = new cmMakefile;
- this->Makefile->SetLocalGenerator(this);
+ this->Makefile = 0; // moved to after set on global
this->Parent = 0;
this->WindowsShell = false;
this->WindowsVSIDE = false;
@@ -173,6 +172,8 @@ void cmLocalGenerator::SetupPathConversions()
void cmLocalGenerator::SetGlobalGenerator(cmGlobalGenerator *gg)
{
this->GlobalGenerator = gg;
+ this->Makefile = new cmMakefile;
+ this->Makefile->SetLocalGenerator(this);
// setup the home directories
this->Makefile->GetProperties().SetCMakeInstance(gg->GetCMakeInstance());
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 3451c4d..5edbaa6 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -80,17 +80,6 @@ cmMakefile::cmMakefile()
this->DefineFlags = " ";
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->Initialize();
this->PreOrder = false;
@@ -755,6 +744,20 @@ void cmMakefile::AddCommand(cmCommand* wg)
void cmMakefile::SetLocalGenerator(cmLocalGenerator* 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,
@@ -1956,10 +1959,25 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name,
}
// 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)
{
sg->AddChild(cmSourceGroup(name[i].c_str(), 0, sg->GetFullName()));
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);