ENH: allow for source tree to be in root directory
This commit is contained in:
parent
53549a6426
commit
3b74388050
@ -176,6 +176,7 @@ void cmLocalVisualStudio7Generator::AddVCProjBuildRule(cmTarget& tgt)
|
|||||||
std::string makefileIn = this->Makefile->GetStartDirectory();
|
std::string makefileIn = this->Makefile->GetStartDirectory();
|
||||||
makefileIn += "/";
|
makefileIn += "/";
|
||||||
makefileIn += "CMakeLists.txt";
|
makefileIn += "CMakeLists.txt";
|
||||||
|
makefileIn = cmSystemTools::CollapseFullPath(makefileIn.c_str());
|
||||||
std::string comment = "Building Custom Rule ";
|
std::string comment = "Building Custom Rule ";
|
||||||
comment += makefileIn;
|
comment += makefileIn;
|
||||||
std::string args;
|
std::string args;
|
||||||
|
@ -1339,13 +1339,17 @@ void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path)
|
|||||||
path.replace(0,1,homeEnv);
|
path.replace(0,1,homeEnv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// remove trailing slash if the path is more than
|
||||||
|
// a single /
|
||||||
pathCString = path.c_str();
|
pathCString = path.c_str();
|
||||||
if (*(pathCString+(path.size()-1)) == '/')
|
if(path.size() > 1 && *(pathCString+(path.size()-1)) == '/')
|
||||||
{
|
{
|
||||||
path = path.substr(0, path.size()-1);
|
// if it is c:/ then do not remove the trailing slash
|
||||||
|
if(!((path.size() == 3 && pathCString[1] == ':')))
|
||||||
|
{
|
||||||
|
path = path.substr(0, path.size()-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2503,7 +2507,6 @@ kwsys_stl::string SystemTools::CollapseFullPath(const char* in_path,
|
|||||||
// Split the input path components.
|
// Split the input path components.
|
||||||
kwsys_stl::vector<kwsys_stl::string> path_components;
|
kwsys_stl::vector<kwsys_stl::string> path_components;
|
||||||
SystemTools::SplitPath(in_path, path_components);
|
SystemTools::SplitPath(in_path, path_components);
|
||||||
|
|
||||||
// If the input path is relative, start with a base path.
|
// If the input path is relative, start with a base path.
|
||||||
if(path_components[0].length() == 0)
|
if(path_components[0].length() == 0)
|
||||||
{
|
{
|
||||||
@ -2891,7 +2894,16 @@ kwsys_stl::string SystemTools::GetFilenamePath(const kwsys_stl::string& filename
|
|||||||
kwsys_stl::string::size_type slash_pos = fn.rfind("/");
|
kwsys_stl::string::size_type slash_pos = fn.rfind("/");
|
||||||
if(slash_pos != kwsys_stl::string::npos)
|
if(slash_pos != kwsys_stl::string::npos)
|
||||||
{
|
{
|
||||||
return fn.substr(0, slash_pos);
|
kwsys_stl::string ret = fn.substr(0, slash_pos);
|
||||||
|
if(ret.size() == 2 && ret[1] == ':')
|
||||||
|
{
|
||||||
|
return ret + '/';
|
||||||
|
}
|
||||||
|
if(ret.size() == 0)
|
||||||
|
{
|
||||||
|
return "/";
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user