1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-17 15:32:10 +08:00

cmTarget: Move IMPORTED check to callers

This way the policy can be checked without depending on cmTarget.
This commit is contained in:
Stephen Kelly
2016-10-13 00:18:23 +02:00
parent 1fb6f672bd
commit 705fcf522b

View File

@@ -1032,9 +1032,6 @@ void cmTarget::CheckProperty(const std::string& prop,
bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const
{
if (this->IsImported()) {
return true;
}
std::ostringstream e;
const char* modal = CM_NULLPTR;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
@@ -1090,7 +1087,9 @@ const char* cmTarget::GetProperty(const std::string& prop,
this->GetType() == cmState::UNKNOWN_LIBRARY) {
static const std::string propLOCATION = "LOCATION";
if (prop == propLOCATION) {
if (!this->HandleLocationPropertyPolicy(context)) {
if (!this->IsImported() &&
!this->HandleLocationPropertyPolicy(context)) {
return CM_NULLPTR;
}
@@ -1122,7 +1121,8 @@ const char* cmTarget::GetProperty(const std::string& prop,
// Support "LOCATION_<CONFIG>".
else if (cmHasLiteralPrefix(prop, "LOCATION_")) {
if (!this->HandleLocationPropertyPolicy(context)) {
if (!this->IsImported() &&
!this->HandleLocationPropertyPolicy(context)) {
return CM_NULLPTR;
}
const char* configName = prop.c_str() + 9;
@@ -1147,7 +1147,8 @@ const char* cmTarget::GetProperty(const std::string& prop,
!cmHasLiteralPrefix(prop, "XCODE_ATTRIBUTE_")) {
std::string configName(prop.c_str(), prop.size() - 9);
if (configName != "IMPORTED") {
if (!this->HandleLocationPropertyPolicy(context)) {
if (!this->IsImported() &&
!this->HandleLocationPropertyPolicy(context)) {
return CM_NULLPTR;
}
if (this->IsImported()) {