summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorRobert Goulet <robert.goulet@autodesk.com>2015-08-11 19:19:03 (GMT)
committerBrad King <brad.king@kitware.com>2015-08-12 17:43:00 (GMT)
commitd25819bc2623b5144ffc57b694500993ac5759b4 (patch)
tree89116aa3d941ae23e5cb53a0c85dc255abd5ee0d /Source/cmTarget.cxx
parente36a05fd7f7d008c4c1e75ebf46eac3072ef71b1 (diff)
downloadCMake-d25819bc2623b5144ffc57b694500993ac5759b4.zip
CMake-d25819bc2623b5144ffc57b694500993ac5759b4.tar.gz
CMake-d25819bc2623b5144ffc57b694500993ac5759b4.tar.bz2
Add generator expression support to OUTPUT_DIRECTORY target properties
If {ARCHIVE,LIBRARY,RUNTIME}_OUTPUT_DIRECTORY is set with a genex then do not add the per-config subdirectory on multi-config generators. This will allow projects to use $<CONFIG> to place the per-config part of the directory path somewhere other than the end.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index d2d4c67..a94c2dd 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3520,7 +3520,10 @@ bool cmTarget::ComputeOutputDir(const std::string& config,
if(const char* config_outdir = this->GetProperty(configProp))
{
// Use the user-specified per-configuration output directory.
- out = config_outdir;
+ cmGeneratorExpression ge;
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+ ge.Parse(config_outdir);
+ out = cge->Evaluate(this->Makefile, config);
// Skip per-configuration subdirectory.
conf = "";
@@ -3528,7 +3531,17 @@ bool cmTarget::ComputeOutputDir(const std::string& config,
else if(const char* outdir = this->GetProperty(propertyName))
{
// Use the user-specified output directory.
- out = outdir;
+ cmGeneratorExpression ge;
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+ ge.Parse(outdir);
+ out = cge->Evaluate(this->Makefile, config);
+
+ // Skip per-configuration subdirectory if the value contained a
+ // generator expression.
+ if (out != outdir)
+ {
+ conf = "";
+ }
}
else if(this->GetType() == cmTarget::EXECUTABLE)
{