Просмотр исходного кода

ENH: Remove unused PROPERTIES from file(INSTALL)

The undocumented file(INSTALL) command used to support a PROPERTIES
option, but no install code still uses it.  This removes the option.
Brad King 16 лет назад
Родитель
Сommit
da993b64ce

+ 8 - 37
Source/cmFileCommand.cxx

@@ -1733,9 +1733,8 @@ bool cmFileCommand::HandleInstallCommand(std::vector<std::string> const& args)
   std::vector<std::string> files;
   int itype = cmTarget::INSTALL_FILES;
 
-  std::map<cmStdString, const char*> properties;
   bool optional = false;
-  bool result = this->ParseInstallArgs(args, installer, properties,
+  bool result = this->ParseInstallArgs(args, installer,
                                        itype, rename, destination, files,
                                        optional);
   if (result == true)
@@ -1749,7 +1748,6 @@ bool cmFileCommand::HandleInstallCommand(std::vector<std::string> const& args)
 //----------------------------------------------------------------------------
 bool cmFileCommand::ParseInstallArgs(std::vector<std::string> const& args,
                                 cmFileInstaller& installer,
-                                std::map<cmStdString, const char*>& properties,
                                 int& itype,
                                 std::string& rename,
                                 std::string& destination,
@@ -1757,7 +1755,7 @@ bool cmFileCommand::ParseInstallArgs(std::vector<std::string> const& args,
                                 bool& optional)
 {
     std::string stype = "FILES";
-    enum Doing { DoingNone, DoingFiles, DoingProperties,
+    enum Doing { DoingNone, DoingFiles,
                  DoingPermissionsFile, DoingPermissionsDir,
                  DoingPermissionsMatch, DoingSelf24 };
     Doing doing = DoingNone;
@@ -1850,15 +1848,12 @@ bool cmFileCommand::ParseInstallArgs(std::vector<std::string> const& args,
         }
       else if ( *cstr == "PROPERTIES"  )
         {
-        if(current_match_rule)
-          {
-          cmOStringStream e;
-          e << "INSTALL does not allow \"" << *cstr << "\" after REGEX.";
-          this->SetError(e.str().c_str());
-          return false;
-          }
-
-        doing = DoingProperties;
+        cmOStringStream e;
+        e << "INSTALL called with old-style PROPERTIES argument.  "
+          << "This script was generated with an older version of CMake.  "
+          << "Re-run this cmake version on your build tree.";
+        this->SetError(e.str().c_str());
+        return false;
         }
       else if ( *cstr == "PERMISSIONS" )
         {
@@ -1949,11 +1944,6 @@ bool cmFileCommand::ParseInstallArgs(std::vector<std::string> const& args,
 
         doing = DoingFiles;
         }
-      else if(doing == DoingProperties && i < args.size()-1)
-        {
-        properties[args[i]] = args[i+1].c_str();
-        i++;
-        }
       else if(doing == DoingFiles)
         {
         files.push_back(*cstr);
@@ -2027,25 +2017,6 @@ bool cmFileCommand::ParseInstallArgs(std::vector<std::string> const& args,
       return false;
       }
 
-    if(properties.find("VERSION") != properties.end())
-      {
-      cmOStringStream e;
-      e << "INSTALL called with old-style VERSION property.  "
-        << "This script was generated with an older version of CMake.  "
-        << "Re-run this cmake version on your build tree.";
-      this->SetError(e.str().c_str());
-      return false;
-      }
-    if(properties.find("SOVERSION") != properties.end())
-      {
-      cmOStringStream e;
-      e << "INSTALL called with old-style SOVERSION property.  "
-        << "This script was generated with an older version of CMake.  "
-        << "Re-run this cmake version on your build tree.";
-      this->SetError(e.str().c_str());
-      return false;
-      }
-
     this->GetTargetTypeFromString(stype, itype);
 
     this->HandleInstallPermissions(installer,

+ 0 - 1
Source/cmFileCommand.h

@@ -183,7 +183,6 @@ protected:
   bool HandleInstallCommand(std::vector<std::string> const& args);
   bool ParseInstallArgs(std::vector<std::string> const& args,
                         cmFileInstaller& installer,
-                        std::map<cmStdString, const char*>& properties,
                         int& itype,
                         std::string& destination,
                         std::string& rename,

+ 1 - 2
Source/cmInstallDirectoryGenerator.cxx

@@ -46,11 +46,10 @@ cmInstallDirectoryGenerator::GenerateScriptActions(std::ostream& os,
                                                    Indent const& indent)
 {
   // Write code to install the directories.
-  const char* no_properties = 0;
   const char* no_rename = 0;
   this->AddInstallRule(os, cmTarget::INSTALL_DIRECTORY,
                        this->Directories,
-                       this->Optional, no_properties,
+                       this->Optional,
                        this->FilePermissions.c_str(),
                        this->DirPermissions.c_str(),
                        no_rename, this->LiteralArguments.c_str(),

+ 2 - 2
Source/cmInstallExportGenerator.cxx

@@ -191,7 +191,7 @@ cmInstallExportGenerator::GenerateScriptConfigs(std::ostream& os,
     files.push_back(i->second);
     std::string config_test = this->CreateConfigTest(i->first.c_str());
     os << indent << "IF(" << config_test << ")\n";
-    this->AddInstallRule(os, cmTarget::INSTALL_FILES, files, false, 0,
+    this->AddInstallRule(os, cmTarget::INSTALL_FILES, files, false,
                          this->FilePermissions.c_str(), 0, 0, 0,
                          indent.Next());
     os << indent << "ENDIF(" << config_test << ")\n";
@@ -230,6 +230,6 @@ void cmInstallExportGenerator::GenerateScriptActions(std::ostream& os,
   // Install the main export file.
   std::vector<std::string> files;
   files.push_back(this->MainImportFile);
-  this->AddInstallRule(os, cmTarget::INSTALL_FILES, files, false, 0,
+  this->AddInstallRule(os, cmTarget::INSTALL_FILES, files, false,
                        this->FilePermissions.c_str(), 0, 0, 0, indent);
 }

+ 1 - 2
Source/cmInstallFilesGenerator.cxx

@@ -45,14 +45,13 @@ void cmInstallFilesGenerator::GenerateScriptActions(std::ostream& os,
                                                     Indent const& indent)
 {
   // Write code to install the files.
-  const char* no_properties = 0;
   const char* no_dir_permissions = 0;
   this->AddInstallRule(os,
                        (this->Programs
                         ? cmTarget::INSTALL_PROGRAMS
                         : cmTarget::INSTALL_FILES),
                        this->Files,
-                       this->Optional, no_properties,
+                       this->Optional,
                        this->FilePermissions.c_str(), no_dir_permissions,
                        this->Rename.c_str(), 0, indent);
 }

+ 0 - 5
Source/cmInstallGenerator.cxx

@@ -43,7 +43,6 @@ void cmInstallGenerator
                  int type,
                  std::vector<std::string> const& files,
                  bool optional /* = false */,
-                 const char* properties /* = 0 */,
                  const char* permissions_file /* = 0 */,
                  const char* permissions_dir /* = 0 */,
                  const char* rename /* = 0 */,
@@ -71,10 +70,6 @@ void cmInstallGenerator
     {
     os << " OPTIONAL";
     }
-  if(properties && *properties)
-    {
-    os << " PROPERTIES" << properties;
-    }
   if(permissions_file && *permissions_file)
     {
     os << " PERMISSIONS" << permissions_file;

+ 0 - 1
Source/cmInstallGenerator.h

@@ -37,7 +37,6 @@ public:
     std::ostream& os, int type,
     std::vector<std::string> const& files,
     bool optional = false,
-    const char* properties = 0,
     const char* permissions_file = 0,
     const char* permissions_dir = 0,
     const char* rename = 0,

+ 1 - 2
Source/cmInstallTargetGenerator.cxx

@@ -311,10 +311,9 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
   // Write code to install the target file.
   const char* no_dir_permissions = 0;
   const char* no_rename = 0;
-  const char* no_properties = 0;
   bool optional = this->Optional || this->ImportLibrary;
   this->AddInstallRule(os, type, files,
-                       optional, no_properties,
+                       optional,
                        this->FilePermissions.c_str(), no_dir_permissions,
                        no_rename, literal_args.c_str(),
                        indent);