Merge topic 'cleanup-Convert'
6429d6d9 cmOutputConverter: Remove now-obsolete Convert method ad790617 Convert: Inline uses of START_OUTPUT 4cf707b0 Convert: Remove HOME_OUTPUT enum value 3d12ffbf Ninja: Update comment variable reference 4d69ac76 Convert: Move access to BinaryDirectory out of loops e7c89567 Convert: Inline uses of HOME_OUTPUT dc510919 Common: Use a string instead of enum for WorkingDirectory 76833149 Convert: Simplify switch dc95020e Convert: Remove obsolete MAKERULE enum value 1825f876 Convert: Move access to BinaryDirectory out of loops 25c39ac2 Convert: Inline HOME_OUTPUT MAKERULE conversion 516e79ba Convert: Inline MAKERULE conversions e13e519e Convert: Move access to BinaryDirectory out of loops 34c6e995 Convert: Avoid HOME_OUTPUT enum when converting to relative paths 839c65bc Convert: Move access to CurrentBinaryDirectory out of loops 21b5fdf9 Convert: Avoid START_OUTPUT enum when converting to relative paths ...
This commit is contained in:
commit
160a7ad640
@ -47,13 +47,6 @@ std::string const& cmCommonTargetGenerator::GetConfigName() const
|
|||||||
return this->ConfigName;
|
return this->ConfigName;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCommonTargetGenerator::Convert(
|
|
||||||
std::string const& source, cmOutputConverter::RelativeRoot relative,
|
|
||||||
cmOutputConverter::OutputFormat output)
|
|
||||||
{
|
|
||||||
return this->LocalGenerator->Convert(source, relative, output);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* cmCommonTargetGenerator::GetFeature(const std::string& feature)
|
const char* cmCommonTargetGenerator::GetFeature(const std::string& feature)
|
||||||
{
|
{
|
||||||
return this->GeneratorTarget->GetFeature(feature, this->ConfigName);
|
return this->GeneratorTarget->GetFeature(feature, this->ConfigName);
|
||||||
@ -204,8 +197,9 @@ std::string cmCommonTargetGenerator::GetManifests()
|
|||||||
std::vector<std::string> manifests;
|
std::vector<std::string> manifests;
|
||||||
for (std::vector<cmSourceFile const*>::iterator mi = manifest_srcs.begin();
|
for (std::vector<cmSourceFile const*>::iterator mi = manifest_srcs.begin();
|
||||||
mi != manifest_srcs.end(); ++mi) {
|
mi != manifest_srcs.end(); ++mi) {
|
||||||
manifests.push_back(this->Convert(
|
manifests.push_back(this->LocalGenerator->ConvertToOutputFormat(
|
||||||
(*mi)->GetFullPath(), this->LocalGenerator->GetWorkingDirectory(),
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetWorkingDirectory(), (*mi)->GetFullPath()),
|
||||||
cmOutputConverter::SHELL));
|
cmOutputConverter::SHELL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,10 +57,6 @@ protected:
|
|||||||
// The windows module definition source file (.def), if any.
|
// The windows module definition source file (.def), if any.
|
||||||
cmSourceFile const* ModuleDefinitionFile;
|
cmSourceFile const* ModuleDefinitionFile;
|
||||||
|
|
||||||
std::string Convert(std::string const& source,
|
|
||||||
cmOutputConverter::RelativeRoot relative,
|
|
||||||
cmOutputConverter::OutputFormat output);
|
|
||||||
|
|
||||||
void AppendFortranFormatFlags(std::string& flags,
|
void AppendFortranFormatFlags(std::string& flags,
|
||||||
cmSourceFile const& source);
|
cmSourceFile const& source);
|
||||||
|
|
||||||
|
@ -239,19 +239,18 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
|
|||||||
// written by the original local generator for this directory
|
// written by the original local generator for this directory
|
||||||
// convert the dependencies to paths relative to the home output
|
// convert the dependencies to paths relative to the home output
|
||||||
// directory. We must do the same here.
|
// directory. We must do the same here.
|
||||||
std::string obj_i = this->LocalGenerator->ConvertToRelativePath(
|
std::string binDir = this->LocalGenerator->GetBinaryDirectory();
|
||||||
obj, cmOutputConverter::HOME_OUTPUT);
|
std::string obj_i = this->LocalGenerator->ConvertToRelativePath(binDir, obj);
|
||||||
std::string obj_m = this->LocalGenerator->ConvertToOutputFormat(
|
std::string obj_m = cmSystemTools::ConvertToOutputPath(obj_i.c_str());
|
||||||
obj_i, cmOutputConverter::MAKERULE);
|
|
||||||
internalDepends << obj_i << std::endl;
|
internalDepends << obj_i << std::endl;
|
||||||
|
|
||||||
for (std::set<std::string>::const_iterator i = dependencies.begin();
|
for (std::set<std::string>::const_iterator i = dependencies.begin();
|
||||||
i != dependencies.end(); ++i) {
|
i != dependencies.end(); ++i) {
|
||||||
makeDepends << obj_m << ": "
|
makeDepends
|
||||||
<< this->LocalGenerator->Convert(
|
<< obj_m << ": "
|
||||||
*i, cmOutputConverter::HOME_OUTPUT,
|
<< cmSystemTools::ConvertToOutputPath(
|
||||||
cmOutputConverter::MAKERULE)
|
this->LocalGenerator->ConvertToRelativePath(binDir, *i).c_str())
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
internalDepends << " " << *i << std::endl;
|
internalDepends << " " << *i << std::endl;
|
||||||
}
|
}
|
||||||
makeDepends << std::endl;
|
makeDepends << std::endl;
|
||||||
|
@ -189,6 +189,8 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends,
|
|||||||
cmGeneratedFileStream fcStream(fcName.c_str());
|
cmGeneratedFileStream fcStream(fcName.c_str());
|
||||||
fcStream << "# Remove fortran modules provided by this target.\n";
|
fcStream << "# Remove fortran modules provided by this target.\n";
|
||||||
fcStream << "FILE(REMOVE";
|
fcStream << "FILE(REMOVE";
|
||||||
|
std::string currentBinDir =
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory();
|
||||||
for (std::set<std::string>::const_iterator i = provides.begin();
|
for (std::set<std::string>::const_iterator i = provides.begin();
|
||||||
i != provides.end(); ++i) {
|
i != provides.end(); ++i) {
|
||||||
std::string mod_upper = mod_dir;
|
std::string mod_upper = mod_dir;
|
||||||
@ -205,16 +207,16 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends,
|
|||||||
stamp += ".mod.stamp";
|
stamp += ".mod.stamp";
|
||||||
fcStream << "\n";
|
fcStream << "\n";
|
||||||
fcStream << " \""
|
fcStream << " \""
|
||||||
<< this->LocalGenerator->ConvertToRelativePath(
|
<< this->LocalGenerator->ConvertToRelativePath(currentBinDir,
|
||||||
mod_lower, cmOutputConverter::START_OUTPUT)
|
mod_lower)
|
||||||
<< "\"\n";
|
<< "\"\n";
|
||||||
fcStream << " \""
|
fcStream << " \""
|
||||||
<< this->LocalGenerator->ConvertToRelativePath(
|
<< this->LocalGenerator->ConvertToRelativePath(currentBinDir,
|
||||||
mod_upper, cmOutputConverter::START_OUTPUT)
|
mod_upper)
|
||||||
<< "\"\n";
|
<< "\"\n";
|
||||||
fcStream << " \""
|
fcStream << " \""
|
||||||
<< this->LocalGenerator->ConvertToRelativePath(
|
<< this->LocalGenerator->ConvertToRelativePath(currentBinDir,
|
||||||
stamp, cmOutputConverter::START_OUTPUT)
|
stamp)
|
||||||
<< "\"\n";
|
<< "\"\n";
|
||||||
}
|
}
|
||||||
fcStream << " )\n";
|
fcStream << " )\n";
|
||||||
@ -329,19 +331,18 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
|
|||||||
const char* src = info.Source.c_str();
|
const char* src = info.Source.c_str();
|
||||||
|
|
||||||
// Write the include dependencies to the output stream.
|
// Write the include dependencies to the output stream.
|
||||||
std::string obj_i = this->LocalGenerator->ConvertToRelativePath(
|
std::string binDir = this->LocalGenerator->GetBinaryDirectory();
|
||||||
obj, cmOutputConverter::HOME_OUTPUT);
|
std::string obj_i = this->LocalGenerator->ConvertToRelativePath(binDir, obj);
|
||||||
std::string obj_m = this->LocalGenerator->ConvertToOutputFormat(
|
std::string obj_m = cmSystemTools::ConvertToOutputPath(obj_i.c_str());
|
||||||
obj_i, cmOutputConverter::MAKERULE);
|
|
||||||
internalDepends << obj_i << std::endl;
|
internalDepends << obj_i << std::endl;
|
||||||
internalDepends << " " << src << std::endl;
|
internalDepends << " " << src << std::endl;
|
||||||
for (std::set<std::string>::const_iterator i = info.Includes.begin();
|
for (std::set<std::string>::const_iterator i = info.Includes.begin();
|
||||||
i != info.Includes.end(); ++i) {
|
i != info.Includes.end(); ++i) {
|
||||||
makeDepends << obj_m << ": "
|
makeDepends
|
||||||
<< this->LocalGenerator->Convert(
|
<< obj_m << ": "
|
||||||
*i, cmOutputConverter::HOME_OUTPUT,
|
<< cmSystemTools::ConvertToOutputPath(
|
||||||
cmOutputConverter::MAKERULE)
|
this->LocalGenerator->ConvertToRelativePath(binDir, *i).c_str())
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
internalDepends << " " << *i << std::endl;
|
internalDepends << " " << *i << std::endl;
|
||||||
}
|
}
|
||||||
makeDepends << std::endl;
|
makeDepends << std::endl;
|
||||||
@ -366,8 +367,8 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
|
|||||||
proxy += "/";
|
proxy += "/";
|
||||||
proxy += *i;
|
proxy += *i;
|
||||||
proxy += ".mod.proxy";
|
proxy += ".mod.proxy";
|
||||||
proxy = this->LocalGenerator->Convert(
|
proxy = cmSystemTools::ConvertToOutputPath(
|
||||||
proxy, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::MAKERULE);
|
this->LocalGenerator->ConvertToRelativePath(binDir, proxy).c_str());
|
||||||
|
|
||||||
// since we require some things add them to our list of requirements
|
// since we require some things add them to our list of requirements
|
||||||
makeDepends << obj_m << ".requires: " << proxy << std::endl;
|
makeDepends << obj_m << ".requires: " << proxy << std::endl;
|
||||||
@ -382,17 +383,17 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
|
|||||||
}
|
}
|
||||||
if (!required->second.empty()) {
|
if (!required->second.empty()) {
|
||||||
// This module is known. Depend on its timestamp file.
|
// This module is known. Depend on its timestamp file.
|
||||||
std::string stampFile = this->LocalGenerator->Convert(
|
std::string stampFile = cmSystemTools::ConvertToOutputPath(
|
||||||
required->second, cmOutputConverter::HOME_OUTPUT,
|
this->LocalGenerator->ConvertToRelativePath(binDir, required->second)
|
||||||
cmOutputConverter::MAKERULE);
|
.c_str());
|
||||||
makeDepends << obj_m << ": " << stampFile << "\n";
|
makeDepends << obj_m << ": " << stampFile << "\n";
|
||||||
} else {
|
} else {
|
||||||
// This module is not known to CMake. Try to locate it where
|
// This module is not known to CMake. Try to locate it where
|
||||||
// the compiler will and depend on that.
|
// the compiler will and depend on that.
|
||||||
std::string module;
|
std::string module;
|
||||||
if (this->FindModule(*i, module)) {
|
if (this->FindModule(*i, module)) {
|
||||||
module = this->LocalGenerator->Convert(
|
module = cmSystemTools::ConvertToOutputPath(
|
||||||
module, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::MAKERULE);
|
this->LocalGenerator->ConvertToRelativePath(binDir, module).c_str());
|
||||||
makeDepends << obj_m << ": " << module << "\n";
|
makeDepends << obj_m << ": " << module << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -405,8 +406,8 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
|
|||||||
proxy += "/";
|
proxy += "/";
|
||||||
proxy += *i;
|
proxy += *i;
|
||||||
proxy += ".mod.proxy";
|
proxy += ".mod.proxy";
|
||||||
proxy = this->LocalGenerator->Convert(
|
proxy = cmSystemTools::ConvertToOutputPath(
|
||||||
proxy, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::MAKERULE);
|
this->LocalGenerator->ConvertToRelativePath(binDir, proxy).c_str());
|
||||||
makeDepends << proxy << ": " << obj_m << ".provides" << std::endl;
|
makeDepends << proxy << ": " << obj_m << ".provides" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,14 +428,16 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
|
|||||||
std::string modFile = mod_dir;
|
std::string modFile = mod_dir;
|
||||||
modFile += "/";
|
modFile += "/";
|
||||||
modFile += *i;
|
modFile += *i;
|
||||||
modFile = this->LocalGenerator->Convert(
|
modFile = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
modFile, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(binDir, modFile),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
std::string stampFile = stamp_dir;
|
std::string stampFile = stamp_dir;
|
||||||
stampFile += "/";
|
stampFile += "/";
|
||||||
stampFile += m;
|
stampFile += m;
|
||||||
stampFile += ".mod.stamp";
|
stampFile += ".mod.stamp";
|
||||||
stampFile = this->LocalGenerator->Convert(
|
stampFile = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
stampFile, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(binDir, stampFile),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
makeDepends << "\t$(CMAKE_COMMAND) -E cmake_copy_f90_mod " << modFile
|
makeDepends << "\t$(CMAKE_COMMAND) -E cmake_copy_f90_mod " << modFile
|
||||||
<< " " << stampFile;
|
<< " " << stampFile;
|
||||||
cmMakefile* mf = this->LocalGenerator->GetMakefile();
|
cmMakefile* mf = this->LocalGenerator->GetMakefile();
|
||||||
@ -453,8 +456,8 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
|
|||||||
// the target finishes building.
|
// the target finishes building.
|
||||||
std::string driver = this->TargetDirectory;
|
std::string driver = this->TargetDirectory;
|
||||||
driver += "/build";
|
driver += "/build";
|
||||||
driver = this->LocalGenerator->Convert(
|
driver = cmSystemTools::ConvertToOutputPath(
|
||||||
driver, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::MAKERULE);
|
this->LocalGenerator->ConvertToRelativePath(binDir, driver).c_str());
|
||||||
makeDepends << driver << ": " << obj_m << ".provides.build\n";
|
makeDepends << driver << ": " << obj_m << ".provides.build\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ void cmExportBuildAndroidMKGenerator::GenerateImportTargetCode(
|
|||||||
os << "LOCAL_MODULE := ";
|
os << "LOCAL_MODULE := ";
|
||||||
os << targetName << "\n";
|
os << targetName << "\n";
|
||||||
os << "LOCAL_SRC_FILES := ";
|
os << "LOCAL_SRC_FILES := ";
|
||||||
std::string path = target->GetLocalGenerator()->ConvertToOutputFormat(
|
std::string path =
|
||||||
target->GetFullPath(), cmOutputConverter::MAKERULE);
|
cmSystemTools::ConvertToOutputPath(target->GetFullPath().c_str());
|
||||||
os << path << "\n";
|
os << path << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -914,7 +914,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
|
|||||||
const std::vector<cmGeneratorTarget*> targets =
|
const std::vector<cmGeneratorTarget*> targets =
|
||||||
(*it)->GetGeneratorTargets();
|
(*it)->GetGeneratorTargets();
|
||||||
std::string subdir = (*it)->ConvertToRelativePath(
|
std::string subdir = (*it)->ConvertToRelativePath(
|
||||||
(*it)->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT);
|
this->HomeOutputDirectory, (*it)->GetCurrentBinaryDirectory());
|
||||||
if (subdir == ".") {
|
if (subdir == ".") {
|
||||||
subdir = "";
|
subdir = "";
|
||||||
}
|
}
|
||||||
|
@ -2579,7 +2579,7 @@ void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
|
|||||||
// Shorten the output name (in expected use case).
|
// Shorten the output name (in expected use case).
|
||||||
cmOutputConverter converter(this->GetMakefiles()[0]->GetStateSnapshot());
|
cmOutputConverter converter(this->GetMakefiles()[0]->GetStateSnapshot());
|
||||||
std::string fname = converter.ConvertToRelativePath(
|
std::string fname = converter.ConvertToRelativePath(
|
||||||
outputs[0], cmOutputConverter::HOME_OUTPUT);
|
this->GetMakefiles()[0]->GetState()->GetBinaryDirectory(), outputs[0]);
|
||||||
|
|
||||||
// Associate the hash with this output.
|
// Associate the hash with this output.
|
||||||
this->RuleHashes[fname] = hash;
|
this->RuleHashes[fname] = hash;
|
||||||
|
@ -760,8 +760,8 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path)
|
|||||||
{
|
{
|
||||||
cmLocalNinjaGenerator* ng =
|
cmLocalNinjaGenerator* ng =
|
||||||
static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]);
|
static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]);
|
||||||
std::string convPath =
|
std::string convPath = ng->ConvertToRelativePath(
|
||||||
ng->ConvertToRelativePath(path, cmOutputConverter::HOME_OUTPUT);
|
this->LocalGenerators[0]->GetState()->GetBinaryDirectory(), path);
|
||||||
convPath = this->NinjaOutputPath(convPath);
|
convPath = this->NinjaOutputPath(convPath);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
std::replace(convPath.begin(), convPath.end(), '/', '\\');
|
std::replace(convPath.begin(), convPath.end(), '/', '\\');
|
||||||
@ -774,8 +774,8 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaFolderRule(
|
|||||||
{
|
{
|
||||||
cmLocalNinjaGenerator* ng =
|
cmLocalNinjaGenerator* ng =
|
||||||
static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]);
|
static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]);
|
||||||
std::string convPath =
|
std::string convPath = ng->ConvertToRelativePath(
|
||||||
ng->ConvertToRelativePath(path + "/all", cmOutputConverter::HOME);
|
this->LocalGenerators[0]->GetState()->GetSourceDirectory(), path + "/all");
|
||||||
convPath = this->NinjaOutputPath(convPath);
|
convPath = this->NinjaOutputPath(convPath);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
std::replace(convPath.begin(), convPath.end(), '/', '\\');
|
std::replace(convPath.begin(), convPath.end(), '/', '\\');
|
||||||
|
@ -319,18 +319,15 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
|
|||||||
std::string cache = this->GetCMakeInstance()->GetHomeOutputDirectory();
|
std::string cache = this->GetCMakeInstance()->GetHomeOutputDirectory();
|
||||||
cache += "/CMakeCache.txt";
|
cache += "/CMakeCache.txt";
|
||||||
|
|
||||||
|
std::string currentBinDir = lg->GetCurrentBinaryDirectory();
|
||||||
// Save the list to the cmake file.
|
// Save the list to the cmake file.
|
||||||
cmakefileStream
|
cmakefileStream
|
||||||
<< "# The top level Makefile was generated from the following files:\n"
|
<< "# The top level Makefile was generated from the following files:\n"
|
||||||
<< "set(CMAKE_MAKEFILE_DEPENDS\n"
|
<< "set(CMAKE_MAKEFILE_DEPENDS\n"
|
||||||
<< " \""
|
<< " \"" << lg->ConvertToRelativePath(currentBinDir, cache) << "\"\n";
|
||||||
<< lg->ConvertToRelativePath(cache, cmOutputConverter::START_OUTPUT)
|
|
||||||
<< "\"\n";
|
|
||||||
for (std::vector<std::string>::const_iterator i = lfiles.begin();
|
for (std::vector<std::string>::const_iterator i = lfiles.begin();
|
||||||
i != lfiles.end(); ++i) {
|
i != lfiles.end(); ++i) {
|
||||||
cmakefileStream << " \""
|
cmakefileStream << " \"" << lg->ConvertToRelativePath(currentBinDir, *i)
|
||||||
<< lg->ConvertToRelativePath(
|
|
||||||
*i, cmOutputConverter::START_OUTPUT)
|
|
||||||
<< "\"\n";
|
<< "\"\n";
|
||||||
}
|
}
|
||||||
cmakefileStream << " )\n\n";
|
cmakefileStream << " )\n\n";
|
||||||
@ -344,15 +341,14 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
|
|||||||
cmakefileStream << "# The corresponding makefile is:\n"
|
cmakefileStream << "# The corresponding makefile is:\n"
|
||||||
<< "set(CMAKE_MAKEFILE_OUTPUTS\n"
|
<< "set(CMAKE_MAKEFILE_OUTPUTS\n"
|
||||||
<< " \""
|
<< " \""
|
||||||
<< lg->ConvertToRelativePath(makefileName,
|
<< lg->ConvertToRelativePath(currentBinDir, makefileName)
|
||||||
cmOutputConverter::START_OUTPUT)
|
|
||||||
<< "\"\n"
|
<< "\"\n"
|
||||||
<< " \""
|
<< " \"" << lg->ConvertToRelativePath(currentBinDir, check)
|
||||||
<< lg->ConvertToRelativePath(check,
|
|
||||||
cmOutputConverter::START_OUTPUT)
|
|
||||||
<< "\"\n";
|
<< "\"\n";
|
||||||
cmakefileStream << " )\n\n";
|
cmakefileStream << " )\n\n";
|
||||||
|
|
||||||
|
const std::string binDir = lg->GetBinaryDirectory();
|
||||||
|
|
||||||
// CMake must rerun if a byproduct is missing.
|
// CMake must rerun if a byproduct is missing.
|
||||||
{
|
{
|
||||||
cmakefileStream << "# Byproducts of CMake generate step:\n"
|
cmakefileStream << "# Byproducts of CMake generate step:\n"
|
||||||
@ -361,9 +357,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
|
|||||||
lg->GetMakefile()->GetOutputFiles();
|
lg->GetMakefile()->GetOutputFiles();
|
||||||
for (std::vector<std::string>::const_iterator k = outfiles.begin();
|
for (std::vector<std::string>::const_iterator k = outfiles.begin();
|
||||||
k != outfiles.end(); ++k) {
|
k != outfiles.end(); ++k) {
|
||||||
cmakefileStream << " \""
|
cmakefileStream << " \"" << lg->ConvertToRelativePath(binDir, *k)
|
||||||
<< lg->ConvertToRelativePath(
|
|
||||||
*k, cmOutputConverter::HOME_OUTPUT)
|
|
||||||
<< "\"\n";
|
<< "\"\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,9 +369,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
|
|||||||
tmpStr = lg->GetCurrentBinaryDirectory();
|
tmpStr = lg->GetCurrentBinaryDirectory();
|
||||||
tmpStr += cmake::GetCMakeFilesDirectory();
|
tmpStr += cmake::GetCMakeFilesDirectory();
|
||||||
tmpStr += "/CMakeDirectoryInformation.cmake";
|
tmpStr += "/CMakeDirectoryInformation.cmake";
|
||||||
cmakefileStream << " \""
|
cmakefileStream << " \"" << lg->ConvertToRelativePath(binDir, tmpStr)
|
||||||
<< lg->ConvertToRelativePath(
|
|
||||||
tmpStr, cmOutputConverter::HOME_OUTPUT)
|
|
||||||
<< "\"\n";
|
<< "\"\n";
|
||||||
}
|
}
|
||||||
cmakefileStream << " )\n\n";
|
cmakefileStream << " )\n\n";
|
||||||
@ -488,9 +480,10 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRules2(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Begin the directory-level rules section.
|
// Begin the directory-level rules section.
|
||||||
std::string dir = lg->GetCurrentBinaryDirectory();
|
std::string dir = cmSystemTools::ConvertToOutputPath(
|
||||||
dir = lg->Convert(dir, cmOutputConverter::HOME_OUTPUT,
|
lg->ConvertToRelativePath(lg->GetBinaryDirectory(),
|
||||||
cmOutputConverter::MAKERULE);
|
lg->GetCurrentBinaryDirectory())
|
||||||
|
.c_str());
|
||||||
lg->WriteDivider(ruleFileStream);
|
lg->WriteDivider(ruleFileStream);
|
||||||
ruleFileStream << "# Directory level rules for directory " << dir << "\n\n";
|
ruleFileStream << "# Directory level rules for directory " << dir << "\n\n";
|
||||||
|
|
||||||
@ -538,7 +531,8 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
|||||||
tname += "/fast";
|
tname += "/fast";
|
||||||
}
|
}
|
||||||
cmOutputConverter conv(mf->GetStateSnapshot());
|
cmOutputConverter conv(mf->GetStateSnapshot());
|
||||||
tname = conv.ConvertToRelativePath(tname, cmOutputConverter::HOME_OUTPUT);
|
tname =
|
||||||
|
conv.ConvertToRelativePath(mf->GetState()->GetBinaryDirectory(), tname);
|
||||||
cmSystemTools::ConvertToOutputSlashes(tname);
|
cmSystemTools::ConvertToOutputSlashes(tname);
|
||||||
makeCommand.push_back(tname);
|
makeCommand.push_back(tname);
|
||||||
if (this->Makefiles.empty()) {
|
if (this->Makefiles.empty()) {
|
||||||
|
@ -382,6 +382,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
|
|||||||
{
|
{
|
||||||
VisualStudioFolders.clear();
|
VisualStudioFolders.clear();
|
||||||
|
|
||||||
|
std::string rootBinaryDir = root->GetCurrentBinaryDirectory();
|
||||||
for (OrderedTargetDependSet::const_iterator tt = projectTargets.begin();
|
for (OrderedTargetDependSet::const_iterator tt = projectTargets.begin();
|
||||||
tt != projectTargets.end(); ++tt) {
|
tt != projectTargets.end(); ++tt) {
|
||||||
cmGeneratorTarget const* target = *tt;
|
cmGeneratorTarget const* target = *tt;
|
||||||
@ -405,8 +406,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
|
|||||||
if (vcprojName) {
|
if (vcprojName) {
|
||||||
cmLocalGenerator* lg = target->GetLocalGenerator();
|
cmLocalGenerator* lg = target->GetLocalGenerator();
|
||||||
std::string dir = lg->GetCurrentBinaryDirectory();
|
std::string dir = lg->GetCurrentBinaryDirectory();
|
||||||
dir = root->ConvertToRelativePath(dir.c_str(),
|
dir = root->ConvertToRelativePath(rootBinaryDir, dir.c_str());
|
||||||
cmOutputConverter::START_OUTPUT);
|
|
||||||
if (dir == ".") {
|
if (dir == ".") {
|
||||||
dir = ""; // msbuild cannot handle ".\" prefix
|
dir = ""; // msbuild cannot handle ".\" prefix
|
||||||
}
|
}
|
||||||
|
@ -896,9 +896,6 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen)
|
|||||||
{
|
{
|
||||||
this->CurrentLocalGenerator = gen;
|
this->CurrentLocalGenerator = gen;
|
||||||
this->CurrentMakefile = gen->GetMakefile();
|
this->CurrentMakefile = gen->GetMakefile();
|
||||||
std::string outdir = cmSystemTools::CollapseFullPath(
|
|
||||||
this->CurrentLocalGenerator->GetCurrentBinaryDirectory());
|
|
||||||
cmSystemTools::SplitPath(outdir, this->CurrentOutputDirectoryComponents);
|
|
||||||
|
|
||||||
// Select the current set of configuration types.
|
// Select the current set of configuration types.
|
||||||
this->CurrentConfigurationTypes.clear();
|
this->CurrentConfigurationTypes.clear();
|
||||||
|
@ -241,7 +241,6 @@ private:
|
|||||||
std::string CurrentXCodeHackMakefile;
|
std::string CurrentXCodeHackMakefile;
|
||||||
std::string CurrentProject;
|
std::string CurrentProject;
|
||||||
std::set<std::string> TargetDoneSet;
|
std::set<std::string> TargetDoneSet;
|
||||||
std::vector<std::string> CurrentOutputDirectoryComponents;
|
|
||||||
std::vector<std::string> ProjectSourceDirectoryComponents;
|
std::vector<std::string> ProjectSourceDirectoryComponents;
|
||||||
std::vector<std::string> ProjectOutputDirectoryComponents;
|
std::vector<std::string> ProjectOutputDirectoryComponents;
|
||||||
std::map<std::string, cmXCodeObject*> GroupMap;
|
std::map<std::string, cmXCodeObject*> GroupMap;
|
||||||
|
@ -404,8 +404,8 @@ void cmListFileBacktrace::PrintTitle(std::ostream& out) const
|
|||||||
cmOutputConverter converter(this->Bottom);
|
cmOutputConverter converter(this->Bottom);
|
||||||
cmListFileContext lfc = *this->Cur;
|
cmListFileContext lfc = *this->Cur;
|
||||||
if (!this->Bottom.GetState()->GetIsInTryCompile()) {
|
if (!this->Bottom.GetState()->GetIsInTryCompile()) {
|
||||||
lfc.FilePath =
|
lfc.FilePath = converter.ConvertToRelativePath(
|
||||||
converter.ConvertToRelativePath(lfc.FilePath, cmOutputConverter::HOME);
|
this->Bottom.GetState()->GetSourceDirectory(), lfc.FilePath);
|
||||||
}
|
}
|
||||||
out << (lfc.Line ? " at " : " in ") << lfc;
|
out << (lfc.Line ? " at " : " in ") << lfc;
|
||||||
}
|
}
|
||||||
@ -430,8 +430,8 @@ void cmListFileBacktrace::PrintCallStack(std::ostream& out) const
|
|||||||
}
|
}
|
||||||
cmListFileContext lfc = *i;
|
cmListFileContext lfc = *i;
|
||||||
if (!this->Bottom.GetState()->GetIsInTryCompile()) {
|
if (!this->Bottom.GetState()->GetIsInTryCompile()) {
|
||||||
lfc.FilePath =
|
lfc.FilePath = converter.ConvertToRelativePath(
|
||||||
converter.ConvertToRelativePath(lfc.FilePath, cmOutputConverter::HOME);
|
this->Bottom.GetState()->GetSourceDirectory(), lfc.FilePath);
|
||||||
}
|
}
|
||||||
out << " " << lfc << "\n";
|
out << " " << lfc << "\n";
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,9 @@
|
|||||||
|
|
||||||
class cmGlobalGenerator;
|
class cmGlobalGenerator;
|
||||||
|
|
||||||
cmLocalCommonGenerator::cmLocalCommonGenerator(
|
cmLocalCommonGenerator::cmLocalCommonGenerator(cmGlobalGenerator* gg,
|
||||||
cmGlobalGenerator* gg, cmMakefile* mf, cmOutputConverter::RelativeRoot wd)
|
cmMakefile* mf,
|
||||||
|
std::string const& wd)
|
||||||
: cmLocalGenerator(gg, mf)
|
: cmLocalGenerator(gg, mf)
|
||||||
, WorkingDirectory(wd)
|
, WorkingDirectory(wd)
|
||||||
{
|
{
|
||||||
@ -55,8 +56,9 @@ std::string cmLocalCommonGenerator::GetTargetFortranFlags(
|
|||||||
// Add a module output directory flag if necessary.
|
// Add a module output directory flag if necessary.
|
||||||
std::string mod_dir = target->GetFortranModuleDirectory();
|
std::string mod_dir = target->GetFortranModuleDirectory();
|
||||||
if (!mod_dir.empty()) {
|
if (!mod_dir.empty()) {
|
||||||
mod_dir =
|
mod_dir = this->ConvertToOutputFormat(
|
||||||
this->Convert(mod_dir, this->WorkingDirectory, cmOutputConverter::SHELL);
|
this->ConvertToRelativePath(this->WorkingDirectory, mod_dir),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
} else {
|
} else {
|
||||||
mod_dir =
|
mod_dir =
|
||||||
this->Makefile->GetSafeDefinition("CMAKE_Fortran_MODDIR_DEFAULT");
|
this->Makefile->GetSafeDefinition("CMAKE_Fortran_MODDIR_DEFAULT");
|
||||||
|
@ -30,21 +30,18 @@ class cmLocalCommonGenerator : public cmLocalGenerator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmLocalCommonGenerator(cmGlobalGenerator* gg, cmMakefile* mf,
|
cmLocalCommonGenerator(cmGlobalGenerator* gg, cmMakefile* mf,
|
||||||
cmOutputConverter::RelativeRoot wd);
|
std::string const& wd);
|
||||||
~cmLocalCommonGenerator() CM_OVERRIDE;
|
~cmLocalCommonGenerator() CM_OVERRIDE;
|
||||||
|
|
||||||
std::string const& GetConfigName() { return this->ConfigName; }
|
std::string const& GetConfigName() { return this->ConfigName; }
|
||||||
|
|
||||||
cmOutputConverter::RelativeRoot GetWorkingDirectory() const
|
std::string GetWorkingDirectory() const { return this->WorkingDirectory; }
|
||||||
{
|
|
||||||
return this->WorkingDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string GetTargetFortranFlags(cmGeneratorTarget const* target,
|
std::string GetTargetFortranFlags(cmGeneratorTarget const* target,
|
||||||
std::string const& config) CM_OVERRIDE;
|
std::string const& config) CM_OVERRIDE;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
cmOutputConverter::RelativeRoot WorkingDirectory;
|
std::string WorkingDirectory;
|
||||||
|
|
||||||
void SetConfigName();
|
void SetConfigName();
|
||||||
std::string ConfigName;
|
std::string ConfigName;
|
||||||
|
@ -177,10 +177,11 @@ void cmLocalGenerator::GenerateTestFiles()
|
|||||||
}
|
}
|
||||||
typedef std::vector<cmState::Snapshot> vec_t;
|
typedef std::vector<cmState::Snapshot> vec_t;
|
||||||
vec_t const& children = this->Makefile->GetStateSnapshot().GetChildren();
|
vec_t const& children = this->Makefile->GetStateSnapshot().GetChildren();
|
||||||
|
std::string parentBinDir = this->GetCurrentBinaryDirectory();
|
||||||
for (vec_t::const_iterator i = children.begin(); i != children.end(); ++i) {
|
for (vec_t::const_iterator i = children.begin(); i != children.end(); ++i) {
|
||||||
// TODO: Use add_subdirectory instead?
|
// TODO: Use add_subdirectory instead?
|
||||||
std::string outP = i->GetDirectory().GetCurrentBinary();
|
std::string outP = i->GetDirectory().GetCurrentBinary();
|
||||||
outP = this->ConvertToRelativePath(outP, START_OUTPUT);
|
outP = this->ConvertToRelativePath(parentBinDir, outP);
|
||||||
outP = cmOutputConverter::EscapeForCMake(outP);
|
outP = cmOutputConverter::EscapeForCMake(outP);
|
||||||
fout << "subdirs(" << outP << ")" << std::endl;
|
fout << "subdirs(" << outP << ")" << std::endl;
|
||||||
}
|
}
|
||||||
@ -1408,7 +1409,9 @@ std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Normal behavior.
|
// Normal behavior.
|
||||||
return this->Convert(lib, START_OUTPUT, format);
|
return this->ConvertToOutputFormat(
|
||||||
|
this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), lib),
|
||||||
|
format);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2242,11 +2245,11 @@ std::string cmLocalGenerator::ConstructComment(
|
|||||||
std::string comment;
|
std::string comment;
|
||||||
comment = "Generating ";
|
comment = "Generating ";
|
||||||
const char* sep = "";
|
const char* sep = "";
|
||||||
|
std::string currentBinaryDir = this->GetCurrentBinaryDirectory();
|
||||||
for (std::vector<std::string>::const_iterator o = ccg.GetOutputs().begin();
|
for (std::vector<std::string>::const_iterator o = ccg.GetOutputs().begin();
|
||||||
o != ccg.GetOutputs().end(); ++o) {
|
o != ccg.GetOutputs().end(); ++o) {
|
||||||
comment += sep;
|
comment += sep;
|
||||||
comment +=
|
comment += this->ConvertToRelativePath(currentBinaryDir, *o);
|
||||||
this->ConvertToRelativePath(*o, cmOutputConverter::START_OUTPUT);
|
|
||||||
sep = ", ";
|
sep = ", ";
|
||||||
}
|
}
|
||||||
return comment;
|
return comment;
|
||||||
@ -2514,14 +2517,15 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
|
|||||||
const char* fullPath = source.GetFullPath().c_str();
|
const char* fullPath = source.GetFullPath().c_str();
|
||||||
|
|
||||||
// Try referencing the source relative to the source tree.
|
// Try referencing the source relative to the source tree.
|
||||||
std::string relFromSource = this->ConvertToRelativePath(fullPath, START);
|
std::string relFromSource =
|
||||||
|
this->ConvertToRelativePath(this->GetCurrentSourceDirectory(), fullPath);
|
||||||
assert(!relFromSource.empty());
|
assert(!relFromSource.empty());
|
||||||
bool relSource = !cmSystemTools::FileIsFullPath(relFromSource.c_str());
|
bool relSource = !cmSystemTools::FileIsFullPath(relFromSource.c_str());
|
||||||
bool subSource = relSource && relFromSource[0] != '.';
|
bool subSource = relSource && relFromSource[0] != '.';
|
||||||
|
|
||||||
// Try referencing the source relative to the binary tree.
|
// Try referencing the source relative to the binary tree.
|
||||||
std::string relFromBinary =
|
std::string relFromBinary =
|
||||||
this->ConvertToRelativePath(fullPath, START_OUTPUT);
|
this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), fullPath);
|
||||||
assert(!relFromBinary.empty());
|
assert(!relFromBinary.empty());
|
||||||
bool relBinary = !cmSystemTools::FileIsFullPath(relFromBinary.c_str());
|
bool relBinary = !cmSystemTools::FileIsFullPath(relFromBinary.c_str());
|
||||||
bool subBinary = relBinary && relFromBinary[0] != '.';
|
bool subBinary = relBinary && relFromBinary[0] != '.';
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmGlobalGenerator* gg,
|
cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmGlobalGenerator* gg,
|
||||||
cmMakefile* mf)
|
cmMakefile* mf)
|
||||||
: cmLocalCommonGenerator(gg, mf, cmOutputConverter::HOME_OUTPUT)
|
: cmLocalCommonGenerator(gg, mf, mf->GetState()->GetBinaryDirectory())
|
||||||
, HomeRelativeOutputPath("")
|
, HomeRelativeOutputPath("")
|
||||||
{
|
{
|
||||||
this->TargetImplib = "$TARGET_IMPLIB";
|
this->TargetImplib = "$TARGET_IMPLIB";
|
||||||
@ -51,7 +51,7 @@ void cmLocalNinjaGenerator::Generate()
|
|||||||
// Compute the path to use when referencing the current output
|
// Compute the path to use when referencing the current output
|
||||||
// directory from the top output directory.
|
// directory from the top output directory.
|
||||||
this->HomeRelativeOutputPath = this->ConvertToRelativePath(
|
this->HomeRelativeOutputPath = this->ConvertToRelativePath(
|
||||||
this->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT);
|
this->GetBinaryDirectory(), this->GetCurrentBinaryDirectory());
|
||||||
if (this->HomeRelativeOutputPath == ".") {
|
if (this->HomeRelativeOutputPath == ".") {
|
||||||
this->HomeRelativeOutputPath = "";
|
this->HomeRelativeOutputPath = "";
|
||||||
}
|
}
|
||||||
@ -145,7 +145,8 @@ std::string cmLocalNinjaGenerator::ConvertToIncludeReference(
|
|||||||
return this->ConvertToOutputFormat(cmSystemTools::CollapseFullPath(path),
|
return this->ConvertToOutputFormat(cmSystemTools::CollapseFullPath(path),
|
||||||
format);
|
format);
|
||||||
}
|
}
|
||||||
return this->Convert(path, cmOutputConverter::HOME_OUTPUT, format);
|
return this->ConvertToOutputFormat(
|
||||||
|
this->ConvertToRelativePath(this->GetBinaryDirectory(), path), format);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private methods.
|
// Private methods.
|
||||||
@ -499,8 +500,10 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
|
|||||||
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
||||||
if (!outputs.empty()) {
|
if (!outputs.empty()) {
|
||||||
if (ccg.GetWorkingDirectory().empty()) {
|
if (ccg.GetWorkingDirectory().empty()) {
|
||||||
output = this->Convert(outputs[0], cmOutputConverter::START_OUTPUT,
|
output = this->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(),
|
||||||
|
outputs[0]),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
} else {
|
} else {
|
||||||
output =
|
output =
|
||||||
this->ConvertToOutputFormat(outputs[0], cmOutputConverter::SHELL);
|
this->ConvertToOutputFormat(outputs[0], cmOutputConverter::SHELL);
|
||||||
|
@ -94,7 +94,7 @@ static std::string cmSplitExtension(std::string const& in, std::string& base)
|
|||||||
|
|
||||||
cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3(
|
cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3(
|
||||||
cmGlobalGenerator* gg, cmMakefile* mf)
|
cmGlobalGenerator* gg, cmMakefile* mf)
|
||||||
: cmLocalCommonGenerator(gg, mf, cmOutputConverter::START_OUTPUT)
|
: cmLocalCommonGenerator(gg, mf, mf->GetCurrentBinaryDirectory())
|
||||||
{
|
{
|
||||||
this->MakefileVariableSize = 0;
|
this->MakefileVariableSize = 0;
|
||||||
this->ColorMakefile = false;
|
this->ColorMakefile = false;
|
||||||
@ -151,7 +151,7 @@ void cmLocalUnixMakefileGenerator3::ComputeHomeRelativeOutputPath()
|
|||||||
// Compute the path to use when referencing the current output
|
// Compute the path to use when referencing the current output
|
||||||
// directory from the top output directory.
|
// directory from the top output directory.
|
||||||
this->HomeRelativeOutputPath = this->ConvertToRelativePath(
|
this->HomeRelativeOutputPath = this->ConvertToRelativePath(
|
||||||
this->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT);
|
this->GetBinaryDirectory(), this->GetCurrentBinaryDirectory());
|
||||||
if (this->HomeRelativeOutputPath == ".") {
|
if (this->HomeRelativeOutputPath == ".") {
|
||||||
this->HomeRelativeOutputPath = "";
|
this->HomeRelativeOutputPath = "";
|
||||||
}
|
}
|
||||||
@ -556,8 +556,8 @@ void cmLocalUnixMakefileGenerator3::WriteMakeRule(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Construct the left hand side of the rule.
|
// Construct the left hand side of the rule.
|
||||||
std::string tgt = this->Convert(target, cmOutputConverter::HOME_OUTPUT,
|
std::string tgt = cmSystemTools::ConvertToOutputPath(
|
||||||
cmOutputConverter::MAKERULE);
|
this->ConvertToRelativePath(this->GetBinaryDirectory(), target).c_str());
|
||||||
|
|
||||||
const char* space = "";
|
const char* space = "";
|
||||||
if (tgt.size() == 1) {
|
if (tgt.size() == 1) {
|
||||||
@ -581,11 +581,12 @@ void cmLocalUnixMakefileGenerator3::WriteMakeRule(
|
|||||||
} else {
|
} else {
|
||||||
// Split dependencies into multiple rule lines. This allows for
|
// Split dependencies into multiple rule lines. This allows for
|
||||||
// very long dependency lists even on older make implementations.
|
// very long dependency lists even on older make implementations.
|
||||||
|
std::string binDir = this->GetBinaryDirectory();
|
||||||
for (std::vector<std::string>::const_iterator dep = depends.begin();
|
for (std::vector<std::string>::const_iterator dep = depends.begin();
|
||||||
dep != depends.end(); ++dep) {
|
dep != depends.end(); ++dep) {
|
||||||
replace = *dep;
|
replace = *dep;
|
||||||
replace = this->Convert(replace, cmOutputConverter::HOME_OUTPUT,
|
replace = cmSystemTools::ConvertToOutputPath(
|
||||||
cmOutputConverter::MAKERULE);
|
this->ConvertToRelativePath(binDir, replace).c_str());
|
||||||
os << cmMakeSafe(tgt) << space << ": " << cmMakeSafe(replace) << "\n";
|
os << cmMakeSafe(tgt) << space << ": " << cmMakeSafe(replace) << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -952,6 +953,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
|
|||||||
|
|
||||||
// Add each command line to the set of commands.
|
// Add each command line to the set of commands.
|
||||||
std::vector<std::string> commands1;
|
std::vector<std::string> commands1;
|
||||||
|
std::string currentBinDir = this->GetCurrentBinaryDirectory();
|
||||||
for (unsigned int c = 0; c < ccg.GetNumberOfCommands(); ++c) {
|
for (unsigned int c = 0; c < ccg.GetNumberOfCommands(); ++c) {
|
||||||
// Build the command line in a single string.
|
// Build the command line in a single string.
|
||||||
std::string cmd = ccg.GetCommand(c);
|
std::string cmd = ccg.GetCommand(c);
|
||||||
@ -976,8 +978,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
|
|||||||
// working directory will be the start-output directory.
|
// working directory will be the start-output directory.
|
||||||
bool had_slash = cmd.find('/') != cmd.npos;
|
bool had_slash = cmd.find('/') != cmd.npos;
|
||||||
if (workingDir.empty()) {
|
if (workingDir.empty()) {
|
||||||
cmd =
|
cmd = this->ConvertToRelativePath(currentBinDir, cmd);
|
||||||
this->ConvertToRelativePath(cmd, cmOutputConverter::START_OUTPUT);
|
|
||||||
}
|
}
|
||||||
bool has_slash = cmd.find('/') != cmd.npos;
|
bool has_slash = cmd.find('/') != cmd.npos;
|
||||||
if (had_slash && !has_slash) {
|
if (had_slash && !has_slash) {
|
||||||
@ -1001,8 +1002,10 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
|
|||||||
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
||||||
if (!outputs.empty()) {
|
if (!outputs.empty()) {
|
||||||
if (workingDir.empty()) {
|
if (workingDir.empty()) {
|
||||||
output = this->Convert(outputs[0], cmOutputConverter::START_OUTPUT,
|
output = this->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(),
|
||||||
|
outputs[0]),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
output = this->ConvertToOutputFormat(outputs[0],
|
output = this->ConvertToOutputFormat(outputs[0],
|
||||||
@ -1069,7 +1072,8 @@ void cmLocalUnixMakefileGenerator3::AppendCleanCommand(
|
|||||||
std::vector<std::string>& commands, const std::vector<std::string>& files,
|
std::vector<std::string>& commands, const std::vector<std::string>& files,
|
||||||
cmGeneratorTarget* target, const char* filename)
|
cmGeneratorTarget* target, const char* filename)
|
||||||
{
|
{
|
||||||
std::string cleanfile = this->GetCurrentBinaryDirectory();
|
std::string currentBinDir = this->GetCurrentBinaryDirectory();
|
||||||
|
std::string cleanfile = currentBinDir;
|
||||||
cleanfile += "/";
|
cleanfile += "/";
|
||||||
cleanfile += this->GetTargetDirectory(target);
|
cleanfile += this->GetTargetDirectory(target);
|
||||||
cleanfile += "/cmake_clean";
|
cleanfile += "/cmake_clean";
|
||||||
@ -1087,15 +1091,15 @@ void cmLocalUnixMakefileGenerator3::AppendCleanCommand(
|
|||||||
fout << "file(REMOVE_RECURSE\n";
|
fout << "file(REMOVE_RECURSE\n";
|
||||||
for (std::vector<std::string>::const_iterator f = files.begin();
|
for (std::vector<std::string>::const_iterator f = files.begin();
|
||||||
f != files.end(); ++f) {
|
f != files.end(); ++f) {
|
||||||
std::string fc =
|
std::string fc = this->ConvertToRelativePath(currentBinDir, *f);
|
||||||
this->ConvertToRelativePath(*f, cmOutputConverter::START_OUTPUT);
|
|
||||||
fout << " " << cmOutputConverter::EscapeForCMake(fc) << "\n";
|
fout << " " << cmOutputConverter::EscapeForCMake(fc) << "\n";
|
||||||
}
|
}
|
||||||
fout << ")\n";
|
fout << ")\n";
|
||||||
}
|
}
|
||||||
std::string remove = "$(CMAKE_COMMAND) -P ";
|
std::string remove = "$(CMAKE_COMMAND) -P ";
|
||||||
remove += this->Convert(cleanfile, cmOutputConverter::START_OUTPUT,
|
remove += this->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), cleanfile),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
commands.push_back(remove);
|
commands.push_back(remove);
|
||||||
|
|
||||||
// For the main clean rule add per-language cleaning.
|
// For the main clean rule add per-language cleaning.
|
||||||
@ -1853,9 +1857,9 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo(
|
|||||||
const std::string& config =
|
const std::string& config =
|
||||||
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
|
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
|
||||||
this->GetIncludeDirectories(includes, target, l->first, config);
|
this->GetIncludeDirectories(includes, target, l->first, config);
|
||||||
|
std::string binaryDir = this->GetState()->GetBinaryDirectory();
|
||||||
if (this->Makefile->IsOn("CMAKE_DEPENDS_IN_PROJECT_ONLY")) {
|
if (this->Makefile->IsOn("CMAKE_DEPENDS_IN_PROJECT_ONLY")) {
|
||||||
const char* sourceDir = this->GetState()->GetSourceDirectory();
|
const char* sourceDir = this->GetState()->GetSourceDirectory();
|
||||||
const char* binaryDir = this->GetState()->GetBinaryDirectory();
|
|
||||||
std::vector<std::string>::iterator itr =
|
std::vector<std::string>::iterator itr =
|
||||||
std::remove_if(includes.begin(), includes.end(),
|
std::remove_if(includes.begin(), includes.end(),
|
||||||
::NotInProjectDir(sourceDir, binaryDir));
|
::NotInProjectDir(sourceDir, binaryDir));
|
||||||
@ -1863,9 +1867,7 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo(
|
|||||||
}
|
}
|
||||||
for (std::vector<std::string>::iterator i = includes.begin();
|
for (std::vector<std::string>::iterator i = includes.begin();
|
||||||
i != includes.end(); ++i) {
|
i != includes.end(); ++i) {
|
||||||
cmakefileStream << " \""
|
cmakefileStream << " \"" << this->ConvertToRelativePath(binaryDir, *i)
|
||||||
<< this->ConvertToRelativePath(
|
|
||||||
*i, cmOutputConverter::HOME_OUTPUT)
|
|
||||||
<< "\"\n";
|
<< "\"\n";
|
||||||
}
|
}
|
||||||
cmakefileStream << " )\n";
|
cmakefileStream << " )\n";
|
||||||
@ -1930,7 +1932,7 @@ std::string cmLocalUnixMakefileGenerator3::GetRecursiveMakeCall(
|
|||||||
if (!tgt.empty()) {
|
if (!tgt.empty()) {
|
||||||
// The make target is always relative to the top of the build tree.
|
// The make target is always relative to the top of the build tree.
|
||||||
std::string tgt2 =
|
std::string tgt2 =
|
||||||
this->ConvertToRelativePath(tgt, cmOutputConverter::HOME_OUTPUT);
|
this->ConvertToRelativePath(this->GetBinaryDirectory(), tgt);
|
||||||
|
|
||||||
// The target may have been written with windows paths.
|
// The target may have been written with windows paths.
|
||||||
cmSystemTools::ConvertToOutputSlashes(tgt2);
|
cmSystemTools::ConvertToOutputSlashes(tgt2);
|
||||||
|
@ -788,8 +788,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
|
|||||||
target->GetProperty("Fortran_MODULE_DIRECTORY");
|
target->GetProperty("Fortran_MODULE_DIRECTORY");
|
||||||
std::string modDir;
|
std::string modDir;
|
||||||
if (target_mod_dir) {
|
if (target_mod_dir) {
|
||||||
modDir = this->ConvertToRelativePath(target_mod_dir,
|
modDir = this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(),
|
||||||
cmOutputConverter::START_OUTPUT);
|
target_mod_dir);
|
||||||
} else {
|
} else {
|
||||||
modDir = ".";
|
modDir = ".";
|
||||||
}
|
}
|
||||||
@ -1298,10 +1298,11 @@ void cmLocalVisualStudio7GeneratorInternals::OutputLibraries(
|
|||||||
std::ostream& fout, ItemVector const& libs)
|
std::ostream& fout, ItemVector const& libs)
|
||||||
{
|
{
|
||||||
cmLocalVisualStudio7Generator* lg = this->LocalGenerator;
|
cmLocalVisualStudio7Generator* lg = this->LocalGenerator;
|
||||||
|
std::string currentBinDir = lg->GetCurrentBinaryDirectory();
|
||||||
for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
|
for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
|
||||||
if (l->IsPath) {
|
if (l->IsPath) {
|
||||||
std::string rel = lg->ConvertToRelativePath(
|
std::string rel =
|
||||||
l->Value.c_str(), cmOutputConverter::START_OUTPUT);
|
lg->ConvertToRelativePath(currentBinDir, l->Value.c_str());
|
||||||
fout << lg->ConvertToXMLOutputPath(rel.c_str()) << " ";
|
fout << lg->ConvertToXMLOutputPath(rel.c_str()) << " ";
|
||||||
} else if (!l->Target ||
|
} else if (!l->Target ||
|
||||||
l->Target->GetType() != cmState::INTERFACE_LIBRARY) {
|
l->Target->GetType() != cmState::INTERFACE_LIBRARY) {
|
||||||
@ -1316,13 +1317,13 @@ void cmLocalVisualStudio7GeneratorInternals::OutputObjects(
|
|||||||
// VS < 8 does not support per-config source locations so we
|
// VS < 8 does not support per-config source locations so we
|
||||||
// list object library content on the link line instead.
|
// list object library content on the link line instead.
|
||||||
cmLocalVisualStudio7Generator* lg = this->LocalGenerator;
|
cmLocalVisualStudio7Generator* lg = this->LocalGenerator;
|
||||||
|
std::string currentBinDir = lg->GetCurrentBinaryDirectory();
|
||||||
std::vector<std::string> objs;
|
std::vector<std::string> objs;
|
||||||
gt->UseObjectLibraries(objs, "");
|
gt->UseObjectLibraries(objs, "");
|
||||||
const char* sep = isep ? isep : "";
|
const char* sep = isep ? isep : "";
|
||||||
for (std::vector<std::string>::const_iterator oi = objs.begin();
|
for (std::vector<std::string>::const_iterator oi = objs.begin();
|
||||||
oi != objs.end(); ++oi) {
|
oi != objs.end(); ++oi) {
|
||||||
std::string rel =
|
std::string rel = lg->ConvertToRelativePath(currentBinDir, oi->c_str());
|
||||||
lg->ConvertToRelativePath(oi->c_str(), cmOutputConverter::START_OUTPUT);
|
|
||||||
fout << sep << lg->ConvertToXMLOutputPath(rel.c_str());
|
fout << sep << lg->ConvertToXMLOutputPath(rel.c_str());
|
||||||
sep = " ";
|
sep = " ";
|
||||||
}
|
}
|
||||||
@ -1332,6 +1333,7 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories(
|
|||||||
std::ostream& fout, std::vector<std::string> const& dirs)
|
std::ostream& fout, std::vector<std::string> const& dirs)
|
||||||
{
|
{
|
||||||
const char* comma = "";
|
const char* comma = "";
|
||||||
|
std::string currentBinDir = this->GetCurrentBinaryDirectory();
|
||||||
for (std::vector<std::string>::const_iterator d = dirs.begin();
|
for (std::vector<std::string>::const_iterator d = dirs.begin();
|
||||||
d != dirs.end(); ++d) {
|
d != dirs.end(); ++d) {
|
||||||
// Remove any trailing slash and skip empty paths.
|
// Remove any trailing slash and skip empty paths.
|
||||||
@ -1345,8 +1347,8 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories(
|
|||||||
|
|
||||||
// Switch to a relative path specification if it is shorter.
|
// Switch to a relative path specification if it is shorter.
|
||||||
if (cmSystemTools::FileIsFullPath(dir.c_str())) {
|
if (cmSystemTools::FileIsFullPath(dir.c_str())) {
|
||||||
std::string rel = this->ConvertToRelativePath(
|
std::string rel =
|
||||||
dir.c_str(), cmOutputConverter::START_OUTPUT);
|
this->ConvertToRelativePath(currentBinDir, dir.c_str());
|
||||||
if (rel.size() < dir.size()) {
|
if (rel.size() < dir.size()) {
|
||||||
dir = rel;
|
dir = rel;
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,9 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (workingDirectory.empty()) {
|
if (workingDirectory.empty()) {
|
||||||
script += this->Convert(cmd.c_str(), START_OUTPUT, SHELL);
|
script += this->ConvertToOutputFormat(
|
||||||
|
this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), cmd),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
} else {
|
} else {
|
||||||
script += this->ConvertToOutputFormat(cmd.c_str(), SHELL);
|
script += this->ConvertToOutputFormat(cmd.c_str(), SHELL);
|
||||||
}
|
}
|
||||||
|
@ -138,14 +138,20 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
|
|||||||
std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
|
std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
targetFullPathPDB, cmOutputConverter::SHELL);
|
targetFullPathPDB, cmOutputConverter::SHELL);
|
||||||
// Convert to the output path to use in constructing commands.
|
// Convert to the output path to use in constructing commands.
|
||||||
std::string targetOutPath = this->Convert(
|
std::string targetOutPath = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
targetFullPath, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
std::string targetOutPathReal =
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPath),
|
||||||
this->Convert(targetFullPathReal, cmOutputConverter::START_OUTPUT,
|
cmOutputConverter::SHELL);
|
||||||
cmOutputConverter::SHELL);
|
std::string targetOutPathReal = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
std::string targetOutPathImport =
|
std::string targetOutPathImport =
|
||||||
this->Convert(targetFullPathImport, cmOutputConverter::START_OUTPUT,
|
this->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(),
|
||||||
|
targetFullPathImport),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
|
|
||||||
// Get the language to use for linking this executable.
|
// Get the language to use for linking this executable.
|
||||||
std::string linkLanguage =
|
std::string linkLanguage =
|
||||||
@ -219,25 +225,27 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
|
|||||||
// may need to be cleaned.
|
// may need to be cleaned.
|
||||||
std::vector<std::string> exeCleanFiles;
|
std::vector<std::string> exeCleanFiles;
|
||||||
exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
||||||
targetFullPath, cmOutputConverter::START_OUTPUT));
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPath));
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// There may be a manifest file for this target. Add it to the
|
// There may be a manifest file for this target. Add it to the
|
||||||
// clean set just in case.
|
// clean set just in case.
|
||||||
exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
||||||
(targetFullPath + ".manifest").c_str(), cmOutputConverter::START_OUTPUT));
|
this->LocalGenerator->GetCurrentBinaryDirectory(),
|
||||||
|
(targetFullPath + ".manifest").c_str()));
|
||||||
#endif
|
#endif
|
||||||
if (targetNameReal != targetName) {
|
if (targetNameReal != targetName) {
|
||||||
exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
||||||
targetFullPathReal, cmOutputConverter::START_OUTPUT));
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal));
|
||||||
}
|
}
|
||||||
if (!targetNameImport.empty()) {
|
if (!targetNameImport.empty()) {
|
||||||
exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
||||||
targetFullPathImport, cmOutputConverter::START_OUTPUT));
|
this->LocalGenerator->GetCurrentBinaryDirectory(),
|
||||||
|
targetFullPathImport));
|
||||||
std::string implib;
|
std::string implib;
|
||||||
if (this->GeneratorTarget->GetImplibGNUtoMS(targetFullPathImport,
|
if (this->GeneratorTarget->GetImplibGNUtoMS(targetFullPathImport,
|
||||||
implib)) {
|
implib)) {
|
||||||
exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
||||||
implib, cmOutputConverter::START_OUTPUT));
|
this->LocalGenerator->GetCurrentBinaryDirectory(), implib));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,7 +253,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
|
|||||||
// cleaned. We do not want to delete the .pdb file just before
|
// cleaned. We do not want to delete the .pdb file just before
|
||||||
// linking the target.
|
// linking the target.
|
||||||
this->CleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
this->CleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
||||||
targetFullPathPDB, cmOutputConverter::START_OUTPUT));
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathPDB));
|
||||||
|
|
||||||
// Add the pre-build and pre-link rules building but not when relinking.
|
// Add the pre-build and pre-link rules building but not when relinking.
|
||||||
if (!relink) {
|
if (!relink) {
|
||||||
@ -317,14 +325,19 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
|
|||||||
vars.Language = linkLanguage.c_str();
|
vars.Language = linkLanguage.c_str();
|
||||||
vars.Objects = buildObjs.c_str();
|
vars.Objects = buildObjs.c_str();
|
||||||
std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
|
std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
|
||||||
objectDir = this->Convert(objectDir, cmOutputConverter::START_OUTPUT,
|
|
||||||
cmOutputConverter::SHELL);
|
objectDir = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), objectDir),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
vars.ObjectDir = objectDir.c_str();
|
vars.ObjectDir = objectDir.c_str();
|
||||||
cmOutputConverter::OutputFormat output = (useWatcomQuote)
|
cmOutputConverter::OutputFormat output = (useWatcomQuote)
|
||||||
? cmOutputConverter::WATCOMQUOTE
|
? cmOutputConverter::WATCOMQUOTE
|
||||||
: cmOutputConverter::SHELL;
|
: cmOutputConverter::SHELL;
|
||||||
std::string target = this->Convert(
|
std::string target = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
targetFullPathReal, cmOutputConverter::START_OUTPUT, output);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal),
|
||||||
|
output);
|
||||||
vars.Target = target.c_str();
|
vars.Target = target.c_str();
|
||||||
vars.TargetPDB = targetOutPathPDB.c_str();
|
vars.TargetPDB = targetOutPathPDB.c_str();
|
||||||
|
|
||||||
|
@ -312,17 +312,25 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
|
|||||||
// arguments.
|
// arguments.
|
||||||
std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
|
std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
targetFullPathPDB, cmOutputConverter::SHELL);
|
targetFullPathPDB, cmOutputConverter::SHELL);
|
||||||
std::string targetOutPath = this->Convert(
|
|
||||||
targetFullPath, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL);
|
std::string targetOutPath = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
std::string targetOutPathSO =
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
this->Convert(targetFullPathSO, cmOutputConverter::START_OUTPUT,
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPath),
|
||||||
cmOutputConverter::SHELL);
|
cmOutputConverter::SHELL);
|
||||||
std::string targetOutPathReal =
|
std::string targetOutPathSO = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
this->Convert(targetFullPathReal, cmOutputConverter::START_OUTPUT,
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathSO),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
|
std::string targetOutPathReal = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
std::string targetOutPathImport =
|
std::string targetOutPathImport =
|
||||||
this->Convert(targetFullPathImport, cmOutputConverter::START_OUTPUT,
|
this->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(),
|
||||||
|
targetFullPathImport),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
|
|
||||||
this->NumberOfProgressActions++;
|
this->NumberOfProgressActions++;
|
||||||
if (!this->NoRuleMessages) {
|
if (!this->NoRuleMessages) {
|
||||||
@ -368,23 +376,24 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
|
|||||||
// Clean files associated with this library.
|
// Clean files associated with this library.
|
||||||
std::vector<std::string> libCleanFiles;
|
std::vector<std::string> libCleanFiles;
|
||||||
libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
||||||
targetFullPath, cmOutputConverter::START_OUTPUT));
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPath));
|
||||||
if (targetNameReal != targetName) {
|
if (targetNameReal != targetName) {
|
||||||
libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
||||||
targetFullPathReal, cmOutputConverter::START_OUTPUT));
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal));
|
||||||
}
|
}
|
||||||
if (targetNameSO != targetName && targetNameSO != targetNameReal) {
|
if (targetNameSO != targetName && targetNameSO != targetNameReal) {
|
||||||
libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
||||||
targetFullPathSO, cmOutputConverter::START_OUTPUT));
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathSO));
|
||||||
}
|
}
|
||||||
if (!targetNameImport.empty()) {
|
if (!targetNameImport.empty()) {
|
||||||
libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
||||||
targetFullPathImport, cmOutputConverter::START_OUTPUT));
|
this->LocalGenerator->GetCurrentBinaryDirectory(),
|
||||||
|
targetFullPathImport));
|
||||||
std::string implib;
|
std::string implib;
|
||||||
if (this->GeneratorTarget->GetImplibGNUtoMS(targetFullPathImport,
|
if (this->GeneratorTarget->GetImplibGNUtoMS(targetFullPathImport,
|
||||||
implib)) {
|
implib)) {
|
||||||
libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
||||||
implib, cmOutputConverter::START_OUTPUT));
|
this->LocalGenerator->GetCurrentBinaryDirectory(), implib));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,15 +401,15 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
|
|||||||
// cleaned. We do not want to delete the .pdb file just before
|
// cleaned. We do not want to delete the .pdb file just before
|
||||||
// linking the target.
|
// linking the target.
|
||||||
this->CleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
this->CleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
||||||
targetFullPathPDB, cmOutputConverter::START_OUTPUT));
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathPDB));
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// There may be a manifest file for this target. Add it to the
|
// There may be a manifest file for this target. Add it to the
|
||||||
// clean set just in case.
|
// clean set just in case.
|
||||||
if (this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY) {
|
if (this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY) {
|
||||||
libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
||||||
(targetFullPath + ".manifest").c_str(),
|
this->LocalGenerator->GetCurrentBinaryDirectory(),
|
||||||
cmOutputConverter::START_OUTPUT));
|
(targetFullPath + ".manifest").c_str()));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -535,14 +544,20 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
|
|||||||
vars.Language = linkLanguage.c_str();
|
vars.Language = linkLanguage.c_str();
|
||||||
vars.Objects = buildObjs.c_str();
|
vars.Objects = buildObjs.c_str();
|
||||||
std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
|
std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
|
||||||
objectDir = this->Convert(objectDir, cmOutputConverter::START_OUTPUT,
|
|
||||||
cmOutputConverter::SHELL);
|
objectDir = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), objectDir),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
|
|
||||||
vars.ObjectDir = objectDir.c_str();
|
vars.ObjectDir = objectDir.c_str();
|
||||||
cmOutputConverter::OutputFormat output = (useWatcomQuote)
|
cmOutputConverter::OutputFormat output = (useWatcomQuote)
|
||||||
? cmOutputConverter::WATCOMQUOTE
|
? cmOutputConverter::WATCOMQUOTE
|
||||||
: cmOutputConverter::SHELL;
|
: cmOutputConverter::SHELL;
|
||||||
std::string target = this->Convert(
|
std::string target = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
targetFullPathReal, cmOutputConverter::START_OUTPUT, output);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal),
|
||||||
|
output);
|
||||||
vars.Target = target.c_str();
|
vars.Target = target.c_str();
|
||||||
vars.LinkLibraries = linkLibs.c_str();
|
vars.LinkLibraries = linkLibs.c_str();
|
||||||
vars.ObjectsQuoted = buildObjs.c_str();
|
vars.ObjectsQuoted = buildObjs.c_str();
|
||||||
|
@ -162,6 +162,8 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
|
|||||||
// files for this target.
|
// files for this target.
|
||||||
std::vector<cmSourceFile const*> customCommands;
|
std::vector<cmSourceFile const*> customCommands;
|
||||||
this->GeneratorTarget->GetCustomCommands(customCommands, config);
|
this->GeneratorTarget->GetCustomCommands(customCommands, config);
|
||||||
|
std::string currentBinDir =
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory();
|
||||||
for (std::vector<cmSourceFile const*>::const_iterator si =
|
for (std::vector<cmSourceFile const*>::const_iterator si =
|
||||||
customCommands.begin();
|
customCommands.begin();
|
||||||
si != customCommands.end(); ++si) {
|
si != customCommands.end(); ++si) {
|
||||||
@ -172,8 +174,8 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
|
|||||||
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
||||||
for (std::vector<std::string>::const_iterator o = outputs.begin();
|
for (std::vector<std::string>::const_iterator o = outputs.begin();
|
||||||
o != outputs.end(); ++o) {
|
o != outputs.end(); ++o) {
|
||||||
this->CleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
|
this->CleanFiles.push_back(
|
||||||
*o, cmOutputConverter::START_OUTPUT));
|
this->LocalGenerator->ConvertToRelativePath(currentBinDir, *o));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -214,8 +216,11 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules()
|
|||||||
*this->BuildFileStream
|
*this->BuildFileStream
|
||||||
<< "# Include any dependencies generated for this target.\n"
|
<< "# Include any dependencies generated for this target.\n"
|
||||||
<< this->GlobalGenerator->IncludeDirective << " " << root
|
<< this->GlobalGenerator->IncludeDirective << " " << root
|
||||||
<< this->Convert(dependFileNameFull, cmOutputConverter::HOME_OUTPUT,
|
<< cmSystemTools::ConvertToOutputPath(
|
||||||
cmOutputConverter::MAKERULE)
|
this->LocalGenerator
|
||||||
|
->ConvertToRelativePath(this->LocalGenerator->GetBinaryDirectory(),
|
||||||
|
dependFileNameFull)
|
||||||
|
.c_str())
|
||||||
<< "\n\n";
|
<< "\n\n";
|
||||||
|
|
||||||
if (!this->NoRuleMessages) {
|
if (!this->NoRuleMessages) {
|
||||||
@ -223,9 +228,12 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules()
|
|||||||
*this->BuildFileStream
|
*this->BuildFileStream
|
||||||
<< "# Include the progress variables for this target.\n"
|
<< "# Include the progress variables for this target.\n"
|
||||||
<< this->GlobalGenerator->IncludeDirective << " " << root
|
<< this->GlobalGenerator->IncludeDirective << " " << root
|
||||||
<< this->Convert(this->ProgressFileNameFull,
|
<< cmSystemTools::ConvertToOutputPath(
|
||||||
cmOutputConverter::HOME_OUTPUT,
|
this->LocalGenerator
|
||||||
cmOutputConverter::MAKERULE)
|
->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetBinaryDirectory(),
|
||||||
|
this->ProgressFileNameFull)
|
||||||
|
.c_str())
|
||||||
<< "\n\n";
|
<< "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,8 +263,11 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules()
|
|||||||
*this->BuildFileStream
|
*this->BuildFileStream
|
||||||
<< "# Include the compile flags for this target's objects.\n"
|
<< "# Include the compile flags for this target's objects.\n"
|
||||||
<< this->GlobalGenerator->IncludeDirective << " " << root
|
<< this->GlobalGenerator->IncludeDirective << " " << root
|
||||||
<< this->Convert(this->FlagFileNameFull, cmOutputConverter::HOME_OUTPUT,
|
<< cmSystemTools::ConvertToOutputPath(
|
||||||
cmOutputConverter::MAKERULE)
|
this->LocalGenerator
|
||||||
|
->ConvertToRelativePath(this->LocalGenerator->GetBinaryDirectory(),
|
||||||
|
this->FlagFileNameFull)
|
||||||
|
.c_str())
|
||||||
<< "\n\n";
|
<< "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -313,9 +324,9 @@ void cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator()(
|
|||||||
output += cmSystemTools::GetFilenameName(input);
|
output += cmSystemTools::GetFilenameName(input);
|
||||||
this->Generator->CleanFiles.push_back(
|
this->Generator->CleanFiles.push_back(
|
||||||
this->Generator->LocalGenerator->ConvertToRelativePath(
|
this->Generator->LocalGenerator->ConvertToRelativePath(
|
||||||
output, cmOutputConverter::START_OUTPUT));
|
this->Generator->LocalGenerator->GetCurrentBinaryDirectory(), output));
|
||||||
output = this->Generator->LocalGenerator->ConvertToRelativePath(
|
output = this->Generator->LocalGenerator->ConvertToRelativePath(
|
||||||
output, cmOutputConverter::HOME_OUTPUT);
|
this->Generator->LocalGenerator->GetBinaryDirectory(), output);
|
||||||
|
|
||||||
// Create a rule to copy the content into the bundle.
|
// Create a rule to copy the content into the bundle.
|
||||||
std::vector<std::string> depends;
|
std::vector<std::string> depends;
|
||||||
@ -515,14 +526,17 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
targetOutPathReal =
|
targetOutPathReal = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
this->Convert(targetFullPathReal, cmOutputConverter::START_OUTPUT,
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
|
targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
targetFullPathPDB, cmOutputConverter::SHELL);
|
targetFullPathPDB, cmOutputConverter::SHELL);
|
||||||
targetOutPathCompilePDB =
|
targetOutPathCompilePDB = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
this->Convert(targetFullPathCompilePDB, cmOutputConverter::START_OUTPUT,
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->GetCurrentBinaryDirectory(),
|
||||||
|
targetFullPathCompilePDB),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
|
|
||||||
if (this->LocalGenerator->IsMinGWMake() &&
|
if (this->LocalGenerator->IsMinGWMake() &&
|
||||||
cmHasLiteralSuffix(targetOutPathCompilePDB, "\\")) {
|
cmHasLiteralSuffix(targetOutPathCompilePDB, "\\")) {
|
||||||
@ -544,12 +558,16 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
|
|||||||
this->LocalGenerator->ConvertToOutputFormat(obj, cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToOutputFormat(obj, cmOutputConverter::SHELL);
|
||||||
vars.Object = shellObj.c_str();
|
vars.Object = shellObj.c_str();
|
||||||
std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
|
std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
|
||||||
objectDir = this->Convert(objectDir, cmOutputConverter::START_OUTPUT,
|
objectDir = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), objectDir),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
vars.ObjectDir = objectDir.c_str();
|
vars.ObjectDir = objectDir.c_str();
|
||||||
std::string objectFileDir = cmSystemTools::GetFilenamePath(obj);
|
std::string objectFileDir = cmSystemTools::GetFilenamePath(obj);
|
||||||
objectFileDir = this->Convert(objectFileDir, cmOutputConverter::START_OUTPUT,
|
objectFileDir = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), objectFileDir),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
vars.ObjectFileDir = objectFileDir.c_str();
|
vars.ObjectFileDir = objectFileDir.c_str();
|
||||||
vars.Flags = flags.c_str();
|
vars.Flags = flags.c_str();
|
||||||
|
|
||||||
@ -889,12 +907,14 @@ bool cmMakefileTargetGenerator::WriteMakeRule(
|
|||||||
|
|
||||||
// For multiple outputs, make the extra ones depend on the first one.
|
// For multiple outputs, make the extra ones depend on the first one.
|
||||||
std::vector<std::string> const output_depends(1, outputs[0]);
|
std::vector<std::string> const output_depends(1, outputs[0]);
|
||||||
|
std::string binDir = this->LocalGenerator->GetBinaryDirectory();
|
||||||
for (std::vector<std::string>::const_iterator o = outputs.begin() + 1;
|
for (std::vector<std::string>::const_iterator o = outputs.begin() + 1;
|
||||||
o != outputs.end(); ++o) {
|
o != outputs.end(); ++o) {
|
||||||
// Touch the extra output so "make" knows that it was updated,
|
// Touch the extra output so "make" knows that it was updated,
|
||||||
// but only if the output was acually created.
|
// but only if the output was acually created.
|
||||||
std::string const out = this->Convert(*o, cmOutputConverter::HOME_OUTPUT,
|
std::string const out = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(binDir, *o),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
std::vector<std::string> output_commands;
|
std::vector<std::string> output_commands;
|
||||||
|
|
||||||
bool o_symbolic = false;
|
bool o_symbolic = false;
|
||||||
@ -1180,11 +1200,12 @@ void cmMakefileTargetGenerator::WriteObjectsVariable(
|
|||||||
<< this->GeneratorTarget->GetName() << "\n"
|
<< this->GeneratorTarget->GetName() << "\n"
|
||||||
<< variableNameExternal << " =";
|
<< variableNameExternal << " =";
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
|
std::string currentBinDir =
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory();
|
||||||
for (std::vector<std::string>::const_iterator i =
|
for (std::vector<std::string>::const_iterator i =
|
||||||
this->ExternalObjects.begin();
|
this->ExternalObjects.begin();
|
||||||
i != this->ExternalObjects.end(); ++i) {
|
i != this->ExternalObjects.end(); ++i) {
|
||||||
object = this->LocalGenerator->ConvertToRelativePath(
|
object = this->LocalGenerator->ConvertToRelativePath(currentBinDir, *i);
|
||||||
*i, cmOutputConverter::START_OUTPUT);
|
|
||||||
*this->BuildFileStream << " " << lineContinue << "\n"
|
*this->BuildFileStream << " " << lineContinue << "\n"
|
||||||
<< this->Makefile->GetSafeDefinition(
|
<< this->Makefile->GetSafeDefinition(
|
||||||
"CMAKE_OBJECT_NAME");
|
"CMAKE_OBJECT_NAME");
|
||||||
@ -1217,8 +1238,10 @@ public:
|
|||||||
void Feed(std::string const& obj)
|
void Feed(std::string const& obj)
|
||||||
{
|
{
|
||||||
// Construct the name of the next object.
|
// Construct the name of the next object.
|
||||||
this->NextObject = this->LocalGenerator->Convert(
|
this->NextObject = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
obj, cmOutputConverter::START_OUTPUT, cmOutputConverter::RESPONSE);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), obj),
|
||||||
|
cmOutputConverter::RESPONSE);
|
||||||
|
|
||||||
// Roll over to next string if the limit will be exceeded.
|
// Roll over to next string if the limit will be exceeded.
|
||||||
if (this->LengthLimit != std::string::npos &&
|
if (this->LengthLimit != std::string::npos &&
|
||||||
@ -1272,7 +1295,7 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(
|
|||||||
std::string buildTargetRuleName = dir;
|
std::string buildTargetRuleName = dir;
|
||||||
buildTargetRuleName += relink ? "/preinstall" : "/build";
|
buildTargetRuleName += relink ? "/preinstall" : "/build";
|
||||||
buildTargetRuleName = this->LocalGenerator->ConvertToRelativePath(
|
buildTargetRuleName = this->LocalGenerator->ConvertToRelativePath(
|
||||||
buildTargetRuleName, cmOutputConverter::HOME_OUTPUT);
|
this->LocalGenerator->GetBinaryDirectory(), buildTargetRuleName);
|
||||||
|
|
||||||
// Build the list of target outputs to drive.
|
// Build the list of target outputs to drive.
|
||||||
std::vector<std::string> depends;
|
std::vector<std::string> depends;
|
||||||
@ -1460,8 +1483,10 @@ void cmMakefileTargetGenerator::CreateLinkScript(
|
|||||||
|
|
||||||
// Create the makefile command to invoke the link script.
|
// Create the makefile command to invoke the link script.
|
||||||
std::string link_command = "$(CMAKE_COMMAND) -E cmake_link_script ";
|
std::string link_command = "$(CMAKE_COMMAND) -E cmake_link_script ";
|
||||||
link_command += this->Convert(
|
link_command += this->LocalGenerator->ConvertToOutputFormat(
|
||||||
linkScriptName, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), linkScriptName),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
link_command += " --verbose=$(VERBOSE)";
|
link_command += " --verbose=$(VERBOSE)";
|
||||||
makefile_commands.push_back(link_command);
|
makefile_commands.push_back(link_command);
|
||||||
makefile_depends.push_back(linkScriptName);
|
makefile_depends.push_back(linkScriptName);
|
||||||
@ -1492,9 +1517,9 @@ bool cmMakefileTargetGenerator::CheckUseResponseFileForObjects(
|
|||||||
if (size_t const limit = calculateCommandLineLengthLimit()) {
|
if (size_t const limit = calculateCommandLineLengthLimit()) {
|
||||||
// Compute the total length of our list of object files with room
|
// Compute the total length of our list of object files with room
|
||||||
// for argument separation and quoting. This does not convert paths
|
// for argument separation and quoting. This does not convert paths
|
||||||
// relative to START_OUTPUT like the final list will be, so the actual
|
// relative to CMAKE_CURRENT_BINARY_DIR like the final list will be, so the
|
||||||
// list will likely be much shorter than this. However, in the worst
|
// actual list will likely be much shorter than this. However, in the
|
||||||
// case all objects will remain as absolute paths.
|
// worst case all objects will remain as absolute paths.
|
||||||
size_t length = 0;
|
size_t length = 0;
|
||||||
for (std::vector<std::string>::const_iterator i = this->Objects.begin();
|
for (std::vector<std::string>::const_iterator i = this->Objects.begin();
|
||||||
i != this->Objects.end(); ++i) {
|
i != this->Objects.end(); ++i) {
|
||||||
@ -1695,13 +1720,17 @@ void cmMakefileTargetGenerator::GenDefFile(
|
|||||||
cmd = this->LocalGenerator->ConvertToOutputFormat(
|
cmd = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmd, cmOutputConverter::SHELL);
|
cmd, cmOutputConverter::SHELL);
|
||||||
cmd += " -E __create_def ";
|
cmd += " -E __create_def ";
|
||||||
cmd += this->Convert(name_of_def_file, cmOutputConverter::START_OUTPUT,
|
cmd += this->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), name_of_def_file),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
cmd += " ";
|
cmd += " ";
|
||||||
std::string objlist_file = name_of_def_file;
|
std::string objlist_file = name_of_def_file;
|
||||||
objlist_file += ".objs";
|
objlist_file += ".objs";
|
||||||
cmd += this->Convert(objlist_file, cmOutputConverter::START_OUTPUT,
|
cmd += this->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), objlist_file),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
real_link_commands.insert(real_link_commands.begin(), cmd);
|
real_link_commands.insert(real_link_commands.begin(), cmd);
|
||||||
// create a list of obj files for the -E __create_def to read
|
// create a list of obj files for the -E __create_def to read
|
||||||
cmGeneratedFileStream fout(objlist_file.c_str());
|
cmGeneratedFileStream fout(objlist_file.c_str());
|
||||||
@ -1719,9 +1748,10 @@ void cmMakefileTargetGenerator::GenDefFile(
|
|||||||
// now add the def file link flag
|
// now add the def file link flag
|
||||||
linkFlags += " ";
|
linkFlags += " ";
|
||||||
linkFlags += this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG");
|
linkFlags += this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG");
|
||||||
linkFlags +=
|
linkFlags += this->LocalGenerator->ConvertToOutputFormat(
|
||||||
this->Convert(name_of_def_file, cmOutputConverter::START_OUTPUT,
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->GetCurrentBinaryDirectory(), name_of_def_file),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
linkFlags += " ";
|
linkFlags += " ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,9 +53,12 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles()
|
|||||||
*this->BuildFileStream
|
*this->BuildFileStream
|
||||||
<< "# Include the progress variables for this target.\n"
|
<< "# Include the progress variables for this target.\n"
|
||||||
<< this->GlobalGenerator->IncludeDirective << " " << root
|
<< this->GlobalGenerator->IncludeDirective << " " << root
|
||||||
<< this->Convert(this->ProgressFileNameFull,
|
<< cmSystemTools::ConvertToOutputPath(
|
||||||
cmOutputConverter::HOME_OUTPUT,
|
this->LocalGenerator
|
||||||
cmOutputConverter::MAKERULE)
|
->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetBinaryDirectory(),
|
||||||
|
this->ProgressFileNameFull)
|
||||||
|
.c_str())
|
||||||
<< "\n\n";
|
<< "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -642,7 +642,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If we have any PRE_LINK commands, we need to go back to HOME_OUTPUT for
|
// If we have any PRE_LINK commands, we need to go back to CMAKE_BINARY_DIR
|
||||||
|
// for
|
||||||
// the link commands.
|
// the link commands.
|
||||||
if (!preLinkCmdLines.empty()) {
|
if (!preLinkCmdLines.empty()) {
|
||||||
const std::string homeOutDir = localGen.ConvertToOutputFormat(
|
const std::string homeOutDir = localGen.ConvertToOutputFormat(
|
||||||
|
@ -46,49 +46,12 @@ std::string cmOutputConverter::ConvertToOutputForExisting(
|
|||||||
return this->ConvertToOutputFormat(remote, format);
|
return this->ConvertToOutputFormat(remote, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmOutputConverter::ConvertToRelativePath(
|
|
||||||
const std::string& source, RelativeRoot relative) const
|
|
||||||
{
|
|
||||||
std::string result;
|
|
||||||
|
|
||||||
switch (relative) {
|
|
||||||
case HOME:
|
|
||||||
result = this->ConvertToRelativePath(
|
|
||||||
this->GetState()->GetSourceDirectory(), source);
|
|
||||||
break;
|
|
||||||
case START:
|
|
||||||
result = this->ConvertToRelativePath(
|
|
||||||
this->StateSnapshot.GetDirectory().GetCurrentSource(), source);
|
|
||||||
break;
|
|
||||||
case HOME_OUTPUT:
|
|
||||||
result = this->ConvertToRelativePath(
|
|
||||||
this->GetState()->GetBinaryDirectory(), source);
|
|
||||||
break;
|
|
||||||
case START_OUTPUT:
|
|
||||||
result = this->ConvertToRelativePath(
|
|
||||||
this->StateSnapshot.GetDirectory().GetCurrentBinary(), source);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string cmOutputConverter::Convert(const std::string& source,
|
|
||||||
RelativeRoot relative,
|
|
||||||
OutputFormat output) const
|
|
||||||
{
|
|
||||||
// Convert the path to a relative path.
|
|
||||||
std::string result = this->ConvertToRelativePath(source, relative);
|
|
||||||
return this->ConvertToOutputFormat(result, output);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string cmOutputConverter::ConvertToOutputFormat(const std::string& source,
|
std::string cmOutputConverter::ConvertToOutputFormat(const std::string& source,
|
||||||
OutputFormat output) const
|
OutputFormat output) const
|
||||||
{
|
{
|
||||||
std::string result = source;
|
std::string result = source;
|
||||||
// Convert it to an output path.
|
// Convert it to an output path.
|
||||||
if (output == MAKERULE) {
|
if (output == SHELL || output == WATCOMQUOTE) {
|
||||||
result = cmSystemTools::ConvertToOutputPath(result.c_str());
|
|
||||||
} else if (output == SHELL || output == WATCOMQUOTE) {
|
|
||||||
result = this->ConvertDirectorySeparatorsForShell(source);
|
result = this->ConvertDirectorySeparatorsForShell(source);
|
||||||
result = this->EscapeForShell(result, true, false, output == WATCOMQUOTE);
|
result = this->EscapeForShell(result, true, false, output == WATCOMQUOTE);
|
||||||
} else if (output == RESPONSE) {
|
} else if (output == RESPONSE) {
|
||||||
|
@ -24,40 +24,14 @@ class cmOutputConverter
|
|||||||
public:
|
public:
|
||||||
cmOutputConverter(cmState::Snapshot snapshot);
|
cmOutputConverter(cmState::Snapshot snapshot);
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert something to something else. This is a centralized conversion
|
|
||||||
* routine used by the generators to handle relative paths and the like.
|
|
||||||
* The flags determine what is actually done.
|
|
||||||
*
|
|
||||||
* relative: treat the argument as a directory and convert it to make it
|
|
||||||
* relative or full or unchanged. If relative (HOME, START etc) then that
|
|
||||||
* specifies what it should be relative to.
|
|
||||||
*
|
|
||||||
* output: make the result suitable for output to a...
|
|
||||||
*
|
|
||||||
* optional: should any relative path operation be controlled by the rel
|
|
||||||
* path setting
|
|
||||||
*/
|
|
||||||
enum RelativeRoot
|
|
||||||
{
|
|
||||||
HOME,
|
|
||||||
START,
|
|
||||||
HOME_OUTPUT,
|
|
||||||
START_OUTPUT
|
|
||||||
};
|
|
||||||
enum OutputFormat
|
enum OutputFormat
|
||||||
{
|
{
|
||||||
MAKERULE,
|
|
||||||
SHELL,
|
SHELL,
|
||||||
WATCOMQUOTE,
|
WATCOMQUOTE,
|
||||||
RESPONSE
|
RESPONSE
|
||||||
};
|
};
|
||||||
std::string ConvertToOutputFormat(const std::string& source,
|
std::string ConvertToOutputFormat(const std::string& source,
|
||||||
OutputFormat output) const;
|
OutputFormat output) const;
|
||||||
std::string Convert(const std::string& remote, RelativeRoot local,
|
|
||||||
OutputFormat output) const;
|
|
||||||
std::string ConvertToRelativePath(const std::string& remote,
|
|
||||||
RelativeRoot local) const;
|
|
||||||
std::string ConvertDirectorySeparatorsForShell(
|
std::string ConvertDirectorySeparatorsForShell(
|
||||||
const std::string& source) const;
|
const std::string& source) const;
|
||||||
|
|
||||||
|
@ -596,8 +596,8 @@ void cmTarget::GetTllSignatureTraces(std::ostream& s, TLLSignature sig) const
|
|||||||
it != this->TLLCommands.end(); ++it) {
|
it != this->TLLCommands.end(); ++it) {
|
||||||
if (it->first == sig) {
|
if (it->first == sig) {
|
||||||
cmListFileContext lfc = it->second;
|
cmListFileContext lfc = it->second;
|
||||||
lfc.FilePath =
|
lfc.FilePath = converter.ConvertToRelativePath(
|
||||||
converter.ConvertToRelativePath(lfc.FilePath, cmOutputConverter::HOME);
|
this->Makefile->GetState()->GetSourceDirectory(), lfc.FilePath);
|
||||||
s << " * " << lfc << std::endl;
|
s << " * " << lfc << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2415,10 +2415,12 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
|
|||||||
{
|
{
|
||||||
typedef cmComputeLinkInformation::ItemVector ItemVector;
|
typedef cmComputeLinkInformation::ItemVector ItemVector;
|
||||||
ItemVector libs = cli.GetItems();
|
ItemVector libs = cli.GetItems();
|
||||||
|
std::string currentBinDir =
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory();
|
||||||
for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
|
for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
|
||||||
if (l->IsPath) {
|
if (l->IsPath) {
|
||||||
std::string path = this->LocalGenerator->ConvertToRelativePath(
|
std::string path = this->LocalGenerator->ConvertToRelativePath(
|
||||||
l->Value.c_str(), cmOutputConverter::START_OUTPUT);
|
currentBinDir, l->Value.c_str());
|
||||||
this->ConvertToWindowsSlash(path);
|
this->ConvertToWindowsSlash(path);
|
||||||
libVec.push_back(path);
|
libVec.push_back(path);
|
||||||
} else if (!l->Target ||
|
} else if (!l->Target ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user