From ddec0533213ef8c7ea80f31d82e4f7baabcd3956 Mon Sep 17 00:00:00 2001
From: Eric NOULARD <eric.noulard@gmail.com>
Date: Sun, 14 Oct 2012 18:50:57 +0200
Subject: Make CPACK_SET_DESTDIR work with archive generator + component-based
 packaging

Fix bug #13004. The patch is from Stanislaw Szymczyk.
---
 Source/CPack/cmCPackGenerator.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index f113400..fb08d36 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -905,7 +905,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
             localFileName =
                 cmSystemTools::RelativePath(InstallPrefix, fit->c_str());
             localFileName =
-                localFileName.substr(localFileName.find('/')+1,
+                localFileName.substr(localFileName.find_first_not_of('/'),
                                      std::string::npos);
             Components[installComponent].Files.push_back(localFileName);
             cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file <"
-- 
cgit v0.12