summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmCoreTryCompile.cxx4
-rw-r--r--Source/cmExportBuildFileGenerator.cxx13
-rw-r--r--Source/cmExportFileGenerator.cxx136
-rw-r--r--Source/cmExportFileGenerator.h5
-rw-r--r--Source/cmExportInstallFileGenerator.cxx38
-rw-r--r--Source/cmInstallDirectoryGenerator.cxx4
-rw-r--r--Source/cmInstallExportGenerator.cxx8
-rw-r--r--Source/cmInstallExportGenerator.h3
-rw-r--r--Source/cmInstallFilesGenerator.cxx1
-rw-r--r--Source/cmInstallGenerator.cxx14
-rw-r--r--Source/cmInstallGenerator.h9
-rw-r--r--Source/cmInstallTargetGenerator.cxx17
-rw-r--r--Source/cmInstallTargetGenerator.h2
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx2
15 files changed, 166 insertions, 92 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 03df29d..6152144 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 2)
-set(CMake_VERSION_PATCH 20150210)
+set(CMake_VERSION_PATCH 20150212)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index c414553..d9369e6 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -383,8 +383,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
/* Use a random file name to avoid rapid creation and deletion
of the same executable name (some filesystems fail on that). */
- sprintf(targetNameBuf, "cmTryCompileExec%u",
- cmSystemTools::RandomSeed());
+ sprintf(targetNameBuf, "cmTC_%05x",
+ cmSystemTools::RandomSeed() & 0xFFFFF);
targetName = targetNameBuf;
if (!targets.empty())
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index a28ec48..b1203dd 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -68,16 +68,6 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
tei != this->Exports.end(); ++tei)
{
cmTarget* te = *tei;
- if (te->GetProperty("INTERFACE_SOURCES"))
- {
- std::ostringstream e;
- e << "Target \""
- << te->GetName()
- << "\" has a populated INTERFACE_SOURCES property. This is not "
- "currently supported.";
- cmSystemTools::Error(e.str().c_str());
- return false;
- }
this->GenerateImportTargetCode(os, te);
te->AppendBuildInterfaceIncludes();
@@ -87,6 +77,9 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
this->PopulateInterfaceProperty("INTERFACE_INCLUDE_DIRECTORIES", te,
cmGeneratorExpression::BuildInterface,
properties, missingTargets);
+ this->PopulateInterfaceProperty("INTERFACE_SOURCES", te,
+ cmGeneratorExpression::BuildInterface,
+ properties, missingTargets);
this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS", te,
cmGeneratorExpression::BuildInterface,
properties, missingTargets);
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index af4ce8b..71728be 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -224,7 +224,7 @@ static bool isSubDirectory(const char* a, const char* b)
//----------------------------------------------------------------------------
static bool checkInterfaceDirs(const std::string &prepro,
- cmTarget *target)
+ cmTarget *target, const std::string& prop)
{
const char* installDir =
target->GetMakefile()->GetSafeDefinition("CMAKE_INSTALL_PREFIX");
@@ -250,20 +250,27 @@ static bool checkInterfaceDirs(const std::string &prepro,
std::ostringstream e;
if (genexPos != std::string::npos)
{
- switch (target->GetPolicyStatusCMP0041())
+ if (prop == "INTERFACE_INCLUDE_DIRECTORIES")
{
- case cmPolicies::WARN:
- messageType = cmake::WARNING;
- e << target->GetMakefile()->GetPolicies()
- ->GetPolicyWarning(cmPolicies::CMP0041) << "\n";
- break;
- case cmPolicies::OLD:
- continue;
- case cmPolicies::REQUIRED_IF_USED:
- case cmPolicies::REQUIRED_ALWAYS:
- case cmPolicies::NEW:
- hadFatalError = true;
- break; // Issue fatal message.
+ switch (target->GetPolicyStatusCMP0041())
+ {
+ case cmPolicies::WARN:
+ messageType = cmake::WARNING;
+ e << target->GetMakefile()->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0041) << "\n";
+ break;
+ case cmPolicies::OLD:
+ continue;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::NEW:
+ hadFatalError = true;
+ break; // Issue fatal message.
+ }
+ }
+ else
+ {
+ hadFatalError = true;
}
}
if (cmHasLiteralPrefix(li->c_str(), "${_IMPORT_PREFIX}"))
@@ -272,8 +279,8 @@ static bool checkInterfaceDirs(const std::string &prepro,
}
if (!cmSystemTools::FileIsFullPath(li->c_str()))
{
- e << "Target \"" << target->GetName() << "\" "
- "INTERFACE_INCLUDE_DIRECTORIES property contains relative path:\n"
+ e << "Target \"" << target->GetName() << "\" " << prop <<
+ " property contains relative path:\n"
" \"" << *li << "\"";
target->GetMakefile()->IssueMessage(messageType, e.str());
}
@@ -289,32 +296,35 @@ static bool checkInterfaceDirs(const std::string &prepro,
(!inBinary || isSubDirectory(installDir, topBinaryDir)) &&
(!inSource || isSubDirectory(installDir, topSourceDir));
- if (!shouldContinue)
+ if (prop == "INTERFACE_INCLUDE_DIRECTORIES")
{
- switch(target->GetPolicyStatusCMP0052())
+ if (!shouldContinue)
{
- case cmPolicies::WARN:
+ switch(target->GetPolicyStatusCMP0052())
{
- std::ostringstream s;
- s << target->GetMakefile()->GetPolicies()
- ->GetPolicyWarning(cmPolicies::CMP0052) << "\n";
- s << "Directory:\n \"" << *li << "\"\nin "
- "INTERFACE_INCLUDE_DIRECTORIES of target \""
- << target->GetName() << "\" is a subdirectory of the install "
- "directory:\n \"" << installDir << "\"\nhowever it is also "
- "a subdirectory of the " << (inBinary ? "build" : "source")
- << " tree:\n \"" << (inBinary ? topBinaryDir : topSourceDir)
- << "\"" << std::endl;
- target->GetMakefile()->IssueMessage(cmake::AUTHOR_WARNING,
- s.str());
+ case cmPolicies::WARN:
+ {
+ std::ostringstream s;
+ s << target->GetMakefile()->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0052) << "\n";
+ s << "Directory:\n \"" << *li << "\"\nin "
+ "INTERFACE_INCLUDE_DIRECTORIES of target \""
+ << target->GetName() << "\" is a subdirectory of the install "
+ "directory:\n \"" << installDir << "\"\nhowever it is also "
+ "a subdirectory of the " << (inBinary ? "build" : "source")
+ << " tree:\n \"" << (inBinary ? topBinaryDir : topSourceDir)
+ << "\"" << std::endl;
+ target->GetMakefile()->IssueMessage(cmake::AUTHOR_WARNING,
+ s.str());
+ }
+ case cmPolicies::OLD:
+ shouldContinue = true;
+ break;
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::NEW:
+ break;
}
- case cmPolicies::OLD:
- shouldContinue = true;
- break;
- case cmPolicies::REQUIRED_ALWAYS:
- case cmPolicies::REQUIRED_IF_USED:
- case cmPolicies::NEW:
- break;
}
}
if (shouldContinue)
@@ -324,8 +334,8 @@ static bool checkInterfaceDirs(const std::string &prepro,
}
if (inBinary)
{
- e << "Target \"" << target->GetName() << "\" "
- "INTERFACE_INCLUDE_DIRECTORIES property contains path:\n"
+ e << "Target \"" << target->GetName() << "\" " << prop <<
+ " property contains path:\n"
" \"" << *li << "\"\nwhich is prefixed in the build directory.";
target->GetMakefile()->IssueMessage(messageType, e.str());
}
@@ -333,8 +343,8 @@ static bool checkInterfaceDirs(const std::string &prepro,
{
if (inSource)
{
- e << "Target \"" << target->GetName() << "\" "
- "INTERFACE_INCLUDE_DIRECTORIES property contains path:\n"
+ e << "Target \"" << target->GetName() << "\" " << prop <<
+ " property contains path:\n"
" \"" << *li << "\"\nwhich is prefixed in the source directory.";
target->GetMakefile()->IssueMessage(messageType, e.str());
}
@@ -365,6 +375,46 @@ static void prefixItems(std::string &exportDirs)
}
//----------------------------------------------------------------------------
+void cmExportFileGenerator::PopulateSourcesInterface(
+ cmTargetExport *tei,
+ cmGeneratorExpression::PreprocessContext preprocessRule,
+ ImportPropertyMap &properties,
+ std::vector<std::string> &missingTargets)
+{
+ cmTarget *target = tei->Target;
+ assert(preprocessRule == cmGeneratorExpression::InstallInterface);
+
+ const char *propName = "INTERFACE_SOURCES";
+ const char *input = target->GetProperty(propName);
+
+ if (!input)
+ {
+ return;
+ }
+
+ if (!*input)
+ {
+ properties[propName] = "";
+ return;
+ }
+
+ std::string prepro = cmGeneratorExpression::Preprocess(input,
+ preprocessRule,
+ true);
+ if (!prepro.empty())
+ {
+ this->ResolveTargetsInGeneratorExpressions(prepro, target,
+ missingTargets);
+
+ if (!checkInterfaceDirs(prepro, target, propName))
+ {
+ return;
+ }
+ properties[propName] = prepro;
+ }
+}
+
+//----------------------------------------------------------------------------
void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
cmTargetExport *tei,
cmGeneratorExpression::PreprocessContext preprocessRule,
@@ -424,7 +474,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
this->ResolveTargetsInGeneratorExpressions(prepro, target,
missingTargets);
- if (!checkInterfaceDirs(prepro, target))
+ if (!checkInterfaceDirs(prepro, target, propName))
{
return;
}
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 919924e..b6f4166 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -139,6 +139,11 @@ protected:
cmGeneratorExpression::PreprocessContext preprocessRule,
ImportPropertyMap &properties,
std::vector<std::string> &missingTargets);
+ void PopulateSourcesInterface(
+ cmTargetExport *target,
+ cmGeneratorExpression::PreprocessContext preprocessRule,
+ ImportPropertyMap &properties,
+ std::vector<std::string> &missingTargets);
void SetImportLinkInterface(const std::string& config,
std::string const& suffix,
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 98ed818..ba1dde2 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -73,8 +73,8 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
// to reference if they are relative to the install prefix.
std::string installPrefix =
this->IEGen->GetMakefile()->GetSafeDefinition("CMAKE_INSTALL_PREFIX");
- const char* installDest = this->IEGen->GetDestination();
- if(cmSystemTools::FileIsFullPath(installDest))
+ std::string const& expDest = this->IEGen->GetDestination();
+ if(cmSystemTools::FileIsFullPath(expDest))
{
// The export file is being installed to an absolute path so the
// package is not relocatable. Use the configured install prefix.
@@ -87,7 +87,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
{
// Add code to compute the installation prefix relative to the
// import file location.
- std::string absDest = installPrefix + "/" + installDest;
+ std::string absDest = installPrefix + "/" + expDest;
std::string absDestS = absDest + "/";
os << "# Compute the installation prefix relative to this file.\n"
<< "get_filename_component(_IMPORT_PREFIX"
@@ -109,7 +109,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
"unset(_realOrig)\n"
"unset(_realCurr)\n";
}
- std::string dest = installDest;
+ std::string dest = expDest;
while(!dest.empty())
{
os <<
@@ -123,6 +123,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
bool require2_8_12 = false;
bool require3_0_0 = false;
+ bool require3_1_0 = false;
bool requiresConfigFiles = false;
// Create all the imported targets.
for(std::vector<cmTargetExport*>::const_iterator
@@ -131,17 +132,6 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
{
cmTarget* te = (*tei)->Target;
- if (te->GetProperty("INTERFACE_SOURCES"))
- {
- std::ostringstream e;
- e << "Target \""
- << te->GetName()
- << "\" has a populated INTERFACE_SOURCES property. This is not "
- "currently supported.";
- cmSystemTools::Error(e.str().c_str());
- return false;
- }
-
requiresConfigFiles = requiresConfigFiles
|| te->GetType() != cmTarget::INTERFACE_LIBRARY;
@@ -152,6 +142,9 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
this->PopulateIncludeDirectoriesInterface(*tei,
cmGeneratorExpression::InstallInterface,
properties, missingTargets);
+ this->PopulateSourcesInterface(*tei,
+ cmGeneratorExpression::InstallInterface,
+ properties, missingTargets);
this->PopulateInterfaceProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES",
te,
cmGeneratorExpression::InstallInterface,
@@ -190,6 +183,13 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
{
require3_0_0 = true;
}
+ if(te->GetProperty("INTERFACE_SOURCES"))
+ {
+ // We can only generate INTERFACE_SOURCES in CMake 3.3, but CMake 3.1
+ // can consume them.
+ require3_1_0 = true;
+ }
+
this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
te, properties);
this->PopulateCompatibleInterfaceProperties(te, properties);
@@ -197,7 +197,11 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
this->GenerateInterfaceProperties(te, os, properties);
}
- if (require3_0_0)
+ if (require3_1_0)
+ {
+ this->GenerateRequiredCMakeVersion(os, "3.1.0");
+ }
+ else if (require3_0_0)
{
this->GenerateRequiredCMakeVersion(os, "3.0.0");
}
@@ -394,7 +398,7 @@ cmExportInstallFileGenerator
cmTarget* target = itgen->GetTarget();
// Construct the installed location of the target.
- std::string dest = itgen->GetDestination();
+ std::string dest = itgen->GetDestination(config);
std::string value;
if(!cmSystemTools::FileIsFullPath(dest.c_str()))
{
diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx
index 8c13bab..7593380 100644
--- a/Source/cmInstallDirectoryGenerator.cxx
+++ b/Source/cmInstallDirectoryGenerator.cxx
@@ -44,7 +44,9 @@ cmInstallDirectoryGenerator::GenerateScriptActions(std::ostream& os,
{
// Write code to install the directories.
const char* no_rename = 0;
- this->AddInstallRule(os, cmInstallType_DIRECTORY,
+ this->AddInstallRule(os,
+ this->Destination,
+ cmInstallType_DIRECTORY,
this->Directories,
this->Optional,
this->FilePermissions.c_str(),
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index 4480cc6..38c80df 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -185,7 +185,8 @@ cmInstallExportGenerator::GenerateScriptConfigs(std::ostream& os,
files.push_back(i->second);
std::string config_test = this->CreateConfigTest(i->first);
os << indent << "if(" << config_test << ")\n";
- this->AddInstallRule(os, cmInstallType_FILES, files, false,
+ this->AddInstallRule(os, this->Destination,
+ cmInstallType_FILES, files, false,
this->FilePermissions.c_str(), 0, 0, 0,
indent.Next());
os << indent << "endif()\n";
@@ -199,7 +200,7 @@ void cmInstallExportGenerator::GenerateScriptActions(std::ostream& os,
{
// Remove old per-configuration export files if the main changes.
std::string installedDir = "$ENV{DESTDIR}";
- installedDir += this->GetInstallDestination();
+ installedDir += this->ConvertToAbsoluteDestination(this->Destination);
installedDir += "/";
std::string installedFile = installedDir;
installedFile += this->FileName;
@@ -224,6 +225,7 @@ void cmInstallExportGenerator::GenerateScriptActions(std::ostream& os,
// Install the main export file.
std::vector<std::string> files;
files.push_back(this->MainImportFile);
- this->AddInstallRule(os, cmInstallType_FILES, files, false,
+ this->AddInstallRule(os, this->Destination,
+ cmInstallType_FILES, files, false,
this->FilePermissions.c_str(), 0, 0, 0, indent);
}
diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h
index eb8c28b..3e078f2 100644
--- a/Source/cmInstallExportGenerator.h
+++ b/Source/cmInstallExportGenerator.h
@@ -41,6 +41,9 @@ public:
const std::string& GetNamespace() const { return this->Namespace; }
+ std::string const& GetDestination() const
+ { return this->Destination; }
+
protected:
virtual void GenerateScript(std::ostream& os);
virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent);
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx
index 91b102a..28c27c2 100644
--- a/Source/cmInstallFilesGenerator.cxx
+++ b/Source/cmInstallFilesGenerator.cxx
@@ -57,6 +57,7 @@ void cmInstallFilesGenerator::AddFilesInstallRule(
// Write code to install the files.
const char* no_dir_permissions = 0;
this->AddInstallRule(os,
+ this->Destination,
(this->Programs
? cmInstallType_PROGRAMS
: cmInstallType_FILES),
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx
index b261cbf..2e1c5f0 100644
--- a/Source/cmInstallGenerator.cxx
+++ b/Source/cmInstallGenerator.cxx
@@ -37,6 +37,7 @@ cmInstallGenerator
void cmInstallGenerator
::AddInstallRule(
std::ostream& os,
+ std::string const& dest,
cmInstallType type,
std::vector<std::string> const& files,
bool optional /* = false */,
@@ -60,7 +61,6 @@ void cmInstallGenerator
case cmInstallType_FILES: stype = "FILE"; break;
}
os << indent;
- std::string dest = this->GetInstallDestination();
if (cmSystemTools::FileIsFullPath(dest.c_str()))
{
os << "list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES\n";
@@ -94,7 +94,8 @@ void cmInstallGenerator
<< "${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n";
os << indent << "endif()\n";
}
- os << "file(INSTALL DESTINATION \"" << dest << "\" TYPE " << stype;
+ std::string absDest = this->ConvertToAbsoluteDestination(dest);
+ os << "file(INSTALL DESTINATION \"" << absDest << "\" TYPE " << stype;
if(optional)
{
os << " OPTIONAL";
@@ -179,15 +180,16 @@ bool cmInstallGenerator::InstallsForConfig(const std::string& config)
}
//----------------------------------------------------------------------------
-std::string cmInstallGenerator::GetInstallDestination() const
+std::string
+cmInstallGenerator::ConvertToAbsoluteDestination(std::string const& dest) const
{
std::string result;
- if(!this->Destination.empty() &&
- !cmSystemTools::FileIsFullPath(this->Destination.c_str()))
+ if(!dest.empty() &&
+ !cmSystemTools::FileIsFullPath(dest.c_str()))
{
result = "${CMAKE_INSTALL_PREFIX}/";
}
- result += this->Destination;
+ result += dest;
return result;
}
diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h
index 38aac91..c4191e4 100644
--- a/Source/cmInstallGenerator.h
+++ b/Source/cmInstallGenerator.h
@@ -40,7 +40,9 @@ public:
virtual ~cmInstallGenerator();
void AddInstallRule(
- std::ostream& os, cmInstallType type,
+ std::ostream& os,
+ std::string const& dest,
+ cmInstallType type,
std::vector<std::string> const& files,
bool optional = false,
const char* permissions_file = 0,
@@ -50,12 +52,9 @@ public:
Indent const& indent = Indent()
);
- const char* GetDestination() const
- { return this->Destination.c_str(); }
-
/** Get the install destination as it should appear in the
installation script. */
- std::string GetInstallDestination() const;
+ std::string ConvertToAbsoluteDestination(std::string const& dest) const;
/** Test if this generator installs something for a given configuration. */
bool InstallsForConfig(const std::string& config);
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 6d69f54..b035bad 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -12,6 +12,7 @@
#include "cmInstallTargetGenerator.h"
#include "cmComputeLinkInformation.h"
+#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
@@ -77,7 +78,8 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
fromDirConfig = this->Target->GetDirectory(config, this->ImportLibrary);
fromDirConfig += "/";
}
- std::string toDir = this->GetInstallDestination();
+ std::string toDir =
+ this->ConvertToAbsoluteDestination(this->GetDestination(config));
toDir += "/";
// Compute the list of files to install for this target.
@@ -322,8 +324,8 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
const char* no_dir_permissions = 0;
const char* no_rename = 0;
bool optional = this->Optional || this->ImportLibrary;
- this->AddInstallRule(os, type, filesFrom,
- optional,
+ this->AddInstallRule(os, this->GetDestination(config),
+ type, filesFrom, optional,
this->FilePermissions.c_str(), no_dir_permissions,
no_rename, literal_args.c_str(),
indent);
@@ -335,6 +337,15 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
//----------------------------------------------------------------------------
std::string
+cmInstallTargetGenerator::GetDestination(std::string const& config) const
+{
+ cmGeneratorExpression ge;
+ return ge.Parse(this->Destination)
+ ->Evaluate(this->Target->GetMakefile(), config);
+}
+
+//----------------------------------------------------------------------------
+std::string
cmInstallTargetGenerator::GetInstallFilename(const std::string& config) const
{
NameType nameType = this->ImportLibrary? NameImplib : NameNormal;
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h
index 7e5cc71..075c8a4 100644
--- a/Source/cmInstallTargetGenerator.h
+++ b/Source/cmInstallTargetGenerator.h
@@ -60,6 +60,8 @@ public:
cmTarget* GetTarget() const { return this->Target; }
bool IsImportLibrary() const { return this->ImportLibrary; }
+ std::string GetDestination(std::string const& config) const;
+
protected:
virtual void GenerateScript(std::ostream& os);
virtual void GenerateScriptForConfig(std::ostream& os,
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index a08c159..c275e6b 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1132,7 +1132,7 @@ cmLocalUnixMakefileGenerator3
if(echo_comment)
{
const char* comment = ccg.GetComment();
- if(comment && !*comment)
+ if(comment && *comment)
{
this->AppendEcho(commands, comment,
cmLocalUnixMakefileGenerator3::EchoGenerate);