diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2007-12-13 20:54:29 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2007-12-13 20:54:29 (GMT) |
commit | fd33bf93a5e9d86ee249cc3fde22a221dfe861e8 (patch) | |
tree | 1704ac68da40c79e84d9598b5b4d7b816637d86b /Source/cmGlobalUnixMakefileGenerator3.cxx | |
parent | 3409e0a777a5ae0306e2165bc518f60a5281b8ca (diff) | |
download | CMake-fd33bf93a5e9d86ee249cc3fde22a221dfe861e8.zip CMake-fd33bf93a5e9d86ee249cc3fde22a221dfe861e8.tar.gz CMake-fd33bf93a5e9d86ee249cc3fde22a221dfe861e8.tar.bz2 |
ENH: fix for bug 6102, allow users to change the compiler
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 0eefef3..f3a5dde 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -63,7 +63,7 @@ void cmGlobalUnixMakefileGenerator3 " not set, after EnableLanguage"); continue; } - const char* name = mf->GetRequiredDefinition(langComp.c_str()); + const char* name = mf->GetRequiredDefinition(langComp.c_str()); if(!cmSystemTools::FileIsFullPath(name)) { path = cmSystemTools::FindProgram(name); @@ -87,6 +87,26 @@ void cmGlobalUnixMakefileGenerator3 } std::string doc = lang; doc += " compiler."; + const char* cname = this->GetCMakeInstance()-> + GetCacheManager()->GetCacheValue(langComp.c_str()); + std::string changeVars; + if(cname && (path != cname)) + { + const char* cvars = + this->GetCMakeInstance()->GetProperty( + "__CMAKE_DELETE_CACHE_CHANGE_VARS_"); + if(cvars) + { + changeVars += cvars; + changeVars += ";"; + } + changeVars += langComp; + changeVars += ";"; + changeVars += cname; + this->GetCMakeInstance()->SetProperty( + "__CMAKE_DELETE_CACHE_CHANGE_VARS_", + changeVars.c_str()); + } mf->AddCacheDefinition(langComp.c_str(), path.c_str(), doc.c_str(), cmCacheManager::FILEPATH); } |