[Cmake-commits] [cmake-commits] hoffman committed cmAddCustomCommandCommand.cxx 1.37 1.37.2.1 cmAddCustomCommandCommand.h 1.33 1.33.2.1 cmCustomCommand.cxx 1.24 1.24.2.1 cmCustomCommand.h 1.23 1.23.2.1 cmDepends.cxx 1.17 1.17.2.1 cmDepends.h 1.14 1.14.2.1 cmDependsC.cxx 1.33 1.33.2.1 cmDependsC.h 1.20 1.20.10.1 cmDependsFortran.cxx 1.46.2.1 1.46.2.2 cmDependsFortran.h 1.14 1.14.2.1 cmDocumentationFormatterDocbook.cxx 1.1.2.1 1.1.2.2 cmELF.cxx 1.8.2.1 1.8.2.2 cmGlobalGenerator.cxx 1.227.2.1 1.227.2.2 cmGlobalGenerator.h 1.107 1.107.2.1 cmGlobalUnixMakefileGenerator3.cxx 1.126.2.1 1.126.2.2 cmListCommand.cxx 1.18.2.3 1.18.2.4 cmLocalUnixMakefileGenerator3.cxx 1.240.2.5 1.240.2.6 cmMakefile.cxx 1.463.2.3 1.463.2.4 cmMakefileTargetGenerator.cxx 1.93.2.3 1.93.2.4 cmSetSourceFilesPropertiesCommand.cxx 1.19 1.19.2.1 cmTarget.cxx 1.207.2.5 1.207.2.6 cmTarget.h 1.109.2.3 1.109.2.4 cmXCodeObject.cxx 1.24 1.24.2.1 cmake.cxx 1.375.2.5 1.375.2.6 cmakemain.cxx 1.80 1.80.2.1

cmake-commits at cmake.org cmake-commits at cmake.org
Thu May 15 15:39:59 EDT 2008


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

Modified Files:
      Tag: CMake-2-6
	cmAddCustomCommandCommand.cxx cmAddCustomCommandCommand.h 
	cmCustomCommand.cxx cmCustomCommand.h cmDepends.cxx 
	cmDepends.h cmDependsC.cxx cmDependsC.h cmDependsFortran.cxx 
	cmDependsFortran.h cmDocumentationFormatterDocbook.cxx 
	cmELF.cxx cmGlobalGenerator.cxx cmGlobalGenerator.h 
	cmGlobalUnixMakefileGenerator3.cxx cmListCommand.cxx 
	cmLocalUnixMakefileGenerator3.cxx cmMakefile.cxx 
	cmMakefileTargetGenerator.cxx 
	cmSetSourceFilesPropertiesCommand.cxx cmTarget.cxx cmTarget.h 
	cmXCodeObject.cxx cmake.cxx cmakemain.cxx 
Log Message:
ENH: merge in from main tree


Index: cmDependsFortran.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortran.cxx,v
retrieving revision 1.46.2.1
retrieving revision 1.46.2.2
diff -C 2 -d -r1.46.2.1 -r1.46.2.2
*** cmDependsFortran.cxx	21 Apr 2008 19:21:57 -0000	1.46.2.1
--- cmDependsFortran.cxx	15 May 2008 19:39:50 -0000	1.46.2.2
***************
*** 132,136 ****
  //----------------------------------------------------------------------------
  cmDependsFortran::cmDependsFortran():
!   IncludePath(0), PPDefinitions(0), Internal(0)
  {
  }
--- 132,136 ----
  //----------------------------------------------------------------------------
  cmDependsFortran::cmDependsFortran():
!   PPDefinitions(0), Internal(0)
  {
  }
***************
*** 138,146 ****
  //----------------------------------------------------------------------------
  cmDependsFortran
