diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-02-21 04:08:12 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-02-21 04:08:12 (GMT) |
commit | e015df7d06a2b591571228cba10c5268a8f8fccd (patch) | |
tree | 3b25646b59d65a98d7a34edeeda9ac895d4bb0bc /Source/cmGlobalMSYSMakefileGenerator.cxx | |
parent | 2cb68f60003d0dbe9a2f91663ebca7de3b16c8f1 (diff) | |
download | CMake-e015df7d06a2b591571228cba10c5268a8f8fccd.zip CMake-e015df7d06a2b591571228cba10c5268a8f8fccd.tar.gz CMake-e015df7d06a2b591571228cba10c5268a8f8fccd.tar.bz2 |
ENH: better finding of mingw from msys, and delete CMakeFiles directory when cache is deleted
Diffstat (limited to 'Source/cmGlobalMSYSMakefileGenerator.cxx')
-rw-r--r-- | Source/cmGlobalMSYSMakefileGenerator.cxx | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx index fdae0b9..8643857 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.cxx +++ b/Source/cmGlobalMSYSMakefileGenerator.cxx @@ -25,13 +25,36 @@ cmGlobalMSYSMakefileGenerator::cmGlobalMSYSMakefileGenerator() m_ForceUnixPaths = true; } +std::string +cmGlobalMSYSMakefileGenerator::FindMinGW(std::string const& makeloc) +{ + std::string fstab = makeloc; + fstab += "/../etc/fstab"; + std::ifstream fin(fstab.c_str()); + std::string path; + std::string mount; + while(fin) + { + fin >> path; + fin >> mount; + if(mount == "/mingw") + { + path += "/bin"; + return path; + } + } + return ""; +} + void cmGlobalMSYSMakefileGenerator::EnableLanguage(std::vector<std::string>const& l, cmMakefile *mf) { this->FindMakeProgram(mf); std::string makeProgram = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"); std::vector<std::string> locations; - locations.push_back(cmSystemTools::GetProgramPath(makeProgram.c_str())); + std::string makeloc = cmSystemTools::GetProgramPath(makeProgram.c_str()); + locations.push_back(makeloc); + locations.push_back(this->FindMinGW(makeloc)); locations.push_back("/mingw/bin"); locations.push_back("/msys/1.0/bin"); locations.push_back("c:/mingw/bin"); |