diff options
author | Brad King <brad.king@kitware.com> | 2006-02-14 20:35:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-02-14 20:35:34 (GMT) |
commit | bd0b829ffb6bf540fb9d3938687705deea0532e2 (patch) | |
tree | dd3e19affb1bb9487c61d8e77a47cc31f6a96818 | |
parent | eeab2c55ed0615032ae9935fc2e805feee689031 (diff) | |
download | CMake-bd0b829ffb6bf540fb9d3938687705deea0532e2.zip CMake-bd0b829ffb6bf540fb9d3938687705deea0532e2.tar.gz CMake-bd0b829ffb6bf540fb9d3938687705deea0532e2.tar.bz2 |
BUG: Fixed generation of VS8 solution file to not be re-written when loaded by VS and to work with msbuild.
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.cxx | 40 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.h | 3 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 12 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 35 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.h | 3 |
5 files changed, 70 insertions, 23 deletions
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index a5e14aa..ef9487d 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -25,6 +25,7 @@ cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator() { m_FindMakeProgramFile = "CMakeVS71FindMake.cmake"; + m_ProjectConfigurationSectionName = "ProjectConfiguration"; } @@ -52,6 +53,7 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout, std::string rootdir = root->GetMakefile()->GetStartOutputDirectory(); rootdir += "/"; bool doneAllBuild = false; + bool doneCheckBuild = false; bool doneRunTests = false; bool doneInstall = false; @@ -141,6 +143,17 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout, doneAllBuild = true; } } + if(l->first == CMAKE_CHECK_BUILD_SYSTEM_TARGET) + { + if(doneCheckBuild) + { + skip = true; + } + else + { + doneCheckBuild = true; + } + } if(l->first == "INSTALL") { if(doneInstall) @@ -172,16 +185,10 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout, } } } - fout << "Global\n" - << "\tGlobalSection(SolutionConfiguration) = preSolution\n"; - - for(std::vector<std::string>::iterator i = m_Configurations.begin(); - i != m_Configurations.end(); ++i) - { - fout << "\t\t" << *i << " = " << *i << "\n"; - } - fout << "\tEndGlobalSection\n"; - fout << "\tGlobalSection(ProjectConfiguration) = postSolution\n"; + fout << "Global\n"; + this->WriteSolutionConfigurations(fout); + fout << "\tGlobalSection(" << m_ProjectConfigurationSectionName + << ") = postSolution\n"; // loop over again and compute the depends for(i = 0; i < generators.size(); ++i) { @@ -221,6 +228,19 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout, } +void +cmGlobalVisualStudio71Generator +::WriteSolutionConfigurations(std::ostream& fout) +{ + fout << "\tGlobalSection(SolutionConfiguration) = preSolution\n"; + for(std::vector<std::string>::iterator i = m_Configurations.begin(); + i != m_Configurations.end(); ++i) + { + fout << "\t\t" << *i << " = " << *i << "\n"; + } + fout << "\tEndGlobalSection\n"; +} + // Write a dsp file into the SLN file, // Note, that dependencies from executables to // the libraries it uses are also done here diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index e1ff825..fb52fa7 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -46,6 +46,7 @@ protected: virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators); + virtual void WriteSolutionConfigurations(std::ostream& fout); virtual void WriteProject(std::ostream& fout, const char* name, const char* path, cmTarget &t); virtual void WriteProjectDepends(std::ostream& fout, @@ -55,5 +56,7 @@ protected: const std::vector<std::string>& depends); virtual void WriteSLNFooter(std::ostream& fout); virtual void WriteSLNHeader(std::ostream& fout); + + std::string m_ProjectConfigurationSectionName; }; #endif diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index fb96d36..e43263f 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -278,7 +278,6 @@ void cmGlobalVisualStudio7Generator::WriteSLNFile(std::ostream& fout, std::string rootdir = root->GetMakefile()->GetStartOutputDirectory(); rootdir += "/"; bool doneAllBuild = false; - bool doneCheckBuild = false; bool doneRunTests = false; bool doneInstall = false; @@ -368,17 +367,6 @@ void cmGlobalVisualStudio7Generator::WriteSLNFile(std::ostream& fout, doneAllBuild = true; } } - if(l->first == CMAKE_CHECK_BUILD_SYSTEM_TARGET) - { - if(doneCheckBuild) - { - skip = true; - } - else - { - doneCheckBuild = true; - } - } if(l->first == "INSTALL") { if(doneInstall) diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index c13efd0..39562c4 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -25,6 +25,7 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator() { m_FindMakeProgramFile = "CMakeVS8FindMake.cmake"; + m_ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; } @@ -179,5 +180,37 @@ void cmGlobalVisualStudio8Generator::WriteSLNFile( } // Now write the solution file. - this->cmGlobalVisualStudio7Generator::WriteSLNFile(fout, root, generators); + this->cmGlobalVisualStudio71Generator::WriteSLNFile(fout, root, generators); +} + +//---------------------------------------------------------------------------- +void +cmGlobalVisualStudio8Generator +::WriteSolutionConfigurations(std::ostream& fout) +{ + fout << "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n"; + for(std::vector<std::string>::iterator i = m_Configurations.begin(); + i != m_Configurations.end(); ++i) + { + fout << "\t\t" << *i << "|Win32 = " << *i << "|Win32\n"; + } + fout << "\tEndGlobalSection\n"; +} + +//---------------------------------------------------------------------------- +void +cmGlobalVisualStudio8Generator +::WriteProjectConfigurations(std::ostream& fout, + const char* name, bool in_all_build) +{ + std::string guid = this->GetGUID(name); + for(std::vector<std::string>::iterator i = m_Configurations.begin(); + i != m_Configurations.end(); ++i) + { + fout << "\t\t{" << guid << "}." << *i << "|Win32.ActiveCfg = " << *i << "|Win32\n"; + if (in_all_build) + { + fout << "\t\t{" << guid << "}." << *i << "|Win32.Build.0 = " << *i << "|Win32\n"; + } + } } diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 85ff7dd..8542b6f 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -52,5 +52,8 @@ protected: virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators); virtual void WriteSLNHeader(std::ostream& fout); + virtual void WriteSolutionConfigurations(std::ostream& fout); + virtual void WriteProjectConfigurations(std::ostream& fout, + const char* name, bool in_all); }; #endif |