! ::cmDependsFortran(std::vector<std::string> const& includes,
!                    std::vector<std::string> const& definitions):
!   IncludePath(&includes),
    Internal(new cmDependsFortranInternals)
  {
    // translate i.e. FOO=BAR to FOO and add it to the list of defined
    // preprocessor symbols
--- 138,154 ----
  //----------------------------------------------------------------------------
  cmDependsFortran
! ::cmDependsFortran(cmLocalGenerator* lg):
!   cmDepends(lg),
    Internal(new cmDependsFortranInternals)
  {
+   // Get the list of definitions.
+   std::vector<std::string> definitions;
+   cmMakefile* mf = this->LocalGenerator->GetMakefile();
+   if(const char* c_defines =
+      mf->GetDefinition("CMAKE_TARGET_DEFINITIONS"))
+     {
+     cmSystemTools::ExpandListArgument(c_defines, definitions);
+     }
+ 
    // translate i.e. FOO=BAR to FOO and add it to the list of defined
    // preprocessor symbols
***************
*** 179,187 ****
      return false;
      }
-   if(!this->IncludePath)
-     {
-     cmSystemTools::Error("Cannot scan dependencies without an include path.");
-     return false;
-     }
  
    // Get the information object for this source.
--- 187,190 ----
***************
*** 596,600 ****
    std::string fullName;
    for(std::vector<std::string>::const_iterator i =
!         this->IncludePath->begin(); i != this->IncludePath->end(); ++i)
      {
      // Try the lower-case name.
--- 599,603 ----
    std::string fullName;
    for(std::vector<std::string>::const_iterator i =
!         this->IncludePath.begin(); i != this->IncludePath.end(); ++i)
      {
      // Try the lower-case name.
***************
*** 888,892 ****
      // Search the include path for the file.
      for(std::vector<std::string>::const_iterator i = 
!           this->IncludePath->begin(); i != this->IncludePath->end(); ++i)
        {
        fullName = *i;
--- 891,895 ----
      // Search the include path for the file.
      for(std::vector<std::string>::const_iterator i = 
!           this->IncludePath.begin(); i != this->IncludePath.end(); ++i)
        {
        fullName = *i;

Index: cmCustomCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCustomCommand.cxx,v
retrieving revision 1.24
retrieving revision 1.24.2.1
diff -C 2 -d -r1.24 -r1.24.2.1
*** cmCustomCommand.cxx	17 Sep 2007 14:50:46 -0000	1.24
--- cmCustomCommand.cxx	15 May 2008 19:39:50 -0000	1.24.2.1
***************
*** 23,26 ****
--- 23,27 ----
    this->EscapeOldStyle = true;
    this->EscapeAllowMakeVars = false;
+   this->SkipRuleDepends = false;
  }
  
***************
*** 51,58 ****
    WorkingDirectory(workingDirectory?workingDirectory:""),
    EscapeAllowMakeVars(false),
!   EscapeOldStyle(true)
  {
-   this->EscapeOldStyle = true;
-   this->EscapeAllowMakeVars = false;
  }
  
--- 52,58 ----
    WorkingDirectory(workingDirectory?workingDirectory:""),
    EscapeAllowMakeVars(false),
!   EscapeOldStyle(true),
!   SkipRuleDepends(false)
  {
  }
  
***************
*** 137,140 ****
--- 137,152 ----
  
  //----------------------------------------------------------------------------
+ bool cmCustomCommand::GetSkipRuleDepends() const
+ {
+   return this->SkipRuleDepends;
+ }
+ 
+ //----------------------------------------------------------------------------
+ void cmCustomCommand::SetSkipRuleDepends(bool b)
+ {
+   this->SkipRuleDepends = b;
+ }
+ 
+ //----------------------------------------------------------------------------
  cmCustomCommand::ImplicitDependsList const&
  cmCustomCommand::GetImplicitDepends() const

Index: cmGlobalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.h,v
retrieving revision 1.107
retrieving revision 1.107.2.1
diff -C 2 -d -r1.107 -r1.107.2.1
*** cmGlobalGenerator.h	14 Feb 2008 21:42:29 -0000	1.107
--- cmGlobalGenerator.h	15 May 2008 19:39:54 -0000	1.107.2.1
***************
*** 261,264 ****
--- 261,266 ----
    virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS();
  
+   bool CheckTargets();
+ 
    // Fill the ProjectMap, this must be called after LocalGenerators 
    // has been populated.

Index: cmGlobalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalUnixMakefileGenerator3.cxx,v
retrieving revision 1.126.2.1
retrieving revision 1.126.2.2
diff -C 2 -d -r1.126.2.1 -r1.126.2.2
*** cmGlobalUnixMakefileGenerator3.cxx	24 Mar 2008 22:23:26 -0000	1.126.2.1
--- cmGlobalUnixMakefileGenerator3.cxx	15 May 2008 19:39:54 -0000	1.126.2.2
***************
*** 91,95 ****
        GetCacheManager()->GetCacheValue(langComp.c_str());
      std::string changeVars;
!     if(cname && (path != cname))
        {
        const char* cvars = 
--- 91,95 ----
        GetCacheManager()->GetCacheValue(langComp.c_str());
      std::string changeVars;
!     if(cname && (path != cname) && (optional==false))
        {
        const char* cvars = 

Index: cmListCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmListCommand.cxx,v
retrieving revision 1.18.2.3
retrieving revision 1.18.2.4
diff -C 2 -d -r1.18.2.3 -r1.18.2.4
*** cmListCommand.cxx	23 Apr 2008 16:14:33 -0000	1.18.2.3
--- cmListCommand.cxx	15 May 2008 19:39:55 -0000	1.18.2.4
***************
*** 545,548 ****
--- 545,554 ----
    for ( it = varArgsExpanded.begin(); it != varArgsExpanded.end(); ++ it )
      {
+     if(value.size() == 0 && 
+        this->Makefile->GetPolicyStatus(cmPolicies::CMP0007) ==
+        cmPolicies::NEW)
+       {
+       value += ";";
+       }
      if (value.size())
        {

Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.227.2.1
retrieving revision 1.227.2.2
diff -C 2 -d -r1.227.2.1 -r1.227.2.2
*** cmGlobalGenerator.cxx	1 May 2008 16:35:39 -0000	1.227.2.1
--- cmGlobalGenerator.cxx	15 May 2008 19:39:54 -0000	1.227.2.2
***************
*** 765,768 ****
--- 765,774 ----
      }
  
+   // Check that all targets are valid.
+   if(!this->CheckTargets())
+     {
+     return;
+     }
+ 
    // For each existing cmLocalGenerator
    unsigned int i;
***************
*** 851,854 ****
--- 857,888 ----
  }
  
+ //----------------------------------------------------------------------------
+ bool cmGlobalGenerator::CheckTargets()
+ {
+   // Make sure all targets can find their source files.
+   for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
+     {
+     cmTargets& targets =
+       this->LocalGenerators[i]->GetMakefile()->GetTargets();
+     for(cmTargets::iterator ti = targets.begin();
+         ti != targets.end(); ++ti)
+       {
+       cmTarget& target = ti->second;
+       if(target.GetType() == cmTarget::EXECUTABLE ||
+          target.GetType() == cmTarget::STATIC_LIBRARY ||
+          target.GetType() == cmTarget::SHARED_LIBRARY ||
+          target.GetType() == cmTarget::MODULE_LIBRARY ||
+          target.GetType() == cmTarget::UTILITY)
+         {
+         if(!target.FindSourceFiles())
+           {
+           return false;
+           }
+         }
+       }
+     }
+   return true;
+ }
+ 
  void cmGlobalGenerator::CheckLocalGenerators()
  {

Index: cmakemain.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmakemain.cxx,v
retrieving revision 1.80
retrieving revision 1.80.2.1
diff -C 2 -d -r1.80 -r1.80.2.1
*** cmakemain.cxx	11 Mar 2008 20:02:10 -0000	1.80
--- cmakemain.cxx	15 May 2008 19:39:57 -0000	1.80.2.1
***************
*** 145,148 ****
--- 145,159 ----
     "format is determined depending on the filename suffix. Supported are man "
     "page, HTML, DocBook and plain text."},
+   {"--help-policy cmp [file]", 
+    "Print help for a single policy and exit.",
+    "Full documentation specific to the given policy is displayed."
+    "If a file is specified, the documentation is written into and the output "
+    "format is determined depending on the filename suffix. Supported are man "
+    "page, HTML, DocBook and plain text."},
+   {"--help-policies [file]", "Print help for all policies and exit.",
+    "Full documentation for all policies is displayed."
+    "If a file is specified, the documentation is written into and the output "
+    "format is determined depending on the filename suffix. Supported are man "
+    "page, HTML, DocBook and plain text."},
    {"--help-property prop [file]", 
     "Print help for a single property and exit.",

Index: cmTarget.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.h,v
retrieving revision 1.109.2.3
retrieving revision 1.109.2.4
diff -C 2 -d -r1.109.2.3 -r1.109.2.4
*** cmTarget.h	8 Apr 2008 20:26:07 -0000	1.109.2.3
--- cmTarget.h	15 May 2008 19:39:57 -0000	1.109.2.4
***************
*** 272,275 ****
--- 272,280 ----
    void TraceDependencies(const char* vsProjectFile);
  
+   /**
+    * Make sure the full path to all source files is known.
+    */
+   bool FindSourceFiles();
+ 
    ///! Return the prefered linker language for this target
    const char* GetLinkerLanguage(cmGlobalGenerator*);

Index: cmMakefileTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.cxx,v
retrieving revision 1.93.2.3
retrieving revision 1.93.2.4
diff -C 2 -d -r1.93.2.3 -r1.93.2.4
*** cmMakefileTargetGenerator.cxx	23 Apr 2008 02:05:40 -0000	1.93.2.3
--- cmMakefileTargetGenerator.cxx	15 May 2008 19:39:57 -0000	1.93.2.4
***************
*** 934,939 ****
          pi != this->MultipleOutputPairs.end(); ++pi)
        {
!       *this->InfoFileStream << "  \"" << pi->first << "\" \""
!                             << pi->second << "\"\n";
        }
      *this->InfoFileStream << "  )\n\n";
--- 934,941 ----
          pi != this->MultipleOutputPairs.end(); ++pi)
        {
!       *this->InfoFileStream
!         << "  " << this->LocalGenerator->EscapeForCMake(pi->first.c_str())
!         << " "  << this->LocalGenerator->EscapeForCMake(pi->second.c_str())
!         << "\n";
        }
      *this->InfoFileStream << "  )\n\n";
***************
*** 1121,1126 ****
  
    // Add a dependency on the rule file itself.
!   this->LocalGenerator->AppendRuleDepend(depends,
!                                          this->BuildFileNameFull.c_str());
  
    // Check whether we need to bother checking for a symbolic output.
--- 1123,1131 ----
  
    // Add a dependency on the rule file itself.
!   if(!cc.GetSkipRuleDepends())
!     {
!     this->LocalGenerator->AppendRuleDepend(depends,
!                                            this->BuildFileNameFull.c_str());
!     }
  
    // Check whether we need to bother checking for a symbolic output.

Index: cmDocumentationFormatterDocbook.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentationFormatterDocbook.cxx,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C 2 -d -r1.1.2.1 -r1.1.2.2
*** cmDocumentationFormatterDocbook.cxx	5 May 2008 17:38:19 -0000	1.1.2.1
--- cmDocumentationFormatterDocbook.cxx	15 May 2008 19:39:54 -0000	1.1.2.2
***************
*** 145,149 ****
        os << "\"><emphasis><literal>";
        cmDocumentationPrintDocbookEscapes(os, op->Name.c_str());
!       os << "</literal></emphasis></link></listitem>";
        }
      }
--- 145,149 ----
        os << "\"><emphasis><literal>";
        cmDocumentationPrintDocbookEscapes(os, op->Name.c_str());
!       os << "</literal></emphasis></link></listitem>\n";
        }
      }

Index: cmDepends.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDepends.h,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -C 2 -d -r1.14 -r1.14.2.1
*** cmDepends.h	28 Dec 2007 16:49:59 -0000	1.14
--- cmDepends.h	15 May 2008 19:39:50 -0000	1.14.2.1
***************
*** 35,39 ****
    /** Instances need to know the build directory name and the relative
        path from the build directory to the target file.  */
!   cmDepends();
    
    /** at what level will the compile be done from */
--- 35,39 ----
    /** Instances need to know the build directory name and the relative
        path from the build directory to the target file.  */
!   cmDepends(cmLocalGenerator* lg=0, const char* targetDir="");
    
    /** at what level will the compile be done from */
***************
*** 109,112 ****
--- 109,117 ----
    char* Depender;
  
+   // The include file search path.
+   std::vector<std::string> IncludePath;
+ 
+   void SetIncludePathFromLanguage(const char* lang);
+ 
  private:
    cmDepends(cmDepends const&); // Purposely not implemented.

Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.207.2.5
retrieving revision 1.207.2.6
diff -C 2 -d -r1.207.2.5 -r1.207.2.6
*** cmTarget.cxx	21 Apr 2008 00:44:53 -0000	1.207.2.5
--- cmTarget.cxx	15 May 2008 19:39:57 -0000	1.207.2.6
***************
*** 160,163 ****
--- 160,181 ----
  
    cm->DefineProperty
+     ("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM", cmProperty::TARGET,
+      "Specify #include line transforms for dependencies in a target.",
+      "This property specifies rules to transform macro-like #include lines "
+      "during implicit dependency scanning of C and C++ source files.  "
+      "The list of rules must be semicolon-separated with each entry of "
+      "the form \"A_MACRO(%)=value-with-%\" (the % must be literal).  "
+      "During dependency scanning occurrences of A_MACRO(...) on #include "
+      "lines will be replaced by the value given with the macro argument "
+      "substituted for '%'.  For example, the entry\n"
+      "  MYDIR(%)=<mydir/%>\n"
+      "will convert lines of the form\n"
+      "  #include MYDIR(myheader.h)\n"
+      "to\n"
+      "  #include <mydir/myheader.h>\n"
+      "allowing the dependency to be followed.\n"
+      "This property applies to sources in the target on which it is set.");
+ 
+   cm->DefineProperty
      ("IMPORT_PREFIX", cmProperty::TARGET,
       "What comes before the import library name.",
***************
*** 1007,1010 ****
--- 1025,1043 ----
  
  //----------------------------------------------------------------------------
+ bool cmTarget::FindSourceFiles()
+ {
+   for(std::vector<cmSourceFile*>::const_iterator
+         si = this->SourceFiles.begin();
+       si != this->SourceFiles.end(); ++si)
+     {
+     if((*si)->GetFullPath().empty())
+       {
+       return false;
+       }
+     }
+   return true;
+ }
+ 
+ //----------------------------------------------------------------------------
  void cmTarget::AddSources(std::vector<std::string> const& srcs)
  {

Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.375.2.5
retrieving revision 1.375.2.6
diff -C 2 -d -r1.375.2.5 -r1.375.2.6
*** cmake.cxx	1 May 2008 16:35:40 -0000	1.375.2.5
--- cmake.cxx	15 May 2008 19:39:57 -0000	1.375.2.6
***************
*** 593,602 ****
        {
        // skip for now
-       i++;
        }
      else if(arg.find("-Wdev",0) == 0)
        {
        // skip for now
-       i++;
        }
      else if(arg.find("--graphviz=",0) == 0)
--- 593,600 ----
***************
*** 3508,3512 ****
          break;
          }
!       fprintf(progFile,"%s with scope %s\n",ap->first.c_str(),scopeStr);
        }
      }
