From 467fa9dfb3ecfb72a10b92edb8a4b53244e0562d Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 12 Nov 2003 14:06:02 -0500 Subject: [PATCH] ENH: Bug #371 - Add build configuration for try compiles using cmake variable --- Source/cmGlobalVisualStudio6Generator.cxx | 12 +++++++++++- Source/cmGlobalVisualStudio7Generator.cxx | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index b04713aea..75b74674e 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/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, diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 11032ceb8..543519011 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/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;