summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-02-03 18:23:57 (GMT)
committerBrad King <brad.king@kitware.com>2015-02-03 18:23:57 (GMT)
commitfdb0799d7568efbae2b01ede62e6cec30a0798ce (patch)
tree4e61a6ba0f12599e1c2d58613fa4e7f7ffa356b0
parent37662ea4bf64087f2251e2f4a71a13623cfe047f (diff)
parentdea42d929699ef62c1d6df0eb273beb30c9fbf6e (diff)
downloadCMake-fdb0799d7568efbae2b01ede62e6cec30a0798ce.zip
CMake-fdb0799d7568efbae2b01ede62e6cec30a0798ce.tar.gz
CMake-fdb0799d7568efbae2b01ede62e6cec30a0798ce.tar.bz2
Merge branch 'fix-default-install-config' into release-3.1
-rw-r--r--Source/cmLocalGenerator.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 50e279b..e726ab9 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -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.