MCPcopy Create free account
hub / github.com/Kitware/CMake / CheckImportedLibName

Method CheckImportedLibName

Source/cmTarget.cxx:3222–3250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3220}
3221
3222bool cmTargetInternals::CheckImportedLibName(std::string const& prop,
3223 std::string const& value) const
3224{
3225 if (this->TargetType != cmStateEnums::INTERFACE_LIBRARY ||
3226 !this->IsImported()) {
3227 this->Makefile->IssueMessage(
3228 MessageType::FATAL_ERROR,
3229 prop +
3230 " property may be set only on imported INTERFACE library targets.");
3231 return false;
3232 }
3233 if (!value.empty()) {
3234 if (value[0] == '-') {
3235 this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
3236 prop + " property value\n " + value +
3237 "\nmay not start with '-'.");
3238 return false;
3239 }
3240 std::string::size_type bad = value.find_first_of(":/\\;");
3241 if (bad != std::string::npos) {
3242 this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
3243 prop + " property value\n " + value +
3244 "\nmay not contain '" +
3245 value.substr(bad, 1) + "'.");
3246 return false;
3247 }
3248 }
3249 return true;
3250}
3251
3252bool cmTarget::GetMappedConfig(std::string const& desiredConfig, cmValue& loc,
3253 cmValue& imp, std::string& suffix) const

Callers 1

SetPropertyMethod · 0.80

Calls 5

IsImportedMethod · 0.95
find_first_ofMethod · 0.80
IssueMessageMethod · 0.45
emptyMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected