From 6783765c907932449bfe450918735d2405835427 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Tue, 28 Feb 2006 15:31:43 -0500 Subject: [PATCH] BUG: On Visual Studio and XCode, handle build configurations --- Source/cmGlobalGenerator.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index bc99f12eb..506e80dec 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1213,6 +1213,8 @@ void cmGlobalGenerator::SetupTests() void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) { cmMakefile* mf = m_LocalGenerators[0]->GetMakefile(); + const char* cmakeCfgIntDir = this->GetCMakeCFGInitDirectory(); + // CPack cmCustomCommandLines cpackCommandLines; std::vector depends; @@ -1220,6 +1222,11 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end()); singleLine.erase(singleLine.begin(), singleLine.end()); depends.erase(depends.begin(), depends.end()); + if ( cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[1] != '.' ) + { + singleLine.push_back("-C"); + singleLine.push_back(mf->GetDefinition("CMAKE_CFG_INTDIR")); + } singleLine.push_back(this->GetCMakeInstance()->GetCPackCommand()); singleLine.push_back("--config"); std::string configFile = mf->GetStartOutputDirectory();; @@ -1314,7 +1321,6 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) cmd = cmakeCommand; } singleLine.push_back(cmd.c_str()); - const char* cmakeCfgIntDir = this->GetCMakeCFGInitDirectory(); if ( cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[1] != '.' ) { std::string cfgArg = "-DBUILD_TYPE=";