summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-07 19:41:24 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-10-07 19:41:24 (GMT)
commitf7558c544707c81cc40c2b4ef1c3ac2063d3c692 (patch)
tree56385f6d6ffe24189da09288a24e68b2e010a8f5 /Source
parent610234a5e8285a1cfac453cc7a5432b7c0a81e9d (diff)
parent8b2a2db0735a836c6ebe40458b9a95ac08e61ea9 (diff)
downloadCMake-f7558c544707c81cc40c2b4ef1c3ac2063d3c692.zip
CMake-f7558c544707c81cc40c2b4ef1c3ac2063d3c692.tar.gz
CMake-f7558c544707c81cc40c2b4ef1c3ac2063d3c692.tar.bz2
Merge topic 'fix-reset-compiler'
8b2a2db Fix resetting the compiler on the command line (#14366).
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 7f2b592..799bbdb 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -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);