summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-05-09 14:41:38 -0400
committerAlexander Neundorf <neundorf@kde.org>2007-05-09 14:41:38 -0400
commit8245f437b6528cfa86dda12e566a32c810f2d64a (patch)
tree2a7cbdef5bc06663e403b19af241b1acb7402d63
parent181f4cb0aff97af0b5251ad3347e00efe7310ba9 (diff)
downloadcmake-8245f437b6528cfa86dda12e566a32c810f2d64a.tar.gz
BUG: fix problem for non-C/CXX languages with Visual Studio, the
dependencies for the custom commands added for java were not handled correctly. Needs more work. Alex
-rw-r--r--Source/cmGlobalGenerator.cxx29
-rw-r--r--Source/cmGlobalGenerator.h2
-rw-r--r--Source/cmLocalGenerator.h4
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx9
-rw-r--r--Source/cmLocalVisualStudio6Generator.h4
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx7
-rw-r--r--Source/cmLocalVisualStudio7Generator.h4
7 files changed, 36 insertions, 23 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 16913086b3..6273f15b38 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -717,14 +717,12 @@ void cmGlobalGenerator::Configure()
}
// at this point this->LocalGenerators has been filled,
// so create the map from project name to vector of local generators
- this->FillProjectMap();
+ this->FillProjectMap();
// now create project to target map
// This will make sure that targets have all the
// targets they depend on as part of the build.
- this->FillProjectToTargetMap();
- // now trace all dependencies
- this->TraceDependencies();
-
+ this->FillProjectToTargetMap();
+
if ( !this->CMakeInstance->GetScriptMode() )
{
this->CMakeInstance->UpdateProgress("Configuring done", -1);
@@ -735,6 +733,19 @@ void cmGlobalGenerator::Generate()
{
// For each existing cmLocalGenerator
unsigned int i;
+
+ // Add generator specific helper commands
+ for (i = 0; i < this->LocalGenerators.size(); ++i)
+ {
+ this->LocalGenerators[i]->AddHelperCommands();
+ }
+
+ // Trace the dependencies, after that no custom commands should be added
+ // because their dependencies might not be handled correctly
+ for (i = 0; i < this->LocalGenerators.size(); ++i)
+ {
+ this->LocalGenerators[i]->TraceDependencies();
+ }
// Consolidate global targets
cmTargets globalTargets;
@@ -1043,14 +1054,6 @@ const char* cmGlobalGenerator::GetLinkerPreference(const char* lang)
return "None";
}
-void cmGlobalGenerator::TraceDependencies()
-{
- for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
- {
- this->LocalGenerators[i]->TraceDependencies();
- }
-}
-
void cmGlobalGenerator::FillProjectMap()
{
this->ProjectMap.clear(); // make sure we start with a clean map
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 0c0cd20f63..65fe7159e8 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -202,8 +202,6 @@ protected:
void FillProjectMap();
bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen);
void FillProjectToTargetMap();
- // Calls TraceVSDependencies() on all targets
- void TraceDependencies();
void CreateDefaultGlobalTargets(cmTargets* targets);
cmTarget CreateGlobalTarget(const char* name, const char* message,
const cmCustomCommandLines* commandLines,
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index a9f56822c3..58a5a11567 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -54,7 +54,9 @@ public:
* Calls TraceVSDependencies() on all targets of this generator.
*/
virtual void TraceDependencies();
-
+
+ virtual void AddHelperCommands() {}
+
/**
* Perform any final calculations prior to generation
*/
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index b3ae6e2199..071835a380 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -32,13 +32,16 @@ cmLocalVisualStudio6Generator::~cmLocalVisualStudio6Generator()
{
}
-
-void cmLocalVisualStudio6Generator::Generate()
-{
+void cmLocalVisualStudio6Generator::AddHelperCommands()
+{
std::set<cmStdString> lang;
lang.insert("C");
lang.insert("CXX");
this->CreateCustomTargetsAndCommands(lang);
+}
+
+void cmLocalVisualStudio6Generator::Generate()
+{
this->OutputDSPFile();
}
diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h
index 7ac84a43ec..c371f20cb3 100644
--- a/Source/cmLocalVisualStudio6Generator.h
+++ b/Source/cmLocalVisualStudio6Generator.h
@@ -38,7 +38,9 @@ public:
cmLocalVisualStudio6Generator();
virtual ~cmLocalVisualStudio6Generator();
-
+
+ virtual void AddHelperCommands();
+
/**
* Generate the makefile for this directory.
*/
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 2019b8e736..53d24a9ab1 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -42,8 +42,7 @@ cmLocalVisualStudio7Generator::~cmLocalVisualStudio7Generator()
{
}
-
-void cmLocalVisualStudio7Generator::Generate()
+void cmLocalVisualStudio7Generator::AddHelperCommands()
{
std::set<cmStdString> lang;
lang.insert("C");
@@ -53,6 +52,10 @@ void cmLocalVisualStudio7Generator::Generate()
lang.insert("DEF");
this->CreateCustomTargetsAndCommands(lang);
this->FixGlobalTargets();
+}
+
+void cmLocalVisualStudio7Generator::Generate()
+{
this->OutputVCProjFile();
}
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 1863ff9c3f..e5b9d5ecca 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -41,7 +41,9 @@ public:
cmLocalVisualStudio7Generator();
virtual ~cmLocalVisualStudio7Generator();
-
+
+ virtual void AddHelperCommands();
+
/**
* Generate the makefile for this directory.
*/