diff options
author | Brad King <brad.king@kitware.com> | 2015-02-03 18:23:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-02-03 18:23:57 (GMT) |
commit | fdb0799d7568efbae2b01ede62e6cec30a0798ce (patch) | |
tree | 4e61a6ba0f12599e1c2d58613fa4e7f7ffa356b0 | |
parent | 37662ea4bf64087f2251e2f4a71a13623cfe047f (diff) | |
parent | dea42d929699ef62c1d6df0eb273beb30c9fbf6e (diff) | |
download | CMake-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.cxx | 14 |
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. |