summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator2.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-03-02 14:34:16 (GMT)
committerBrad King <brad.king@kitware.com>2005-03-02 14:34:16 (GMT)
commite015d822ab900b9a2f164a29db67a613aafed1df (patch)
tree1dd13cde371367634fb335b882694e43b6a99d2f /Source/cmLocalUnixMakefileGenerator2.cxx
parentba6f07b10c5dcf238d50953e203e769ee87f1856 (diff)
downloadCMake-e015d822ab900b9a2f164a29db67a613aafed1df.zip
CMake-e015d822ab900b9a2f164a29db67a613aafed1df.tar.gz
CMake-e015d822ab900b9a2f164a29db67a613aafed1df.tar.bz2
BUG: Pay attention to ForceUnixPaths setting in cmSystemTools for ConvertToQuotedOutputPath and for dependency scanning.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator2.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator2.cxx50
1 files changed, 36 insertions, 14 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator2.cxx b/Source/cmLocalUnixMakefileGenerator2.cxx
index b5d5388..952cac0 100644
--- a/Source/cmLocalUnixMakefileGenerator2.cxx
+++ b/Source/cmLocalUnixMakefileGenerator2.cxx
@@ -274,6 +274,15 @@ void cmLocalUnixMakefileGenerator2::GenerateDirectoryInformationFile()
// Write the do not edit header.
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.
infoFileStream
<< "# The C and CXX include file search paths:\n";
@@ -2343,16 +2352,21 @@ cmLocalUnixMakefileGenerator2::ConvertToQuotedOutputPath(const char* p)
return "\"\"";
}
- // Fix root component slash direction for windows.
+ // Choose a slash direction and fix root component.
+ const char* slash = "/";
#if defined(_WIN32) && !defined(__CYGWIN__)
- for(std::string::iterator i = components[0].begin();
- i != components[0].end(); ++i)
- {
- if(*i == '/')
- {
- *i = '\\';
- }
- }
+ if(!cmSystemTools::GetForceUnixPaths())
+ {
+ slash = "\\";
+ for(std::string::iterator i = components[0].begin();
+ i != components[0].end(); ++i)
+ {
+ if(*i == '/')
+ {
+ *i = '\\';
+ }
+ }
+ }
#endif
// Begin the quoted result with the root component.
@@ -2369,11 +2383,7 @@ cmLocalUnixMakefileGenerator2::ConvertToQuotedOutputPath(const char* p)
{
if(!first)
{
-#if defined(_WIN32) && !defined(__CYGWIN__)
- result += "\\";
-#else
- result += "/";
-#endif
+ result += slash;
}
result += components[i];
first = false;
@@ -3177,6 +3187,18 @@ cmLocalUnixMakefileGenerator2
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.
std::vector<std::string> includes;
if(haveDirectoryInfo)