summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-03 19:28:36 (GMT)
committerBrad King <brad.king@kitware.com>2020-09-04 13:44:30 (GMT)
commitaea465793e9744fcda0c26dad14c0620b7448f14 (patch)
tree49755bcc289a1d1864acaee9a474e3171d4eb8db /Source/cmLocalVisualStudio7Generator.cxx
parent152724274534def1126f97a28f0ce9f0e126a2b2 (diff)
downloadCMake-aea465793e9744fcda0c26dad14c0620b7448f14.zip
CMake-aea465793e9744fcda0c26dad14c0620b7448f14.tar.gz
CMake-aea465793e9744fcda0c26dad14c0620b7448f14.tar.bz2
cmLocalVisualStudio7Generator: Consolidate target iteration
Combine iteration with `cmLocalVisualStudio10Generator` and dispatch generation of each target with a virtual `GenerateTarget` method.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx44
1 files changed, 11 insertions, 33 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 1eaf450..1ebd5da 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -80,7 +80,15 @@ void cmLocalVisualStudio7Generator::AddHelperCommands()
void cmLocalVisualStudio7Generator::Generate()
{
- this->WriteProjectFiles();
+ // Create the project file for each target.
+ for (cmGeneratorTarget* gt :
+ this->GlobalGenerator->GetLocalGeneratorTargetsInOrder(this)) {
+ if (!gt->IsInBuildSystem() || gt->GetProperty("EXTERNAL_MSPROJECT")) {
+ continue;
+ }
+ this->GenerateTarget(gt);
+ }
+
this->WriteStampFiles();
}
@@ -111,36 +119,6 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
}
}
-// TODO
-// for CommandLine= need to repleace quotes with &quot
-// write out configurations
-void cmLocalVisualStudio7Generator::WriteProjectFiles()
-{
- // If not an in source build, then create the output directory
- if (this->GetCurrentBinaryDirectory() != this->GetSourceDirectory()) {
- if (!cmSystemTools::MakeDirectory(this->GetCurrentBinaryDirectory())) {
- cmSystemTools::Error("Error creating directory " +
- this->GetCurrentBinaryDirectory());
- }
- }
-
- // Get the set of targets in this directory.
- const auto& tgts =
- this->GlobalGenerator->GetLocalGeneratorTargetsInOrder(this);
-
- // Create the project file for each target.
- for (const auto& l : tgts) {
- if (!l->IsInBuildSystem()) {
- continue;
- }
- // INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
- // so don't build a projectfile for it
- if (!l->GetProperty("EXTERNAL_MSPROJECT")) {
- this->CreateSingleVCProj(l->GetName(), l);
- }
- }
-}
-
void cmLocalVisualStudio7Generator::WriteStampFiles()
{
// Touch a timestamp file used to determine when the project file is
@@ -179,9 +157,9 @@ void cmLocalVisualStudio7Generator::WriteStampFiles()
}
}
-void cmLocalVisualStudio7Generator::CreateSingleVCProj(
- const std::string& lname, cmGeneratorTarget* target)
+void cmLocalVisualStudio7Generator::GenerateTarget(cmGeneratorTarget* target)
{
+ std::string const& lname = target->GetName();
cmGlobalVisualStudioGenerator* gg =
static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator);
this->FortranProject = gg->TargetIsFortranOnly(target);