Commit dea42d92 authored by Ben Boeckel's avatar Ben Boeckel Committed by Brad King
Browse files

install: Fix regression in default configuration selection



The refactoring in commit v3.1.0-rc1~812^2~16 (stringapi: Pass
configuration names as strings, 2014-02-09) broke the code path in
cmLocalGenerator::GenerateInstallRules that intends to pick a default
install configuration for multi-config generators.  Fix the logic to
select an empty default configuration only when using a single-config
generator whose CMAKE_BUILD_TYPE is not set.
Inspired-by: Roman's avatarRoman Wüger <roman.wueger@gmx.at>
Reported-by: default avatarNoRulez <norulez@me.com>
parent 57622bd1
......@@ -390,27 +390,23 @@ void cmLocalGenerator::GenerateInstallRules()
this->Makefile->GetConfigurations(configurationTypes, false);
// Choose a default install configuration.
const char* default_config = config.c_str();
std::string default_config = config;
const char* default_order[] = {"RELEASE", "MINSIZEREL",
"RELWITHDEBINFO", "DEBUG", 0};
for(const char** c = default_order; *c && !default_config; ++c)
for(const char** c = default_order; *c && default_config.empty(); ++c)
{
for(std::vector<std::string>::iterator i = configurationTypes.begin();
i != configurationTypes.end(); ++i)
{
if(cmSystemTools::UpperCase(*i) == *c)
{
default_config = i->c_str();
default_config = *i;
}
}
}
if(!default_config && !configurationTypes.empty())
if(default_config.empty() && !configurationTypes.empty())
{
default_config = configurationTypes[0].c_str();
}
if(!default_config)
{
default_config = "Release";
default_config = configurationTypes[0];
}
// Create the install script file.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment