summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetPropCommandBase.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-02-08 18:12:45 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-02-08 18:21:30 (GMT)
commit510fdcb18801076e2041eaae2941375eecc93ec2 (patch)
tree97cb7b62dc605e8cc8f46cf092ba75911e0a6e6c /Source/cmTargetPropCommandBase.cxx
parent4de71786e89ba35190e23ae9e1c05f902c5350ff (diff)
downloadCMake-510fdcb18801076e2041eaae2941375eecc93ec2.zip
CMake-510fdcb18801076e2041eaae2941375eecc93ec2.tar.gz
CMake-510fdcb18801076e2041eaae2941375eecc93ec2.tar.bz2
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 18a1d2a..771097c 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;