diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2019-07-08 20:02:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-07-15 12:17:36 (GMT) |
commit | 41b85968d858d825891417c244879f4ebb6543c3 (patch) | |
tree | 1b84b5eca3ae1a419ae11e5c4a9401b7274a827a /Source/cmProjectCommand.cxx | |
parent | 45e85dd2b2830601b28da26a0ed36db23c82204d (diff) | |
download | CMake-41b85968d858d825891417c244879f4ebb6543c3.zip CMake-41b85968d858d825891417c244879f4ebb6543c3.tar.gz CMake-41b85968d858d825891417c244879f4ebb6543c3.tar.bz2 |
Refactor: Use initializer lists instead of `push_back` series
Diffstat (limited to 'Source/cmProjectCommand.cxx')
-rw-r--r-- | Source/cmProjectCommand.cxx | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index b2bc0c4..aae2ada 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -260,17 +260,16 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args, TopLevelCMakeVarCondSet("CMAKE_PROJECT_VERSION_TWEAK", vb[3]); } else if (cmp0048 != cmPolicies::OLD) { // Set project VERSION variables to empty - std::vector<std::string> vv; - vv.emplace_back("PROJECT_VERSION"); - vv.emplace_back("PROJECT_VERSION_MAJOR"); - vv.emplace_back("PROJECT_VERSION_MINOR"); - vv.emplace_back("PROJECT_VERSION_PATCH"); - vv.emplace_back("PROJECT_VERSION_TWEAK"); - vv.push_back(projectName + "_VERSION"); - vv.push_back(projectName + "_VERSION_MAJOR"); - vv.push_back(projectName + "_VERSION_MINOR"); - vv.push_back(projectName + "_VERSION_PATCH"); - vv.push_back(projectName + "_VERSION_TWEAK"); + std::vector<std::string> vv = { "PROJECT_VERSION", + "PROJECT_VERSION_MAJOR", + "PROJECT_VERSION_MINOR", + "PROJECT_VERSION_PATCH", + "PROJECT_VERSION_TWEAK", + projectName + "_VERSION", + projectName + "_VERSION_MAJOR", + projectName + "_VERSION_MINOR", + projectName + "_VERSION_PATCH", + projectName + "_VERSION_TWEAK" }; if (this->Makefile->IsRootMakefile()) { vv.emplace_back("CMAKE_PROJECT_VERSION"); vv.emplace_back("CMAKE_PROJECT_VERSION_MAJOR"); @@ -312,8 +311,7 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args, if (languages.empty()) { // if no language is specified do c and c++ - languages.emplace_back("C"); - languages.emplace_back("CXX"); + languages = { "C", "CXX" }; } this->Makefile->EnableLanguage(languages, false); |