summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-12 22:18:23 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-15 09:14:21 (GMT)
commit705fcf522be16eee03b1757274b23ada6547e6bd (patch)
treef7d7cb352045a65cd6d169b1e14931f0d7a22159 /Source/cmTarget.cxx
parent1fb6f672bd2bd041edb772b0627278383a00fb62 (diff)
downloadCMake-705fcf522be16eee03b1757274b23ada6547e6bd.zip
CMake-705fcf522be16eee03b1757274b23ada6547e6bd.tar.gz
CMake-705fcf522be16eee03b1757274b23ada6547e6bd.tar.bz2
cmTarget: Move IMPORTED check to callers
This way the policy can be checked without depending on cmTarget.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 129dd63..62e2d1c 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -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()) {