summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-02-20 00:29:30 (GMT)
committerBrad King <brad.king@kitware.com>2006-02-20 00:29:30 (GMT)
commit3ca9ef09b72612bd48438701c03ebadc1295441e (patch)
treeca05f85f942668a1f3bce0cabd2164e1827faeb6 /Source/cmInstallGenerator.cxx
parentc21287552bd262a60c38e495b75c91888882e681 (diff)
downloadCMake-3ca9ef09b72612bd48438701c03ebadc1295441e.zip
CMake-3ca9ef09b72612bd48438701c03ebadc1295441e.tar.gz
CMake-3ca9ef09b72612bd48438701c03ebadc1295441e.tar.bz2
BUG: Fixed optional file install support for multi-configuration generators.
Diffstat (limited to 'Source/cmInstallGenerator.cxx')
-rw-r--r--Source/cmInstallGenerator.cxx26
1 files changed, 5 insertions, 21 deletions
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx
index fd337ea..a7e1d6f 100644
--- a/Source/cmInstallGenerator.cxx
+++ b/Source/cmInstallGenerator.cxx
@@ -54,19 +54,6 @@ void cmInstallGenerator::AddInstallRule(std::ostream& os,
bool optional /* = false */,
const char* properties /* = 0 */)
{
- // If the file is optional test its existence before installing.
- const char* indent = "";
- if(optional)
- {
- os << "IF(EXISTS \"" << file << "\")\n";
- indent = " ";
- }
-
- // Write a message indicating the file is being installed.
- std::string fname = cmSystemTools::GetFilenameName(file);
- os << indent << "MESSAGE(STATUS \"Installing " << dest
- << "/" << fname.c_str() << "\")\n";
-
// Use the FILE command to install the file.
std::string stype;
switch(type)
@@ -79,17 +66,14 @@ void cmInstallGenerator::AddInstallRule(std::ostream& os,
case cmTarget::INSTALL_FILES:
default: stype = "FILE"; break;
}
- os << indent << "FILE(INSTALL DESTINATION \"" << dest
- << "\" TYPE " << stype.c_str() ;
+ os << "FILE(INSTALL DESTINATION \"" << dest << "\" TYPE " << stype.c_str();
+ if(optional)
+ {
+ os << " OPTIONAL";
+ }
if(properties && *properties)
{
os << " PROPERTIES" << properties;
}
os << " FILES \"" << file << "\")\n";
-
- // If the file is optional close the IF block.
- if(optional)
- {
- os << "ENDIF(EXISTS \"" << file << "\")\n";
- }
}