|
|
@@ -12,6 +12,8 @@
|
|
|
#include "cmInstallDirectoryGenerator.h"
|
|
|
|
|
|
#include "cmTarget.h"
|
|
|
+#include "cmGeneratorExpression.h"
|
|
|
+#include "cmLocalGenerator.h"
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
cmInstallDirectoryGenerator
|
|
|
@@ -25,10 +27,16 @@ cmInstallDirectoryGenerator
|
|
|
const char* literal_args,
|
|
|
bool optional):
|
|
|
cmInstallGenerator(dest, configurations, component, message),
|
|
|
+ LocalGenerator(0),
|
|
|
Directories(dirs),
|
|
|
FilePermissions(file_permissions), DirPermissions(dir_permissions),
|
|
|
LiteralArguments(literal_args), Optional(optional)
|
|
|
{
|
|
|
+ // We need per-config actions if destination have generator expressions.
|
|
|
+ if(cmGeneratorExpression::Find(Destination) != std::string::npos)
|
|
|
+ {
|
|
|
+ this->ActionsPerConfig = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
@@ -37,15 +45,43 @@ cmInstallDirectoryGenerator
|
|
|
{
|
|
|
}
|
|
|
|
|
|
+void cmInstallDirectoryGenerator::Compute(cmLocalGenerator* lg)
|
|
|
+{
|
|
|
+ LocalGenerator = lg;
|
|
|
+}
|
|
|
+
|
|
|
//----------------------------------------------------------------------------
|
|
|
void
|
|
|
cmInstallDirectoryGenerator::GenerateScriptActions(std::ostream& os,
|
|
|
Indent const& indent)
|
|
|
+{
|
|
|
+ if(this->ActionsPerConfig)
|
|
|
+ {
|
|
|
+ this->cmInstallGenerator::GenerateScriptActions(os, indent);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ this->AddDirectoryInstallRule(os, "", indent);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void cmInstallDirectoryGenerator::GenerateScriptForConfig(
|
|
|
+ std::ostream& os,
|
|
|
+ const std::string& config,
|
|
|
+ Indent const& indent)
|
|
|
+{
|
|
|
+ this->AddDirectoryInstallRule(os, config, indent);
|
|
|
+}
|
|
|
+
|
|
|
+void cmInstallDirectoryGenerator::AddDirectoryInstallRule(
|
|
|
+ std::ostream& os,
|
|
|
+ const std::string& config,
|
|
|
+ Indent const& indent)
|
|
|
{
|
|
|
// Write code to install the directories.
|
|
|
const char* no_rename = 0;
|
|
|
this->AddInstallRule(os,
|
|
|
- this->Destination,
|
|
|
+ this->GetDestination(config),
|
|
|
cmInstallType_DIRECTORY,
|
|
|
this->Directories,
|
|
|
this->Optional,
|
|
|
@@ -54,3 +90,12 @@ cmInstallDirectoryGenerator::GenerateScriptActions(std::ostream& os,
|
|
|
no_rename, this->LiteralArguments.c_str(),
|
|
|
indent);
|
|
|
}
|
|
|
+
|
|
|
+//----------------------------------------------------------------------------
|
|
|
+std::string
|
|
|
+cmInstallDirectoryGenerator::GetDestination(std::string const& config) const
|
|
|
+{
|
|
|
+ cmGeneratorExpression ge;
|
|
|
+ return ge.Parse(this->Destination)
|
|
|
+ ->Evaluate(this->LocalGenerator->GetMakefile(), config);
|
|
|
+}
|