summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-02-19 23:47:13 (GMT)
committerBrad King <brad.king@kitware.com>2006-02-19 23:47:13 (GMT)
commit518080136d2b643b2b27ae1ef69cee28306c2f81 (patch)
tree3e57cf1c6f7943dcff3bb879e0da13bc01f97412 /Source/cmLocalGenerator.cxx
parent4140f4a6faa63042cdb5378061cf8d30040a7dd1 (diff)
downloadCMake-518080136d2b643b2b27ae1ef69cee28306c2f81.zip
CMake-518080136d2b643b2b27ae1ef69cee28306c2f81.tar.gz
CMake-518080136d2b643b2b27ae1ef69cee28306c2f81.tar.bz2
ENH: Implemented FILES and PROGRAMS forms of the INSTALL command as replacements for the INSTALL_FILES and INSTALL_PROGRAMS commands. This addresses the request for absolute path install destinations in bug#2691.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx51
1 files changed, 9 insertions, 42 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index b6e1369..e7d56a5 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -19,6 +19,7 @@
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmInstallGenerator.h"
+#include "cmInstallFilesGenerator.h"
#include "cmInstallScriptGenerator.h"
#include "cmInstallTargetGenerator.h"
#include "cmMakefile.h"
@@ -1679,52 +1680,18 @@ cmLocalGenerator
break;
case cmTarget::INSTALL_FILES:
{
- std::string sourcePath = m_Makefile->GetCurrentDirectory();
- std::string binaryPath = m_Makefile->GetCurrentOutputDirectory();
- sourcePath += "/";
- binaryPath += "/";
- const std::vector<std::string> &sf = l->second.GetSourceLists();
- std::vector<std::string>::const_iterator i;
- for (i = sf.begin(); i != sf.end(); ++i)
- {
- std::string f = *i;
- if(f.substr(0, sourcePath.length()) == sourcePath)
- {
- f = f.substr(sourcePath.length());
- }
- else if(f.substr(0, binaryPath.length()) == binaryPath)
- {
- f = f.substr(binaryPath.length());
- }
- cmInstallGenerator::AddInstallRule(os, destination.c_str(),
- cmTarget::INSTALL_FILES,
- i->c_str());
- }
+ // Use a file install generator.
+ cmInstallFilesGenerator g(l->second.GetSourceLists(),
+ destination.c_str(), false);
+ g.Generate(os, config, configurationTypes);
}
break;
case cmTarget::INSTALL_PROGRAMS:
{
- std::string sourcePath = m_Makefile->GetCurrentDirectory();
- std::string binaryPath = m_Makefile->GetCurrentOutputDirectory();
- sourcePath += "/";
- binaryPath += "/";
- const std::vector<std::string> &sf = l->second.GetSourceLists();
- std::vector<std::string>::const_iterator i;
- for (i = sf.begin(); i != sf.end(); ++i)
- {
- std::string f = *i;
- if(f.substr(0, sourcePath.length()) == sourcePath)
- {
- f = f.substr(sourcePath.length());
- }
- else if(f.substr(0, binaryPath.length()) == binaryPath)
- {
- f = f.substr(binaryPath.length());
- }
- cmInstallGenerator::AddInstallRule(os, destination.c_str(),
- cmTarget::INSTALL_PROGRAMS,
- i->c_str());
- }
+ // Use a file install generator.
+ cmInstallFilesGenerator g(l->second.GetSourceLists(),
+ destination.c_str(), true);
+ g.Generate(os, config, configurationTypes);
}
break;
case cmTarget::UTILITY: