Browse Source

cmake-gui: Fix handling of missing CMAKE_EXTRA_GENERATOR (#14804)

Since commit 1a1b737c (stringapi: Use strings for generator names,
2014-02-24) cmExternalMakefileProjectGenerator::CreateFullGeneratorName
expects a std::string instead of const char*.  When no extra generator
name is available, pass an empty string to avoid NULL dereference.
Brad King 12 years ago
parent
commit
ae32622bcf
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Source/QtDialog/QCMake.cxx

+ 1 - 1
Source/QtDialog/QCMake.cxx

@@ -117,7 +117,7 @@ void QCMake::setBinaryDirectory(const QString& _dir)
       {
       {
       const char* extraGen = cachem->GetCacheValue("CMAKE_EXTRA_GENERATOR");
       const char* extraGen = cachem->GetCacheValue("CMAKE_EXTRA_GENERATOR");
       std::string curGen = cmExternalMakefileProjectGenerator::
       std::string curGen = cmExternalMakefileProjectGenerator::
-                              CreateFullGeneratorName(itm.GetValue(), extraGen);
+        CreateFullGeneratorName(itm.GetValue(), extraGen? extraGen : "");
       this->setGenerator(QString::fromLocal8Bit(curGen.c_str()));
       this->setGenerator(QString::fromLocal8Bit(curGen.c_str()));
       }
       }
     }
     }