summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-01 14:39:19 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-09-01 14:39:19 (GMT)
commit06b7789d4dfcfeedce6fa9a163e8f8d66b188c32 (patch)
treedd115c7fa4921ead02ac65cce429f3d2ffc6353a
parentd5bdcee737f428b09c6b390655e0ac485cd0b21a (diff)
parent3bd55dba7c889776bd094c6c29045c567b9000e2 (diff)
downloadCMake-06b7789d4dfcfeedce6fa9a163e8f8d66b188c32.zip
CMake-06b7789d4dfcfeedce6fa9a163e8f8d66b188c32.tar.gz
CMake-06b7789d4dfcfeedce6fa9a163e8f8d66b188c32.tar.bz2
Merge topic 'install-directory-genex-fix'
3bd55dba install: Fix evaluation of leading generator expressions in DIRECTORY
-rw-r--r--Source/cmInstallCommand.cxx3
-rw-r--r--Source/cmInstallDirectoryGenerator.cxx11
2 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 86ab85a..4912eac 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -976,7 +976,8 @@ bool cmInstallCommand::HandleDirectoryMode(
} else if (doing == DoingDirs) {
// Convert this directory to a full path.
std::string dir = args[i];
- if (!cmSystemTools::FileIsFullPath(dir.c_str())) {
+ std::string::size_type gpos = cmGeneratorExpression::Find(dir);
+ if (gpos != 0 && !cmSystemTools::FileIsFullPath(dir.c_str())) {
dir = this->Makefile->GetCurrentSourceDirectory();
dir += "/";
dir += args[i];
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);
}