diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CPack/cpack.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 40 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.h | 5 | ||||
-rw-r--r-- | Source/CTest/cmParseJacocoCoverage.cxx | 167 | ||||
-rw-r--r-- | Source/CTest/cmParseJacocoCoverage.h | 59 | ||||
-rw-r--r-- | Source/CursesDialog/ccmake.cxx | 18 | ||||
-rw-r--r-- | Source/cmDocumentation.cxx | 20 | ||||
-rw-r--r-- | Source/cmDocumentation.h | 3 | ||||
-rw-r--r-- | Source/cmDocumentationFormatter.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 30 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 3 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 9 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 29 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.h | 8 | ||||
-rw-r--r-- | Source/cmake.cxx | 18 | ||||
-rw-r--r-- | Source/cmakemain.cxx | 18 | ||||
-rw-r--r-- | Source/ctest.cxx | 2 |
20 files changed, 378 insertions, 60 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index fe6cc1b..c3c24fe 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -518,6 +518,7 @@ set(CTEST_SRCS cmCTest.cxx CTest/cmParseMumpsCoverage.cxx CTest/cmParseCacheCoverage.cxx CTest/cmParseGTMCoverage.cxx + CTest/cmParseJacocoCoverage.cxx CTest/cmParsePHPCoverage.cxx CTest/cmParseCoberturaCoverage.cxx CTest/cmCTestEmptyBinaryDirectoryCommand.cxx diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index c1694c6..d259a0c 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 0) -set(CMake_VERSION_PATCH 20140612) +set(CMake_VERSION_PATCH 20140616) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index ad37c42..98c62d5 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -101,7 +101,7 @@ int cpackDefinitionArgument(const char* argument, const char* cValue, // this is CPack. int main (int argc, char const* const* argv) { - setlocale(LC_ALL, ""); + setlocale(LC_CTYPE, ""); cmsys::Encoding::CommandLineArguments args = cmsys::Encoding::CommandLineArguments::Main(argc, argv); argc = args.argc(); diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index da27c8c..76f6584 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -14,6 +14,7 @@ #include "cmParseCoberturaCoverage.h" #include "cmParseGTMCoverage.h" #include "cmParseCacheCoverage.h" +#include "cmParseJacocoCoverage.h" #include "cmCTest.h" #include "cmake.h" #include "cmMakefile.h" @@ -415,6 +416,13 @@ int cmCTestCoverageHandler::ProcessHandler() return error; } + file_count += this->HandleJacocoCoverage(&cont); + error = cont.Error; + if ( file_count < 0 ) + { + return error; + } + std::set<std::string> uncovered = this->FindUncoveredFiles(&cont); if ( file_count == 0 ) @@ -872,6 +880,38 @@ struct cmCTestCoverageHandlerLocale }; //---------------------------------------------------------------------- +int cmCTestCoverageHandler::HandleJacocoCoverage( + cmCTestCoverageHandlerContainer* cont) +{ + cmParseJacocoCoverage cov = + cmParseJacocoCoverage(*cont, this->CTest); + cmsys::Glob g; + std::vector<std::string> files; + g.SetRecurse(true); + + std::string SourceDir + = this->CTest->GetCTestConfiguration("SourceDirectory"); + std::string coverageFile = SourceDir+ "/*jacoco.xml"; + + g.FindFiles(coverageFile); + files=g.GetFiles(); + if (files.size() > 0) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Found Jacoco Files, Performing Coverage" << std::endl); + cov.LoadCoverageData(files); + } + else + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + " Cannot find Jacoco coverage files: " << coverageFile + << std::endl); + } + return static_cast<int>(cont->TotalCoverage.size()); +} + + +//---------------------------------------------------------------------- int cmCTestCoverageHandler::HandleGCovCoverage( cmCTestCoverageHandlerContainer* cont) { diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h index 38a3353..d0f274c 100644 --- a/Source/CTest/cmCTestCoverageHandler.h +++ b/Source/CTest/cmCTestCoverageHandler.h @@ -81,7 +81,10 @@ private: //! Handle coverage for mumps int HandleMumpsCoverage(cmCTestCoverageHandlerContainer* cont); - //! Handle coverage using Bullseye + //! Handle coverage for Jacoco + int HandleJacocoCoverage(cmCTestCoverageHandlerContainer* cont); + +//! Handle coverage using Bullseye int HandleBullseyeCoverage(cmCTestCoverageHandlerContainer* cont); int RunBullseyeSourceSummary(cmCTestCoverageHandlerContainer* cont); int RunBullseyeCoverageBranch(cmCTestCoverageHandlerContainer* cont, diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx new file mode 100644 index 0000000..4723dd3 --- /dev/null +++ b/Source/CTest/cmParseJacocoCoverage.cxx @@ -0,0 +1,167 @@ +#include "cmStandardIncludes.h" +#include <stdio.h> +#include <stdlib.h> +#include "cmSystemTools.h" +#include "cmXMLParser.h" +#include "cmParseJacocoCoverage.h" +#include <cmsys/Directory.hxx> +#include <cmsys/Glob.hxx> +#include <cmsys/FStream.hxx> + + +class cmParseJacocoCoverage::XMLParser: public cmXMLParser +{ + public: + XMLParser(cmCTest* ctest, cmCTestCoverageHandlerContainer& cont) + : CTest(ctest), Coverage(cont) + { + this->PackageName = ""; + this->ModuleName = ""; + this->FileName = ""; + this->CurFileName = ""; + this->FilePaths.push_back(this->Coverage.SourceDir); + } + + virtual ~XMLParser() + { + } + + protected: + + virtual void EndElement(const std::string&) + { + } + + virtual void StartElement(const std::string& name, + const char** atts) + { + if(name == "package") + { + this->PackageName = atts[1]; + std::string FilePath = this->Coverage.SourceDir + + "/" + this->ModuleName + "/src/main/java/" + + this->PackageName; + this->FilePaths.push_back(FilePath); + } + else if(name == "sourcefile") + { + this->FileName = atts[1]; + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Reading file: " + << this->FileName << std::endl); + for(size_t i=0;i < FilePaths.size();i++) + { + std::string finalpath = FilePaths[i] + "/" + this->FileName; + if(cmSystemTools::FileExists(finalpath.c_str())) + { + this->CurFileName = finalpath; + break; + } + } + cmsys::ifstream fin(this->CurFileName.c_str()); + if(this->CurFileName == "" || !fin ) + { + this->CurFileName = this->Coverage.BinaryDir + "/" + + this->FileName; + fin.open(this->CurFileName.c_str()); + if (!fin) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Jacoco Coverage: Error opening " << this->CurFileName + << std::endl); + this->Coverage.Error++; + } + } + std::string line; + FileLinesType& curFileLines = + this->Coverage.TotalCoverage[this->CurFileName]; + curFileLines.push_back(-1); + while(cmSystemTools::GetLineFromStream(fin, line)) + { + curFileLines.push_back(-1); + } + } + else if(name == "report") + { + this->ModuleName=atts[1]; + } + else if(name == "line") + { + int tagCount = 0; + int nr = -1; + int ci = -1; + while(true) + { + if(strcmp(atts[tagCount],"ci") == 0) + { + ci = atoi(atts[tagCount+1]); + } + else if (strcmp(atts[tagCount],"nr") == 0) + { + nr = atoi(atts[tagCount+1]); + } + if (ci > -1 && nr > 0) + { + FileLinesType& curFileLines= + this->Coverage.TotalCoverage[this->CurFileName]; + if(curFileLines.size() > 0) + { + curFileLines[nr-1] = ci; + } + break; + } + ++tagCount; + } + } + } + + private: + std::string PackageName; + std::string FileName; + std::string ModuleName; + std::string CurFileName; + std::vector<std::string> FilePaths; + typedef cmCTestCoverageHandlerContainer::SingleFileCoverageVector + FileLinesType; + cmCTest* CTest; + cmCTestCoverageHandlerContainer& Coverage; +}; + +cmParseJacocoCoverage::cmParseJacocoCoverage( + cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest) + :Coverage(cont), CTest(ctest) + { + } + +bool cmParseJacocoCoverage::LoadCoverageData( + const std::vector<std::string> files) +{ + // load all the jacoco.xml files in the source directory + cmsys::Directory dir; + size_t i; + std::string path; + size_t numf = files.size(); + for (i = 0; i < numf; i++) + { + path = files[i]; + + cmCTestLog(this->CTest,HANDLER_VERBOSE_OUTPUT, + "Reading XML File " << path << std::endl); + if(cmSystemTools::GetFilenameLastExtension(path) == ".xml") + { + if(!this->ReadJacocoXML(path.c_str())) + { + return false; + } + } + } + return true; +} + +bool cmParseJacocoCoverage::ReadJacocoXML(const char* file) +{ + cmParseJacocoCoverage::XMLParser + parser(this->CTest, this->Coverage); + parser.ParseFile(file); + return true; +} diff --git a/Source/CTest/cmParseJacocoCoverage.h b/Source/CTest/cmParseJacocoCoverage.h new file mode 100644 index 0000000..dad05a3 --- /dev/null +++ b/Source/CTest/cmParseJacocoCoverage.h @@ -0,0 +1,59 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc. + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ + +#ifndef cmParseJacocoCoverage_h +#define cmParseJacocoCoverage_h + +#include "cmStandardIncludes.h" +#include "cmCTestCoverageHandler.h" + + +/** \class cmParseJacocoCoverage + * \brief Parse JaCoCO coverage information + * + * This class is used to parse coverage information for + * java using the JaCoCo tool: + * + * http://www.eclemma.org/jacoco/trunk/index.html + */ +class cmParseJacocoCoverage +{ +public: + cmParseJacocoCoverage(cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest); + bool LoadCoverageData(const std::vector<std::string> files); + + std::string PackageName; + std::string FileName; + std::string ModuleName; + std::string CurFileName; +private: + // implement virtual from parent + // remove files with no coverage + void RemoveUnCoveredFiles(); + // Read a single mcov file + bool ReadJacocoXML(const char* f); + // split a string based on , + bool SplitString(std::vector<std::string>& args, + std::string const& line); + bool FindJavaFile(std::string const& routine, + std::string& filepath); + void InitializeJavaFile(std::string& file); + bool LoadSource(std::string d); + + class XMLParser; + std::map<std::string, std::string> RoutineToDirectory; + cmCTestCoverageHandlerContainer& Coverage; + cmCTest* CTest; +}; + +#endif diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index a9d4d98..28f3d9b 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -38,6 +38,18 @@ static const char * cmDocumentationUsage[][2] = {0, " ccmake <path-to-source>\n" " ccmake <path-to-existing-build>"}, + {0, + "Specify a source directory to (re-)generate a build system for " + "it in the current working directory. Specify an existing build " + "directory to re-generate its build system."}, + {0,0} +}; + +//---------------------------------------------------------------------------- +static const char * cmDocumentationUsageNote[][2] = +{ + {0, + "Run 'ccmake --help' for more information."}, {0,0} }; @@ -83,7 +95,7 @@ void CMakeMessageHandler(const char* message, const char* title, bool&, int main(int argc, char const* const* argv) { - setlocale(LC_ALL, ""); + setlocale(LC_CTYPE, ""); cmsys::Encoding::CommandLineArguments encoding_args = cmsys::Encoding::CommandLineArguments::Main(argc, argv); @@ -102,6 +114,10 @@ int main(int argc, char const* const* argv) doc.SetName("ccmake"); doc.SetSection("Name",cmDocumentationName); doc.SetSection("Usage",cmDocumentationUsage); + if ( argc == 1 ) + { + doc.AppendSection("Usage",cmDocumentationUsageNote); + } doc.SetSection("Generators",generators); doc.PrependSection("Options",cmDocumentationOptions); return doc.PrintRequestedDocumentation(std::cout)? 0:1; diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 8d035af..3ff1017 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -113,7 +113,9 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os) switch (ht) { case cmDocumentation::Usage: - return this->PrintDocumentationUsage(os); + return this->PrintUsage(os); + case cmDocumentation::Help: + return this->PrintHelp(os); case cmDocumentation::Full: return this->PrintHelpFull(os); case cmDocumentation::OneManual: @@ -300,7 +302,7 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv, (strcmp(argv[i], "-h") == 0) || (strcmp(argv[i], "-H") == 0)) { - help.HelpType = cmDocumentation::Usage; + help.HelpType = cmDocumentation::Help; GET_OPT_ARGUMENT(help.Argument); help.Argument = cmSystemTools::LowerCase(help.Argument); // special case for single command @@ -841,7 +843,19 @@ bool cmDocumentation::PrintHelpListVariables(std::ostream& os) } //---------------------------------------------------------------------------- -bool cmDocumentation::PrintDocumentationUsage(std::ostream& os) +bool cmDocumentation::PrintUsage(std::ostream& os) +{ + std::map<std::string,cmDocumentationSection*>::iterator si; + si = this->AllSections.find("Usage"); + if(si != this->AllSections.end()) + { + this->Formatter.PrintSection(os, *si->second); + } + return true; +} + +//---------------------------------------------------------------------------- +bool cmDocumentation::PrintHelp(std::ostream& os) { std::map<std::string,cmDocumentationSection*>::iterator si; si = this->AllSections.find("Usage"); diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index c98e48e..b72b5fe 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -102,6 +102,8 @@ private: bool PrintFiles(std::ostream& os, std::string const& pattern); bool PrintVersion(std::ostream& os); + bool PrintUsage(std::ostream& os); + bool PrintHelp(std::ostream& os); bool PrintHelpFull(std::ostream& os); bool PrintHelpOneManual(std::ostream& os); bool PrintHelpOneCommand(std::ostream& os); @@ -115,7 +117,6 @@ private: bool PrintHelpListProperties(std::ostream& os); bool PrintHelpListVariables(std::ostream& os); bool PrintHelpListPolicies(std::ostream& os); - bool PrintDocumentationUsage(std::ostream& os); bool PrintOldCustomModules(std::ostream& os); const char* GetNameString() const; diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h index 61766b9..59513cc 100644 --- a/Source/cmDocumentationFormatter.h +++ b/Source/cmDocumentationFormatter.h @@ -26,7 +26,7 @@ public: /** Types of help provided. */ enum Type { - None, Version, Usage, Full, ListManuals, + None, Version, Usage, Help, Full, ListManuals, ListCommands, ListModules, ListProperties, ListVariables, ListPolicies, OneManual, OneCommand, OneModule, OneProperty, OneVariable, OnePolicy, OldCustomModules diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 6c8be72..36932aa 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1045,36 +1045,6 @@ void cmGlobalGenerator::ClearEnabledLanguages() this->LanguageEnabled.clear(); } -bool cmGlobalGenerator::IsDependedOn(const std::string& project, - cmTarget const* targetIn) -{ - // Get all local gens for this project - std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator it = - this->ProjectMap.find(project); - if (it == this->ProjectMap.end()) - { - return false; - } - - // loop over local gens and get the targets for each one - for(std::vector<cmLocalGenerator*>::const_iterator geIt = it->second.begin(); - geIt != it->second.end(); ++geIt) - { - cmTargets const& targets = (*geIt)->GetMakefile()->GetTargets(); - for (cmTargets::const_iterator l = targets.begin(); - l != targets.end(); l++) - { - cmTarget const& target = l->second; - TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(target); - if(tgtdeps.count(targetIn)) - { - return true; - } - } - } - return false; -} - void cmGlobalGenerator::Configure() { this->FirstTimeProgress = 0.0f; diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 67bd378..6403429 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -225,9 +225,6 @@ public: that is a framework. */ bool NameResolvesToFramework(const std::string& libname) const; - /** If check to see if the target is linked to by any other - target in the project */ - bool IsDependedOn(const std::string& project, cmTarget const* target); ///! Find a local generator by its startdirectory cmLocalGenerator* FindLocalGenerator(const std::string& start_dir) const; diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index a0caf0e..0facfeb 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -961,7 +961,16 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) { knownDependencies.insert( ng->ConvertToNinjaPath( j->c_str() ) ); } + //get list files which are implicit dependencies as well and will be phony + //for rebuild manifest + std::vector<std::string> const& lf = (*i)->GetMakefile()->GetListFiles(); + typedef std::vector<std::string>::const_iterator vect_it; + for(vect_it j = lf.begin(); j != lf.end(); ++j) + { + knownDependencies.insert( ng->ConvertToNinjaPath( j->c_str() ) ); + } } + knownDependencies.insert( "CMakeCache.txt" ); for(std::vector<cmGeneratorExpressionEvaluationFile*>::const_iterator li = this->EvaluationFiles.begin(); diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 4bea5ac..a67a649 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -118,7 +118,7 @@ void cmGlobalVisualStudio71Generator fout << "\tGlobalSection(" << this->ProjectConfigurationSectionName << ") = postSolution\n"; // Write out the configurations for all the targets in the project - this->WriteTargetConfigurations(fout, root, orderedProjectTargets); + this->WriteTargetConfigurations(fout, orderedProjectTargets); fout << "\tEndGlobalSection\n"; if (useFolderProperty) diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index b581147..a918d1d 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -366,7 +366,6 @@ void cmGlobalVisualStudio7Generator::OutputSLNFile() void cmGlobalVisualStudio7Generator::WriteTargetConfigurations( std::ostream& fout, - cmLocalGenerator* root, OrderedTargetDependSet const& projectTargets) { // loop over again and write out configurations for each target @@ -392,8 +391,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations( else { const std::set<std::string>& configsPartOfDefaultBuild = - this->IsPartOfDefaultBuild(root->GetMakefile()->GetProjectName(), - target); + this->IsPartOfDefaultBuild(projectTargets, target); const char *vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); if (vcprojName) @@ -579,7 +577,7 @@ void cmGlobalVisualStudio7Generator // Write out the configurations for all the targets in the project fout << "\tGlobalSection(ProjectConfiguration) = postSolution\n"; - this->WriteTargetConfigurations(fout, root, orderedProjectTargets); + this->WriteTargetConfigurations(fout, orderedProjectTargets); fout << "\tEndGlobalSection\n"; // Write out global sections @@ -981,8 +979,7 @@ cmGlobalVisualStudio7Generator std::set<std::string> cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild( - const std::string& project, - cmTarget const* target) + OrderedTargetDependSet const& projectTargets, cmTarget const* target) { std::set<std::string> activeConfigs; // if it is a utilitiy target then only make it part of the @@ -992,7 +989,7 @@ cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild( { return activeConfigs; } - if(type == cmTarget::UTILITY && !this->IsDependedOn(project, target)) + if(type == cmTarget::UTILITY && !this->IsDependedOn(projectTargets, target)) { return activeConfigs; } @@ -1010,6 +1007,24 @@ cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild( return activeConfigs; } +bool +cmGlobalVisualStudio7Generator +::IsDependedOn(OrderedTargetDependSet const& projectTargets, + cmTarget const* targetIn) +{ + for (OrderedTargetDependSet::const_iterator l = projectTargets.begin(); + l != projectTargets.end(); ++l) + { + cmTarget const& target = **l; + TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(target); + if(tgtdeps.count(targetIn)) + { + return true; + } + } + return false; +} + //---------------------------------------------------------------------------- static cmVS7FlagTable cmVS7ExtraFlagTable[] = { diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 1dc709d..291d297 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -150,7 +150,6 @@ protected: OrderedTargetDependSet const& projectTargets); virtual void WriteTargetConfigurations( std::ostream& fout, - cmLocalGenerator* root, OrderedTargetDependSet const& projectTargets); void GenerateConfigurations(cmMakefile* mf); @@ -164,8 +163,11 @@ protected: std::string ConvertToSolutionPath(const char* path); - std::set<std::string> IsPartOfDefaultBuild(const std::string& project, - cmTarget const* target); + std::set<std::string> + IsPartOfDefaultBuild(OrderedTargetDependSet const& projectTargets, + cmTarget const* target); + bool IsDependedOn(OrderedTargetDependSet const& projectTargets, + cmTarget const* target); std::vector<std::string> Configurations; std::map<std::string, std::string> GUIDMap; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e3bebbd..86d3766 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -343,16 +343,24 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args) // The value is transformed if it is a filepath for example, so // we can't compare whether the value is already in the cache until // after we call AddCacheEntry. - const char *cachedValue = - this->CacheManager->GetCacheValue(var); + bool haveValue = false; + std::string cachedValue; + if(this->WarnUnusedCli) + { + if(const char *v = this->CacheManager->GetCacheValue(var)) + { + haveValue = true; + cachedValue = v; + } + } this->CacheManager->AddCacheEntry(var, value.c_str(), "No help, variable specified on the command line.", type); + if(this->WarnUnusedCli) { - if (!cachedValue - || strcmp(this->CacheManager->GetCacheValue(var), - cachedValue) != 0) + if (!haveValue || + cachedValue != this->CacheManager->GetCacheValue(var)) { this->WatchUnusedCli(var); } diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 9f9f6bb..61b175e 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -42,6 +42,18 @@ static const char * cmDocumentationUsage[][2] = {0, " cmake [options] <path-to-source>\n" " cmake [options] <path-to-existing-build>"}, + {0, + "Specify a source directory to (re-)generate a build system for " + "it in the current working directory. Specify an existing build " + "directory to re-generate its build system."}, + {0,0} +}; + +//---------------------------------------------------------------------------- +static const char * cmDocumentationUsageNote[][2] = +{ + {0, + "Run 'cmake --help' for more information."}, {0,0} }; @@ -163,7 +175,7 @@ static void cmakemainProgressCallback(const char *m, float prog, int main(int ac, char const* const* av) { - setlocale(LC_ALL, ""); + setlocale(LC_CTYPE, ""); cmsys::Encoding::CommandLineArguments args = cmsys::Encoding::CommandLineArguments::Main(ac, av); ac = args.argc(); @@ -223,6 +235,10 @@ int do_cmake(int ac, char const* const* av) doc.SetName("cmake"); doc.SetSection("Name",cmDocumentationName); doc.SetSection("Usage",cmDocumentationUsage); + if ( ac == 1 ) + { + doc.AppendSection("Usage",cmDocumentationUsageNote); + } doc.AppendSection("Generators",generators); doc.PrependSection("Options",cmDocumentationOptions); diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 167e348..ff32de9 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -116,7 +116,7 @@ static const char * cmDocumentationOptions[][2] = // this is a test driver program for cmCTest. int main (int argc, char const* const* argv) { - setlocale(LC_ALL, ""); + setlocale(LC_CTYPE, ""); cmsys::Encoding::CommandLineArguments encoding_args = cmsys::Encoding::CommandLineArguments::Main(argc, argv); |