[cmake-commits] alex committed cmIncludeCommand.cxx 1.18.2.2 1.18.2.3 cmIncludeCommand.h 1.14.4.1 1.14.4.2 cmInstallTargetGenerator.cxx 1.28.2.3 1.28.2.4 cmLocalGenerator.cxx 1.212.2.1 1.212.2.2 cmLocalGenerator.h 1.78.2.1 1.78.2.2

cmake-commits at cmake.org cmake-commits at cmake.org
Tue May 15 13:30:41 EDT 2007


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv30220/Source

Modified Files:
      Tag: CMake-CrossCompileBasic
	cmIncludeCommand.cxx cmIncludeCommand.h 
	cmInstallTargetGenerator.cxx cmLocalGenerator.cxx 
	cmLocalGenerator.h 
Log Message:

ENH: some adjustments as suggested by Brad: only check for the various
"binutils" on the respective platform, hardcode the strip command, make the
return variable of include() available also without OPTIONAL, honor DESTDIR
for strip and ranlib
-use FIND_PROGRAM(CMAKE_LINKER link) for the MSVC linker

Alex


Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.212.2.1
retrieving revision 1.212.2.2
diff -u -d -r1.212.2.1 -r1.212.2.2
--- cmLocalGenerator.cxx	14 May 2007 20:28:07 -0000	1.212.2.1
+++ cmLocalGenerator.cxx	15 May 2007 17:30:39 -0000	1.212.2.2
@@ -924,13 +924,6 @@
       return replaceValues.TargetInstallNameDir;
       }
     }
-  if(replaceValues.BinaryFullInstallPath)
-    {
-    if(variable == "BINARY_FULL_INSTALL_PATH")
-      {
-      return replaceValues.BinaryFullInstallPath;
-      }
-    }
   if(replaceValues.LinkLibraries)
     {
     if(variable == "LINK_LIBRARIES")

Index: cmInstallTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallTargetGenerator.cxx,v
retrieving revision 1.28.2.3
retrieving revision 1.28.2.4
diff -u -d -r1.28.2.3 -r1.28.2.4
--- cmInstallTargetGenerator.cxx	14 May 2007 21:02:18 -0000	1.28.2.3
+++ cmInstallTargetGenerator.cxx	15 May 2007 17:30:39 -0000	1.28.2.4
@@ -455,31 +455,15 @@
     return;
     }
 
-  std::string stripRule = this->Target->GetMakefile()->GetSafeDefinition("CMAKE_STRIP_BINARY");
-  if (!stripRule.size()>0)
-    {
-    return;
-    }
-
   if(! this->Target->GetMakefile()->IsSet("CMAKE_STRIP"))
     {
     return;
     }
 
-  std::string qoutedDestinationFilename = "\"";
-  qoutedDestinationFilename += destinationFilename;
-  qoutedDestinationFilename += "\"";
-  
-  cmLocalGenerator::RuleVariables vars;
-  vars.BinaryFullInstallPath = qoutedDestinationFilename.c_str();
-
-  this->Target->GetMakefile()->
-      GetLocalGenerator()->ExpandRuleVariables(stripRule, vars);
-  
   os << "IF(CMAKE_INSTALL_DO_STRIP)\n";
-  os << "  EXECUTE_PROCESS(COMMAND ";
-  os << stripRule;
-  os << " )\n";
+  os << "  EXECUTE_PROCESS(COMMAND \"";
+  os << this->Target->GetMakefile()->GetDefinition("CMAKE_STRIP");
+  os << "\" \"$ENV{DESTDIR}" << destinationFilename << "\" )\n";
   os << "ENDIF(CMAKE_INSTALL_DO_STRIP)\n";
 }
 
@@ -487,25 +471,26 @@
                                              cmTarget::TargetType type,
                                              const std::string& destinationFilename)
 {
-  // Perform post-installation processing on the file depending
-  // on its type.
-#if defined(__APPLE_CC__)
   // Static libraries need ranlib on this platform.
   if(type != cmTarget::STATIC_LIBRARY)
     {
     return;
     }
-  
-  std::string ranlib = this->Target->GetMakefile()->GetSafeDefinition("CMAKE_RANLIB");
+
+  // Perform post-installation processing on the file depending
+  // on its type.
+  if(!this->Target->GetMakefile()->IsOn("APPLE"))
+    {
+    return;
+    }
+
+  std::string ranlib = this->Target->GetMakefile()->GetRequiredDefinition("CMAKE_RANLIB");
   if (!ranlib.size()>0)
     {
     return;
     }
 
   os << "EXECUTE_PROCESS(COMMAND \"";
-  os << ranlib << "\" \"";
-  os << destinationFilename;
-  os << "\" )\n";
-        
-#endif
+  os << ranlib;
+  os << "\" \"$ENV{DESTDIR}" << destinationFilename << "\" )\n";
 }

