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
This commit is contained in:
Alexander Neundorf 2007-05-09 14:41:38 -04:00
parent 181f4cb0af
commit 8245f437b6
7 changed files with 36 additions and 23 deletions

View File

@ -717,14 +717,12 @@ void cmGlobalGenerator::Configure()
} }
// at this point this->LocalGenerators has been filled, // at this point this->LocalGenerators has been filled,
// so create the map from project name to vector of local generators // so create the map from project name to vector of local generators
this->FillProjectMap(); this->FillProjectMap();
// now create project to target map // now create project to target map
// This will make sure that targets have all the // This will make sure that targets have all the
// targets they depend on as part of the build. // targets they depend on as part of the build.
this->FillProjectToTargetMap(); this->FillProjectToTargetMap();
// now trace all dependencies
this->TraceDependencies();
if ( !this->CMakeInstance->GetScriptMode() ) if ( !this->CMakeInstance->GetScriptMode() )
{ {
this->CMakeInstance->UpdateProgress("Configuring done", -1); this->CMakeInstance->UpdateProgress("Configuring done", -1);
@ -735,6 +733,19 @@ void cmGlobalGenerator::Generate()
{ {
// For each existing cmLocalGenerator // For each existing cmLocalGenerator
unsigned int i; 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 // Consolidate global targets
cmTargets globalTargets; cmTargets globalTargets;
@ -1043,14 +1054,6 @@ const char* cmGlobalGenerator::GetLinkerPreference(const char* lang)
return "None"; return "None";
} }
void cmGlobalGenerator::TraceDependencies()
{
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
{
this->LocalGenerators[i]->TraceDependencies();
}
}
void cmGlobalGenerator::FillProjectMap() void cmGlobalGenerator::FillProjectMap()
{ {
this->ProjectMap.clear(); // make sure we start with a clean map this->ProjectMap.clear(); // make sure we start with a clean map

View File

@ -202,8 +202,6 @@ protected:
void FillProjectMap(); void FillProjectMap();
bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen); bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen);
void FillProjectToTargetMap(); void FillProjectToTargetMap();
// Calls TraceVSDependencies() on all targets
void TraceDependencies();
void CreateDefaultGlobalTargets(cmTargets* targets); void CreateDefaultGlobalTargets(cmTargets* targets);
cmTarget CreateGlobalTarget(const char* name, const char* message, cmTarget CreateGlobalTarget(const char* name, const char* message,
const cmCustomCommandLines* commandLines, const cmCustomCommandLines* commandLines,

View File

@ -54,7 +54,9 @@ public:
* Calls TraceVSDependencies() on all targets of this generator. * Calls TraceVSDependencies() on all targets of this generator.
*/ */
virtual void TraceDependencies(); virtual void TraceDependencies();
virtual void AddHelperCommands() {}
/** /**
* Perform any final calculations prior to generation * Perform any final calculations prior to generation
*/ */

View File

@ -32,13 +32,16 @@ cmLocalVisualStudio6Generator::~cmLocalVisualStudio6Generator()
{ {
} }
void cmLocalVisualStudio6Generator::AddHelperCommands()
void cmLocalVisualStudio6Generator::Generate() {
{
std::set<cmStdString> lang; std::set<cmStdString> lang;
lang.insert("C"); lang.insert("C");
lang.insert("CXX"); lang.insert("CXX");
this->CreateCustomTargetsAndCommands(lang); this->CreateCustomTargetsAndCommands(lang);
}
void cmLocalVisualStudio6Generator::Generate()
{
this->OutputDSPFile(); this->OutputDSPFile();
} }

View File

@ -38,7 +38,9 @@ public:
cmLocalVisualStudio6Generator(); cmLocalVisualStudio6Generator();
virtual ~cmLocalVisualStudio6Generator(); virtual ~cmLocalVisualStudio6Generator();
virtual void AddHelperCommands();
/** /**
* Generate the makefile for this directory. * Generate the makefile for this directory.
*/ */

View File

@ -42,8 +42,7 @@ cmLocalVisualStudio7Generator::~cmLocalVisualStudio7Generator()
{ {
} }
void cmLocalVisualStudio7Generator::AddHelperCommands()
void cmLocalVisualStudio7Generator::Generate()
{ {
std::set<cmStdString> lang; std::set<cmStdString> lang;
lang.insert("C"); lang.insert("C");
@ -53,6 +52,10 @@ void cmLocalVisualStudio7Generator::Generate()
lang.insert("DEF"); lang.insert("DEF");
this->CreateCustomTargetsAndCommands(lang); this->CreateCustomTargetsAndCommands(lang);
this->FixGlobalTargets(); this->FixGlobalTargets();
}
void cmLocalVisualStudio7Generator::Generate()
{
this->OutputVCProjFile(); this->OutputVCProjFile();
} }

View File

@ -41,7 +41,9 @@ public:
cmLocalVisualStudio7Generator(); cmLocalVisualStudio7Generator();
virtual ~cmLocalVisualStudio7Generator(); virtual ~cmLocalVisualStudio7Generator();
virtual void AddHelperCommands();
/** /**
* Generate the makefile for this directory. * Generate the makefile for this directory.
*/ */