summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx29
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx43
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx3
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx5
-rw-r--r--Source/cmLocalVisualStudio7Generator.h9
-rw-r--r--Source/cmTarget.cxx6
6 files changed, 45 insertions, 50 deletions
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index fec8df9..dd6ea9f 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<std::string> dspnames =
- static_cast<cmLocalVisualStudio7Generator *>(generators[i])
- ->GetCreatedProjectNames();
cmTargets &tgts = generators[i]->GetMakefile()->GetTargets();
cmTargets::iterator l = tgts.begin();
- for(std::vector<std::string>::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<std::string> dspnames =
- pg->GetCreatedProjectNames();
cmTargets &tgts = pg->GetMakefile()->GetTargets();
cmTargets::iterator l = tgts.begin();
std::string dir = mf->GetStartDirectory();
- for(std::vector<std::string>::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 1918674..cdee3bb 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<std::string> dspnames =
- static_cast<cmLocalVisualStudio7Generator *>(generators[i])
- ->GetCreatedProjectNames();
cmTargets &tgts = generators[i]->GetMakefile()->GetTargets();
cmTargets::iterator l = tgts.begin();
- for(std::vector<std::string>::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<std::string> dspnames =
- pg->GetCreatedProjectNames();
cmTargets &tgts = pg->GetMakefile()->GetTargets();
cmTargets::iterator l = tgts.begin();
std::string dir = mf->GetStartDirectory();
- for(std::vector<std::string>::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<std::string> dspnames =
- pg->GetCreatedProjectNames();
cmTargets &tgts = pg->GetMakefile()->GetTargets();
cmTargets::iterator l = tgts.begin();
std::string dir = mf->GetStartDirectory();
- for(std::vector<std::string>::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 5029240..694c2db 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -184,9 +184,6 @@ void cmGlobalVisualStudio8Generator::WriteSLNFile(
continue;
}
cmMakefile* mf = generators[i]->GetMakefile();
- std::vector<std::string> dspnames =
- static_cast<cmLocalVisualStudio7Generator*>(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 97bd3b4..ebb2b63 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 64a29c5..b983799 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<std::string> 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<std::string> CreatedProjectNames;
std::string ModuleDefinitionFile;
int Version;
std::string PlatformName; // Win32 or x64
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c4dc29e..5b15428 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -276,6 +276,12 @@ void cmTarget::DefineProperties(cmake *cm)
"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 "
"target.",