diff options
Diffstat (limited to 'Source/cmInstallGenerator.cxx')
-rw-r--r-- | Source/cmInstallGenerator.cxx | 26 |
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"; - } } |