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

This commit is contained in:
Andy Cedilnik 2003-11-12 14:06:02 -05:00
parent 37149fc5b3
commit 467fa9dfb3
2 changed files with 22 additions and 2 deletions

View File

@ -114,7 +114,17 @@ int cmGlobalVisualStudio6Generator::TryCompile(const char *,
{ {
makeCommand += "ALL_BUILD"; 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 retVal;
int timeout = cmGlobalGenerator::s_TryCompileTimeout; int timeout = cmGlobalGenerator::s_TryCompileTimeout;
if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output, if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output,

View File

@ -75,7 +75,17 @@ int cmGlobalVisualStudio7Generator::TryCompile(const char *,
#endif #endif
makeCommand += " "; makeCommand += " ";
makeCommand += projectName; 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) if (targetName)
{ {
makeCommand += targetName; makeCommand += targetName;