--- 3506,3510 ----
          break;
          }
!       fprintf(progFile, "%s with scope %s\n", ap->first.c_str(), scopeStr);
        }
      }

Index: cmXCodeObject.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmXCodeObject.cxx,v
retrieving revision 1.24
retrieving revision 1.24.2.1
diff -C 2 -d -r1.24 -r1.24.2.1
*** cmXCodeObject.cxx	14 Aug 2007 15:45:14 -0000	1.24
--- cmXCodeObject.cxx	15 May 2008 19:39:57 -0000	1.24.2.1
***************
*** 70,73 ****
--- 70,77 ----
        }
      }
+   if(this->Id.size() > 24)
+     {
+     this->Id = this->Id.substr(0,24);
+     }
    this->TypeValue = type;
    if(this->TypeValue == OBJECT)

Index: cmDependsC.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsC.h,v
retrieving revision 1.20
retrieving revision 1.20.10.1
diff -C 2 -d -r1.20 -r1.20.10.1
*** cmDependsC.h	5 Feb 2007 14:48:38 -0000	1.20
--- cmDependsC.h	15 May 2008 19:39:50 -0000	1.20.10.1
***************
*** 31,37 ****
        relative path from the build directory to the target file.  */
    cmDependsC();
!   cmDependsC(std::vector<std::string> const& includes,
!              const char* scanRegex, const char* complainRegex,
!              const cmStdString& cachFileName);
  
    /** Virtual destructor to cleanup subclasses properly.  */
