summaryrefslogtreecommitdiff
path: root/Source/cmTargetPropCommandBase.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-02-08 19:12:45 +0100
committerStephen Kelly <steveire@gmail.com>2013-02-08 19:21:30 +0100
commit510fdcb18801076e2041eaae2941375eecc93ec2 (patch)
tree97cb7b62dc605e8cc8f46cf092ba75911e0a6e6c /Source/cmTargetPropCommandBase.cxx
parent4de71786e89ba35190e23ae9e1c05f902c5350ff (diff)
downloadcmake-510fdcb18801076e2041eaae2941375eecc93ec2.tar.gz
Whitelist target types in target_{include_directories,compile_definitions}
Setting include directories or compile definitions on a target created with add_custom_target does not make sense.
Diffstat (limited to 'Source/cmTargetPropCommandBase.cxx')
-rw-r--r--Source/cmTargetPropCommandBase.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index 18a1d2a9f6..771097ca2b 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -38,6 +38,15 @@ bool cmTargetPropCommandBase
this->HandleMissingTarget(args[0]);
return false;
}
+ if ((this->Target->GetType() != cmTarget::SHARED_LIBRARY)
+ && (this->Target->GetType() != cmTarget::STATIC_LIBRARY)
+ && (this->Target->GetType() != cmTarget::OBJECT_LIBRARY)
+ && (this->Target->GetType() != cmTarget::MODULE_LIBRARY)
+ && (this->Target->GetType() != cmTarget::EXECUTABLE))
+ {
+ this->SetError("called with non-compilable target type");
+ return false;
+ }
unsigned int argIndex = 1;