Bladeren bron

ENH: Bug #371 - Add build configuration for try compiles using cmake variable

Andy Cedilnik 22 jaren geleden
bovenliggende
commit
467fa9dfb3
2 gewijzigde bestanden met toevoegingen van 22 en 2 verwijderingen
  1. 11 1
      Source/cmGlobalVisualStudio6Generator.cxx
  2. 11 1
      Source/cmGlobalVisualStudio7Generator.cxx

+ 11 - 1
Source/cmGlobalVisualStudio6Generator.cxx

@@ -114,7 +114,17 @@ int cmGlobalVisualStudio6Generator::TryCompile(const char *,
     {
     makeCommand += "ALL_BUILD";
     }
-  makeCommand += " - Debug\"";
+  makeCommand += " - ";
+  if ( m_LocalGenerators[0]->GetMakefile()->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION") )
+    {
+    makeCommand += 
+      m_LocalGenerators[0]->GetMakefile()->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
+    }
+  else
+    {
+    makeCommand += "Debug";
+    }
+  makeCommand += "\"";
   int retVal;
   int timeout = cmGlobalGenerator::s_TryCompileTimeout;
   if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output, 

+ 11 - 1
Source/cmGlobalVisualStudio7Generator.cxx

@@ -75,7 +75,17 @@ int cmGlobalVisualStudio7Generator::TryCompile(const char *,
 #endif
   makeCommand += " ";
   makeCommand += projectName;
-  makeCommand += ".sln /build Debug /project ";
+  makeCommand += ".sln /build ";
+  if ( m_LocalGenerators[0]->GetMakefile()->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION") )
+    {
+    makeCommand += 
+      m_LocalGenerators[0]->GetMakefile()->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
+    }
+  else
+    {
+    makeCommand += "Debug";
+    }
+  makeCommand += " /project ";
   if (targetName)
     {
     makeCommand += targetName;