--- 31,35 ----
        relative path from the build directory to the target file.  */
    cmDependsC();
!   cmDependsC(cmLocalGenerator* lg, const char* targetDir, const char* lang);
  
    /** Virtual destructor to cleanup subclasses properly.  */
***************
*** 51,57 ****
      const cmStdString& fullName);
  
-   // The include file search path.
-   std::vector<std::string> const* IncludePath;
- 
    // Regular expression to identify C preprocessor include directives.
    cmsys::RegularExpression IncludeRegexLine;
--- 49,52 ----
***************
*** 61,67 ****
    cmsys::RegularExpression IncludeRegexScan;
    cmsys::RegularExpression IncludeRegexComplain;
!   const std::string IncludeRegexLineString;
!   const std::string IncludeRegexScanString;
!   const std::string IncludeRegexComplainString;
  
  public:
--- 56,71 ----
    cmsys::RegularExpression IncludeRegexScan;
    cmsys::RegularExpression IncludeRegexComplain;
!   std::string IncludeRegexLineString;
!   std::string IncludeRegexScanString;
!   std::string IncludeRegexComplainString;
! 
!   // Regex to transform #include lines.
!   std::string IncludeRegexTransformString;
!   cmsys::RegularExpression IncludeRegexTransform;
!   typedef std::map<cmStdString, cmStdString> TransformRulesType;
!   TransformRulesType TransformRules;
!   void SetupTransforms();
!   void ParseTransform(std::string const& xform);
!   void TransformLine(std::string& line);
  
  public:

Index: cmDependsC.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsC.cxx,v
retrieving revision 1.33
retrieving revision 1.33.2.1
diff -C 2 -d -r1.33 -r1.33.2.1
*** cmDependsC.cxx	15 Dec 2007 01:31:27 -0000	1.33
--- cmDependsC.cxx	15 May 2008 19:39:50 -0000	1.33.2.1
***************
*** 19,22 ****
--- 19,23 ----
  #include "cmFileTimeComparison.h"
  #include "cmLocalGenerator.h"
+ #include "cmMakefile.h"
  #include "cmSystemTools.h"
  
***************
*** 30,54 ****
  #define INCLUDE_REGEX_SCAN_MARKER "#IncludeRegexScan: "
  #define INCLUDE_REGEX_COMPLAIN_MARKER "#IncludeRegexComplain: "
  
  //----------------------------------------------------------------------------
! cmDependsC::cmDependsC():
!   IncludePath(0)
  {
  }
  //----------------------------------------------------------------------------
! // yummy look at all those constructor arguments
! cmDependsC::cmDependsC(std::vector<std::string> const& includes,
!                        const char* scanRegex, const char* complainRegex,
!                        const cmStdString& cacheFileName):
!   IncludePath(&includes),
!   IncludeRegexLine(INCLUDE_REGEX_LINE),
!   IncludeRegexScan(scanRegex),
!   IncludeRegexComplain(complainRegex),
!   IncludeRegexLineString(INCLUDE_REGEX_LINE_MARKER INCLUDE_REGEX_LINE),
!   IncludeRegexScanString(std::string(INCLUDE_REGEX_SCAN_MARKER)+scanRegex),
!   IncludeRegexComplainString(
!     std::string(INCLUDE_REGEX_COMPLAIN_MARKER)+complainRegex),
!   CacheFileName(cacheFileName)
  {
    this->ReadCacheFile();
  }
--- 31,86 ----
  #define INCLUDE_REGEX_SCAN_MARKER "#IncludeRegexScan: "
  #define INCLUDE_REGEX_COMPLAIN_MARKER "#IncludeRegexComplain: "
+ #define INCLUDE_REGEX_TRANSFORM_MARKER "#IncludeRegexTransform: "
  
  //----------------------------------------------------------------------------
! cmDependsC::cmDependsC()
  {
  }
+ 
  //----------------------------------------------------------------------------
! cmDependsC::cmDependsC(cmLocalGenerator* lg, const char* targetDir,
!                        const char* lang): cmDepends(lg, targetDir)
  {
+   cmMakefile* mf = lg->GetMakefile();
+ 
+   // Configure the include file search path.
+   this->SetIncludePathFromLanguage(lang);
+ 
+   // Configure regular expressions.
+   std::string scanRegex = "^.*$";
+   std::string complainRegex = "^$";
+   {
+   std::string scanRegexVar = "CMAKE_";
+   scanRegexVar += lang;
+   scanRegexVar += "_INCLUDE_REGEX_SCAN";
+   if(const char* sr = mf->GetDefinition(scanRegexVar.c_str()))
+     {
+     scanRegex = sr;
+     }
+   std::string complainRegexVar = "CMAKE_";
+   complainRegexVar += lang;
+   complainRegexVar += "_INCLUDE_REGEX_COMPLAIN";
+   if(const char* cr = mf->GetDefinition(complainRegexVar.c_str()))
+     {
+     complainRegex = cr;
+     }
+   }
+ 
+   this->IncludeRegexLine.compile(INCLUDE_REGEX_LINE);
+   this->IncludeRegexScan.compile(scanRegex.c_str());
+   this->IncludeRegexComplain.compile(complainRegex.c_str());
+   this->IncludeRegexLineString = INCLUDE_REGEX_LINE_MARKER INCLUDE_REGEX_LINE;
+   this->IncludeRegexScanString = INCLUDE_REGEX_SCAN_MARKER;
+   this->IncludeRegexScanString += scanRegex;
+   this->IncludeRegexComplainString = INCLUDE_REGEX_COMPLAIN_MARKER;
+   this->IncludeRegexComplainString += complainRegex;
+ 
+   this->SetupTransforms();
+ 
+   this->CacheFileName = this->TargetDirectory;
+   this->CacheFileName += "/";
+   this->CacheFileName += lang;
+   this->CacheFileName += ".includecache";
+ 
    this->ReadCacheFile();
  }
***************
*** 81,89 ****
      return false;
      }
-   if(!this->IncludePath)
-     {
-     cmSystemTools::Error("Cannot scan dependencies without an include path.");
-     return false;
-     }
  
    // Walk the dependency graph starting with the source file.
--- 113,116 ----
***************
*** 139,143 ****
  
        for(std::vector<std::string>::const_iterator i = 
!             this->IncludePath->begin(); i != this->IncludePath->end(); ++i)
          {
          cacheKey+=*i;
--- 166,170 ----
  
        for(std::vector<std::string>::const_iterator i = 
!             this->IncludePath.begin(); i != this->IncludePath.end(); ++i)
          {
          cacheKey+=*i;
***************
*** 150,154 ****
          }
        else for(std::vector<std::string>::const_iterator i =
!             this->IncludePath->begin(); i != this->IncludePath->end(); ++i)
          {
          // Construct the name of the file as if it were in the current
--- 177,181 ----
          }
        else for(std::vector<std::string>::const_iterator i =
!             this->IncludePath.begin(); i != this->IncludePath.end(); ++i)
          {
          // Construct the name of the file as if it were in the current
***************
*** 318,321 ****
--- 345,355 ----
              }
            }
+         else if (line.find(INCLUDE_REGEX_TRANSFORM_MARKER) == 0)
+           {
+           if (line != this->IncludeRegexTransformString)
+             {
+             return;
+             }
+           }
          }
        }
***************
*** 352,355 ****
--- 386,390 ----
    cacheOut << this->IncludeRegexScanString << "\n\n";
    cacheOut << this->IncludeRegexComplainString << "\n\n";
+   cacheOut << this->IncludeRegexTransformString << "\n\n";
  
    for (std::map<cmStdString, cmIncludeLines*>::const_iterator fileIt=
***************
*** 392,395 ****
--- 427,436 ----
    while(cmSystemTools::GetLineFromStream(is, line))
      {
+     // Transform the line content first.
+     if(!this->TransformRules.empty())
+       {
+       this->TransformLine(line);
+       }
+ 
      // Match include directives.
      if(this->IncludeRegexLine.find(line.c_str()))
***************
*** 428,429 ****
--- 469,567 ----
      }
  }
+ 
+ //----------------------------------------------------------------------------
+ void cmDependsC::SetupTransforms()
+ {
+   // Get the transformation rules.
+   std::vector<std::string> transformRules;
+   cmMakefile* mf = this->LocalGenerator->GetMakefile();
+   if(const char* xform =
+      mf->GetDefinition("CMAKE_INCLUDE_TRANSFORMS"))
+     {
+     cmSystemTools::ExpandListArgument(xform, transformRules, true);
+     }
+   for(std::vector<std::string>::const_iterator tri = transformRules.begin();
+       tri != transformRules.end(); ++tri)
+     {
+     this->ParseTransform(*tri);
+     }
+ 
+   this->IncludeRegexTransformString = INCLUDE_REGEX_TRANSFORM_MARKER;
+   if(!this->TransformRules.empty())
+     {
+     // Construct the regular expression to match lines to be
+     // transformed.
+     std::string xform = "^([ \t]*#[ \t]*(include|import)[ \t]*)(";
+     const char* sep = "";
+     for(TransformRulesType::const_iterator tri = this->TransformRules.begin();
+         tri != this->TransformRules.end(); ++tri)
+       {
+       xform += sep;
+       xform += tri->first;
+       sep = "|";
+       }
+     xform += ")[ \t]*\\(([^),]*)\\)";
+     this->IncludeRegexTransform.compile(xform.c_str());
+ 
+     // Build a string that encodes all transformation rules and will
+     // change when rules are changed.
+     this->IncludeRegexTransformString += xform;
+     for(TransformRulesType::const_iterator tri = this->TransformRules.begin();
+         tri != this->TransformRules.end(); ++tri)
+       {
+       this->IncludeRegexTransformString += " ";
+       this->IncludeRegexTransformString += tri->first;
+       this->IncludeRegexTransformString += "(%)=";
+       this->IncludeRegexTransformString += tri->second;
+       }
+     }
+ }
+ 
+ //----------------------------------------------------------------------------
+ void cmDependsC::ParseTransform(std::string const& xform)
+ {
+   // A transform rule is of the form SOME_MACRO(%)=value-with-%
+   // We can simply separate with "(%)=".
+   std::string::size_type pos = xform.find("(%)=");
+   if(pos == xform.npos || pos == 0)
+     {
+     return;
+     }
+   std::string name = xform.substr(0, pos);
+   std::string value = xform.substr(pos+4, xform.npos);
+   this->TransformRules[name] = value;
+ }
+ 
+ //----------------------------------------------------------------------------
+ void cmDependsC::TransformLine(std::string& line)
+ {
+   // Check for a transform rule match.  Return if none.
+   if(!this->IncludeRegexTransform.find(line.c_str()))
+     {
+     return;
+     }
+   TransformRulesType::const_iterator tri =
+     this->TransformRules.find(this->IncludeRegexTransform.match(3));
+   if(tri == this->TransformRules.end())
+     {
+     return;
+     }
+ 
+   // Construct the transformed line.
+   std::string newline = this->IncludeRegexTransform.match(1);
+   std::string arg = this->IncludeRegexTransform.match(4);
+   for(const char* c = tri->second.c_str(); *c; ++c)
+     {
+     if(*c == '%')
+       {
+       newline += arg;
+       }
+     else
+       {
+       newline += *c;
+       }
+     }
+ 
+   // Return the transformed line.
+   line = newline;
+ }

Index: cmAddCustomCommandCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddCustomCommandCommand.h,v
retrieving revision 1.33
retrieving revision 1.33.2.1
diff -C 2 -d -r1.33 -r1.33.2.1
*** cmAddCustomCommandCommand.h	30 Jan 2008 16:22:10 -0000	1.33
--- cmAddCustomCommandCommand.h	15 May 2008 19:39:50 -0000	1.33.2.1
***************
*** 72,76 ****
        "                     [COMMAND command2 [ARGS] [args2...] ...]\n"
        "                     [MAIN_DEPENDENCY depend]\n"
!       "                     [DEPENDS [depends...]]\n"
        "                     [IMPLICIT_DEPENDS <lang1> depend1 ...]\n"
        "                     [WORKING_DIRECTORY dir]\n"
--- 72,76 ----
        "                     [COMMAND command2 [ARGS] [args2...] ...]\n"
        "                     [MAIN_DEPENDENCY depend]\n"
!       "                     [DEPENDS [depends...]] [SKIP_RULE_DEPENDS]\n"
        "                     [IMPLICIT_DEPENDS <lang1> depend1 ...]\n"
        "                     [WORKING_DIRECTORY dir]\n"
***************
*** 135,138 ****
--- 135,144 ----
        "SET_SOURCE_FILES_PROPERTIES.\n"
  
+       "The SKIP_RULE_DEPENDS option prevents the custom build rule from "
+       "having a dependency on itself.  This prevents the rule from running "
+       "again just because the command changed but is useful to create "
+       "rules that have absolutely no dependencies.  Such rules run only "
+       "when the output file is missing.\n"
+ 
        "The IMPLICIT_DEPENDS option requests scanning of implicit "
        "dependencies of an input file.  The language given specifies the "

Index: cmSetSourceFilesPropertiesCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetSourceFilesPropertiesCommand.cxx,v
retrieving revision 1.19
retrieving revision 1.19.2.1
diff -C 2 -d -r1.19 -r1.19.2.1
*** cmSetSourceFilesPropertiesCommand.cxx	15 Feb 2008 16:22:23 -0000	1.19
--- cmSetSourceFilesPropertiesCommand.cxx	15 May 2008 19:39:57 -0000	1.19.2.1
***************
*** 34,38 ****
    j = args.begin();
    // old style allows for specifier before PROPERTIES keyword
!   while (*j != "ABSTRACT" &&
           *j != "WRAP_EXCLUDE" &&
           *j != "GENERATED" &&
--- 34,39 ----
    j = args.begin();
    // old style allows for specifier before PROPERTIES keyword
!   while (j != args.end() &&
!          *j != "ABSTRACT" &&
           *j != "WRAP_EXCLUDE" &&
           *j != "GENERATED" &&

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.463.2.3
retrieving revision 1.463.2.4
diff -C 2 -d -r1.463.2.3 -r1.463.2.4
*** cmMakefile.cxx	1 May 2008 16:35:39 -0000	1.463.2.3
--- cmMakefile.cxx	15 May 2008 19:39:55 -0000	1.463.2.4
***************
*** 1295,1298 ****
--- 1295,1304 ----
    this->DefineFlags = parent->DefineFlags;
  
+   // Include transform property.  There is no per-config version.
+   {
+   const char* prop = "IMPLICIT_DEPENDS_INCLUDE_TRANSFORM";
+   this->SetProperty(prop, parent->GetProperty(prop));
+   }
+ 
    // compile definitions property and per-config versions
    {
***************
*** 3210,3213 ****
--- 3216,3239 ----
  
    cm->DefineProperty
+     ("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM", cmProperty::DIRECTORY,
+      "Specify #include line transforms for dependencies in a directory.",
+      "This property specifies rules to transform macro-like #include lines "
+      "during implicit dependency scanning of C and C++ source files.  "
+      "The list of rules must be semicolon-separated with each entry of "
+      "the form \"A_MACRO(%)=value-with-%\" (the % must be literal).  "
+      "During dependency scanning occurrences of A_MACRO(...) on #include "
+      "lines will be replaced by the value given with the macro argument "
+      "substituted for '%'.  For example, the entry\n"
+      "  MYDIR(%)=<mydir/%>\n"
+      "will convert lines of the form\n"
+      "  #include MYDIR(myheader.h)\n"
+      "to\n"
+      "  #include <mydir/myheader.h>\n"
+      "allowing the dependency to be followed.\n"
+      "This property applies to sources in all targets within a directory.  "
+      "The property value is initialized in each directory by its value "
+      "in the directory's parent.");
+ 
+   cm->DefineProperty
      ("EXCLUDE_FROM_ALL", cmProperty::DIRECTORY,
       "Exclude the directory from the all target of its parent.",

Index: cmCustomCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCustomCommand.h,v
retrieving revision 1.23
retrieving revision 1.23.2.1
diff -C 2 -d -r1.23 -r1.23.2.1
*** cmCustomCommand.h	17 Sep 2007 14:50:46 -0000	1.23
--- cmCustomCommand.h	15 May 2008 19:39:50 -0000	1.23.2.1
***************
*** 69,72 ****
--- 69,76 ----
    void SetEscapeAllowMakeVars(bool b);
  
+   /** Set/Get whether to skip the dependency on the rule itself.  */
+   bool GetSkipRuleDepends() const;
+   void SetSkipRuleDepends(bool b);
+ 
    typedef std::pair<cmStdString, cmStdString> ImplicitDependsPair;
    class ImplicitDependsList: public std::vector<ImplicitDependsPair> {};
***************
*** 84,87 ****
--- 88,92 ----
    bool EscapeAllowMakeVars;
    bool EscapeOldStyle;
+   bool SkipRuleDepends;
    ImplicitDependsList ImplicitDepends;
  };

Index: cmAddCustomCommandCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddCustomCommandCommand.cxx,v
retrieving revision 1.37
retrieving revision 1.37.2.1
diff -C 2 -d -r1.37 -r1.37.2.1
*** cmAddCustomCommandCommand.cxx	30 Jan 2008 16:22:10 -0000	1.37
--- cmAddCustomCommandCommand.cxx	15 May 2008 19:39:50 -0000	1.37.2.1
***************
*** 41,44 ****
--- 41,45 ----
    bool verbatim = false;
    bool append = false;
+   bool skip_rule_depends = false;
    std::string implicit_depends_lang;
    cmCustomCommand::ImplicitDependsList implicit_depends;
***************
*** 104,107 ****
--- 105,113 ----
        verbatim = true;
        }
+     else if(copy == "SKIP_RULE_DEPENDS")
+       {
+       doing = doing_nothing;
+       skip_rule_depends = true;
+       }
      else if(copy == "APPEND")
        {
***************
*** 311,316 ****
                                               escapeOldStyle);
  
!     // Add implicit dependency scanning requests if any were given.
!     if(!implicit_depends.empty())
        {
        bool okay = false;
--- 317,322 ----
                                               escapeOldStyle);
  
!     // Get the rule object to add some extra information.
!     if(!implicit_depends.empty() || skip_rule_depends)
        {
        bool okay = false;
***************
*** 321,325 ****
            {
            okay = true;
!           cc->SetImplicitDepends(implicit_depends);
            }
          }
--- 327,340 ----
            {
            okay = true;
! 
!           // Add implicit dependency scanning requests if any were
!           // given.
!           if(!implicit_depends.empty())
!             {
!             cc->SetImplicitDepends(implicit_depends);
!             }
! 
!           // Set the rule dependency state.
!           cc->SetSkipRuleDepends(skip_rule_depends);
            }
          }

Index: cmELF.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmELF.cxx,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -C 2 -d -r1.8.2.1 -r1.8.2.2
*** cmELF.cxx	21 Apr 2008 00:44:51 -0000	1.8.2.1
--- cmELF.cxx	15 May 2008 19:39:54 -0000	1.8.2.2
***************
*** 21,24 ****
--- 21,25 ----
  
  // Need the native byte order of the running CPU.
+ #define cmsys_CPU_UNKNOWN_OKAY // We can decide at runtime if not known.
  #include <cmsys/CPU.h>
  
***************
*** 85,88 ****
--- 86,91 ----
  #elif cmsys_CPU_ENDIAN_ID == cmsys_CPU_ENDIAN_ID_BIG
      this->NeedSwap = (this->ByteOrder == ByteOrderLSB);
+ #else
+     this->NeedSwap = false; // Final decision is at runtime anyway.
  #endif
  

Index: cmDependsFortran.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortran.h,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -C 2 -d -r1.14 -r1.14.2.1
*** cmDependsFortran.h	9 Jan 2008 15:30:10 -0000	1.14
--- cmDependsFortran.h	15 May 2008 19:39:53 -0000	1.14.2.1
***************
*** 37,42 ****
        file from which to start scanning, the include file search
        path, and the target directory.  */
!   cmDependsFortran(std::vector<std::string> const& includes,
!     std::vector<std::string> const& defines);
  
    /** Virtual destructor to cleanup subclasses properly.  */
--- 37,41 ----
        file from which to start scanning, the include file search
        path, and the target directory.  */
!   cmDependsFortran(cmLocalGenerator* lg);
  
    /** Virtual destructor to cleanup subclasses properly.  */
***************
*** 86,91 ****
    std::string SourceFile;
  
-   // The include file search path.
-   std::vector<std::string> const* IncludePath;
    std::vector<std::string> PPDefinitions;
  
--- 85,88 ----

Index: cmDepends.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDepends.cxx,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -C 2 -d -r1.17 -r1.17.2.1
*** cmDepends.cxx	28 Dec 2007 16:49:59 -0000	1.17
--- cmDepends.cxx	15 May 2008 19:39:50 -0000	1.17.2.1
***************
*** 25,33 ****
  
  //----------------------------------------------------------------------------
! cmDepends::cmDepends():
    CompileDirectory(),
!   LocalGenerator(0),
    Verbose(false),
    FileComparison(0),
    MaxPath(cmSystemTools::GetMaximumFilePathLength()),
    Dependee(new char[MaxPath]),
--- 25,34 ----
  
  //----------------------------------------------------------------------------
! cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir):
    CompileDirectory(),
!   LocalGenerator(lg),
    Verbose(false),
    FileComparison(0),
+   TargetDirectory(targetDir),
    MaxPath(cmSystemTools::GetMaximumFilePathLength()),
    Dependee(new char[MaxPath]),
***************
*** 232,234 ****
  }
  
! 
--- 233,246 ----
  }
  
! //----------------------------------------------------------------------------
! void cmDepends::SetIncludePathFromLanguage(const char* lang)
! {
!   std::string includePathVar = "CMAKE_";
!   includePathVar += lang;
!   includePathVar += "_INCLUDE_PATH";
!   cmMakefile* mf = this->LocalGenerator->GetMakefile();
!   if(const char* includePath = mf->GetDefinition(includePathVar.c_str()))
!     {
!     cmSystemTools::ExpandListArgument(includePath, this->IncludePath);
!     }
! }

Index: cmLocalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.cxx,v
retrieving revision 1.240.2.5
retrieving revision 1.240.2.6
diff -C 2 -d -r1.240.2.5 -r1.240.2.6
*** cmLocalUnixMakefileGenerator3.cxx	1 May 2008 16:35:39 -0000	1.240.2.5
--- cmLocalUnixMakefileGenerator3.cxx	15 May 2008 19:39:55 -0000	1.240.2.6
***************
*** 1111,1116 ****
          f != files.end(); ++f)
        {
!       fout << "\"" << this->Convert(f->c_str(),START_OUTPUT,UNCHANGED) 
!            << "\"\n";
        }
      fout << ")\n";
--- 1111,1116 ----
          f != files.end(); ++f)
        {
!       std::string fc = this->Convert(f->c_str(),START_OUTPUT,UNCHANGED);
!       fout << "  " << this->EscapeForCMake(fc.c_str()) << "\n";
        }
      fout << ")\n";
***************
*** 1438,1444 ****
    // create the file stream for the depends file
    std::string dir = targetDir;
!   
!   // Open the rule file.  This should be copy-if-different because the
!   // rules may depend on this file itself.
    std::string ruleFileNameFull = dir;
    ruleFileNameFull += "/depend.make";
--- 1438,1444 ----
    // create the file stream for the depends file
    std::string dir = targetDir;
! 
!   // Open the make depends file.  This should be copy-if-different
!   // because the make tool may try to reload it needlessly otherwise.
    std::string ruleFileNameFull = dir;
    ruleFileNameFull += "/depend.make";
***************
*** 1449,1457 ****
      return false;
      }
    std::string internalRuleFileNameFull = dir;
    internalRuleFileNameFull += "/depend.internal";
