Pārlūkot izejas kodu

BUG: Fix old-style install to prefix top

The old install_files, install_programs, and install_targets commands
used to permit installation to the top of the prefix by specifying
destination '/'.  This was broken in 2.6.0 to 2.6.2 by changes to
enforce valid destinations that did not account for this case.  This
change fixes the case by converting the install destination to '.' which
is the new-style way to specify the top of the installation prefix.
Brad King 16 gadi atpakaļ
vecāks
revīzija
a27e9ca4a2

+ 4 - 0
Source/cmInstallFilesCommand.cxx

@@ -125,6 +125,10 @@ void cmInstallFilesCommand::CreateInstallGenerator() const
   // the prefix.  We skip the leading slash given by the user.
   // the prefix.  We skip the leading slash given by the user.
   std::string destination = this->Destination.substr(1);
   std::string destination = this->Destination.substr(1);
   cmSystemTools::ConvertToUnixSlashes(destination);
   cmSystemTools::ConvertToUnixSlashes(destination);
+  if(destination.empty())
+    {
+    destination = ".";
+    }
 
 
   // Use a file install generator.
   // Use a file install generator.
   const char* no_permissions = "";
   const char* no_permissions = "";

+ 4 - 0
Source/cmInstallProgramsCommand.cxx

@@ -86,6 +86,10 @@ void cmInstallProgramsCommand::FinalPass()
   // the prefix.  We skip the leading slash given by the user.
   // the prefix.  We skip the leading slash given by the user.
   std::string destination = this->Destination.substr(1);
   std::string destination = this->Destination.substr(1);
   cmSystemTools::ConvertToUnixSlashes(destination);
   cmSystemTools::ConvertToUnixSlashes(destination);
+  if(destination.empty())
+    {
+    destination = ".";
+    }
 
 
   // Use a file install generator.
   // Use a file install generator.
   const char* no_permissions = "";
   const char* no_permissions = "";

+ 4 - 0
Source/cmLocalGenerator.cxx

@@ -2377,6 +2377,10 @@ cmLocalGenerator
       // We also skip over the leading slash given by the user.
       // We also skip over the leading slash given by the user.
       std::string destination = l->second.GetInstallPath().substr(1);
       std::string destination = l->second.GetInstallPath().substr(1);
       cmSystemTools::ConvertToUnixSlashes(destination);
       cmSystemTools::ConvertToUnixSlashes(destination);
+      if(destination.empty())
+        {
+        destination = ".";
+        }
 
 
       // Generate the proper install generator for this target type.
       // Generate the proper install generator for this target type.
       switch(l->second.GetType())
       switch(l->second.GetType())