This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, master has been updated via 9da844d8cbbd2c525265a551421dbf126ef328d1 (commit) via 6f7c96fb178a290934b5b91c919ddff143d8b542 (commit) via 50fbfee3a02e7099a3909d81597f4b8047847ece (commit) via c8fd23ec6f33eef8cf11d81938c379590080bd19 (commit) from c549deed7fc6dec2c3f5f3ab5f9ded1acb916239 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9da844d8cbbd2c525265a551421dbf126ef328d1 commit 9da844d8cbbd2c525265a551421dbf126ef328d1 Merge: 6f7c96f 50fbfee Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Aug 28 17:42:41 2018 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Tue Aug 28 13:43:48 2018 -0400 Merge topic 'lg-directory' 50fbfee3a0 cmLocalGenerator: return directories as const std::string& Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !2309 diff --cc Source/cmVisualStudio10TargetGenerator.cxx index 49f951a,a6396a5..abd0416 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@@ -250,10 -250,11 +250,10 @@@ cmVisualStudio10TargetGenerator::cmVisu this->TargetCompileAsWinRT = false; this->IsMissingFiles = false; this->DefaultArtifactDir = - this->LocalGenerator->GetCurrentBinaryDirectory() + std::string("/") + + this->LocalGenerator->GetCurrentBinaryDirectory() + "/" + this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget); - this->InSourceBuild = - (strcmp(this->Makefile->GetCurrentSourceDirectory(), - this->Makefile->GetCurrentBinaryDirectory()) == 0); + this->InSourceBuild = (this->Makefile->GetCurrentSourceDirectory() == + this->Makefile->GetCurrentBinaryDirectory()); } cmVisualStudio10TargetGenerator::~cmVisualStudio10TargetGenerator() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6f7c96fb178a290934b5b91c919ddff143d8b542 commit 6f7c96fb178a290934b5b91c919ddff143d8b542 Merge: c549dee c8fd23e Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Aug 28 17:42:36 2018 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Tue Aug 28 13:42:43 2018 -0400 Merge topic 'mk-directory' c8fd23ec6f cmMakefile: return directories as const std::string& Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !2311 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=50fbfee3a02e7099a3909d81597f4b8047847ece commit 50fbfee3a02e7099a3909d81597f4b8047847ece Author: Vitaly Stakhovsky <vvs31...@gitlab.org> AuthorDate: Fri Aug 24 09:43:35 2018 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Mon Aug 27 15:48:57 2018 -0400 cmLocalGenerator: return directories as const std::string& diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index 582a2e7..fe5c7bb 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -122,7 +122,7 @@ std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByTarget( for (cmLocalGenerator* lg : lgs) { for (cmGeneratorTarget* lt : lg->GetGeneratorTargets()) { cmStateEnums::TargetType type = lt->GetType(); - std::string outputDir = lg->GetCurrentBinaryDirectory(); + std::string const& outputDir = lg->GetCurrentBinaryDirectory(); std::string targetName = lt->GetName(); std::string filename = outputDir + "/" + targetName + ".project"; retval.push_back(targetName); @@ -161,7 +161,7 @@ std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByProjectMaps( // for each sub project in the workspace create a codelite project for (auto const& it : this->GlobalGenerator->GetProjectMap()) { - std::string outputDir = it.second[0]->GetCurrentBinaryDirectory(); + std::string const& outputDir = it.second[0]->GetCurrentBinaryDirectory(); std::string projectName = it.second[0]->GetProjectName(); retval.push_back(projectName); std::string filename = outputDir + "/" + projectName + ".project"; @@ -184,7 +184,7 @@ std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByProjectMaps( void cmExtraCodeLiteGenerator::CreateProjectFile( const std::vector<cmLocalGenerator*>& lgs) { - std::string outputDir = lgs[0]->GetCurrentBinaryDirectory(); + std::string const& outputDir = lgs[0]->GetCurrentBinaryDirectory(); std::string projectName = lgs[0]->GetProjectName(); std::string filename = outputDir + "/"; diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 1548374..39f0c9e 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3565,8 +3565,9 @@ bool cmGeneratorTarget::StrictTargetComparison::operator()( { int nameResult = strcmp(t1->GetName().c_str(), t2->GetName().c_str()); if (nameResult == 0) { - return strcmp(t1->GetLocalGenerator()->GetCurrentBinaryDirectory(), - t2->GetLocalGenerator()->GetCurrentBinaryDirectory()) < 0; + return strcmp( + t1->GetLocalGenerator()->GetCurrentBinaryDirectory().c_str(), + t2->GetLocalGenerator()->GetCurrentBinaryDirectory().c_str()) < 0; } return nameResult < 0; } diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 8ba38df..d643f05 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1011,8 +1011,7 @@ void cmGlobalNinjaGenerator::AppendTargetDepends( std::set<std::string> const& utils = target->GetUtilities(); for (std::string const& util : utils) { std::string d = - target->GetLocalGenerator()->GetCurrentBinaryDirectory() + - std::string("/") + util; + target->GetLocalGenerator()->GetCurrentBinaryDirectory() + "/" + util; outputs.push_back(this->ConvertToNinjaPath(d)); } } else { diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index a5709d5..5ea323a 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -1014,7 +1014,7 @@ void cmGlobalVisualStudio10Generator::PathTooLong(cmGeneratorTarget* target, std::string const& sfRel) { size_t len = - (strlen(target->GetLocalGenerator()->GetCurrentBinaryDirectory()) + 1 + + (target->GetLocalGenerator()->GetCurrentBinaryDirectory().length() + 1 + sfRel.length()); if (len > this->LongestSource.Length) { this->LongestSource.Length = len; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 042ce41..5909ccc 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3040,7 +3040,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects( // Point Xcode at the top of the source tree. { std::string pdir = - this->RelativeToBinary(root->GetCurrentSourceDirectory()); + this->RelativeToBinary(root->GetCurrentSourceDirectory().c_str()); this->RootObject->AddAttribute("projectDirPath", this->CreateString(pdir)); this->RootObject->AddAttribute("projectRoot", this->CreateString("")); } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 5e6ce1a..dd0f7d6 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2522,14 +2522,14 @@ std::string const& cmLocalGenerator::GetBinaryDirectory() const return this->GetCMakeInstance()->GetHomeOutputDirectory(); } -const char* cmLocalGenerator::GetCurrentBinaryDirectory() const +std::string const& cmLocalGenerator::GetCurrentBinaryDirectory() const { - return this->StateSnapshot.GetDirectory().GetCurrentBinary().c_str(); + return this->StateSnapshot.GetDirectory().GetCurrentBinary(); } -const char* cmLocalGenerator::GetCurrentSourceDirectory() const +std::string const& cmLocalGenerator::GetCurrentSourceDirectory() const { - return this->StateSnapshot.GetDirectory().GetCurrentSource().c_str(); + return this->StateSnapshot.GetDirectory().GetCurrentSource(); } std::string cmLocalGenerator::GetTargetDirectory( diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 52f0396..e7b3ee6 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -296,8 +296,8 @@ public: std::string const& GetSourceDirectory() const; std::string const& GetBinaryDirectory() const; - const char* GetCurrentBinaryDirectory() const; - const char* GetCurrentSourceDirectory() const; + std::string const& GetCurrentBinaryDirectory() const; + std::string const& GetCurrentSourceDirectory() const; /** * Generate a Mac OS X application bundle Info.plist file. diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index b35b116..73f4a8e 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -118,7 +118,7 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles() if (this->GetCurrentBinaryDirectory() != this->GetSourceDirectory()) { if (!cmSystemTools::MakeDirectory(this->GetCurrentBinaryDirectory())) { cmSystemTools::Error("Error creating directory ", - this->GetCurrentBinaryDirectory()); + this->GetCurrentBinaryDirectory().c_str()); } } diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index b9845ba..08bb2ce 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -456,7 +456,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) // clean set just in case. exeCleanFiles.push_back(this->LocalGenerator->MaybeConvertToRelativePath( this->LocalGenerator->GetCurrentBinaryDirectory(), - (targetFullPath + ".manifest").c_str())); + targetFullPath + ".manifest")); #endif if (targetNameReal != targetName) { exeCleanFiles.push_back(this->LocalGenerator->MaybeConvertToRelativePath( diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 571e74b..6a3ffe5 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -635,7 +635,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( if (this->GeneratorTarget->GetType() != cmStateEnums::STATIC_LIBRARY) { libCleanFiles.push_back(this->LocalGenerator->MaybeConvertToRelativePath( this->LocalGenerator->GetCurrentBinaryDirectory(), - (targetFullPath + ".manifest").c_str())); + targetFullPath + ".manifest")); } #endif diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 56d7243..a6396a5 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -250,7 +250,7 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator( this->TargetCompileAsWinRT = false; this->IsMissingFiles = false; this->DefaultArtifactDir = - this->LocalGenerator->GetCurrentBinaryDirectory() + std::string("/") + + this->LocalGenerator->GetCurrentBinaryDirectory() + "/" + this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget); this->InSourceBuild = (strcmp(this->Makefile->GetCurrentSourceDirectory(), @@ -1877,7 +1877,7 @@ void cmVisualStudio10TargetGenerator::WriteSource(Elem& e2, std::string sourceRel = this->ConvertPath(sf->GetFullPath(), true); size_t const maxLen = 250; if (sf->GetCustomCommand() || - ((strlen(this->LocalGenerator->GetCurrentBinaryDirectory()) + 1 + + ((this->LocalGenerator->GetCurrentBinaryDirectory().length() + 1 + sourceRel.length()) <= maxLen)) { forceRelative = true; sourceFile = sourceRel; @@ -4131,8 +4131,7 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP80(Elem& e1) // this can cause an overwrite problem if projects aren't organized in // folders std::string manifestFile = - this->LocalGenerator->GetCurrentBinaryDirectory() + - std::string("/WMAppManifest.xml"); + this->LocalGenerator->GetCurrentBinaryDirectory() + "/WMAppManifest.xml"; std::string artifactDir = this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget); ConvertToWindowsSlash(artifactDir); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c8fd23ec6f33eef8cf11d81938c379590080bd19 commit c8fd23ec6f33eef8cf11d81938c379590080bd19 Author: Vitaly Stakhovsky <vvs31...@gitlab.org> AuthorDate: Fri Aug 24 13:58:19 2018 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Mon Aug 27 14:07:43 2018 -0400 cmMakefile: return directories as const std::string& diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index 1e3faef..91ccdf7 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -320,7 +320,7 @@ bool cmAddCustomCommandCommand::InitialPass( // Convert working directory to a full path. if (!working.empty()) { - const char* build_dir = this->Makefile->GetCurrentBinaryDirectory(); + const std::string& build_dir = this->Makefile->GetCurrentBinaryDirectory(); working = cmSystemTools::CollapseFullPath(working, build_dir); } diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index 4655f58..82ee6b4 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -183,7 +183,7 @@ bool cmAddCustomTargetCommand::InitialPass( // Convert working directory to a full path. if (!working_directory.empty()) { - const char* build_dir = this->Makefile->GetCurrentBinaryDirectory(); + const std::string& build_dir = this->Makefile->GetCurrentBinaryDirectory(); working_directory = cmSystemTools::CollapseFullPath(working_directory, build_dir); } diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index f673c72..75bd6fb 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -80,17 +80,17 @@ bool cmAddSubDirectoryCommand::InitialPass( // Remove the CurrentDirectory from the srcPath and replace it // with the CurrentOutputDirectory. - const char* src = this->Makefile->GetCurrentSourceDirectory(); - const char* bin = this->Makefile->GetCurrentBinaryDirectory(); - size_t srcLen = strlen(src); - size_t binLen = strlen(bin); + const std::string& src = this->Makefile->GetCurrentSourceDirectory(); + const std::string& bin = this->Makefile->GetCurrentBinaryDirectory(); + size_t srcLen = src.length(); + size_t binLen = bin.length(); if (srcLen > 0 && src[srcLen - 1] == '/') { --srcLen; } if (binLen > 0 && bin[binLen - 1] == '/') { --binLen; } - binPath = std::string(bin, binLen) + srcPath.substr(srcLen); + binPath = bin.substr(0, binLen) + srcPath.substr(srcLen); } else { // Use the binary directory specified. // Interpret a relative path with respect to the current binary directory. diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index be3d2f4..3aa59d6 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -118,22 +118,22 @@ const char* CCONV cmGetHomeOutputDirectory(void* arg) const char* CCONV cmGetStartDirectory(void* arg) { cmMakefile* mf = static_cast<cmMakefile*>(arg); - return mf->GetCurrentSourceDirectory(); + return mf->GetCurrentSourceDirectory().c_str(); } const char* CCONV cmGetStartOutputDirectory(void* arg) { cmMakefile* mf = static_cast<cmMakefile*>(arg); - return mf->GetCurrentBinaryDirectory(); + return mf->GetCurrentBinaryDirectory().c_str(); } const char* CCONV cmGetCurrentDirectory(void* arg) { cmMakefile* mf = static_cast<cmMakefile*>(arg); - return mf->GetCurrentSourceDirectory(); + return mf->GetCurrentSourceDirectory().c_str(); } const char* CCONV cmGetCurrentOutputDirectory(void* arg) { cmMakefile* mf = static_cast<cmMakefile*>(arg); - return mf->GetCurrentBinaryDirectory(); + return mf->GetCurrentBinaryDirectory().c_str(); } const char* CCONV cmGetDefinition(void* arg, const char* def) { diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index c6ec5bf..f965a29 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -254,12 +254,12 @@ bool cmExportCommand::HandlePackage(std::vector<std::string> const& args) // We store the current build directory in the registry as a value // named by a hash of its own content. This is deterministic and is // unique with high probability. - const char* outDir = this->Makefile->GetCurrentBinaryDirectory(); + const std::string& outDir = this->Makefile->GetCurrentBinaryDirectory(); std::string hash = cmSystemTools::ComputeStringMD5(outDir); #if defined(_WIN32) && !defined(__CYGWIN__) - this->StorePackageRegistryWin(package, outDir, hash.c_str()); + this->StorePackageRegistryWin(package, outDir.c_str(), hash.c_str()); #else - this->StorePackageRegistryDir(package, outDir, hash.c_str()); + this->StorePackageRegistryDir(package, outDir.c_str(), hash.c_str()); #endif return true; diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 0c80319..795eb37 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -3463,7 +3463,7 @@ bool cmFileCommand::HandleLockCommand(std::vector<std::string> const& args) } if (!cmsys::SystemTools::FileIsFullPath(path)) { - path = this->Makefile->GetCurrentSourceDirectory() + ("/" + path); + path = this->Makefile->GetCurrentSourceDirectory() + "/" + path; } // Unify path (remove '//', '/../', ...) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 4060269..bbebb90 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -64,8 +64,8 @@ bool cmTarget::StrictTargetComparison::operator()(cmTarget const* t1, { int nameResult = strcmp(t1->GetName().c_str(), t2->GetName().c_str()); if (nameResult == 0) { - return strcmp(t1->GetMakefile()->GetCurrentBinaryDirectory(), - t2->GetMakefile()->GetCurrentBinaryDirectory()) < 0; + return strcmp(t1->GetMakefile()->GetCurrentBinaryDirectory().c_str(), + t2->GetMakefile()->GetCurrentBinaryDirectory().c_str()) < 0; } return nameResult < 0; } diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx index b569b73..c9b50a3 100644 --- a/Source/cmInstallDirectoryGenerator.cxx +++ b/Source/cmInstallDirectoryGenerator.cxx @@ -73,7 +73,7 @@ void cmInstallDirectoryGenerator::GenerateScriptForConfig( cmMakefile const& mf = *this->LocalGenerator->GetMakefile(); for (std::string& d : dirs) { if (!cmSystemTools::FileIsFullPath(d)) { - d = std::string(mf.GetCurrentSourceDirectory()) + "/" + d; + d = mf.GetCurrentSourceDirectory() + "/" + d; } } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 9e14917..6127b57 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1635,14 +1635,14 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath, } } -const char* cmMakefile::GetCurrentSourceDirectory() const +const std::string& cmMakefile::GetCurrentSourceDirectory() const { - return this->StateSnapshot.GetDirectory().GetCurrentSource().c_str(); + return this->StateSnapshot.GetDirectory().GetCurrentSource(); } -const char* cmMakefile::GetCurrentBinaryDirectory() const +const std::string& cmMakefile::GetCurrentBinaryDirectory() const { - return this->StateSnapshot.GetDirectory().GetCurrentBinary().c_str(); + return this->StateSnapshot.GetDirectory().GetCurrentBinary(); } std::vector<cmTarget*> cmMakefile::GetImportedTargets() const diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 616a37f..4085e99 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -327,8 +327,8 @@ public: */ void SetArgcArgv(const std::vector<std::string>& args); - const char* GetCurrentSourceDirectory() const; - const char* GetCurrentBinaryDirectory() const; + std::string const& GetCurrentSourceDirectory() const; + std::string const& GetCurrentBinaryDirectory() const; //@} diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index ee44007..305c7a6 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -35,19 +35,19 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args, srcdir += "_SOURCE_DIR"; this->Makefile->AddCacheDefinition( - bindir, this->Makefile->GetCurrentBinaryDirectory(), + bindir, this->Makefile->GetCurrentBinaryDirectory().c_str(), "Value Computed by CMake", cmStateEnums::STATIC); this->Makefile->AddCacheDefinition( - srcdir, this->Makefile->GetCurrentSourceDirectory(), + srcdir, this->Makefile->GetCurrentSourceDirectory().c_str(), "Value Computed by CMake", cmStateEnums::STATIC); bindir = "PROJECT_BINARY_DIR"; srcdir = "PROJECT_SOURCE_DIR"; - this->Makefile->AddDefinition(bindir, - this->Makefile->GetCurrentBinaryDirectory()); - this->Makefile->AddDefinition(srcdir, - this->Makefile->GetCurrentSourceDirectory()); + this->Makefile->AddDefinition( + bindir, this->Makefile->GetCurrentBinaryDirectory().c_str()); + this->Makefile->AddDefinition( + srcdir, this->Makefile->GetCurrentSourceDirectory().c_str()); this->Makefile->AddDefinition("PROJECT_NAME", projectName.c_str()); diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index db7fde6..5dd3c8b 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -231,7 +231,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets() { // Collapsed current binary directory std::string const cbd = cmSystemTools::CollapseFullPath( - "", makefile->GetCurrentBinaryDirectory()); + std::string(), makefile->GetCurrentBinaryDirectory()); // Info directory this->Dir.Info = cbd; @@ -452,7 +452,7 @@ bool cmQtAutoGenInitializer::InitUic() this->Target->GetSafeProperty("AUTOUIC_SEARCH_PATHS"); if (!usp.empty()) { cmSystemTools::ExpandListArgument(usp, this->Uic.SearchPaths); - std::string const srcDir = makefile->GetCurrentSourceDirectory(); + std::string const& srcDir = makefile->GetCurrentSourceDirectory(); for (std::string& path : this->Uic.SearchPaths) { path = cmSystemTools::CollapseFullPath(path, srcDir); } diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx index 5b29868..5dd4413 100644 --- a/Source/cmSearchPath.cxx +++ b/Source/cmSearchPath.cxx @@ -69,7 +69,8 @@ void cmSearchPath::AddUserPath(const std::string& path) // Process them all from the current directory for (std::string const& p : outPaths) { - this->AddPathInternal(p, this->FC->Makefile->GetCurrentSourceDirectory()); + this->AddPathInternal( + p, this->FC->Makefile->GetCurrentSourceDirectory().c_str()); } } @@ -83,8 +84,8 @@ void cmSearchPath::AddCMakePath(const std::string& variable) cmSystemTools::ExpandListArgument(value, expanded); for (std::string const& p : expanded) { - this->AddPathInternal(p, - this->FC->Makefile->GetCurrentSourceDirectory()); + this->AddPathInternal( + p, this->FC->Makefile->GetCurrentSourceDirectory().c_str()); } } } @@ -107,8 +108,8 @@ void cmSearchPath::AddCMakePrefixPath(const std::string& variable) std::vector<std::string> expanded; cmSystemTools::ExpandListArgument(value, expanded); - this->AddPrefixPaths(expanded, - this->FC->Makefile->GetCurrentSourceDirectory()); + this->AddPrefixPaths( + expanded, this->FC->Makefile->GetCurrentSourceDirectory().c_str()); } } diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index f0a5e26..76d837a 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -769,7 +769,7 @@ static Json::Value DumpSourceFilesList( groupFileList.push_back(file->GetFullPath()); } - const std::string baseDir = target->Makefile->GetCurrentSourceDirectory(); + const std::string& baseDir = target->Makefile->GetCurrentSourceDirectory(); Json::Value result = Json::arrayValue; for (auto const& it : fileGroups) { Json::Value group = DumpSourceFileGroup(it.first, it.second, baseDir); diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 05e26ea..5d1f3f0 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -132,8 +132,8 @@ bool cmSourceFile::FindFullPath(std::string* error) cmMakefile const* mf = this->Location.GetMakefile(); const char* tryDirs[3] = { nullptr, nullptr, nullptr }; if (this->Location.DirectoryIsAmbiguous()) { - tryDirs[0] = mf->GetCurrentSourceDirectory(); - tryDirs[1] = mf->GetCurrentBinaryDirectory(); + tryDirs[0] = mf->GetCurrentSourceDirectory().c_str(); + tryDirs[1] = mf->GetCurrentBinaryDirectory().c_str(); } else { tryDirs[0] = ""; } diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx index bd8d318..15433f9 100644 --- a/Source/cmSourceFileLocation.cxx +++ b/Source/cmSourceFileLocation.cxx @@ -205,18 +205,18 @@ bool cmSourceFileLocation::Matches(cmSourceFileLocation const& loc) } } else if (this->AmbiguousDirectory) { // Compare possible directory combinations. - std::string const& srcDir = cmSystemTools::CollapseFullPath( + std::string const srcDir = cmSystemTools::CollapseFullPath( this->Directory, this->Makefile->GetCurrentSourceDirectory()); - std::string const& binDir = cmSystemTools::CollapseFullPath( + std::string const binDir = cmSystemTools::CollapseFullPath( this->Directory, this->Makefile->GetCurrentBinaryDirectory()); if (srcDir != loc.Directory && binDir != loc.Directory) { return false; } } else if (loc.AmbiguousDirectory) { // Compare possible directory combinations. - std::string const& srcDir = cmSystemTools::CollapseFullPath( + std::string const srcDir = cmSystemTools::CollapseFullPath( loc.Directory, loc.Makefile->GetCurrentSourceDirectory()); - std::string const& binDir = cmSystemTools::CollapseFullPath( + std::string const binDir = cmSystemTools::CollapseFullPath( loc.Directory, loc.Makefile->GetCurrentBinaryDirectory()); if (srcDir != this->Directory && binDir != this->Directory) { return false; diff --git a/Source/cmSubdirCommand.cxx b/Source/cmSubdirCommand.cxx index c74ca59..9d36228 100644 --- a/Source/cmSubdirCommand.cxx +++ b/Source/cmSubdirCommand.cxx @@ -30,18 +30,17 @@ bool cmSubdirCommand::InitialPass(std::vector<std::string> const& args, // if they specified a relative path then compute the full std::string srcPath = - std::string(this->Makefile->GetCurrentSourceDirectory()) + "/" + i; + this->Makefile->GetCurrentSourceDirectory() + "/" + i; if (cmSystemTools::FileIsDirectory(srcPath)) { std::string binPath = - std::string(this->Makefile->GetCurrentBinaryDirectory()) + "/" + i; + this->Makefile->GetCurrentBinaryDirectory() + "/" + i; this->Makefile->AddSubDirectory(srcPath, binPath, excludeFromAll, false); } // otherwise it is a full path else if (cmSystemTools::FileIsDirectory(i)) { // we must compute the binPath from the srcPath, we just take the last // element from the source path and use that - std::string binPath = - std::string(this->Makefile->GetCurrentBinaryDirectory()) + "/" + + std::string binPath = this->Makefile->GetCurrentBinaryDirectory() + "/" + cmSystemTools::GetFilenameName(i); this->Makefile->AddSubDirectory(i, binPath, excludeFromAll, false); } else { diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index cc5a176..cfcb31a 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1127,10 +1127,11 @@ void cmTarget::AppendBuildInterfaceIncludes() this->BuildInterfaceIncludesAppended = true; if (this->Makefile->IsOn("CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE")) { - const char* binDir = this->Makefile->GetCurrentBinaryDirectory(); - const char* srcDir = this->Makefile->GetCurrentSourceDirectory(); - const std::string dirs = std::string(binDir ? binDir : "") + - std::string(binDir ? ";" : "") + std::string(srcDir ? srcDir : ""); + std::string dirs = this->Makefile->GetCurrentBinaryDirectory(); + if (!dirs.empty()) { + dirs += ';'; + } + dirs += this->Makefile->GetCurrentSourceDirectory(); if (!dirs.empty()) { this->AppendProperty("INTERFACE_INCLUDE_DIRECTORIES", ("$<BUILD_INTERFACE:" + dirs + ">").c_str()); diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx index fc546cc..af142aa 100644 --- a/Source/cmTargetIncludeDirectoriesCommand.cxx +++ b/Source/cmTargetIncludeDirectoriesCommand.cxx @@ -35,8 +35,7 @@ std::string cmTargetIncludeDirectoriesCommand::Join( { std::string dirs; std::string sep; - std::string prefix = - this->Makefile->GetCurrentSourceDirectory() + std::string("/"); + std::string prefix = this->Makefile->GetCurrentSourceDirectory() + "/"; for (std::string const& it : content) { if (cmSystemTools::FileIsFullPath(it) || cmGeneratorExpression::Find(it) == 0) { @@ -56,8 +55,7 @@ bool cmTargetIncludeDirectoriesCommand::HandleDirectContent( cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); tgt->InsertInclude(this->Join(content), lfbt, prepend); if (system) { - std::string prefix = - this->Makefile->GetCurrentSourceDirectory() + std::string("/"); + std::string prefix = this->Makefile->GetCurrentSourceDirectory() + "/"; std::set<std::string> sdirs; for (std::string const& it : content) { if (cmSystemTools::FileIsFullPath(it) || diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx index 62e323c..12db7a5 100644 --- a/Source/cmTargetSourcesCommand.cxx +++ b/Source/cmTargetSourcesCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetSourcesCommand.h" -#include <cstring> #include <sstream> #include "cmAlgorithms.h" @@ -71,8 +70,8 @@ std::vector<std::string> cmTargetSourcesCommand::ConvertToAbsoluteContent( if (cmSystemTools::FileIsFullPath(src) || cmGeneratorExpression::Find(src) == 0 || (!isInterfaceContent && - strcmp(this->Makefile->GetCurrentSourceDirectory(), - tgt->GetMakefile()->GetCurrentSourceDirectory()) == 0)) { + (this->Makefile->GetCurrentSourceDirectory() == + tgt->GetMakefile()->GetCurrentSourceDirectory()))) { absoluteSrc = src; } else { changedPath = true; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 56d7243..b099277 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -252,9 +252,8 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator( this->DefaultArtifactDir = this->LocalGenerator->GetCurrentBinaryDirectory() + std::string("/") + this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget); - this->InSourceBuild = - (strcmp(this->Makefile->GetCurrentSourceDirectory(), - this->Makefile->GetCurrentBinaryDirectory()) == 0); + this->InSourceBuild = (this->Makefile->GetCurrentSourceDirectory() == + this->Makefile->GetCurrentBinaryDirectory()); } cmVisualStudio10TargetGenerator::~cmVisualStudio10TargetGenerator() @@ -722,8 +721,7 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferences(Elem& e0) if (!name.empty()) { std::string path = i.second.GetValue(); if (!cmsys::SystemTools::FileIsFullPath(path)) { - path = std::string(this->Makefile->GetCurrentSourceDirectory()) + - "/" + path; + path = this->Makefile->GetCurrentSourceDirectory() + "/" + path; } ConvertToWindowsSlash(path); this->DotNetHintReferences[""].push_back( @@ -929,8 +927,10 @@ void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup(Elem& e0) e2.SetHasElements(); if (this->ProjectType == csproj && !this->InSourceBuild) { // add <Link> tag to written XAML source if necessary - const std::string srcDir = this->Makefile->GetCurrentSourceDirectory(); - const std::string binDir = this->Makefile->GetCurrentBinaryDirectory(); + const std::string& srcDir = + this->Makefile->GetCurrentSourceDirectory(); + const std::string& binDir = + this->Makefile->GetCurrentBinaryDirectory(); std::string link; if (obj.find(srcDir) == 0) { link = obj.substr(srcDir.length() + 1); @@ -4568,7 +4568,7 @@ void cmVisualStudio10TargetGenerator::GetCSharpSourceLink( std::string const& binaryDir = LocalGenerator->GetCurrentBinaryDirectory(); if (!cmSystemTools::IsSubDirectory(sourceFilePath, binaryDir)) { - const std::string stripFromPath = + const std::string& stripFromPath = this->Makefile->GetCurrentSourceDirectory(); if (sourceFilePath.find(stripFromPath) == 0) { if (const char* l = sf->GetProperty("VS_CSHARP_Link")) { ----------------------------------------------------------------------- Summary of changes: Source/cmAddCustomCommandCommand.cxx | 2 +- Source/cmAddCustomTargetCommand.cxx | 2 +- Source/cmAddSubDirectoryCommand.cxx | 10 +++++----- Source/cmCPluginAPI.cxx | 8 ++++---- Source/cmExportCommand.cxx | 6 +++--- Source/cmExtraCodeLiteGenerator.cxx | 6 +++--- Source/cmFileCommand.cxx | 2 +- Source/cmGeneratorTarget.cxx | 5 +++-- Source/cmGlobalGenerator.cxx | 4 ++-- Source/cmGlobalNinjaGenerator.cxx | 3 +-- Source/cmGlobalVisualStudio10Generator.cxx | 2 +- Source/cmGlobalXCodeGenerator.cxx | 2 +- Source/cmInstallDirectoryGenerator.cxx | 2 +- Source/cmLocalGenerator.cxx | 8 ++++---- Source/cmLocalGenerator.h | 4 ++-- Source/cmLocalVisualStudio7Generator.cxx | 2 +- Source/cmMakefile.cxx | 8 ++++---- Source/cmMakefile.h | 4 ++-- Source/cmMakefileExecutableTargetGenerator.cxx | 2 +- Source/cmMakefileLibraryTargetGenerator.cxx | 2 +- Source/cmProjectCommand.cxx | 12 ++++++------ Source/cmQtAutoGenInitializer.cxx | 4 ++-- Source/cmSearchPath.cxx | 11 ++++++----- Source/cmServerProtocol.cxx | 2 +- Source/cmSourceFile.cxx | 4 ++-- Source/cmSourceFileLocation.cxx | 8 ++++---- Source/cmSubdirCommand.cxx | 7 +++---- Source/cmTarget.cxx | 9 +++++---- Source/cmTargetIncludeDirectoriesCommand.cxx | 6 ++---- Source/cmTargetSourcesCommand.cxx | 5 ++--- Source/cmVisualStudio10TargetGenerator.cxx | 23 +++++++++++------------ 31 files changed, 86 insertions(+), 89 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org https://cmake.org/mailman/listinfo/cmake-commits