Browse Source

Merge topic 'cmake-gui-empty-compiler'

7a0c17f704 cmake-gui: Do not pass CMAKE_{C,CXX}_COMPILER items to cmake if empty

Acked-by: Kitware Robot <[email protected]>
Merge-request: !4664
Brad King 5 years ago
parent
commit
d7a1d0dc43
1 changed files with 8 additions and 4 deletions
  1. 8 4
      Source/QtDialog/CMakeSetupDialog.cxx

+ 8 - 4
Source/QtDialog/CMakeSetupDialog.cxx

@@ -808,11 +808,15 @@ bool CMakeSetupDialog::setupFirstConfigure()
       m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_PROCESSOR",
                         tr("CMake System Processor"), systemProcessor, false);
       QString cxxCompiler = dialog.getCXXCompiler();
-      m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER",
-                        tr("CXX compiler."), cxxCompiler, false);
+      if (!cxxCompiler.isEmpty()) {
+        m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER",
+                          tr("CXX compiler."), cxxCompiler, false);
+      }
       QString cCompiler = dialog.getCCompiler();
-      m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER",
-                        tr("C compiler."), cCompiler, false);
+      if (!cCompiler.isEmpty()) {
+        m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER",
+                          tr("C compiler."), cCompiler, false);
+      }
     } else if (dialog.crossCompilerToolChainFile()) {
       QString toolchainFile = dialog.getCrossCompilerToolChainFile();
       m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE",