diff options
author | Brad King <brad.king@kitware.com> | 2013-10-07 19:41:24 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-10-07 19:41:24 (GMT) |
commit | f7558c544707c81cc40c2b4ef1c3ac2063d3c692 (patch) | |
tree | 56385f6d6ffe24189da09288a24e68b2e010a8f5 | |
parent | 610234a5e8285a1cfac453cc7a5432b7c0a81e9d (diff) | |
parent | 8b2a2db0735a836c6ebe40458b9a95ac08e61ea9 (diff) | |
download | CMake-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).
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 12 |
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); |