diff options
author | Brad King <brad.king@kitware.com> | 2006-10-05 15:31:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-10-05 15:31:57 (GMT) |
commit | 934c804ea44236baa59369cd28b018430d1b5b1d (patch) | |
tree | d458bbefcd53727690ad2dc9bde9eccc07269bc1 /Source/cmInstallTargetGenerator.cxx | |
parent | 16b781360c5d1f0264047596711d11dcb5b768a9 (diff) | |
download | CMake-934c804ea44236baa59369cd28b018430d1b5b1d.zip CMake-934c804ea44236baa59369cd28b018430d1b5b1d.tar.gz CMake-934c804ea44236baa59369cd28b018430d1b5b1d.tar.bz2 |
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.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 1e99cd9..61536c8 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(), |