Index: cmLocalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.h,v
retrieving revision 1.78.2.1
retrieving revision 1.78.2.2
diff -u -d -r1.78.2.1 -r1.78.2.2
--- cmLocalGenerator.h	14 May 2007 20:28:07 -0000	1.78.2.1
+++ cmLocalGenerator.h	15 May 2007 17:30:39 -0000	1.78.2.2
@@ -187,7 +187,6 @@
     const char* ObjectsQuoted;
     const char* TargetSOName;
     const char* TargetInstallNameDir;
-    const char* BinaryFullInstallPath;
     const char* LinkFlags;
     const char* LanguageCompileFlags;
   };
@@ -223,9 +222,6 @@
   std::string ConvertToRelativePath(const std::vector<std::string>& local,
                                     const char* remote);
 
-  // Expand rule variables in CMake of the type found in language rules
-  void ExpandRuleVariables(std::string& string,
-                           const RuleVariables& replaceValues);
 protected:
 
   /** Construct a comment for a custom command.  */
@@ -242,10 +238,14 @@
   ///! put all the libraries for a target on into the given stream
   virtual void OutputLinkLibraries(std::ostream&, cmTarget&, bool relink);
 
+  // Expand rule variables in CMake of the type found in language rules
+  void ExpandRuleVariables(std::string& string,
+                           const RuleVariables& replaceValues);
+
   // Expand rule variables in a single string
   std::string ExpandRuleVariable(std::string const& variable,
                                  const RuleVariables& replaceValues);
-  
+
   /** Convert a target to a utility target for unsupported 
    *  languages of a generator */
   void AddBuildTargetRule(const char* llang, cmTarget& target);

Index: cmIncludeCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIncludeCommand.cxx,v
retrieving revision 1.18.2.2
retrieving revision 1.18.2.3
diff -u -d -r1.18.2.2 -r1.18.2.3
--- cmIncludeCommand.cxx	11 May 2007 20:25:09 -0000	1.18.2.2
+++ cmIncludeCommand.cxx	15 May 2007 17:30:39 -0000	1.18.2.3
@@ -27,25 +27,29 @@
       return false;
     }
   bool optional = false;
-
   std::string fname = args[0];
   std::string resultVarName;
-
-  if(args.size() > 1)
+  
+  for (int i=1; i<args.size(); i++)
     {
-    if (args[1] == "OPTIONAL")
+    if (args[i] == "OPTIONAL") 
       {
-      optional = true;
-      if (args.size() == 3)
+      if (optional)
         {
-        resultVarName = args[2];
+        this->SetError("called with invalid arguments: OPTIONAL used twice");
+        return false;
         }
+      optional = true;
       }
     else
       {
-      this->SetError("called with invalid second argument "
-                     "(must be \"OPTIONAL\")");
-      return false;
+      if (resultVarName.size() > 0)
+        {
+        this->SetError("called with invalid arguments: "
+                       "only one variable allowed");
+        return false;
+        }
+      resultVarName = args[i];
       }
     }
   

Index: cmIncludeCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIncludeCommand.h,v
retrieving revision 1.14.4.1
retrieving revision 1.14.4.2
diff -u -d -r1.14.4.1 -r1.14.4.2
--- cmIncludeCommand.h	11 May 2007 15:55:01 -0000	1.14.4.1
+++ cmIncludeCommand.h	15 May 2007 17:30:39 -0000	1.14.4.2
@@ -68,12 +68,12 @@
   virtual const char* GetFullDocumentation()
     {
     return
-      "  INCLUDE(file1 [OPTIONAL [<VAR>]])\n"
-      "  INCLUDE(module [OPTIONAL [<VAR>]])\n"
+      "  INCLUDE(file1 [OPTIONAL] [<VAR>])\n"
+      "  INCLUDE(module [OPTIONAL] [<VAR>])\n"
       "Reads CMake listfile code from the given file.  Commands in the file "
       "are processed immediately as if they were written in place of the "
       "INCLUDE command.  If OPTIONAL is present, then no error "
-      "is raised if the file does not exist. If additionally to OPTIONAL "
+      "is raised if the file does not exist. If additionally "
       "a variable is given, it will be set to the full filename which "
       "has been included or NOTFOUND if it failed.\n"
       "If a module is specified instead of a file, the file with name "



More information about the Cmake-commits mailing list