summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-07-22 15:04:30 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-07-22 15:04:30 (GMT)
commit4c3d431210d8c30b4b6fc67f75af73406dd396fa (patch)
tree765d58dd3acebe783d26bbe7c129691242104649 /Source
parent90b3b5e42c1d0a8b228314451706f49cfbb7e047 (diff)
parent45c5f8cad2f95ccfada50e1b65e56918f3c6c5c4 (diff)
downloadCMake-4c3d431210d8c30b4b6fc67f75af73406dd396fa.zip
CMake-4c3d431210d8c30b4b6fc67f75af73406dd396fa.tar.gz
CMake-4c3d431210d8c30b4b6fc67f75af73406dd396fa.tar.bz2
Merge topic 'target-directory-properties'
45c5f8ca Add SOURCE_DIR and BINARY_DIR target properties
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTarget.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 46e9ed4..3d8adae 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2959,6 +2959,8 @@ const char *cmTarget::GetProperty(const std::string& prop,
MAKE_STATIC_PROP(COMPILE_DEFINITIONS);
MAKE_STATIC_PROP(IMPORTED);
MAKE_STATIC_PROP(NAME);
+ MAKE_STATIC_PROP(BINARY_DIR);
+ MAKE_STATIC_PROP(SOURCE_DIR);
MAKE_STATIC_PROP(SOURCES);
#undef MAKE_STATIC_PROP
if(specialProps.empty())
@@ -2971,6 +2973,8 @@ const char *cmTarget::GetProperty(const std::string& prop,
specialProps.insert(propCOMPILE_DEFINITIONS);
specialProps.insert(propIMPORTED);
specialProps.insert(propNAME);
+ specialProps.insert(propBINARY_DIR);
+ specialProps.insert(propSOURCE_DIR);
specialProps.insert(propSOURCES);
}
if(specialProps.count(prop))
@@ -3053,6 +3057,14 @@ const char *cmTarget::GetProperty(const std::string& prop,
{
return this->GetName().c_str();
}
+ else if (prop == propBINARY_DIR)
+ {
+ return this->GetMakefile()->GetCurrentBinaryDirectory();
+ }
+ else if (prop == propSOURCE_DIR)
+ {
+ return this->GetMakefile()->GetCurrentSourceDirectory();
+ }
else if(prop == propSOURCES)
{
if (this->Internal->SourceEntries.empty())