Merge topic 'fix-reset-compiler'

8b2a2db Fix resetting the compiler on the command line (#14366).
This commit is contained in:
Brad King 2013-10-07 15:41:24 -04:00 committed by CMake Topic Stage
commit f7558c5447
1 changed files with 10 additions and 2 deletions

View File

@ -146,9 +146,17 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang,
const char* cname = this->GetCMakeInstance()->
GetCacheManager()->GetCacheValue(langComp.c_str());
std::string changeVars;
if(cname && (path != cname) && (optional==false))
if(cname && !optional)
{
std::string cnameString = cname;
std::string cnameString;
if(!cmSystemTools::FileIsFullPath(cname))
{
cnameString = cmSystemTools::FindProgram(cname);
}
else
{
cnameString = cname;
}
std::string pathString = path;
// get rid of potentially multiple slashes:
cmSystemTools::ConvertToUnixSlashes(cnameString);