summaryrefslogtreecommitdiff
path: root/Source/cmInstallTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-10-05 11:31:57 -0400
committerBrad King <brad.king@kitware.com>2006-10-05 11:31:57 -0400
commit934c804ea44236baa59369cd28b018430d1b5b1d (patch)
treed458bbefcd53727690ad2dc9bde9eccc07269bc1 /Source/cmInstallTargetGenerator.cxx
parent16b781360c5d1f0264047596711d11dcb5b768a9 (diff)
downloadcmake-934c804ea44236baa59369cd28b018430d1b5b1d.tar.gz
ENH: Added OPTIONAL option to INSTALL command to allow installation of files if they exist while ignoring them otherwise. This addresses bug#2922.
Diffstat (limited to 'Source/cmInstallTargetGenerator.cxx')
-rw-r--r--Source/cmInstallTargetGenerator.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 1e99cd91c6..61536c8b61 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -27,10 +27,10 @@ cmInstallTargetGenerator
::cmInstallTargetGenerator(cmTarget& t, const char* dest, bool implib,
const char* file_permissions,
std::vector<std::string> const& configurations,
- const char* component):
+ const char* component, bool optional):
Target(&t), Destination(dest), ImportLibrary(implib),
FilePermissions(file_permissions), Configurations(configurations),
- Component(component)
+ Component(component), Optional(optional)
{
this->Target->SetHaveInstallRule(true);
}
@@ -162,8 +162,9 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os)
// Write code to install the target file.
const char* no_dir_permissions = 0;
const char* no_rename = 0;
+ bool optional = this->Optional | this->ImportLibrary;
this->AddInstallRule(os, destination.c_str(), type, fromFile.c_str(),
- this->ImportLibrary, properties,
+ optional, properties,
this->FilePermissions.c_str(), no_dir_permissions,
this->Configurations,
this->Component.c_str(),