diff options
author | Brad King <brad.king@kitware.com> | 2016-08-23 13:00:00 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-08-23 13:00:00 (GMT) |
commit | 797f7ad87d6f1b6dd7cbbb553d5525ac8ee390f1 (patch) | |
tree | f5922b06caf987f6faff13f8c2ba8e0f164457f6 /Source/cmTarget.cxx | |
parent | 762131fe8d585ced6b259a451ccde8fded2a8ca4 (diff) | |
parent | 7b6349da4dc968691f1a374211fcc153c8b4f1c6 (diff) | |
download | CMake-797f7ad87d6f1b6dd7cbbb553d5525ac8ee390f1.zip CMake-797f7ad87d6f1b6dd7cbbb553d5525ac8ee390f1.tar.gz CMake-797f7ad87d6f1b6dd7cbbb553d5525ac8ee390f1.tar.bz2 |
Merge topic 'else-after-return'
7b6349da CMake: don't use else after return
50ad1e0a CTest: don't use else after return
7f97a6c9 CPack: don't use else after return
4988b914 CursesDialog: don't use else after return
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 5681885..ed04d2f 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -774,12 +774,14 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) << prop << "\" is not allowed."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; - } else if (prop == "NAME") { + } + if (prop == "NAME") { std::ostringstream e; e << "NAME property is read-only\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; - } else if (prop == "INCLUDE_DIRECTORIES") { + } + if (prop == "INCLUDE_DIRECTORIES") { this->Internal->IncludeDirectoriesEntries.clear(); this->Internal->IncludeDirectoriesBacktraces.clear(); if (value) { @@ -856,12 +858,14 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, << prop << "\" is not allowed."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; - } else if (prop == "NAME") { + } + if (prop == "NAME") { std::ostringstream e; e << "NAME property is read-only\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; - } else if (prop == "INCLUDE_DIRECTORIES") { + } + if (prop == "INCLUDE_DIRECTORIES") { if (value && *value) { this->Internal->IncludeDirectoriesEntries.push_back(value); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); @@ -1230,9 +1234,10 @@ const char* cmTarget::GetProperty(const std::string& prop, return output.c_str(); } // the type property returns what type the target is - else if (prop == propTYPE) { + if (prop == propTYPE) { return cmState::GetTargetTypeName(this->GetType()); - } else if (prop == propINCLUDE_DIRECTORIES) { + } + if (prop == propINCLUDE_DIRECTORIES) { if (this->Internal->IncludeDirectoriesEntries.empty()) { return CM_NULLPTR; } @@ -1240,7 +1245,8 @@ const char* cmTarget::GetProperty(const std::string& prop, static std::string output; output = cmJoin(this->Internal->IncludeDirectoriesEntries, ";"); return output.c_str(); - } else if (prop == propCOMPILE_FEATURES) { + } + if (prop == propCOMPILE_FEATURES) { if (this->Internal->CompileFeaturesEntries.empty()) { return CM_NULLPTR; } @@ -1248,7 +1254,8 @@ const char* cmTarget::GetProperty(const std::string& prop, static std::string output; output = cmJoin(this->Internal->CompileFeaturesEntries, ";"); return output.c_str(); - } else if (prop == propCOMPILE_OPTIONS) { + } + if (prop == propCOMPILE_OPTIONS) { if (this->Internal->CompileOptionsEntries.empty()) { return CM_NULLPTR; } @@ -1256,7 +1263,8 @@ const char* cmTarget::GetProperty(const std::string& prop, static std::string output; output = cmJoin(this->Internal->CompileOptionsEntries, ";"); return output.c_str(); - } else if (prop == propCOMPILE_DEFINITIONS) { + } + if (prop == propCOMPILE_DEFINITIONS) { if (this->Internal->CompileDefinitionsEntries.empty()) { return CM_NULLPTR; } @@ -1264,15 +1272,20 @@ const char* cmTarget::GetProperty(const std::string& prop, static std::string output; output = cmJoin(this->Internal->CompileDefinitionsEntries, ";"); return output.c_str(); - } else if (prop == propIMPORTED) { + } + if (prop == propIMPORTED) { return this->IsImported() ? "TRUE" : "FALSE"; - } else if (prop == propNAME) { + } + if (prop == propNAME) { return this->GetName().c_str(); - } else if (prop == propBINARY_DIR) { + } + if (prop == propBINARY_DIR) { return this->GetMakefile()->GetCurrentBinaryDirectory(); - } else if (prop == propSOURCE_DIR) { + } + if (prop == propSOURCE_DIR) { return this->GetMakefile()->GetCurrentSourceDirectory(); - } else if (prop == propSOURCES) { + } + if (prop == propSOURCES) { if (this->Internal->SourceEntries.empty()) { return CM_NULLPTR; } |