ENH: fix spaces in paths problems
This commit is contained in:
parent
495666742b
commit
8b54b7a683
|
@ -698,7 +698,8 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
|
||||||
{
|
{
|
||||||
if(!this->FindTarget(d->c_str()))
|
if(!this->FindTarget(d->c_str()))
|
||||||
{
|
{
|
||||||
makefileStream << "\\\n" << *d;
|
makefileStream << "\\\n" << this
|
||||||
|
->ConvertToRelativeOutputPath(d->c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -885,7 +886,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
|
||||||
l != linkdirs.end(); ++l)
|
l != linkdirs.end(); ++l)
|
||||||
{
|
{
|
||||||
std::string libpath =
|
std::string libpath =
|
||||||
this->ConvertToRelativeOutputPath(l->c_str());
|
this->XCodeEscapePath(l->c_str());
|
||||||
if(emitted.insert(libpath).second)
|
if(emitted.insert(libpath).second)
|
||||||
{
|
{
|
||||||
dirs += libpath + " ";
|
dirs += libpath + " ";
|
||||||
|
@ -904,7 +905,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
|
||||||
for(;i != includes.end(); ++i)
|
for(;i != includes.end(); ++i)
|
||||||
{
|
{
|
||||||
std::string incpath =
|
std::string incpath =
|
||||||
this->ConvertToRelativeOutputPath(i->c_str());
|
this->XCodeEscapePath(i->c_str());
|
||||||
dirs += incpath + " ";
|
dirs += incpath + " ";
|
||||||
}
|
}
|
||||||
if(dirs.size())
|
if(dirs.size())
|
||||||
|
@ -1389,7 +1390,8 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
|
||||||
t->GetType() == cmTarget::MODULE_LIBRARY)
|
t->GetType() == cmTarget::MODULE_LIBRARY)
|
||||||
{
|
{
|
||||||
makefileStream << "\\\n\t"
|
makefileStream << "\\\n\t"
|
||||||
<< this->GetTargetFullPath(target->GetcmTarget());
|
<< this->
|
||||||
|
ConvertToRelativeOutputPath(this->GetTargetFullPath(target->GetcmTarget()).c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
makefileStream << "\n\n";
|
makefileStream << "\n\n";
|
||||||
|
@ -1407,7 +1409,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
|
||||||
{
|
{
|
||||||
if(emitted.insert(*d).second)
|
if(emitted.insert(*d).second)
|
||||||
{
|
{
|
||||||
makefileStream << *d << ":\n";
|
makefileStream << this->ConvertToRelativeOutputPath(d->c_str()) << ":\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1428,14 +1430,15 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
|
||||||
{
|
{
|
||||||
std::vector<cmStdString> const& deplibs = target->GetDependLibraries();
|
std::vector<cmStdString> const& deplibs = target->GetDependLibraries();
|
||||||
std::string tfull = this->GetTargetFullPath(target->GetcmTarget());
|
std::string tfull = this->GetTargetFullPath(target->GetcmTarget());
|
||||||
makefileStream << tfull << ": ";
|
makefileStream << this->ConvertToRelativeOutputPath(tfull.c_str()) << ": ";
|
||||||
for(std::vector<cmStdString>::const_iterator d = deplibs.begin();
|
for(std::vector<cmStdString>::const_iterator d = deplibs.begin();
|
||||||
d != deplibs.end(); ++d)
|
d != deplibs.end(); ++d)
|
||||||
{
|
{
|
||||||
makefileStream << "\\\n\t" << *d;
|
makefileStream << "\\\n\t" << this->ConvertToRelativeOutputPath(d->c_str());
|
||||||
}
|
}
|
||||||
makefileStream << "\n";
|
makefileStream << "\n";
|
||||||
makefileStream << "\t/bin/rm -f " << tfull << "\n";
|
makefileStream << "\t/bin/rm -f "
|
||||||
|
<< this->ConvertToRelativeOutputPath(tfull.c_str()) << "\n";
|
||||||
makefileStream << "\n\n";
|
makefileStream << "\n\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1556,3 +1559,16 @@ std::string cmGlobalXCodeGenerator::ConvertToRelativeOutputPath(const char* p)
|
||||||
// and correct escaping/quoting of spaces in the path
|
// and correct escaping/quoting of spaces in the path
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string cmGlobalXCodeGenerator::XCodeEscapePath(const char* p)
|
||||||
|
{
|
||||||
|
std::string ret = p;
|
||||||
|
if(ret.find(' ') != ret.npos)
|
||||||
|
{
|
||||||
|
std::string t = ret;
|
||||||
|
ret = "\\\"";
|
||||||
|
ret += t;
|
||||||
|
ret += "\\\"";
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
|
@ -69,6 +69,7 @@ public:
|
||||||
virtual void Generate();
|
virtual void Generate();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
std::string XCodeEscapePath(const char* p);
|
||||||
std::string ConvertToRelativeOutputPath(const char* p);
|
std::string ConvertToRelativeOutputPath(const char* p);
|
||||||
void CreateCustomCommands(cmXCodeObject* buildPhases,
|
void CreateCustomCommands(cmXCodeObject* buildPhases,
|
||||||
cmXCodeObject* sourceBuildPhase,
|
cmXCodeObject* sourceBuildPhase,
|
||||||
|
|
Loading…
Reference in New Issue