summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-14 17:38:00 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-14 18:50:39 (GMT)
commitd97513d842c51e4fb996d42e1f04a9c291e3d5bf (patch)
tree5db0bf17e9b58e722228da22651a0423cead65c7 /Source/cmTarget.cxx
parentea69e03afaeff76d2141ab4a330f3489297a3a41 (diff)
downloadCMake-d97513d842c51e4fb996d42e1f04a9c291e3d5bf.zip
CMake-d97513d842c51e4fb996d42e1f04a9c291e3d5bf.tar.gz
CMake-d97513d842c51e4fb996d42e1f04a9c291e3d5bf.tar.bz2
cmTarget: Add method to get a copy adapted for a directory
The "global" targets are built once for the top directory and then copied into all directories. Add a helper method to make the copy.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index d5274cd..dc3944c 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -83,6 +83,15 @@ void cmTarget::SetType(cmState::TargetType type, const std::string& name)
}
}
+cmTarget cmTarget::CopyForDirectory(cmMakefile* mf) const
+{
+ assert(this->GetType() == cmState::GLOBAL_TARGET);
+ assert(this->GetMakefile() == CM_NULLPTR);
+ cmTarget result(*this);
+ result.SetMakefile(mf);
+ return result;
+}
+
void cmTarget::SetMakefile(cmMakefile* mf)
{
// Set our makefile.