diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index fec8df99b..dd6ea9f04 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -85,13 +85,9 @@ void cmGlobalVisualStudio71Generator // Get the list of create dsp files names from the cmVCProjWriter, more // than one dsp could have been created per input CMakeLists.txt file // for each target - std::vector dspnames = - static_cast(generators[i]) - ->GetCreatedProjectNames(); cmTargets &tgts = generators[i]->GetMakefile()->GetTargets(); cmTargets::iterator l = tgts.begin(); - for(std::vector::iterator si = dspnames.begin(); - l != tgts.end() && si != dspnames.end(); ++l) + for(; l != tgts.end(); ++l) { // special handling for the current makefile if(mf == generators[0]->GetMakefile()) @@ -221,9 +217,13 @@ void cmGlobalVisualStudio71Generator } if(!skip) { - this->WriteProject(fout, si->c_str(), dir.c_str(),l->second); + const char *dspname = + l->second.GetProperty("GENERATOR_FILE_NAME"); + if (dspname) + { + this->WriteProject(fout, dspname, dir.c_str(),l->second); + } } - ++si; } } } @@ -241,13 +241,10 @@ void cmGlobalVisualStudio71Generator // Get the list of create dsp files names from the cmVCProjWriter, more // than one dsp could have been created per input CMakeLists.txt file // for each target - std::vector dspnames = - pg->GetCreatedProjectNames(); cmTargets &tgts = pg->GetMakefile()->GetTargets(); cmTargets::iterator l = tgts.begin(); std::string dir = mf->GetStartDirectory(); - for(std::vector::iterator si = dspnames.begin(); - l != tgts.end() && si != dspnames.end(); ++l) + for(; l != tgts.end(); ++l) { if (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) == 0) { @@ -263,9 +260,13 @@ void cmGlobalVisualStudio71Generator bool partOfDefaultBuild = this->IsPartOfDefaultBuild( root->GetMakefile()->GetProjectName(), &l->second); - this->WriteProjectConfigurations(fout, si->c_str(), - partOfDefaultBuild); - ++si; + const char *dspname = + l->second.GetProperty("GENERATOR_FILE_NAME"); + if (dspname) + { + this->WriteProjectConfigurations(fout, dspname, + partOfDefaultBuild); + } } } } diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 191867473..cdee3bb82 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -317,13 +317,9 @@ void cmGlobalVisualStudio7Generator // Get the list of create dsp files names from the cmVCProjWriter, more // than one dsp could have been created per input CMakeLists.txt file // for each target - std::vector dspnames = - static_cast(generators[i]) - ->GetCreatedProjectNames(); cmTargets &tgts = generators[i]->GetMakefile()->GetTargets(); cmTargets::iterator l = tgts.begin(); - for(std::vector::iterator si = dspnames.begin(); - l != tgts.end(); ++l) + for(; l != tgts.end(); ++l) { // special handling for the current makefile if(mf == generators[0]->GetMakefile()) @@ -442,9 +438,13 @@ void cmGlobalVisualStudio7Generator } if(!skip) { - this->WriteProject(fout, si->c_str(), dir.c_str(),l->second); + const char *dspname = + l->second.GetProperty("GENERATOR_FILE_NAME"); + if (dspname) + { + this->WriteProject(fout, dspname, dir.c_str(),l->second); + } } - ++si; } } } @@ -471,13 +471,10 @@ void cmGlobalVisualStudio7Generator // Get the list of create dsp files names from the cmVCProjWriter, more // than one dsp could have been created per input CMakeLists.txt file // for each target - std::vector dspnames = - pg->GetCreatedProjectNames(); cmTargets &tgts = pg->GetMakefile()->GetTargets(); cmTargets::iterator l = tgts.begin(); std::string dir = mf->GetStartDirectory(); - for(std::vector::iterator si = dspnames.begin(); - l != tgts.end() && si != dspnames.end(); ++l) + for(; l != tgts.end(); ++l) { if (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) == 0) { @@ -507,8 +504,13 @@ void cmGlobalVisualStudio7Generator else if ((l->second.GetType() != cmTarget::INSTALL_FILES) && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)) { - this->WriteProjectDepends(fout, si->c_str(), dir.c_str(), l->second); - ++si; + const char *dspname = + l->second.GetProperty("GENERATOR_FILE_NAME"); + if (dspname) + { + this->WriteProjectDepends(fout, dspname, + dir.c_str(), l->second); + } } } } @@ -523,13 +525,10 @@ void cmGlobalVisualStudio7Generator // Get the list of create dsp files names from the cmVCProjWriter, more // than one dsp could have been created per input CMakeLists.txt file // for each target - std::vector dspnames = - pg->GetCreatedProjectNames(); cmTargets &tgts = pg->GetMakefile()->GetTargets(); cmTargets::iterator l = tgts.begin(); std::string dir = mf->GetStartDirectory(); - for(std::vector::iterator si = dspnames.begin(); - l != tgts.end() && si != dspnames.end(); ++l) + for(; l != tgts.end(); ++l) { if(strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) == 0) { @@ -545,9 +544,13 @@ void cmGlobalVisualStudio7Generator bool partOfDefaultBuild = this->IsPartOfDefaultBuild( root->GetMakefile()->GetProjectName(), &l->second); - this->WriteProjectConfigurations(fout, si->c_str(), - partOfDefaultBuild); - ++si; + const char *dspname = + l->second.GetProperty("GENERATOR_FILE_NAME"); + if (dspname) + { + this->WriteProjectConfigurations(fout, dspname, + partOfDefaultBuild); + } } } } diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 50292402a..694c2db9d 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -184,9 +184,6 @@ void cmGlobalVisualStudio8Generator::WriteSLNFile( continue; } cmMakefile* mf = generators[i]->GetMakefile(); - std::vector dspnames = - static_cast(generators[i]) - ->GetCreatedProjectNames(); cmTargets& tgts = mf->GetTargets(); for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) { diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 97bd3b4d1..ebb2b63bd 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -110,9 +110,6 @@ void cmLocalVisualStudio7Generator::OutputVCProjFile() // Create the VCProj or set of VCProj's for libraries and executables - // clear project names - this->CreatedProjectNames.clear(); - // Call TraceVSDependencies on all targets cmTargets &tgts = this->Makefile->GetTargets(); for(cmTargets::iterator l = tgts.begin(); @@ -158,7 +155,7 @@ void cmLocalVisualStudio7Generator { // add to the list of projects std::string pname = lname; - this->CreatedProjectNames.push_back(pname); + target.SetProperty("GENERATOR_FILE_NAME",lname); // create the dsp.cmake file std::string fname; fname = this->Makefile->GetStartOutputDirectory(); diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index 64a29c521..b98379905 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -54,14 +54,6 @@ public: */ void SetBuildType(BuildType,const char *name); - /** - * Return array of created DSP names in a STL vector. - * Each executable must have its own dsp. - */ - std::vector GetCreatedProjectNames() - { - return this->CreatedProjectNames; - } void SetVersion71() {this->Version = 71;} void SetVersion8() {this->Version = 8;} void SetPlatformName(const char* n) { this->PlatformName = n;} @@ -127,7 +119,6 @@ private: virtual std::string GetTargetDirectory(cmTarget&); cmVS7FlagTable const* ExtraFlagTable; - std::vector CreatedProjectNames; std::string ModuleDefinitionFile; int Version; std::string PlatformName; // Win32 or x64 diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index c4dc29e20..5b1542815 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -275,6 +275,12 @@ void cmTarget::DefineProperties(cmake *cm) "exported symbols and then used for linking. " "All Windows-based systems including Cygwin are DLL platforms."); + cm->DefineProperty + ("GENERATOR_FILE_NAME", cmProperty::TARGET, + "Generator's file for this target.", + "An internal property used by some generators to record the name of " + "project or dsp file associated with this target."); + cm->DefineProperty ("OBJECT_FILES", cmProperty::TARGET, "Used to get the resulting list of object files that make up a "