!   cmGeneratedFileStream 
      internalRuleFileStream(internalRuleFileNameFull.c_str());
-   internalRuleFileStream.SetCopyIfDifferent(true);
    if(!internalRuleFileStream)
      {
--- 1449,1460 ----
      return false;
      }
+ 
+   // Open the cmake dependency tracking file.  This should not be
+   // copy-if-different because dependencies are re-scanned when it is
+   // older than the DependInfo.cmake.
    std::string internalRuleFileNameFull = dir;
    internalRuleFileNameFull += "/depend.internal";
!   cmGeneratedFileStream
      internalRuleFileStream(internalRuleFileNameFull.c_str());
    if(!internalRuleFileStream)
      {
***************
*** 1471,1509 ****
      // construct the checker
      std::string lang = li->c_str();
-     
-     // Get the set of include directories.
-     std::vector<std::string> includes;
-     if(haveDirectoryInfo)
-       {
-       std::string includePathVar = "CMAKE_";
-       includePathVar += lang;
-       includePathVar += "_INCLUDE_PATH";
-       if(const char* includePath = mf->GetDefinition(includePathVar.c_str()))
-         {
-         cmSystemTools::ExpandListArgument(includePath, includes);
-         }
-       }
-     
-     // Get the include file regular expression.
-     std::string includeRegexScan = "^.*$";
-     std::string includeRegexComplain = "^$";
-     if(haveDirectoryInfo)
-       {
-       std::string scanRegexVar = "CMAKE_";
-       scanRegexVar += lang;
-       scanRegexVar += "_INCLUDE_REGEX_SCAN";
-       if(const char* scanRegex = mf->GetDefinition(scanRegexVar.c_str()))
-         {
-         includeRegexScan = scanRegex;
-         }
-       std::string complainRegexVar = "CMAKE_";
-       complainRegexVar += lang;
-       complainRegexVar += "_INCLUDE_REGEX_COMPLAIN";
-       if(const char* complainRegex = 
-          mf->GetDefinition(complainRegexVar.c_str()))
-         {
-         includeRegexComplain = complainRegex;
-         }
-       }
  
      // Create the scanner for this language
--- 1474,1477 ----
***************
*** 1511,1536 ****
      if(lang == "C" || lang == "CXX" || lang == "RC")
        {
-       std::string includeCacheFileName = dir;
-       includeCacheFileName += "/";
-       includeCacheFileName += lang;
-       includeCacheFileName += ".includecache";
-       
        // TODO: Handle RC (resource files) dependencies correctly.
!       scanner = new cmDependsC(includes,
!                                includeRegexScan.c_str(),
!                                includeRegexComplain.c_str(),
!                                includeCacheFileName);
        }
  #ifdef CMAKE_BUILD_WITH_CMAKE
      else if(lang == "Fortran")
        {
!       std::vector<std::string> defines;
!       if(const char* c_defines =
!          mf->GetDefinition("CMAKE_TARGET_DEFINITIONS"))
!         {
!         cmSystemTools::ExpandListArgument(c_defines, defines);
!         }
! 
!       scanner = new cmDependsFortran(includes, defines);
        }
      else if(lang == "Java")
--- 1479,1489 ----
      if(lang == "C" || lang == "CXX" || lang == "RC")
        {
        // TODO: Handle RC (resource files) dependencies correctly.
!       scanner = new cmDependsC(this, targetDir, lang.c_str());
        }
  #ifdef CMAKE_BUILD_WITH_CMAKE
      else if(lang == "Fortran")
        {
!       scanner = new cmDependsFortran(this);
        }
      else if(lang == "Java")
***************
*** 1573,1598 ****
    cmSystemTools::ExpandListArgument(pairs_string, pairs, true);
    for(std::vector<std::string>::const_iterator i = pairs.begin();
!       i != pairs.end(); ++i)
      {
!     const std::string& depender = *i;
!     if(++i != pairs.end())
!       {
!       const std::string& dependee = *i;
  
!       // If the depender is missing then delete the dependee to make
!       // sure both will be regenerated.
!       if(cmSystemTools::FileExists(dependee.c_str()) &&
!          !cmSystemTools::FileExists(depender.c_str()))
          {
!         if(verbose)
!           {
!           cmOStringStream msg;
!           msg << "Deleting primary custom command output \"" << dependee
!               << "\" because another output \""
!               << depender << "\" does not exist." << std::endl;
!           cmSystemTools::Stdout(msg.str().c_str());
!           }
!         cmSystemTools::RemoveFile(dependee.c_str());
          }
        }
      }
--- 1526,1548 ----
    cmSystemTools::ExpandListArgument(pairs_string, pairs, true);
    for(std::vector<std::string>::const_iterator i = pairs.begin();
!       i != pairs.end() && (i+1) != pairs.end();)
      {
!     const std::string& depender = *i++;
!     const std::string& dependee = *i++;
  
!     // If the depender is missing then delete the dependee to make
!     // sure both will be regenerated.
!     if(cmSystemTools::FileExists(dependee.c_str()) &&
!        !cmSystemTools::FileExists(depender.c_str()))
!       {
!       if(verbose)
          {
!         cmOStringStream msg;
!         msg << "Deleting primary custom command output \"" << dependee
!             << "\" because another output \""
!             << depender << "\" does not exist." << std::endl;
!         cmSystemTools::Stdout(msg.str().c_str());
          }
+       cmSystemTools::RemoveFile(dependee.c_str());
        }
      }
***************
*** 1926,1929 ****
--- 1876,1905 ----
        << "  )\n";
      }
+ 
+   // Store include transform rule properties.  Write the directory
+   // rules first because they may be overridden by later target rules.
+   std::vector<std::string> transformRules;
+   if(const char* xform =
+      this->Makefile->GetProperty("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM"))
+     {
+     cmSystemTools::ExpandListArgument(xform, transformRules);
+     }
+   if(const char* xform =
+      target.GetProperty("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM"))
+     {
+     cmSystemTools::ExpandListArgument(xform, transformRules);
+     }
+   if(!transformRules.empty())
+     {
+     cmakefileStream
+       << "SET(CMAKE_INCLUDE_TRANSFORMS\n";
+     for(std::vector<std::string>::const_iterator tri = transformRules.begin();
+         tri != transformRules.end(); ++tri)
+       {
+       cmakefileStream << "  " << this->EscapeForCMake(tri->c_str()) << "\n";
+       }
+     cmakefileStream
+       << "  )\n";
+     }
  }
  



More information about the Cmake-commits mailing list