summaryrefslogtreecommitdiffstats
path: root/Source/cmUnixMakefileGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmUnixMakefileGenerator.cxx')
-rw-r--r--Source/cmUnixMakefileGenerator.cxx46
1 files changed, 43 insertions, 3 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx
index 966db4a..225cd33 100644
--- a/Source/cmUnixMakefileGenerator.cxx
+++ b/Source/cmUnixMakefileGenerator.cxx
@@ -1042,7 +1042,7 @@ void cmUnixMakefileGenerator::OutputInstallRules(std::ostream& fout)
<< cmSystemTools::GetExecutableExtension()
<< " " << prefix << l->second.GetInstallPath() << "\n";
break;
- case cmTarget::INSTALL:
+ case cmTarget::INSTALL_FILES:
{
const std::vector<std::string> &sf = l->second.GetSourceLists();
std::vector<std::string>::const_iterator i;
@@ -1058,7 +1058,7 @@ void cmUnixMakefileGenerator::OutputInstallRules(std::ostream& fout)
}
else
{
- fout << "\t $(INSTALL) ";
+ fout << "\t $(INSTALL_DATA) ";
}
fout << *i
<< " " << prefix << l->second.GetInstallPath() << "; \\\n";
@@ -1071,7 +1071,47 @@ void cmUnixMakefileGenerator::OutputInstallRules(std::ostream& fout)
}
else
{
- fout << "\t $(INSTALL) ";
+ fout << "\t $(INSTALL_DATA) ";
+ }
+ fout << "${srcdir}/" << *i
+ << " " << prefix << l->second.GetInstallPath() << "; \\\n";
+ fout << "\telse \\\n";
+ fout << "\t echo \" ERROR!!! Unable to find: " << *i
+ << " \"; \\\n";
+ fout << "\t fi\n";
+ }
+ }
+ break;
+ case cmTarget::INSTALL_PROGRAMS:
+ {
+ const std::vector<std::string> &sf = l->second.GetSourceLists();
+ std::vector<std::string>::const_iterator i;
+ for (i = sf.begin(); i != sf.end(); ++i)
+ {
+ fout << "\t@ echo \"Installing " << *i << " \"\n";
+ fout << "\t@if [ -f " << *i << " ] ; then \\\n";
+ // avoid using install-sh to install install-sh
+ // does not work on windows....
+ if(*i == "install-sh")
+ {
+ fout << "\t cp ";
+ }
+ else
+ {
+ fout << "\t $(INSTALL_PROGRAM) ";
+ }
+ fout << *i
+ << " " << prefix << l->second.GetInstallPath() << "; \\\n";
+ fout << "\t elif [ -f ${srcdir}/" << *i << " ] ; then \\\n";
+ // avoid using install-sh to install install-sh
+ // does not work on windows....
+ if(*i == "install-sh")
+ {
+ fout << "\t cp ";
+ }
+ else
+ {
+ fout << "\t $(INSTALL_PROGRAM) ";
}
fout << "${srcdir}/" << *i
<< " " << prefix << l->second.GetInstallPath() << "; \\\n";