diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2003-11-26 21:04:01 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2003-11-26 21:04:01 (GMT) |
commit | 6e9a96119c0dd3c4fea12ceba6ed066521dc1c8d (patch) | |
tree | 31b3ab8bbd43057a923d083a74b6678e8eb86266 | |
parent | 9a58ac6649a9e12e06306a7d23aaaf767dea0e64 (diff) | |
download | CMake-6e9a96119c0dd3c4fea12ceba6ed066521dc1c8d.zip CMake-6e9a96119c0dd3c4fea12ceba6ed066521dc1c8d.tar.gz CMake-6e9a96119c0dd3c4fea12ceba6ed066521dc1c8d.tar.bz2 |
ENH: fix some warnings
-rw-r--r-- | Source/cmGlobalVisualStudio6Generator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.cxx | 60 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.h | 3 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 4 |
4 files changed, 50 insertions, 19 deletions
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index 5ff3f12..171a93b 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -194,7 +194,7 @@ void cmGlobalVisualStudio6Generator::CollectSubprojects() m_SubProjectMap[name].push_back(m_LocalGenerators[i]); std::vector<std::string> const& pprojects = m_LocalGenerators[i]->GetMakefile()->GetParentProjects(); - for(int k =0; k < pprojects.size(); ++k) + for(unsigned int k =0; k < pprojects.size(); ++k) { m_SubProjectMap[pprojects[k]].push_back(m_LocalGenerators[i]); } diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 09b7392..52c705a 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -40,7 +40,8 @@ cmLocalGenerator *cmGlobalVisualStudio71Generator::CreateLocalGenerator() // Write a SLN file to the stream -void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout) +void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout, + std::vector<cmLocalGenerator*>& generators) { // Write out the header for a SLN file this->WriteSLNHeader(fout); @@ -48,13 +49,15 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout) // Get the home directory with the trailing slash std::string homedir = m_CMakeInstance->GetHomeDirectory(); homedir += "/"; - + bool doneAllBuild = false; + bool doneRunTests = false; + // For each cmMakefile, create a VCProj for it, and // add it to this SLN file unsigned int i; - for(i = 0; i < m_LocalGenerators.size(); ++i) + for(i = 0; i < generators.size(); ++i) { - cmMakefile* mf = m_LocalGenerators[i]->GetMakefile(); + cmMakefile* mf = generators[i]->GetMakefile(); // Get the source directory from the makefile std::string dir = mf->GetStartDirectory(); @@ -66,28 +69,28 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout) // than one dsp could have been created per input CMakeLists.txt file // for each target std::vector<std::string> dspnames = - static_cast<cmLocalVisualStudio7Generator *>(m_LocalGenerators[i]) + static_cast<cmLocalVisualStudio7Generator *>(generators[i]) ->GetCreatedProjectNames(); - cmTargets &tgts = m_LocalGenerators[i]->GetMakefile()->GetTargets(); + cmTargets &tgts = generators[i]->GetMakefile()->GetTargets(); cmTargets::iterator l = tgts.begin(); for(std::vector<std::string>::iterator si = dspnames.begin(); l != tgts.end(); ++l) { // special handling for the current makefile - if(mf == m_LocalGenerators[0]->GetMakefile()) + if(mf == generators[0]->GetMakefile()) { dir = "."; // no subdirectory for project generated // if this is the special ALL_BUILD utility, then // make it depend on every other non UTILITY project. // This is done by adding the names to the GetUtilities // vector on the makefile - if(l->first == "ALL_BUILD") + if(l->first == "ALL_BUILD" && !doneAllBuild) { unsigned int j; - for(j = 0; j < m_LocalGenerators.size(); ++j) + for(j = 0; j < generators.size(); ++j) { const cmTargets &atgts = - m_LocalGenerators[j]->GetMakefile()->GetTargets(); + generators[j]->GetMakefile()->GetTargets(); for(cmTargets::const_iterator al = atgts.begin(); al != atgts.end(); ++al) { @@ -124,8 +127,35 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout) { if ((l->second.GetType() != cmTarget::INSTALL_FILES) && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)) - { - this->WriteProject(fout, si->c_str(), dir.c_str(),l->second); + { + bool skip = false; + if(l->first == "ALL_BUILD" ) + { + if(doneAllBuild) + { + skip = true; + } + else + { + doneAllBuild = true; + } + } + if(l->first == "RUN_TESTS") + { + if(doneRunTests) + { + skip = true; + } + else + { + doneRunTests = true; + } + } + if(!skip) + { + this->WriteProject(fout, si->c_str(), dir.c_str(),l->second); + } + ++si; } } @@ -142,11 +172,11 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout) fout << "\tEndGlobalSection\n"; fout << "\tGlobalSection(ProjectConfiguration) = postSolution\n"; // loop over again and compute the depends - for(i = 0; i < m_LocalGenerators.size(); ++i) + for(i = 0; i < generators.size(); ++i) { - cmMakefile* mf = m_LocalGenerators[i]->GetMakefile(); + cmMakefile* mf = generators[i]->GetMakefile(); cmLocalVisualStudio7Generator* pg = - static_cast<cmLocalVisualStudio7Generator*>(m_LocalGenerators[i]); + static_cast<cmLocalVisualStudio7Generator*>(generators[i]); // 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 diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index 6acb562..2434951 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -43,7 +43,8 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); protected: - virtual void WriteSLNFile(std::ostream& fout); + virtual void WriteSLNFile(std::ostream& fout, + std::vector<cmLocalGenerator*>& generators); virtual void WriteProject(std::ostream& fout, const char* name, const char* path, const cmTarget &t); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 0d0eade..81d4219 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -392,7 +392,7 @@ void cmGlobalVisualStudio7Generator::WriteSLNFile(std::ostream& fout, && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)) { bool skip = false; - if(l->first == "ALL_BUILD" ) + if(l->first == "ALL_BUILD" ) { if(doneAllBuild) { @@ -662,7 +662,7 @@ void cmGlobalVisualStudio7Generator::CollectSubprojects() m_SubProjectMap[name].push_back(m_LocalGenerators[i]); std::vector<std::string> const& pprojects = m_LocalGenerators[i]->GetMakefile()->GetParentProjects(); - for(int k =0; k < pprojects.size(); ++k) + for(unsigned int k =0; k < pprojects.size(); ++k) { m_SubProjectMap[pprojects[k]].push_back(m_LocalGenerators[i]); } |