BUG: Pay attention to ForceUnixPaths setting in cmSystemTools for ConvertToQuotedOutputPath and for dependency scanning.
This commit is contained in:
parent
ba6f07b10c
commit
e015d822ab
@ -274,6 +274,15 @@ void cmLocalUnixMakefileGenerator2::GenerateDirectoryInformationFile()
|
|||||||
// Write the do not edit header.
|
// Write the do not edit header.
|
||||||
this->WriteDisclaimer(infoFileStream);
|
this->WriteDisclaimer(infoFileStream);
|
||||||
|
|
||||||
|
// Tell the dependency scanner to use unix paths if necessary.
|
||||||
|
if(cmSystemTools::GetForceUnixPaths())
|
||||||
|
{
|
||||||
|
infoFileStream
|
||||||
|
<< "# Force unix paths in dependencies.\n"
|
||||||
|
<< "SET(CMAKE_FORCE_UNIX_PATHS 1)\n"
|
||||||
|
<< "\n";
|
||||||
|
}
|
||||||
|
|
||||||
// Store the include search path for this directory.
|
// Store the include search path for this directory.
|
||||||
infoFileStream
|
infoFileStream
|
||||||
<< "# The C and CXX include file search paths:\n";
|
<< "# The C and CXX include file search paths:\n";
|
||||||
@ -2343,16 +2352,21 @@ cmLocalUnixMakefileGenerator2::ConvertToQuotedOutputPath(const char* p)
|
|||||||
return "\"\"";
|
return "\"\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fix root component slash direction for windows.
|
// Choose a slash direction and fix root component.
|
||||||
|
const char* slash = "/";
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
for(std::string::iterator i = components[0].begin();
|
if(!cmSystemTools::GetForceUnixPaths())
|
||||||
i != components[0].end(); ++i)
|
{
|
||||||
{
|
slash = "\\";
|
||||||
if(*i == '/')
|
for(std::string::iterator i = components[0].begin();
|
||||||
{
|
i != components[0].end(); ++i)
|
||||||
*i = '\\';
|
{
|
||||||
}
|
if(*i == '/')
|
||||||
}
|
{
|
||||||
|
*i = '\\';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Begin the quoted result with the root component.
|
// Begin the quoted result with the root component.
|
||||||
@ -2369,11 +2383,7 @@ cmLocalUnixMakefileGenerator2::ConvertToQuotedOutputPath(const char* p)
|
|||||||
{
|
{
|
||||||
if(!first)
|
if(!first)
|
||||||
{
|
{
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
result += slash;
|
||||||
result += "\\";
|
|
||||||
#else
|
|
||||||
result += "/";
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
result += components[i];
|
result += components[i];
|
||||||
first = false;
|
first = false;
|
||||||
@ -3177,6 +3187,18 @@ cmLocalUnixMakefileGenerator2
|
|||||||
haveDirectoryInfo = true;
|
haveDirectoryInfo = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test whether we need to force Unix paths.
|
||||||
|
if(haveDirectoryInfo)
|
||||||
|
{
|
||||||
|
if(const char* force = mf->GetDefinition("CMAKE_FORCE_UNIX_PATHS"))
|
||||||
|
{
|
||||||
|
if(!cmSystemTools::IsOff(force))
|
||||||
|
{
|
||||||
|
cmSystemTools::SetForceUnixPaths(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get the set of include directories.
|
// Get the set of include directories.
|
||||||
std::vector<std::string> includes;
|
std::vector<std::string> includes;
|
||||||
if(haveDirectoryInfo)
|
if(haveDirectoryInfo)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user