From dc510919443eced785ea972c2a7433c440dacd4f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 27 Aug 2016 18:32:49 +0200 Subject: Common: Use a string instead of enum for WorkingDirectory --- Source/cmCommonTargetGenerator.cxx | 5 +++-- Source/cmLocalCommonGenerator.cxx | 10 ++++++---- Source/cmLocalCommonGenerator.h | 9 +++------ Source/cmLocalNinjaGenerator.cxx | 2 +- Source/cmLocalUnixMakefileGenerator3.cxx | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 6167e2c..df68280 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -204,8 +204,9 @@ std::string cmCommonTargetGenerator::GetManifests() std::vector manifests; for (std::vector::iterator mi = manifest_srcs.begin(); mi != manifest_srcs.end(); ++mi) { - manifests.push_back(this->Convert( - (*mi)->GetFullPath(), this->LocalGenerator->GetWorkingDirectory(), + manifests.push_back(this->LocalGenerator->ConvertToOutputFormat( + this->LocalGenerator->ConvertToRelativePath( + this->LocalGenerator->GetWorkingDirectory(), (*mi)->GetFullPath()), cmOutputConverter::SHELL)); } diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx index 0e79293..97323c9 100644 --- a/Source/cmLocalCommonGenerator.cxx +++ b/Source/cmLocalCommonGenerator.cxx @@ -18,8 +18,9 @@ class cmGlobalGenerator; -cmLocalCommonGenerator::cmLocalCommonGenerator( - cmGlobalGenerator* gg, cmMakefile* mf, cmOutputConverter::RelativeRoot wd) +cmLocalCommonGenerator::cmLocalCommonGenerator(cmGlobalGenerator* gg, + cmMakefile* mf, + std::string const& wd) : cmLocalGenerator(gg, mf) , WorkingDirectory(wd) { @@ -55,8 +56,9 @@ std::string cmLocalCommonGenerator::GetTargetFortranFlags( // Add a module output directory flag if necessary. std::string mod_dir = target->GetFortranModuleDirectory(); if (!mod_dir.empty()) { - mod_dir = - this->Convert(mod_dir, this->WorkingDirectory, cmOutputConverter::SHELL); + mod_dir = this->ConvertToOutputFormat( + this->ConvertToRelativePath(this->WorkingDirectory, mod_dir), + cmOutputConverter::SHELL); } else { mod_dir = this->Makefile->GetSafeDefinition("CMAKE_Fortran_MODDIR_DEFAULT"); diff --git a/Source/cmLocalCommonGenerator.h b/Source/cmLocalCommonGenerator.h index 9012afd..9454739 100644 --- a/Source/cmLocalCommonGenerator.h +++ b/Source/cmLocalCommonGenerator.h @@ -30,21 +30,18 @@ class cmLocalCommonGenerator : public cmLocalGenerator { public: cmLocalCommonGenerator(cmGlobalGenerator* gg, cmMakefile* mf, - cmOutputConverter::RelativeRoot wd); + std::string const& wd); ~cmLocalCommonGenerator() CM_OVERRIDE; std::string const& GetConfigName() { return this->ConfigName; } - cmOutputConverter::RelativeRoot GetWorkingDirectory() const - { - return this->WorkingDirectory; - } + std::string GetWorkingDirectory() const { return this->WorkingDirectory; } std::string GetTargetFortranFlags(cmGeneratorTarget const* target, std::string const& config) CM_OVERRIDE; protected: - cmOutputConverter::RelativeRoot WorkingDirectory; + std::string WorkingDirectory; void SetConfigName(); std::string ConfigName; diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index f651c6e..94f4929 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -34,7 +34,7 @@ cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmGlobalGenerator* gg, cmMakefile* mf) - : cmLocalCommonGenerator(gg, mf, cmOutputConverter::HOME_OUTPUT) + : cmLocalCommonGenerator(gg, mf, mf->GetState()->GetBinaryDirectory()) , HomeRelativeOutputPath("") { this->TargetImplib = "$TARGET_IMPLIB"; diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 6fd319e..3f8dc17 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -94,7 +94,7 @@ static std::string cmSplitExtension(std::string const& in, std::string& base) cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3( cmGlobalGenerator* gg, cmMakefile* mf) - : cmLocalCommonGenerator(gg, mf, cmOutputConverter::START_OUTPUT) + : cmLocalCommonGenerator(gg, mf, mf->GetCurrentBinaryDirectory()) { this->MakefileVariableSize = 0; this->ColorMakefile = false; -- cgit v0.12