summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallDirectoryGenerator.cxx
diff options
context:
space:
mode:
authorYves Frederix <yves.frederix@gmail.com>2016-08-29 20:24:55 (GMT)
committerBrad King <brad.king@kitware.com>2016-08-31 13:33:39 (GMT)
commit3bd55dba7c889776bd094c6c29045c567b9000e2 (patch)
tree68df51d4d806de4b4122f05c6a51a74b6fb12c08 /Source/cmInstallDirectoryGenerator.cxx
parent0a2d0b126ca01a7d989a887c71693989e9d15224 (diff)
downloadCMake-3bd55dba7c889776bd094c6c29045c567b9000e2.zip
CMake-3bd55dba7c889776bd094c6c29045c567b9000e2.tar.gz
CMake-3bd55dba7c889776bd094c6c29045c567b9000e2.tar.bz2
install: Fix evaluation of leading generator expressions in DIRECTORY
Since commit v3.5.0-rc1~58^2 (install: Allow generator expressions in DIRECTORY, 2016-01-12) we accidentally treat leading generator expressions as relative paths even though they may evaluate to absolute paths. Defer the conversion to an absolute path until after evaluation.
Diffstat (limited to 'Source/cmInstallDirectoryGenerator.cxx')
-rw-r--r--Source/cmInstallDirectoryGenerator.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx
index 3928231..469b119 100644
--- a/Source/cmInstallDirectoryGenerator.cxx
+++ b/Source/cmInstallDirectoryGenerator.cxx
@@ -13,6 +13,7 @@
#include "cmGeneratorExpression.h"
#include "cmLocalGenerator.h"
+#include "cmMakefile.h"
cmInstallDirectoryGenerator::cmInstallDirectoryGenerator(
std::vector<std::string> const& dirs, const char* dest,
@@ -73,6 +74,16 @@ void cmInstallDirectoryGenerator::GenerateScriptForConfig(
cmSystemTools::ExpandListArgument(
cge->Evaluate(this->LocalGenerator, config), dirs);
}
+
+ // Make sure all dirs have absolute paths.
+ cmMakefile const& mf = *this->LocalGenerator->GetMakefile();
+ for (std::vector<std::string>::iterator i = dirs.begin(); i != dirs.end();
+ ++i) {
+ if (!cmSystemTools::FileIsFullPath(i->c_str())) {
+ *i = std::string(mf.GetCurrentSourceDirectory()) + "/" + *i;
+ }
+ }
+
this->AddDirectoryInstallRule(os, config, indent, dirs);
}