diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-02-08 19:12:45 +0100 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-02-08 19:21:30 +0100 |
commit | 510fdcb18801076e2041eaae2941375eecc93ec2 (patch) | |
tree | 97cb7b62dc605e8cc8f46cf092ba75911e0a6e6c /Source/cmTargetPropCommandBase.cxx | |
parent | 4de71786e89ba35190e23ae9e1c05f902c5350ff (diff) | |
download | cmake-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.cxx | 9 |
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; |