| 5006 | } |
| 5007 | |
| 5008 | std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const |
| 5009 | { |
| 5010 | // Strip whitespace off the library names because we used to do this |
| 5011 | // in case variables were expanded at generate time. We no longer |
| 5012 | // do the expansion but users link to libraries like " ${VAR} ". |
| 5013 | std::string lib = item; |
| 5014 | std::string::size_type pos = lib.find_first_not_of(" \t\r\n"); |
| 5015 | if (pos != std::string::npos) { |
| 5016 | lib = lib.substr(pos); |
| 5017 | } |
| 5018 | pos = lib.find_last_not_of(" \t\r\n"); |
| 5019 | if (pos != std::string::npos) { |
| 5020 | lib = lib.substr(0, pos + 1); |
| 5021 | } |
| 5022 | if (lib != item) { |
| 5023 | cmake* cm = this->LocalGenerator->GetCMakeInstance(); |
| 5024 | std::ostringstream e; |
| 5025 | e << "Target \"" << this->GetName() << "\" links to item \"" << item |
| 5026 | << "\" which has leading or trailing whitespace. " |
| 5027 | << "This is now an error according to policy CMP0004."; |
| 5028 | cm->IssueMessage(MessageType::FATAL_ERROR, e.str(), this->GetBacktrace()); |
| 5029 | } |
| 5030 | return lib; |
| 5031 | } |
| 5032 | |
| 5033 | bool cmGeneratorTarget::IsDeprecated() const |
| 5034 | { |
no test coverage detected