Jelajahi Sumber

Merge topic 'fix-8914-allow-config-types-override'

e6221ed Xcode: Allow override of CMAKE_CONFIGURATION_TYPES (#8914)
Brad King 14 tahun lalu
induk
melakukan
554641f320
1 mengubah file dengan 10 tambahan dan 7 penghapusan
  1. 10 7
      Source/cmGlobalXCodeGenerator.cxx

+ 10 - 7
Source/cmGlobalXCodeGenerator.cxx

@@ -165,13 +165,16 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const&
     }
     }
   else
   else
     {
     {
-    mf->AddCacheDefinition(
-      "CMAKE_CONFIGURATION_TYPES",
-      "Debug;Release;MinSizeRel;RelWithDebInfo",
-      "Semicolon separated list of supported configuration types, "
-      "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, "
-      "anything else will be ignored.",
-      cmCacheManager::STRING);
+    if(!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
+      {
+      mf->AddCacheDefinition(
+        "CMAKE_CONFIGURATION_TYPES",
+        "Debug;Release;MinSizeRel;RelWithDebInfo",
+        "Semicolon separated list of supported configuration types, "
+        "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, "
+        "anything else will be ignored.",
+        cmCacheManager::STRING);
+      }
     }
     }
   mf->AddDefinition("CMAKE_GENERATOR_CC", "gcc");
   mf->AddDefinition("CMAKE_GENERATOR_CC", "gcc");
   mf->AddDefinition("CMAKE_GENERATOR_CXX", "g++");
   mf->AddDefinition("CMAKE_GENERATOR_CXX", "g++");