Commit 25d1ef64 authored by Daniel Pfeifer's avatar Daniel Pfeifer Committed by Brad King

Use enums defined in cmOutputConverter using their fully qualified name.

Mostly automated:

values=("RelativeRoot" "NONE" "FULL" "HOME" "START" "HOME_OUTPUT" "START_OUTPUT"
        "OutputFormat" "UNCHANGED" "MAKERULE" "SHELL" "WATCOMQUOTE" "RESPONSE"
        "FortranFormat" "FortranFormatNone" "FortranFormatFixed" "FortranFormatFree")
for i in "${values[@]}"; do git grep -l cmLocalGenerator::$i | xargs sed -i "s|cmLocalGenerator::$i|cmOutputConverter::$i|g"; done
parent c75d91a0
......@@ -43,8 +43,8 @@ std::string const& cmCommonTargetGenerator::GetConfigName() const
}
std::string cmCommonTargetGenerator::Convert(
std::string const& source, cmLocalGenerator::RelativeRoot relative,
cmLocalGenerator::OutputFormat output)
std::string const& source, cmOutputConverter::RelativeRoot relative,
cmOutputConverter::OutputFormat output)
{
return this->LocalGenerator->Convert(source, relative, output);
}
......@@ -140,7 +140,7 @@ void cmCommonTargetGenerator::AddFortranFlags(std::string& flags)
std::string mod_dir = this->GetFortranModuleDirectory();
if (!mod_dir.empty()) {
mod_dir =
this->Convert(mod_dir, this->WorkingDirectory, cmLocalGenerator::SHELL);
this->Convert(mod_dir, this->WorkingDirectory, cmOutputConverter::SHELL);
} else {
mod_dir =
this->Makefile->GetSafeDefinition("CMAKE_Fortran_MODDIR_DEFAULT");
......@@ -167,7 +167,7 @@ void cmCommonTargetGenerator::AddFortranFlags(std::string& flags)
idi != includes.end(); ++idi) {
std::string flg = modpath_flag;
flg +=
this->Convert(*idi, cmLocalGenerator::NONE, cmLocalGenerator::SHELL);
this->Convert(*idi, cmOutputConverter::NONE, cmOutputConverter::SHELL);
this->LocalGenerator->AppendFlags(flags, flg);
}
}
......@@ -177,18 +177,18 @@ void cmCommonTargetGenerator::AppendFortranFormatFlags(
std::string& flags, cmSourceFile const& source)
{
const char* srcfmt = source.GetProperty("Fortran_FORMAT");
cmLocalGenerator::FortranFormat format =
cmOutputConverter::FortranFormat format =
this->LocalGenerator->GetFortranFormat(srcfmt);
if (format == cmLocalGenerator::FortranFormatNone) {
if (format == cmOutputConverter::FortranFormatNone) {
const char* tgtfmt = this->GeneratorTarget->GetProperty("Fortran_FORMAT");
format = this->LocalGenerator->GetFortranFormat(tgtfmt);
}
const char* var = 0;
switch (format) {
case cmLocalGenerator::FortranFormatFixed:
case cmOutputConverter::FortranFormatFixed:
var = "CMAKE_Fortran_FORMAT_FIXED_FLAG";
break;
case cmLocalGenerator::FortranFormatFree:
case cmOutputConverter::FortranFormatFree:
var = "CMAKE_Fortran_FORMAT_FREE_FLAG";
break;
default:
......@@ -244,7 +244,7 @@ std::string cmCommonTargetGenerator::GetFrameworkFlags(std::string const& l)
if (emitted.insert(*i).second) {
flags += fwSearchFlag;
flags += this->LocalGenerator->ConvertToOutputFormat(
*i, cmLocalGenerator::SHELL);
*i, cmOutputConverter::SHELL);
flags += " ";
}
}
......
......@@ -65,8 +65,8 @@ protected:
void AddFortranFlags(std::string& flags);
std::string Convert(
std::string const& source, cmLocalGenerator::RelativeRoot relative,
cmLocalGenerator::OutputFormat output = cmLocalGenerator::UNCHANGED);
std::string const& source, cmOutputConverter::RelativeRoot relative,
cmOutputConverter::OutputFormat output = cmOutputConverter::UNCHANGED);
void AppendFortranFormatFlags(std::string& flags,
cmSourceFile const& source);
......
......@@ -238,17 +238,17 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
// convert the dependencies to paths relative to the home output
// directory. We must do the same here.
std::string obj_i =
this->LocalGenerator->Convert(obj, cmLocalGenerator::HOME_OUTPUT);
this->LocalGenerator->Convert(obj, cmOutputConverter::HOME_OUTPUT);
std::string obj_m = this->LocalGenerator->ConvertToOutputFormat(
obj_i, cmLocalGenerator::MAKERULE);
obj_i, cmOutputConverter::MAKERULE);
internalDepends << obj_i << std::endl;
for (std::set<std::string>::const_iterator i = dependencies.begin();
i != dependencies.end(); ++i) {
makeDepends << obj_m << ": "
<< this->LocalGenerator->Convert(*i,
cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKERULE)
<< this->LocalGenerator->Convert(
*i, cmOutputConverter::HOME_OUTPUT,
cmOutputConverter::MAKERULE)
<< std::endl;
internalDepends << " " << *i << std::endl;
}
......
......@@ -192,16 +192,16 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends,
stamp += ".mod.stamp";
fcStream << "\n";
fcStream << " \""
<< this->LocalGenerator->Convert(mod_lower,
cmLocalGenerator::START_OUTPUT)
<< this->LocalGenerator->Convert(
mod_lower, cmOutputConverter::START_OUTPUT)
<< "\"\n";
fcStream << " \""
<< this->LocalGenerator->Convert(mod_upper,
cmLocalGenerator::START_OUTPUT)
<< this->LocalGenerator->Convert(
mod_upper, cmOutputConverter::START_OUTPUT)
<< "\"\n";
fcStream << " \""
<< this->LocalGenerator->Convert(stamp,
cmLocalGenerator::START_OUTPUT)
<< this->LocalGenerator->Convert(
stamp, cmOutputConverter::START_OUTPUT)
<< "\"\n";
}
fcStream << " )\n";
......@@ -317,17 +317,17 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
// Write the include dependencies to the output stream.
std::string obj_i =
this->LocalGenerator->Convert(obj, cmLocalGenerator::HOME_OUTPUT);
this->LocalGenerator->Convert(obj, cmOutputConverter::HOME_OUTPUT);
std::string obj_m = this->LocalGenerator->ConvertToOutputFormat(
obj_i, cmLocalGenerator::MAKERULE);
obj_i, cmOutputConverter::MAKERULE);
internalDepends << obj_i << std::endl;
internalDepends << " " << src << std::endl;
for (std::set<std::string>::const_iterator i = info.Includes.begin();
i != info.Includes.end(); ++i) {
makeDepends << obj_m << ": "
<< this->LocalGenerator->Convert(*i,
cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKERULE)
<< this->LocalGenerator->Convert(
*i, cmOutputConverter::HOME_OUTPUT,
cmOutputConverter::MAKERULE)
<< std::endl;
internalDepends << " " << *i << std::endl;
}
......@@ -354,7 +354,7 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
proxy += *i;
proxy += ".mod.proxy";
proxy = this->LocalGenerator->Convert(
proxy, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::MAKERULE);
proxy, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::MAKERULE);
// since we require some things add them to our list of requirements
makeDepends << obj_m << ".requires: " << proxy << std::endl;
......@@ -370,8 +370,8 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
if (!required->second.empty()) {
// This module is known. Depend on its timestamp file.
std::string stampFile = this->LocalGenerator->Convert(
required->second, cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKERULE);
required->second, cmOutputConverter::HOME_OUTPUT,
cmOutputConverter::MAKERULE);
makeDepends << obj_m << ": " << stampFile << "\n";
} else {
// This module is not known to CMake. Try to locate it where
......@@ -379,7 +379,7 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
std::string module;
if (this->FindModule(*i, module)) {
module = this->LocalGenerator->Convert(
module, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::MAKERULE);
module, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::MAKERULE);
makeDepends << obj_m << ": " << module << "\n";
}
}
......@@ -392,8 +392,8 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
proxy += "/";
proxy += *i;
proxy += ".mod.proxy";
proxy = this->LocalGenerator->Convert(proxy, cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKERULE);
proxy = this->LocalGenerator->Convert(
proxy, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::MAKERULE);
makeDepends << proxy << ": " << obj_m << ".provides" << std::endl;
}
......@@ -415,13 +415,13 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
modFile += "/";
modFile += *i;
modFile = this->LocalGenerator->Convert(
modFile, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::SHELL);
modFile, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::SHELL);
std::string stampFile = stamp_dir;
stampFile += "/";
stampFile += m;
stampFile += ".mod.stamp";
stampFile = this->LocalGenerator->Convert(
stampFile, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::SHELL);
stampFile, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::SHELL);
makeDepends << "\t$(CMAKE_COMMAND) -E cmake_copy_f90_mod " << modFile
<< " " << stampFile;
cmMakefile* mf = this->LocalGenerator->GetMakefile();
......@@ -441,7 +441,7 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
std::string driver = this->TargetDirectory;
driver += "/build";
driver = this->LocalGenerator->Convert(
driver, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::MAKERULE);
driver, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::MAKERULE);
makeDepends << driver << ": " << obj_m << ".provides.build\n";
}
......
......@@ -902,7 +902,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
const std::vector<cmGeneratorTarget*> targets =
(*it)->GetGeneratorTargets();
std::string subdir = (*it)->Convert((*it)->GetCurrentBinaryDirectory(),
cmLocalGenerator::HOME_OUTPUT);
cmOutputConverter::HOME_OUTPUT);
if (subdir == ".") {
subdir = "";
}
......
......@@ -2523,7 +2523,7 @@ void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
// Shorten the output name (in expected use case).
cmOutputConverter converter(this->GetMakefiles()[0]->GetStateSnapshot());
std::string fname =
converter.Convert(outputs[0], cmLocalGenerator::HOME_OUTPUT);
converter.Convert(outputs[0], cmOutputConverter::HOME_OUTPUT);
// Associate the hash with this output.
this->RuleHashes[fname] = hash;
......
......@@ -289,7 +289,7 @@ void cmGlobalNinjaGenerator::AddMacOSXContentRule()
std::ostringstream cmd;
cmd << lg->ConvertToOutputFormat(cmSystemTools::GetCMakeCommand(),
cmLocalGenerator::SHELL)
cmOutputConverter::SHELL)
<< " -E copy $in $out";
this->AddRule("COPY_OSX_CONTENT", cmd.str(), "Copying OS X Content $out",
......@@ -1166,13 +1166,13 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
std::ostringstream cmd;
cmd << lg->ConvertToOutputFormat(cmSystemTools::GetCMakeCommand(),
cmLocalGenerator::SHELL)
cmOutputConverter::SHELL)
<< " -H"
<< lg->ConvertToOutputFormat(lg->GetSourceDirectory(),
cmLocalGenerator::SHELL)
cmOutputConverter::SHELL)
<< " -B"
<< lg->ConvertToOutputFormat(lg->GetBinaryDirectory(),
cmLocalGenerator::SHELL);
cmOutputConverter::SHELL);
WriteRule(*this->RulesFileStream, "RERUN_CMAKE", cmd.str(),
"Re-running CMake...", "Rule for re-running cmake.",
/*depfile=*/"",
......@@ -1221,7 +1221,7 @@ std::string cmGlobalNinjaGenerator::ninjaCmd() const
cmLocalGenerator* lgen = this->LocalGenerators[0];
if (lgen) {
return lgen->ConvertToOutputFormat(this->NinjaCommand,
cmLocalGenerator::SHELL);
cmOutputConverter::SHELL);
}
return "ninja";
}
......
......@@ -311,11 +311,11 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
cmakefileStream
<< "# The top level Makefile was generated from the following files:\n"
<< "set(CMAKE_MAKEFILE_DEPENDS\n"
<< " \"" << lg->Convert(cache, cmLocalGenerator::START_OUTPUT) << "\"\n";
<< " \"" << lg->Convert(cache, cmOutputConverter::START_OUTPUT) << "\"\n";
for (std::vector<std::string>::const_iterator i = lfiles.begin();
i != lfiles.end(); ++i) {
cmakefileStream << " \""
<< lg->Convert(*i, cmLocalGenerator::START_OUTPUT)
<< lg->Convert(*i, cmOutputConverter::START_OUTPUT)
<< "\"\n";
}
cmakefileStream << " )\n\n";
......@@ -329,10 +329,10 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
cmakefileStream << "# The corresponding makefile is:\n"
<< "set(CMAKE_MAKEFILE_OUTPUTS\n"
<< " \""
<< lg->Convert(makefileName, cmLocalGenerator::START_OUTPUT)
<< lg->Convert(makefileName, cmOutputConverter::START_OUTPUT)
<< "\"\n"
<< " \""
<< lg->Convert(check, cmLocalGenerator::START_OUTPUT)
<< lg->Convert(check, cmOutputConverter::START_OUTPUT)
<< "\"\n";
cmakefileStream << " )\n\n";
......@@ -345,7 +345,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
for (std::vector<std::string>::const_iterator k = outfiles.begin();
k != outfiles.end(); ++k) {
cmakefileStream << " \""
<< lg->Convert(*k, cmLocalGenerator::HOME_OUTPUT)
<< lg->Convert(*k, cmOutputConverter::HOME_OUTPUT)
<< "\"\n";
}
......@@ -358,7 +358,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
tmpStr += cmake::GetCMakeFilesDirectory();
tmpStr += "/CMakeDirectoryInformation.cmake";
cmakefileStream << " \""
<< lg->Convert(tmpStr, cmLocalGenerator::HOME_OUTPUT)
<< lg->Convert(tmpStr, cmOutputConverter::HOME_OUTPUT)
<< "\"\n";
}
cmakefileStream << " )\n\n";
......@@ -470,8 +470,8 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRules2(
// Begin the directory-level rules section.
std::string dir = lg->GetCurrentBinaryDirectory();
dir = lg->Convert(dir, cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKERULE);
dir = lg->Convert(dir, cmOutputConverter::HOME_OUTPUT,
cmOutputConverter::MAKERULE);
lg->WriteDivider(ruleFileStream);
ruleFileStream << "# Directory level rules for directory " << dir << "\n\n";
......@@ -716,8 +716,8 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
std::ostringstream progCmd;
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start ";
// # in target
progCmd << lg->Convert(progress.Dir, cmLocalGenerator::FULL,
cmLocalGenerator::SHELL);
progCmd << lg->Convert(progress.Dir, cmOutputConverter::FULL,
cmOutputConverter::SHELL);
//
std::set<cmGeneratorTarget const*> emitted;
progCmd << " " << this->CountProgressMarksInTarget(gtarget, emitted);
......@@ -729,8 +729,8 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
{
std::ostringstream progCmd;
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0
progCmd << lg->Convert(progress.Dir, cmLocalGenerator::FULL,
cmLocalGenerator::SHELL);
progCmd << lg->Convert(progress.Dir, cmOutputConverter::FULL,
cmOutputConverter::SHELL);
progCmd << " 0";
commands.push_back(progCmd.str());
}
......
......@@ -385,7 +385,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
if (vcprojName) {
cmLocalGenerator* lg = target->GetLocalGenerator();
std::string dir = lg->GetCurrentBinaryDirectory();
dir = root->Convert(dir.c_str(), cmLocalGenerator::START_OUTPUT);
dir = root->Convert(dir.c_str(), cmOutputConverter::START_OUTPUT);
if (dir == ".") {
dir = ""; // msbuild cannot handle ".\" prefix
}
......
......@@ -660,10 +660,10 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile(
std::string flags;
const char* srcfmt = sf->GetProperty("Fortran_FORMAT");
switch (this->CurrentLocalGenerator->GetFortranFormat(srcfmt)) {
case cmLocalGenerator::FortranFormatFixed:
case cmOutputConverter::FortranFormatFixed:
flags = "-fixed " + flags;
break;
case cmLocalGenerator::FortranFormatFree:
case cmOutputConverter::FortranFormatFree:
flags = "-free " + flags;
break;
default:
......@@ -1982,10 +1982,10 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
const char* format = 0;
const char* tgtfmt = gtgt->GetProperty("Fortran_FORMAT");
switch (this->CurrentLocalGenerator->GetFortranFormat(tgtfmt)) {
case cmLocalGenerator::FortranFormatFixed:
case cmOutputConverter::FortranFormatFixed:
format = "fixed";
break;
case cmLocalGenerator::FortranFormatFree:
case cmOutputConverter::FortranFormatFree:
format = "free";
break;
default:
......
......@@ -2140,7 +2140,7 @@ std::string cmLocalGenerator::ConstructComment(
for (std::vector<std::string>::const_iterator o = ccg.GetOutputs().begin();
o != ccg.GetOutputs().end(); ++o) {
comment += sep;
comment += this->Convert(*o, cmLocalGenerator::START_OUTPUT);
comment += this->Convert(*o, cmOutputConverter::START_OUTPUT);
sep = ", ";
}
return comment;
......
......@@ -174,9 +174,10 @@ public:
bool GetRealDependency(const std::string& name, const std::string& config,
std::string& dep);
virtual std::string ConvertToIncludeReference(std::string const& path,
OutputFormat format = SHELL,
bool forceFullPaths = false);
virtual std::string ConvertToIncludeReference(
std::string const& path,
cmOutputConverter::OutputFormat format = cmOutputConverter::SHELL,
bool forceFullPaths = false);
/** Called from command-line hook to clear dependencies. */
virtual void ClearDependencies(cmMakefile* /* mf */, bool /* verbose */) {}
......@@ -353,8 +354,9 @@ protected:
std::string& CreateSafeUniqueObjectFileName(const std::string& sin,
std::string const& dir_max);
virtual std::string ConvertToLinkReference(std::string const& lib,
OutputFormat format = SHELL);
virtual std::string ConvertToLinkReference(
std::string const& lib,
cmOutputConverter::OutputFormat format = cmOutputConverter::SHELL);
/** Check whether the native build system supports the given
definition. Issues a warning. */
......
......@@ -41,8 +41,8 @@ void cmLocalNinjaGenerator::Generate()
{
// Compute the path to use when referencing the current output
// directory from the top output directory.
this->HomeRelativeOutputPath =
this->Convert(this->GetCurrentBinaryDirectory(), HOME_OUTPUT);
this->HomeRelativeOutputPath = this->Convert(
this->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT);
if (this->HomeRelativeOutputPath == ".") {
this->HomeRelativeOutputPath = "";
}
......@@ -121,16 +121,19 @@ cmGlobalNinjaGenerator* cmLocalNinjaGenerator::GetGlobalNinjaGenerator()
// Virtual protected methods.
std::string cmLocalNinjaGenerator::ConvertToLinkReference(
std::string const& lib, OutputFormat format)
std::string const& lib, cmOutputConverter::OutputFormat format)
{
std::string path = this->GetGlobalNinjaGenerator()->ConvertToNinjaPath(lib);
return this->ConvertToOutputFormat(path, format);
}
std::string cmLocalNinjaGenerator::ConvertToIncludeReference(
std::string const& path, OutputFormat format, bool forceFullPaths)
std::string const& path, cmOutputConverter::OutputFormat format,
bool forceFullPaths)
{
return this->Convert(path, forceFullPaths ? FULL : HOME_OUTPUT, format);
return this->Convert(path, forceFullPaths ? cmOutputConverter::FULL
: cmOutputConverter::HOME_OUTPUT,
format);
}
// Private methods.
......@@ -338,7 +341,8 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(
#else
std::string cdStr = "cd ";
#endif
cdCmd << cdStr << this->ConvertToOutputFormat(wd, SHELL);
cdCmd << cdStr
<< this->ConvertToOutputFormat(wd, cmOutputConverter::SHELL);
cmdLines.push_back(cdCmd.str());
}
......@@ -346,7 +350,8 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(
for (unsigned i = 0; i != ccg.GetNumberOfCommands(); ++i) {
cmdLines.push_back(launcher +
this->ConvertToOutputFormat(ccg.GetCommand(i), SHELL));
this->ConvertToOutputFormat(ccg.GetCommand(i),
cmOutputConverter::SHELL));
std::string& cmd = cmdLines.back();
ccg.AppendArguments(i, cmd);
......@@ -473,10 +478,12 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
std::string output;
const std::vector<std::string>& outputs = ccg.GetOutputs();
if (!outputs.empty()) {
RelativeRoot relative_root =
ccg.GetWorkingDirectory().empty() ? START_OUTPUT : NONE;
cmOutputConverter::RelativeRoot relative_root =
ccg.GetWorkingDirectory().empty() ? cmOutputConverter::START_OUTPUT
: cmOutputConverter::NONE;
output = this->Convert(outputs[0], relative_root, SHELL);
output =
this->Convert(outputs[0], relative_root, cmOutputConverter::SHELL);
}
vars.Output = output.c_str();
......
......@@ -72,17 +72,19 @@ public:
void AppendCustomCommandDeps(cmCustomCommandGenerator const& ccg,
cmNinjaDeps& ninjaDeps);
virtual std::string ConvertToLinkReference(std::string const& lib,
OutputFormat format = SHELL);
virtual std::string ConvertToLinkReference(
std::string const& lib,
cmOutputConverter::OutputFormat format = cmOutputConverter::SHELL);
virtual void ComputeObjectFilenames(
std::map<cmSourceFile const*, std::string>& mapping,
cmGeneratorTarget const* gt = 0);
protected:
virtual std::string ConvertToIncludeReference(std::string const& path,
OutputFormat format = SHELL,
bool forceFullPaths = false);
virtual std::string ConvertToIncludeReference(
std::string const& path,
cmOutputConverter::OutputFormat format = cmOutputConverter::SHELL,
bool forceFullPaths = false);
private:
cmGeneratedFileStream& GetBuildFileStream() const;
......
This diff is collapsed.
......@@ -120,7 +120,7 @@ public:
// create a command that cds to the start dir then runs the commands
void CreateCDCommand(std::vector<std::string>& commands,
const char* targetDir,
cmLocalGenerator::RelativeRoot returnDir);
cmOutputConverter::RelativeRoot returnDir);
static std::string ConvertToQuotedOutputPath(const char* p,
bool useWatcomQuote);
......@@ -230,11 +230,11 @@ protected:
void AppendCustomCommands(
std::vector<std::string>& commands,
const std::vector<cmCustomCommand>& ccs, cmGeneratorTarget* target,
cmLocalGenerator::RelativeRoot relative = cmLocalGenerator::HOME_OUTPUT);
cmOutputConverter::RelativeRoot relative = cmOutputConverter::HOME_OUTPUT);
void AppendCustomCommand(
std::vector<std::string>& commands, cmCustomCommandGenerator const& ccg,
cmGeneratorTarget* target, bool echo_comment = false,
cmLocalGenerator::RelativeRoot relative = cmLocalGenerator::HOME_OUTPUT,
cmOutputConverter::RelativeRoot relative = cmOutputConverter::HOME_OUTPUT,
std::ostream* content = 0);
void AppendCleanCommand(std::vector<std::string>& commands,
const std::vector<std::string>& files,
......@@ -247,9 +247,11 @@ protected:
void CheckMultipleOutputs(bool verbose);
private:
std::string ConvertShellCommand(std::string const& cmd, RelativeRoot root);
std::string ConvertShellCommand(std::string const& cmd,
cmOutputConverter::RelativeRoot root);
std::string MakeLauncher(cmCustomCommandGenerator const& ccg,
cmGeneratorTarget* target, RelativeRoot relative);
cmGeneratorTarget* target,
cmOutputConverter::RelativeRoot relative);
virtual void ComputeObjectFilenames(
std::map<cmSourceFile const*, std::string>& mapping,
......
......@@ -269,7 +269,8 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
args += this->GetBinaryDirectory();
commandLine.push_back(args);
commandLine.push_back("--check-stamp-file");
std::string stampFilename = this->Convert(stampName.c_str(), FULL, SHELL);
std::string stampFilename = this->Convert(
stampName.c_str(), cmOutputConverter::FULL, cmOutputConverter::SHELL);
commandLine.push_back(stampFilename.c_str());
std::vector<std::string> const& listFiles = this->Makefile->GetListFiles();
......@@ -277,8 +278,8 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
cmCustomCommandLines commandLines;
commandLines.push_back(commandLine);
const char* no_working_directory = 0;
std::string fullpathStampName =
this->Convert(stampName.c_str(), FULL, UNCHANGED);
std::string fullpathStampName = this->Convert(
stampName.c_str(), cmOutputConverter::FULL, cmOutputConverter::UNCHANGED);
this->Makefile->AddCustomCommandToOutput(
fullpathStampName.c_str(), listFiles, makefileIn.c_str(), commandLines,
comment.c_str(), no_working_directory, true);
......@@ -683,10 +684,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
if (this->FortranProject) {
switch (this->GetFortranFormat(target->GetProperty("Fortran_FORMAT"))) {
case FortranFormatFixed:
case cmOutputConverter::FortranFormatFixed:
flags += " -fixed";
break;
case FortranFormatFree:
case cmOutputConverter::FortranFormatFree:
flags += " -free";
break;
default:
......@@ -786,8 +787,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
target->GetProperty("Fortran_MODULE_DIRECTORY");
std::string modDir;
if (target_mod_dir) {
modDir = this->Convert(target_mod_dir, cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::UNCHANGED);
modDir = this->Convert(target_mod_dir, cmOutputConverter::START_OUTPUT,
cmOutputConverter::UNCHANGED);
} else {
modDir = ".";
}
......@@ -1006,8 +1007,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
linkOptions.Parse(extraLinkOptions.c_str());
if (!this->ModuleDefinitionFile.empty()) {
std::string defFile =
this->ConvertToOutputFormat(this->ModuleDefinitionFile, SHELL);
std::string defFile = this->ConvertToOutputFormat(
this->ModuleDefinitionFile, cmOutputConverter::SHELL);
linkOptions.AddFlag("ModuleDefinitionFile", defFile.c_str());
}
......@@ -1298,8 +1299,8 @@ void cmLocalVisualStudio7GeneratorInternals::OutputLibraries(
for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
if (l->IsPath) {
std::string rel =
lg->Convert(l->Value.c_str(), cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::UNCHANGED);
lg->Convert(l->Value.c_str(), cmOutputConverter::START_OUTPUT,
cmOutputConverter::UNCHANGED);
fout << lg->ConvertToXMLOutputPath(rel.c_str()) << " ";
} else if (!l->Target ||
l->Target->GetType() != cmState::INTERFACE_LIBRARY) {
......@@ -1319,8 +1320,8 @@ void cmLocalVisualStudio7GeneratorInternals::OutputObjects(
const char* sep = isep ? isep : "";
for (std::vector<std::string>::const_iterator oi = objs.begin();
oi != objs.end(); ++oi) {
std::string rel = lg->Convert(oi->c_str(), cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::UNCHANGED);
std::string rel = lg->Convert(oi->c_str(), cmOutputConverter::START_OUTPUT,
cmOutputConverter::UNCHANGED);
fout << sep << lg->ConvertToXMLOutputPath(rel.c_str());
sep = " ";
}
......@@ -1343,7 +1344,9 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories(
// Switch to a relative path specification if it is shorter.
if (cmSystemTools::FileIsFullPath(dir.c_str())) {
std::string rel = this->Convert(dir.c_str(), START_OUTPUT, UNCHANGED);
std::string rel =
this->Convert(dir.c_str(), cmOutputConverter::START_OUTPUT,
cmOutputConverter::UNCHANGED);
if (rel.size() < dir.size()) {
dir = rel;
}
......@@ -1472,11 +1475,11 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo(
}
if (lg->FortranProject) {
switch (lg->GetFortranFormat(sf.GetProperty("Fortran_FORMAT"))) {
case cmLocalGenerator::FortranFormatFixed:
case cmOutputConverter::FortranFormatFixed:
fc.CompileFlags = "-fixed " + fc.CompileFlags;
needfc = true;
break;
case cmLocalGenerator::FortranFormatFree:
case cmOutputConverter::FortranFormatFree:
fc.CompileFlags = "-free " + fc.CompileFlags;
needfc = true;
break;
......@@ -2042,7 +2045,8 @@ std::string cmLocalVisualStudio7Generator::EscapeForXML(const std::string& s)
std::string cmLocalVisualStudio7Generator::ConvertToXMLOutputPath(
const char* path)
{
std::string ret = this->ConvertToOutputFormat(path, SHELL);
std::string ret =
this->ConvertToOutputFormat(path, cmOutputConverter::SHELL);
cmSystemTools::ReplaceString(ret, "&", "&amp;");
cmSystemTools::ReplaceString(ret, "\"", "&quot;");
cmSystemTools::ReplaceString(ret, "<", "&lt;");
......@@ -2053,7 +2057,8 @@ std::string cmLocalVisualStudio7Generator::ConvertToXMLOutputPath(
std::string cmLocalVisualStudio7Generator::ConvertToXMLOutputPathSingle(
const char* path)
{
std::string ret = this->ConvertToOutputFormat(path, SHELL);
std::string ret =
this->ConvertToOutputFormat(path, cmOutputConverter::SHELL);
cmSystemTools::ReplaceString(ret, "\"", "");
cmSystemTools::ReplaceString(ret, "&", "&amp;");
cmSystemTools::ReplaceString(ret, "<", "&lt;");
......
......@@ -128,16 +128,16 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
std::string targetFullPathPDB = pdbOutputPath + targetNamePDB;
std::string targetFullPathImport = outpathImp + targetNameImport;
std::string targetOutPathPDB = this->Convert(
targetFullPathPDB, cmLocalGenerator::NONE, cmLocalGenerator::SHELL);
targetFullPathPDB, cmOutputConverter::NONE, cmOutputConverter::SHELL);
// Convert to the output path to use in constructing commands.
std::string targetOutPath = this->Convert(
targetFullPath, cmLocalGenerator::START_OUTPUT, cmLocalGenerator::SHELL);
targetFullPath, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL);
std::string targetOutPathReal =
this->Convert(targetFullPathReal, cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::SHELL);
this->Convert(targetFullPathReal, cmOutputConverter::START_OUTPUT,
cmOutputConverter::SHELL);
std::string targetOutPathImport =