[cmake-commits] hoffman committed CMakeLists.txt 1.289.2.3 1.289.2.4 cmAddCustomCommandCommand.cxx 1.31 1.31.2.1 cmAddCustomCommandCommand.h 1.22.2.1 1.22.2.2 cmAddCustomTargetCommand.cxx 1.21 1.21.2.1 cmAddCustomTargetCommand.h 1.15.2.1 1.15.2.2 cmAddExecutableCommand.cxx 1.25.2.1 1.25.2.2 cmAddExecutableCommand.h 1.14 1.14.2.1 cmAddLibraryCommand.cxx 1.24 1.24.2.1 cmAddLibraryCommand.h 1.15 1.15.2.1 cmAddSubDirectoryCommand.cxx 1.4.2.3 1.4.2.4 cmAddTestCommand.h 1.13 1.13.2.1 cmBuildNameCommand.h 1.12 1.12.2.1 cmCPluginAPI.cxx 1.29 1.29.2.1 cmCommand.h 1.23 1.23.2.1 cmCommandArgumentLexer.cxx 1.4.2.1 1.4.2.2 cmCommandArgumentLexer.h 1.2 1.2.2.1 cmCommandArgumentLexer.in.l 1.5 1.5.6.1 cmCommandArgumentParser.cxx 1.5.2.1 1.5.2.2 cmCommandArgumentParser.y 1.6 1.6.2.1 cmCommandArgumentParserHelper.cxx 1.12.2.3 1.12.2.4 cmCommandArgumentParserHelper.h 1.8 1.8.2.1 cmCommands.cxx 1.103.2.1 1.103.2.2 cmCustomCommand.cxx 1.17 1.17.2.1 cmCustomCommand.h 1.17 1.17.2.1 cmDependsC.cxx 1.21.2.3 1.21.2.4 cmDependsC.h 1.17 1.17.2.1 cmDependsFortranLexer.cxx 1.5 1.5.2.1 cmDependsFortranLexer.in.l 1.5 1.5.4.1 cmDependsFortranParser.cxx 1.4.6.1 1.4.6.2 cmDependsFortranParser.y 1.10 1.10.6.1 cmDependsJavaLexer.cxx 1.7 1.7.2.1 cmDependsJavaLexer.in.l 1.7 1.7.6.1 cmDependsJavaParser.cxx 1.4.6.1 1.4.6.2 cmDependsJavaParser.y 1.4 1.4.6.1 cmDocumentation.cxx 1.31.2.1 1.31.2.2 cmExecProgramCommand.h 1.17 1.17.2.1 cmExprLexer.cxx 1.2.2.1 1.2.2.2 cmExprLexer.in.l 1.1 1.1.4.1 cmExprParser.cxx 1.2.4.2 1.2.4.3 cmExprParser.y 1.2 1.2.4.1 cmFileCommand.cxx 1.56.2.4 1.56.2.5 cmGetTargetPropertyCommand.h 1.9 1.9.2.1 cmGlobalBorlandMakefileGenerator.cxx 1.20.2.3 1.20.2.4 cmGlobalGenerator.cxx 1.137.2.6 1.137.2.7 cmGlobalGenerator.h 1.58.2.3 1.58.2.4 cmGlobalKdevelopGenerator.cxx 1.10.2.4 1.10.2.5 cmGlobalMSYSMakefileGenerator.cxx 1.7.2.3 1.7.2.4 cmGlobalMinGWMakefileGenerator.cxx 1.4.2.3 1.4.2.4 cmGlobalNMakeMakefileGenerator.cxx 1.19.2.3 1.19.2.4 cmGlobalUnixMakefileGenerator3.cxx 1.56.2.8 1.56.2.9 cmGlobalUnixMakefileGenerator3.h 1.27.2.4 1.27.2.5 cmGlobalVisualStudio6Generator.cxx 1.58.2.3 1.58.2.4 cmGlobalVisualStudio71Generator.cxx 1.30.2.2 1.30.2.3 cmGlobalVisualStudio71Generator.h 1.12.2.2 1.12.2.3 cmGlobalVisualStudio7Generator.cxx 1.70.2.4 1.70.2.5 cmGlobalVisualStudio7Generator.h 1.34.2.3 1.34.2.4 cmGlobalVisualStudio8Generator.cxx 1.10.2.2 1.10.2.3 cmGlobalVisualStudio8Generator.h 1.4.2.2 1.4.2.3 cmGlobalWatcomWMakeGenerator.cxx 1.5.2.2 1.5.2.3 cmGlobalXCodeGenerator.cxx 1.111.2.4 1.111.2.5 cmIfCommand.cxx 1.62.2.2 1.62.2.3 cmIfCommand.h 1.32.2.2 1.32.2.3 cmIncludeDirectoryCommand.cxx 1.18.2.2 1.18.2.3 cmIncludeDirectoryCommand.h 1.12 1.12.2.1 cmIncludeExternalMSProjectCommand.cxx 1.13.2.2 1.13.2.3 cmInstallCommand.cxx 1.10.2.1 1.10.2.2 cmInstallCommand.h 1.9.2.2 1.9.2.3 cmInstallFilesCommand.cxx 1.20.2.1 1.20.2.2 cmInstallFilesCommand.h 1.16 1.16.2.1 cmInstallFilesGenerator.cxx 1.3.2.1 1.3.2.2 cmInstallFilesGenerator.h 1.3.2.1 1.3.2.2 cmInstallGenerator.cxx 1.6.2.2 1.6.2.3 cmInstallGenerator.h 1.4.2.2 1.4.2.3 cmInstallProgramsCommand.cxx 1.13.2.1 1.13.2.2 cmInstallProgramsCommand.h 1.13 1.13.2.1 cmInstallTargetGenerator.cxx 1.12.2.3 1.12.2.4 cmInstallTargetGenerator.h 1.5.2.2 1.5.2.3 cmInstallTargetsCommand.cxx 1.12.2.1 1.12.2.2 cmInstallTargetsCommand.h 1.11 1.11.2.1 cmLinkLibrariesCommand.h 1.15 1.15.6.1 cmListCommand.cxx 1.4.2.4 1.4.2.5 cmListCommand.h 1.2.2.3 1.2.2.4 cmListFileCache.cxx 1.27.2.1 1.27.2.2 cmListFileLexer.c 1.12 1.12.4.1 cmListFileLexer.in.l 1.12 1.12.4.1 cmLoadCommandCommand.cxx 1.25 1.25.2.1 cmLocalGenerator.cxx 1.132.2.6 1.132.2.7 cmLocalGenerator.h 1.56.2.3 1.56.2.4 cmLocalUnixMakefileGenerator3.cxx 1.128.2.7 1.128.2.8 cmLocalUnixMakefileGenerator3.h 1.45.2.2 1.45.2.3 cmLocalVisualStudio6Generator.cxx 1.100.2.3 1.100.2.4 cmLocalVisualStudio7Generator.cxx 1.125.2.7 1.125.2.8 cmLocalVisualStudio7Generator.h 1.22.2.2 1.22.2.3 cmLocalVisualStudioGenerator.cxx 1.2.2.1 1.2.2.2 cmLocalVisualStudioGenerator.h 1.1.2.1 1.1.2.2 cmMacroCommand.cxx 1.25.2.2 1.25.2.3 cmMakeDirectoryCommand.h 1.8 1.8.8.1 cmMakefile.cxx 1.335.2.6 1.335.2.7 cmMakefile.h 1.186.2.4 1.186.2.5 cmMakefileExecutableTargetGenerator.cxx 1.12.2.5 1.12.2.6 cmMakefileExecutableTargetGenerator.h 1.2 1.2.2.1 cmMakefileLibraryTargetGenerator.cxx 1.14.2.3 1.14.2.4 cmMakefileLibraryTargetGenerator.h 1.2 1.2.2.1 cmMakefileTargetGenerator.cxx 1.16.2.6 1.16.2.7 cmMakefileTargetGenerator.h 1.6.2.2 1.6.2.3 cmMessageCommand.cxx 1.18.2.1 1.18.2.2 cmOrderLinkDirectories.cxx 1.29.2.1 1.29.2.2 cmOrderLinkDirectories.h 1.17.2.1 1.17.2.2 cmRemoveCommand.h 1.6 1.6.6.1 cmSetCommand.cxx 1.29 1.29.2.1 cmSetSourceFilesPropertiesCommand.h 1.9.2.1 1.9.2.2 cmSetTargetPropertiesCommand.h 1.21.2.3 1.21.2.4 cmStandardIncludes.h 1.62.2.1 1.62.2.2 cmSubdirCommand.h 1.14.2.1 1.14.2.2 cmSubdirDependsCommand.h 1.7 1.7.12.1 cmTarget.cxx 1.96.2.3 1.96.2.4 cmTryCompileCommand.cxx 1.55.2.2 1.55.2.3 cmVTKMakeInstantiatorCommand.h 1.10 1.10.2.1 cmVTKWrapJavaCommand.cxx 1.30.2.1 1.30.2.2 cmVTKWrapJavaCommand.h 1.11 1.11.2.1 cmVTKWrapPythonCommand.h 1.11 1.11.2.1 cmVTKWrapTclCommand.h 1.12 1.12.2.1 cmWin32ProcessExecution.cxx 1.27 1.27.2.1 cmake.cxx 1.247.2.6 1.247.2.7 cmake.h 1.65.2.3 1.65.2.4 cmakemain.cxx 1.50.2.3 1.50.2.4

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Oct 13 10:52:08 EDT 2006


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

Modified Files:
      Tag: CMake-2-4
	CMakeLists.txt cmAddCustomCommandCommand.cxx 
	cmAddCustomCommandCommand.h cmAddCustomTargetCommand.cxx 
	cmAddCustomTargetCommand.h cmAddExecutableCommand.cxx 
	cmAddExecutableCommand.h cmAddLibraryCommand.cxx 
	cmAddLibraryCommand.h cmAddSubDirectoryCommand.cxx 
	cmAddTestCommand.h cmBuildNameCommand.h cmCPluginAPI.cxx 
	cmCommand.h cmCommandArgumentLexer.cxx 
	cmCommandArgumentLexer.h cmCommandArgumentLexer.in.l 
	cmCommandArgumentParser.cxx cmCommandArgumentParser.y 
	cmCommandArgumentParserHelper.cxx 
	cmCommandArgumentParserHelper.h cmCommands.cxx 
	cmCustomCommand.cxx cmCustomCommand.h cmDependsC.cxx 
	cmDependsC.h cmDependsFortranLexer.cxx 
	cmDependsFortranLexer.in.l cmDependsFortranParser.cxx 
	cmDependsFortranParser.y cmDependsJavaLexer.cxx 
	cmDependsJavaLexer.in.l cmDependsJavaParser.cxx 
	cmDependsJavaParser.y cmDocumentation.cxx 
	cmExecProgramCommand.h cmExprLexer.cxx cmExprLexer.in.l 
	cmExprParser.cxx cmExprParser.y cmFileCommand.cxx 
	cmGetTargetPropertyCommand.h 
	cmGlobalBorlandMakefileGenerator.cxx cmGlobalGenerator.cxx 
	cmGlobalGenerator.h cmGlobalKdevelopGenerator.cxx 
	cmGlobalMSYSMakefileGenerator.cxx 
	cmGlobalMinGWMakefileGenerator.cxx 
	cmGlobalNMakeMakefileGenerator.cxx 
	cmGlobalUnixMakefileGenerator3.cxx 
	cmGlobalUnixMakefileGenerator3.h 
	cmGlobalVisualStudio6Generator.cxx 
	cmGlobalVisualStudio71Generator.cxx 
	cmGlobalVisualStudio71Generator.h 
	cmGlobalVisualStudio7Generator.cxx 
	cmGlobalVisualStudio7Generator.h 
	cmGlobalVisualStudio8Generator.cxx 
	cmGlobalVisualStudio8Generator.h 
	cmGlobalWatcomWMakeGenerator.cxx cmGlobalXCodeGenerator.cxx 
	cmIfCommand.cxx cmIfCommand.h cmIncludeDirectoryCommand.cxx 
	cmIncludeDirectoryCommand.h 
	cmIncludeExternalMSProjectCommand.cxx cmInstallCommand.cxx 
	cmInstallCommand.h cmInstallFilesCommand.cxx 
	cmInstallFilesCommand.h cmInstallFilesGenerator.cxx 
	cmInstallFilesGenerator.h cmInstallGenerator.cxx 
	cmInstallGenerator.h cmInstallProgramsCommand.cxx 
	cmInstallProgramsCommand.h cmInstallTargetGenerator.cxx 
	cmInstallTargetGenerator.h cmInstallTargetsCommand.cxx 
	cmInstallTargetsCommand.h cmLinkLibrariesCommand.h 
	cmListCommand.cxx cmListCommand.h cmListFileCache.cxx 
	cmListFileLexer.c cmListFileLexer.in.l 
	cmLoadCommandCommand.cxx cmLocalGenerator.cxx 
	cmLocalGenerator.h cmLocalUnixMakefileGenerator3.cxx 
	cmLocalUnixMakefileGenerator3.h 
	cmLocalVisualStudio6Generator.cxx 
	cmLocalVisualStudio7Generator.cxx 
	cmLocalVisualStudio7Generator.h 
	cmLocalVisualStudioGenerator.cxx 
	cmLocalVisualStudioGenerator.h cmMacroCommand.cxx 
	cmMakeDirectoryCommand.h cmMakefile.cxx cmMakefile.h 
	cmMakefileExecutableTargetGenerator.cxx 
	cmMakefileExecutableTargetGenerator.h 
	cmMakefileLibraryTargetGenerator.cxx 
	cmMakefileLibraryTargetGenerator.h 
	cmMakefileTargetGenerator.cxx cmMakefileTargetGenerator.h 
	cmMessageCommand.cxx cmOrderLinkDirectories.cxx 
	cmOrderLinkDirectories.h cmRemoveCommand.h cmSetCommand.cxx 
	cmSetSourceFilesPropertiesCommand.h 
	cmSetTargetPropertiesCommand.h cmStandardIncludes.h 
	cmSubdirCommand.h cmSubdirDependsCommand.h cmTarget.cxx 
	cmTryCompileCommand.cxx cmVTKMakeInstantiatorCommand.h 
	cmVTKWrapJavaCommand.cxx cmVTKWrapJavaCommand.h 
	cmVTKWrapPythonCommand.h cmVTKWrapTclCommand.h 
	cmWin32ProcessExecution.cxx cmake.cxx cmake.h cmakemain.cxx 
Log Message:
ENH: merge changes from the main tree to the 2.4 branch


Index: cmBuildNameCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmBuildNameCommand.h,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -u -d -r1.12 -r1.12.2.1
--- cmBuildNameCommand.h	10 Mar 2006 18:06:25 -0000	1.12
+++ cmBuildNameCommand.h	13 Oct 2006 14:52:02 -0000	1.12.2.1
@@ -72,6 +72,12 @@
       "CMAKE_SYSTEM and CMAKE_CXX_COMPILER variables.";
     }
 
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmBuildNameCommand, cmCommand);
 };
 

Index: cmMakefileExecutableTargetGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileExecutableTargetGenerator.h,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -d -r1.2 -r1.2.2.1
--- cmMakefileExecutableTargetGenerator.h	16 Feb 2006 20:19:00 -0000	1.2
+++ cmMakefileExecutableTargetGenerator.h	13 Oct 2006 14:52:06 -0000	1.2.2.1
@@ -22,6 +22,8 @@
 class cmMakefileExecutableTargetGenerator: public cmMakefileTargetGenerator
 {
 public:
+  cmMakefileExecutableTargetGenerator();
+
   /* the main entry point for this class. Writes the Makefiles associated
      with this target */
   virtual void WriteRuleFiles();

Index: cmIfCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.cxx,v
retrieving revision 1.62.2.2
retrieving revision 1.62.2.3
diff -u -d -r1.62.2.2 -r1.62.2.3
--- cmIfCommand.cxx	30 Jun 2006 17:48:43 -0000	1.62.2.2
+++ cmIfCommand.cxx	13 Oct 2006 14:52:02 -0000	1.62.2.3
@@ -30,13 +30,56 @@
   
   // watch for our ELSE or ENDIF
   if (!cmSystemTools::Strucmp(lff.Name.c_str(),"else") || 
+      !cmSystemTools::Strucmp(lff.Name.c_str(),"elseif") ||
       !cmSystemTools::Strucmp(lff.Name.c_str(),"endif"))
       {
       // if it was an else statement then we should change state
       // and block this Else Command
     if (!cmSystemTools::Strucmp(lff.Name.c_str(),"else"))
         {
-        this->IsBlocking = !this->IsBlocking;
+      this->IsBlocking = this->HasRun;
+      return true;
+      }
+    // if it was an elseif statement then we should check state
+    // and possibly block this Else Command
+    if (!cmSystemTools::Strucmp(lff.Name.c_str(),"elseif"))
+      {
+      if (!this->HasRun)
+        {
+        char* errorString = 0;
+        
+        std::vector<std::string> expandedArguments;
+        mf.ExpandArguments(lff.Arguments, expandedArguments);
+        bool isTrue = 
+          cmIfCommand::IsTrue(expandedArguments,&errorString,&mf);
+        
+        if (errorString)
+          {
+          std::string err = "had incorrect arguments: ";
+          unsigned int i;
+          for(i =0; i < lff.Arguments.size(); ++i)
+            {
+            err += (lff.Arguments[i].Quoted?"\"":"");
+            err += lff.Arguments[i].Value;
+            err += (lff.Arguments[i].Quoted?"\"":"");
+            err += " ";
+            }
+          err += "(";
+          err += errorString;
+          err += ").";
+          cmSystemTools::Error(err.c_str());
+          delete [] errorString;
+          return false;
+          }
+        
+        if (isTrue)
+          {
+          this->IsBlocking = false;
+          this->HasRun = true;
+          return true;
+          }
+        }
+      this->IsBlocking = true;
         return true;
         }
       // otherwise it must be an ENDIF statement, in that case remove the
@@ -113,6 +156,10 @@
   cmIfFunctionBlocker *f = new cmIfFunctionBlocker();
   // if is isn't true block the commands
   f->IsBlocking = !isTrue;
+  if (isTrue)
+    {
+    f->HasRun = true;
+    }
   f->Args = args;
   this->Makefile->AddFunctionBlocker(f);
   
@@ -226,7 +273,7 @@
         IncrementArguments(newArgs,argP1,argP2);
         reducible = 1;
         }
-      // does a file exist
+      // does a directory with this name exist
       if (*arg == "IS_DIRECTORY" && argP1  != newArgs.end())
         {
         if(cmSystemTools::FileIsDirectory((argP1)->c_str()))
@@ -242,6 +289,29 @@
         IncrementArguments(newArgs,argP1,argP2);
         reducible = 1;
         }
+      // is file A newer than file B
+      if (*arg == "FILE_IS_NEWER" &&
+          argP1  != newArgs.end() && argP2  != newArgs.end())
+        {
+        int fileIsNewer=0;
+        bool success=cmSystemTools::FileTimeCompare((argP1)->c_str(),
+                                                    (argP2)->c_str(),
+                                                    &fileIsNewer);
+        if(success==false || fileIsNewer==1 || fileIsNewer==0)
+          {
+          *arg = "1";
+          }
+        else 
+          {
+          *arg = "0";
+          }
+
+        newArgs.erase(argP2);
+        newArgs.erase(argP1);
+        argP1 = arg;
+        IncrementArguments(newArgs,argP1,argP2);
+        reducible = 1;
+        }
       // does a command exist
       if (*arg == "COMMAND" && argP1  != newArgs.end())
         {

Index: cmake.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.h,v
retrieving revision 1.65.2.3
retrieving revision 1.65.2.4
diff -u -d -r1.65.2.3 -r1.65.2.4
--- cmake.h	30 Jun 2006 17:48:46 -0000	1.65.2.3
+++ cmake.h	13 Oct 2006 14:52:06 -0000	1.65.2.4
@@ -281,6 +281,9 @@
   const char* GetCPackCommand();
   const char* GetCMakeCommand() { return this->CMakeCommand.c_str(); }
 
+  // Do we want debug output during the cmake run.
+  bool GetDebugOutput() { return this->DebugOutput; }
+  void DebugOutputOn() { this->DebugOutput = true;}
 protected:
   typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)();
   typedef std::map<cmStdString,
@@ -333,6 +336,7 @@
   bool Verbose;
   bool InTryCompile;
   bool ScriptMode;
+  bool DebugOutput;
   std::string CMakeCommand;
   std::string CXXEnvironment;
   std::string CCEnvironment;

Index: cmOrderLinkDirectories.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmOrderLinkDirectories.h,v
retrieving revision 1.17.2.1
retrieving revision 1.17.2.2
diff -u -d -r1.17.2.1 -r1.17.2.2
--- cmOrderLinkDirectories.h	14 May 2006 19:22:43 -0000	1.17.2.1
+++ cmOrderLinkDirectories.h	13 Oct 2006 14:52:06 -0000	1.17.2.2
@@ -66,19 +66,28 @@
   // should be set from CMAKE_STATIC_LIBRARY_SUFFIX,
   // CMAKE_SHARED_LIBRARY_SUFFIX
   // CMAKE_LINK_LIBRARY_SUFFIX
-  void AddLinkExtension(const char* e)
+  enum LinkType { LinkUnknown, LinkStatic, LinkShared };
+  void AddLinkExtension(const char* e, LinkType type = LinkUnknown)
     {
     if(e && *e)
       {
+      if(type == LinkStatic)
+        {
+        this->StaticLinkExtensions.push_back(e);
+        }
+      if(type == LinkShared)
+        {
+        this->SharedLinkExtensions.push_back(e);
+        }
       this->LinkExtensions.push_back(e);
       }
     }
   // should be set from CMAKE_STATIC_LIBRARY_PREFIX
-  void SetLinkPrefix(const char* s)
+  void AddLinkPrefix(const char* s)
     {
     if(s)
       {
-      this->LinkPrefix = s;
+      this->LinkPrefixes.insert(s);
       }
     }
   // Return any warnings if the exist
@@ -86,6 +95,11 @@
   // return a list of all full path libraries
   void GetFullPathLibraries(std::vector<cmStdString>& libs);
 
+  // Provide flags for switching library link type.
+  void SetLinkTypeInformation(LinkType start_link_type,
+                              const char* static_link_type_flag,
+                              const char* shared_link_type_flag);
+
   // structure to hold a full path library link item
   struct Library
   {
@@ -101,6 +115,7 @@
   
 private:
   void CreateRegularExpressions();
+  std::string CreateExtensionRegex(std::vector<cmStdString> const& exts);
   void DetermineLibraryPathOrder(std::vector<cmStdString>& searchPaths,
                                  std::vector<cmStdString>& libs,
                                  std::vector<cmStdString>& sortedPaths);
@@ -145,19 +160,31 @@
   // This is the set of -L paths unsorted, but unique
   std::set<cmStdString> LinkPathSet;
   // the names of link extensions
+  std::vector<cmStdString> StaticLinkExtensions;
+  std::vector<cmStdString> SharedLinkExtensions;
   std::vector<cmStdString> LinkExtensions;
   // the names of link prefixes
-  cmStdString LinkPrefix;
+  std::set<cmStdString> LinkPrefixes;
   // set of directories that can not be put in the correct order
   std::set<cmStdString> ImpossibleDirectories;
   // Name of target
   cmStdString TargetName;
   // Subdirectory used for this configuration if any.
   cmStdString ConfigSubdir;
+
+  // Link type adjustment.
+  LinkType StartLinkType;
+  LinkType CurrentLinkType;
+  cmStdString StaticLinkTypeFlag;
+  cmStdString SharedLinkTypeFlag;
+  bool LinkTypeEnabled;
+  void SetCurrentLinkType(LinkType lt);
+
   // library regular expressions
   cmsys::RegularExpression RemoveLibraryExtension;
-  cmsys::RegularExpression ExtractBaseLibraryName;
-  cmsys::RegularExpression ExtractBaseLibraryNameNoPrefix;
+  cmsys::RegularExpression ExtractStaticLibraryName;
+  cmsys::RegularExpression ExtractSharedLibraryName;
+  cmsys::RegularExpression ExtractAnyLibraryName;
   cmsys::RegularExpression SplitFramework;
   bool Debug;
 };

Index: cmLocalVisualStudioGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudioGenerator.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- cmLocalVisualStudioGenerator.h	24 Jul 2006 15:19:35 -0000	1.1.2.1
+++ cmLocalVisualStudioGenerator.h	13 Oct 2006 14:52:05 -0000	1.1.2.2
@@ -35,8 +35,17 @@
   virtual ~cmLocalVisualStudioGenerator();
 
 protected:
+
+  /** Construct a script from the given list of command lines.  */
+  std::string ConstructScript(const cmCustomCommandLines& commandLines,
+                              const char* workingDirectory,
+                              bool escapeOldStyle,
+                              bool escapeAllowMakeVars,
+                              const char* newline = "\n");
+
   // Safe object file name generation.
   void ComputeObjectNameRequirements(std::vector<cmSourceGroup> const&);
+  bool SourceFileCompiles(const cmSourceFile* sf);
   std::set<const cmSourceFile*> NeedObjectName;
 };
 

Index: cmDocumentation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentation.cxx,v
retrieving revision 1.31.2.1
retrieving revision 1.31.2.2
diff -u -d -r1.31.2.1 -r1.31.2.2
--- cmDocumentation.cxx	11 May 2006 02:15:09 -0000	1.31.2.1
+++ cmDocumentation.cxx	13 Oct 2006 14:52:02 -0000	1.31.2.2
@@ -69,12 +69,33 @@
 };
 
 //----------------------------------------------------------------------------
-const cmDocumentationEntry cmDocumentationMailingList[] =
+static const cmDocumentationEntry cmDocumentationStandardSeeAlso[] =
 {
   {0,
-   "For help and discussion about using cmake, a mailing list is provided "
-   "at cmake at www.cmake.org.  Please first read the full documentation at "
-   "http://www.cmake.org before posting questions to the list.", 0},
+   "The following resources are available to get help using CMake:", 0},
+  {"Home Page",
+   "http://www.cmake.org",
+   "The primary starting point for learning about CMake."},
+  {"Frequently Asked Questions",
+   "http://www.cmake.org/Wiki/CMake_FAQ",
+   "A Wiki is provided containing answers to frequently asked questions. "},
+  {"Online Documentation",
+   "http://www.cmake.org/HTML/Documentation.html",
+   "Links to available documentation may be found on this web page."},
+  {"Mailing List",
+   "http://www.cmake.org/HTML/MailingLists.html",
+   "For help and discussion about using cmake, a mailing list is provided at "
+   "cmake at cmake.org. "
+   "The list is member-post-only but one may sign up on the CMake web page. "
+   "Please first read the full documentation at "
+   "http://www.cmake.org before posting questions to the list."},
+  {0,
+   "Summary of helpful links:\n"
+   "  Home: http://www.cmake.org\n"
+   "  Docs: http://www.cmake.org/HTML/Documentation.html\n"
+   "  Mail: http://www.cmake.org/HTML/MailingLists.html\n"
+   "  FAQ:  http://www.cmake.org/Wiki/CMake_FAQ\n"
+   , 0},
   {0,0,0}
 };
 
@@ -545,6 +566,7 @@
 //----------------------------------------------------------------------------
 void cmDocumentation::SetSeeAlsoList(const cmDocumentationEntry* also)
 {
+  this->SeeAlsoSection.clear();
   this->SeeAlsoString = ".B ";
   for(const cmDocumentationEntry* i = also; i->brief; ++i)
     {
@@ -554,6 +576,11 @@
   cmDocumentationEntry e = {0, 0, 0};
   e.brief = this->SeeAlsoString.c_str();
   this->SeeAlsoSection.push_back(e);
+  for(const cmDocumentationEntry* i = cmDocumentationStandardSeeAlso;
+      i->brief; ++i)
+    {
+    this->SeeAlsoSection.push_back(*i);
+    }
   e.brief = 0;
   this->SeeAlsoSection.push_back(e);  
 }
@@ -840,13 +867,17 @@
 //----------------------------------------------------------------------------
 void cmDocumentation::PrintPreformattedMan(std::ostream& os, const char* text)
 {
-  os << text << "\n";
+  std::string man_text = text;
+  cmSystemTools::ReplaceString(man_text, "\\", "\\\\");
+  os << man_text << "\n";
 }
 
 //----------------------------------------------------------------------------
 void cmDocumentation::PrintParagraphMan(std::ostream& os, const char* text)
 {
-  os << text << "\n\n";
+  std::string man_text = text;
+  cmSystemTools::ReplaceString(man_text, "\\", "\\\\");
+  os << man_text << "\n\n";
 }
 
 //----------------------------------------------------------------------------
@@ -1166,7 +1197,7 @@
     this->AddSection("Standard CMake Modules", &this->ModulesSection[0]);
     }
   this->AddSection("Copyright", cmDocumentationCopyright);
-  this->AddSection("Mailing List", cmDocumentationMailingList);
+  this->AddSection("See Also", cmDocumentationStandardSeeAlso);
 }
 
 //----------------------------------------------------------------------------
@@ -1204,7 +1235,6 @@
     }
 
   this->AddSection("COPYRIGHT", cmDocumentationCopyright);
-  this->AddSection("MAILING LIST", cmDocumentationMailingList);  
   if(!this->SeeAlsoSection.empty())
     {
     this->AddSection("SEE ALSO", &this->SeeAlsoSection[0]);

Index: cmListFileLexer.in.l
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmListFileLexer.in.l,v
retrieving revision 1.12
retrieving revision 1.12.4.1
diff -u -d -r1.12 -r1.12.4.1
--- cmListFileLexer.in.l	19 Sep 2005 21:20:48 -0000	1.12
+++ cmListFileLexer.in.l	13 Oct 2006 14:52:03 -0000	1.12.4.1
@@ -27,35 +27,18 @@
   - remove TABs
   - remove the yyunput function
   - add a statement "(void)yyscanner;" to the top of these methods:
-      yy_fatal_error, yyalloc, yyrealloc, yyfree
+      yy_fatal_error, cmListFileLexer_yyalloc, cmListFileLexer_yyrealloc, cmListFileLexer_yyfree
   - remove all YY_BREAK lines occurring right after return statements
+  - remove the isatty forward declaration
 
 */
 
-/* Disable features we do not need. */
-#define YY_NEVER_INTERACTIVE 1
-#define YY_NO_INPUT 1
-#define YY_NO_UNPUT 1
-#define YY_NO_UNISTD_H 1
-#define ECHO
+#include "cmStandardLexer.h"
 
-/* Setup the proper yylex declaration.  */
+/* Setup the proper cmListFileLexer_yylex declaration.  */
 #define YY_EXTRA_TYPE cmListFileLexer*
 #define YY_DECL int cmListFileLexer_yylex (yyscan_t yyscanner, cmListFileLexer* lexer)
 
-/* Disable some warnings.  */
-#if defined(_MSC_VER)
-# pragma warning ( disable : 4127 )
-# pragma warning ( disable : 4131 )
-# pragma warning ( disable : 4244 )
-# pragma warning ( disable : 4251 )
-# pragma warning ( disable : 4267 )
-# pragma warning ( disable : 4305 )
-# pragma warning ( disable : 4309 )
-# pragma warning ( disable : 4706 )
-# pragma warning ( disable : 4786 )
-#endif
-
 #include "cmListFileLexer.h"
 
 /*--------------------------------------------------------------------------*/

Index: cmDependsFortranParser.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortranParser.cxx,v
retrieving revision 1.4.6.1
retrieving revision 1.4.6.2
diff -u -d -r1.4.6.1 -r1.4.6.2
--- cmDependsFortranParser.cxx	11 May 2006 02:15:09 -0000	1.4.6.1
+++ cmDependsFortranParser.cxx	13 Oct 2006 14:52:02 -0000	1.4.6.2
@@ -191,6 +191,9 @@
 /* Disable some warnings in the generated code.  */
 #ifdef __BORLANDC__
 # pragma warn -8004 /* Variable assigned a value that is not used.  */
+# pragma warn -8008 /* condition always returns true */
+# pragma warn -8060 /* possibly incorrect assignment */
+# pragma warn -8066 /* unreachable code */
 #endif
 #ifdef _MSC_VER
 # pragma warning (disable: 4102) /* Unused goto label.  */

Index: cmExprParser.y
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExprParser.y,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -u -d -r1.2 -r1.2.4.1
--- cmExprParser.y	17 Oct 2005 20:53:11 -0000	1.2
+++ cmExprParser.y	13 Oct 2006 14:52:02 -0000	1.2.4.1
@@ -58,6 +58,9 @@
 /* Disable some warnings in the generated code.  */
 #ifdef __BORLANDC__
 # pragma warn -8004 /* Variable assigned a value that is not used.  */
+# pragma warn -8008 /* condition always returns true */
+# pragma warn -8060 /* possibly incorrect assignment */
+# pragma warn -8066 /* unreachable code */
 #endif
 #ifdef _MSC_VER
 # pragma warning (disable: 4102) /* Unused goto label.  */

Index: cmAddLibraryCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddLibraryCommand.h,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -u -d -r1.15 -r1.15.2.1
--- cmAddLibraryCommand.h	15 Mar 2006 16:01:58 -0000	1.15
+++ cmAddLibraryCommand.h	13 Oct 2006 14:52:02 -0000	1.15.2.1
@@ -61,7 +61,7 @@
   virtual const char* GetFullDocumentation()
     {
     return
-      "  ADD_LIBRARY(libname [SHARED | STATIC | MODULE]\n"
+      "  ADD_LIBRARY(libname [SHARED | STATIC | MODULE] [EXCLUDE_FROM_ALL]\n"
       "              source1 source2 ... sourceN)\n"
       "Adds a library target.  SHARED, STATIC or MODULE keywords are used "
       "to set the library type.  If the keyword MODULE appears, the library "
@@ -69,7 +69,10 @@
       "without dyld, MODULE is treated like SHARED.  If no keywords appear "
       " as the second argument, the type defaults to the current value of "
       "BUILD_SHARED_LIBS.  If this variable is not set, the type defaults "
-      "to STATIC.";
+      "to STATIC.\n"
+      "If EXCLUDE_FROM_ALL is given the target will not be built by default. "
+      "It will be built only if the user explicitly builds the target or "
+      "another target that requires the target depends on it.";
     }
   
   cmTypeMacro(cmAddLibraryCommand, cmCommand);

Index: cmLocalVisualStudioGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudioGenerator.cxx,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -d -r1.2.2.1 -r1.2.2.2
--- cmLocalVisualStudioGenerator.cxx	24 Jul 2006 15:19:35 -0000	1.2.2.1
+++ cmLocalVisualStudioGenerator.cxx	13 Oct 2006 14:52:05 -0000	1.2.2.2
@@ -23,6 +23,8 @@
 //----------------------------------------------------------------------------
 cmLocalVisualStudioGenerator::cmLocalVisualStudioGenerator()
 {
+  this->WindowsShell = true;
+  this->WindowsVSIDE = true;
 }
 
 //----------------------------------------------------------------------------
@@ -31,13 +33,32 @@
 }
 
 //----------------------------------------------------------------------------
+bool cmLocalVisualStudioGenerator::SourceFileCompiles(const cmSourceFile* sf)
+{
+  // Identify the language of the source file.
+  if(const char* lang = this->GetSourceFileLanguage(*sf))
+    {
+    // Check whether this source will actually be compiled.
+    return (!sf->GetCustomCommand() &&
+            !sf->GetPropertyAsBool("HEADER_FILE_ONLY") &&
+            !sf->GetPropertyAsBool("EXTERNAL_OBJECT"));
+    }
+  else
+    {
+    // Unknown source file language.  Assume it will not be compiled.
+    return false;
+    }
+}
+
+//----------------------------------------------------------------------------
 void cmLocalVisualStudioGenerator::ComputeObjectNameRequirements
 (std::vector<cmSourceGroup> const& sourceGroups)
 {
   // Clear the current set of requirements.
   this->NeedObjectName.clear();
 
-  // Count the number of object files with each name.
+  // Count the number of object files with each name.  Note that
+  // windows file names are not case sensitive.
   std::map<cmStdString, int> objectNameCounts;
   for(unsigned int i = 0; i < sourceGroups.size(); ++i)
     {
@@ -46,14 +67,13 @@
     for(std::vector<const cmSourceFile*>::const_iterator s = srcs.begin();
         s != srcs.end(); ++s)
       {
-      const cmSourceFile& sf = *(*s);
-      if(!sf.GetCustomCommand() &&
-         !sf.GetPropertyAsBool("HEADER_FILE_ONLY") &&
-         !sf.GetPropertyAsBool("EXTERNAL_OBJECT"))
+      const cmSourceFile* sf = *s;
+      if(this->SourceFileCompiles(sf))
         {
         std::string objectName =
+          cmSystemTools::LowerCase(
           cmSystemTools::GetFilenameWithoutLastExtension(
-            sf.GetFullPath().c_str());
+              sf->GetFullPath().c_str()));
         objectName += ".obj";
         objectNameCounts[objectName] += 1;
         }
@@ -70,13 +90,12 @@
         s != srcs.end(); ++s)
       {
       const cmSourceFile* sf = *s;
-      if(!sf->GetCustomCommand() &&
-         !sf->GetPropertyAsBool("HEADER_FILE_ONLY") &&
-         !sf->GetPropertyAsBool("EXTERNAL_OBJECT"))
+      if(this->SourceFileCompiles(sf))
         {
         std::string objectName =
+          cmSystemTools::LowerCase(
           cmSystemTools::GetFilenameWithoutLastExtension(
-            sf->GetFullPath().c_str());
+              sf->GetFullPath().c_str()));
         objectName += ".obj";
         if(objectNameCounts[objectName] > 1)
           {
@@ -86,3 +105,63 @@
       }
     }
 }
+
+//----------------------------------------------------------------------------
+std::string
+cmLocalVisualStudioGenerator
+::ConstructScript(const cmCustomCommandLines& commandLines,
+                  const char* workingDirectory,
+                  bool escapeOldStyle,
+                  bool escapeAllowMakeVars,
+                  const char* newline)
+{
+  // Store the script in a string.
+  std::string script;
+  if(workingDirectory)
+    {
+    script += "cd ";
+    script += this->Convert(workingDirectory, START_OUTPUT, SHELL);
+    script += newline;
+    }
+  // for visual studio IDE add extra stuff to the PATH
+  // if CMAKE_MSVCIDE_RUN_PATH is set.
+  if(this->Makefile->GetDefinition("MSVC_IDE"))
+    {
+    const char* extraPath =
+      this->Makefile->GetDefinition("CMAKE_MSVCIDE_RUN_PATH");
+    if(extraPath)
+      {
+      script += "set PATH=";
+      script += extraPath;
+      script += ";%PATH%";
+      script += newline;
+      }
+    }
+  // Write each command on a single line.
+  for(cmCustomCommandLines::const_iterator cl = commandLines.begin();
+      cl != commandLines.end(); ++cl)
+    {
+    // Start with the command name.
+    const cmCustomCommandLine& commandLine = *cl;
+    script += this->Convert(commandLine[0].c_str(),START_OUTPUT,SHELL);
+
+    // Add the arguments.
+    for(unsigned int j=1;j < commandLine.size(); ++j)
+      {
+      script += " ";
+      if(escapeOldStyle)
+        {
+        script += this->EscapeForShellOldStyle(commandLine[j].c_str());
+        }
+      else
+        {
+        script += this->EscapeForShell(commandLine[j].c_str(),
+                                       escapeAllowMakeVars);
+        }
+      }
+
+    // End the line.
+    script += newline;
+    }
+  return script;
+}

Index: cmGlobalVisualStudio8Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio8Generator.h,v
retrieving revision 1.4.2.2
retrieving revision 1.4.2.3
diff -u -d -r1.4.2.2 -r1.4.2.3
--- cmGlobalVisualStudio8Generator.h	11 May 2006 20:05:57 -0000	1.4.2.2
+++ cmGlobalVisualStudio8Generator.h	13 Oct 2006 14:52:02 -0000	1.4.2.3
@@ -56,7 +56,8 @@
   virtual void WriteSLNHeader(std::ostream& fout);
   virtual void WriteSolutionConfigurations(std::ostream& fout);
   virtual void WriteProjectConfigurations(std::ostream& fout,
-                                          const char* name, bool in_all);
+                                          const char* name,
+                                          int targetType);
   std::string PlatformName; // Win32 or x64 
 };
 #endif

Index: cmGlobalXCodeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v
retrieving revision 1.111.2.4
retrieving revision 1.111.2.5
diff -u -d -r1.111.2.4 -r1.111.2.5
--- cmGlobalXCodeGenerator.cxx	28 Jul 2006 12:57:57 -0000	1.111.2.4
+++ cmGlobalXCodeGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.111.2.5
@@ -196,7 +196,6 @@
     makeCommand += " ";
     makeCommand += additionalOptions;
     }
-  makeCommand += " OBJROOT=.";
   return makeCommand;
 }
 
@@ -282,10 +281,9 @@
 {
   cmMakefile* mf = root->GetMakefile();
   // Add ALL_BUILD
-  const char* no_output = 0;
   const char* no_working_directory = 0;
   std::vector<std::string> no_depends;
-  mf->AddUtilityCommand("ALL_BUILD", false, no_output, no_depends,
+  mf->AddUtilityCommand("ALL_BUILD", false, no_depends,
                         no_working_directory,
                         "echo", "Build all projects");
   cmTarget* allbuild = mf->FindTarget("ALL_BUILD");
@@ -308,7 +306,7 @@
     }
   cmCustomCommandLines commandLines;
   commandLines.push_back(makecommand);
-  mf->AddUtilityCommand("XCODE_DEPEND_HELPER", false, no_output,
+  mf->AddUtilityCommand("XCODE_DEPEND_HELPER", false,
                         no_working_directory,
                         no_depends,
                         commandLines);
@@ -956,16 +954,20 @@
       }
     }
   makefileStream << "\n\n";
-  
   for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
       i != commands.end(); ++i)
     {
     cmCustomCommand const& cc = *i; 
     if(!cc.GetCommandLines().empty())
       {
-      
-      makefileStream << "\n#" << "Custom command rule: " << 
-        cc.GetComment() << "\n";
+      bool escapeOldStyle = cc.GetEscapeOldStyle();
+      bool escapeAllowMakeVars = cc.GetEscapeAllowMakeVars();
+      makefileStream << "\n#" << "Custom command rule: ";
+      if(cc.GetComment())
+        {
+        makefileStream << cc.GetComment();
+        }
+      makefileStream << "\n";
       const std::vector<std::string>& outputs = cc.GetOutputs();
       if(!outputs.empty())
         {
@@ -1038,7 +1040,17 @@
         for(unsigned int j=1; j < commandLine.size(); ++j)
           {
           cmd += " ";
-          cmd += cmSystemTools::EscapeSpaces(commandLine[j].c_str());
+          if(escapeOldStyle)
+            {
+            cmd += (this->CurrentLocalGenerator
+                    ->EscapeForShellOldStyle(commandLine[j].c_str()));
+            }
+          else
+            {
+            cmd += (this->CurrentLocalGenerator->
+                    EscapeForShell(commandLine[j].c_str(),
+                                   escapeAllowMakeVars));
+            }
           }
         makefileStream << "\t" << cmd.c_str() << "\n";
         }
@@ -1420,18 +1432,8 @@
   std::string install_name_dir;
   if(target.GetType() == cmTarget::SHARED_LIBRARY)
     {
-    // Select whether to generate an install_name directory for the
-    // install tree or the build tree.
-    if(target.GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH"))
-      {
-      install_name_dir =
-        target.GetInstallNameDirForInstallTree(configName);
-      }
-    else
-      {
-      install_name_dir =
-        target.GetInstallNameDirForBuildTree(configName);
-      }
+    // Get the install_name directory for the build tree.
+    install_name_dir = target.GetInstallNameDirForBuildTree(configName);
 
     if(install_name_dir.empty())
       {

Index: cmInstallCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallCommand.cxx,v
retrieving revision 1.10.2.1
retrieving revision 1.10.2.2
diff -u -d -r1.10.2.1 -r1.10.2.2
--- cmInstallCommand.cxx	7 May 2006 14:55:38 -0000	1.10.2.1
+++ cmInstallCommand.cxx	13 Oct 2006 14:52:02 -0000	1.10.2.2
@@ -16,10 +16,13 @@
 =========================================================================*/
 #include "cmInstallCommand.h"
 
+#include "cmInstallDirectoryGenerator.h"
 #include "cmInstallFilesGenerator.h"
 #include "cmInstallScriptGenerator.h"
 #include "cmInstallTargetGenerator.h"
 
+#include <cmsys/Glob.hxx>
+
 // cmInstallCommand
 bool cmInstallCommand::InitialPass(std::vector<std::string> const& args)
 {
@@ -30,6 +33,10 @@
     return true;
     }
 
+  // Enable the install target.
+  this->Makefile->GetLocalGenerator()
+    ->GetGlobalGenerator()->EnableInstallTarget();
+
   // Switch among the command modes.
   if(args[0] == "SCRIPT")
     {
@@ -51,6 +58,10 @@
     {
     return this->HandleFilesMode(args);
     }
+  else if(args[0] == "DIRECTORY")
+    {
+    return this->HandleDirectoryMode(args);
+    }
 
   // Unknown mode.
   cmStdString e = "called with unknown mode ";
@@ -140,6 +151,9 @@
   std::vector<std::string> archive_configurations;
   std::vector<std::string> library_configurations;
   std::vector<std::string> runtime_configurations;
+  bool archive_optional = false;
+  bool library_optional = false;
+  bool runtime_optional = false;
   for(unsigned int i=1; i < args.size(); ++i)
     {
     if(args[i] == "DESTINATION")
@@ -214,6 +228,27 @@
       library_settings = false;
       runtime_settings = true;
       }
+    else if(args[i] == "OPTIONAL")
+      {
+      // Set the optional property.
+      doing_targets = false;
+      doing_destination = false;
+      doing_permissions = false;
+      doing_component = false;
+      doing_configurations = false;
+      if(archive_settings)
+        {
+        archive_optional = true;
+        }
+      if(library_settings)
+        {
+        library_optional = true;
+        }
+      if(runtime_settings)
+        {
+        runtime_optional = true;
+        }
+      }
     else if(doing_targets)
       {
       // Lookup this target in the current directory.
@@ -356,6 +391,11 @@
     return false;
     }
 
+  // Check whether this is a DLL platform.
+  bool dll_platform = (this->Makefile->IsOn("WIN32") ||
+                       this->Makefile->IsOn("CYGWIN") ||
+                       this->Makefile->IsOn("MINGW"));
+
   // Compute destination paths.
   std::string archive_dest;
   std::string library_dest;
@@ -378,7 +418,8 @@
         // platforms.  All windows platforms are DLL platforms
         // including cygwin.  Currently no other platform is a DLL
         // platform.
-#if defined(_WIN32) || defined(__CYGWIN__)
+        if(dll_platform)
+          {
         // This is a DLL platform.
         if(archive_destination)
           {
@@ -387,27 +428,34 @@
             new cmInstallTargetGenerator(target, archive_dest.c_str(), true,
                                          archive_permissions.c_str(),
                                          archive_configurations,
-                                         archive_component.c_str()));
+                                           archive_component.c_str(),
+                                           archive_optional));
           }
         if(runtime_destination)
           {
           // The DLL uses the RUNTIME properties.
           this->Makefile->AddInstallGenerator(
-            new cmInstallTargetGenerator(target, runtime_dest.c_str(), false,
+              new cmInstallTargetGenerator(target, runtime_dest.c_str(),
+                                           false,
                                          runtime_permissions.c_str(),
                                          runtime_configurations,
-                                         runtime_component.c_str()));
+                                           runtime_component.c_str(),
+                                           runtime_optional));
           }
-#else
+          }
+        else
+          {
         // This is a non-DLL platform.
         if(library_destination)
           {
           // The shared library uses the LIBRARY properties.
           this->Makefile->AddInstallGenerator(
-            new cmInstallTargetGenerator(target, library_dest.c_str(), false,
+              new cmInstallTargetGenerator(target, library_dest.c_str(),
+                                           false,
                                          library_permissions.c_str(),
                                          library_configurations,
-                                         library_component.c_str()));
+                                           library_component.c_str(),
+                                           library_optional));
           }
         else
           {
@@ -417,7 +465,7 @@
           this->SetError(e.str().c_str());
           return false;
           }
-#endif
+          }
         }
         break;
       case cmTarget::STATIC_LIBRARY:
@@ -429,7 +477,8 @@
             new cmInstallTargetGenerator(target, archive_dest.c_str(), false,
                                          archive_permissions.c_str(),
                                          archive_configurations,
-                                         archive_component.c_str()));
+                                         archive_component.c_str(),
+                                         archive_optional));
           }
         else
           {
@@ -450,7 +499,8 @@
             new cmInstallTargetGenerator(target, library_dest.c_str(), false,
                                          library_permissions.c_str(),
                                          library_configurations,
-                                         library_component.c_str()));
+                                         library_component.c_str(),
+                                         library_optional));
           }
         else
           {
@@ -471,7 +521,8 @@
             new cmInstallTargetGenerator(target, runtime_dest.c_str(), false,
                                          runtime_permissions.c_str(),
                                          runtime_configurations,
-                                         runtime_component.c_str()));
+                                         runtime_component.c_str(),
+                                         runtime_optional));
           }
         else
           {
@@ -519,6 +570,7 @@
   std::string permissions;
   std::vector<std::string> configurations;
   std::string component;
+  bool optional = false;
   for(unsigned int i=1; i < args.size(); ++i)
     {
     if(args[i] == "DESTINATION")
@@ -571,6 +623,17 @@
       doing_component = false;
       doing_rename = true;
       }
+    else if(args[i] == "OPTIONAL")
+      {
+      // Set the optional property.
+      doing_files = false;
+      doing_destination = false;
+      doing_permissions = false;
+      doing_configurations = false;
+      doing_component = false;
+      doing_rename = false;
+      optional = true;
+      }
     else if(doing_files)
       {
       // Convert this file to a full path.
@@ -665,7 +728,367 @@
   this->Makefile->AddInstallGenerator(
     new cmInstallFilesGenerator(files, dest.c_str(), programs,
                                 permissions.c_str(), configurations,
-                                component.c_str(), rename.c_str()));
+                                component.c_str(), rename.c_str(),
+                                optional));
+
+  // Tell the global generator about any installation component names
+  // specified.
+  this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
+    ->AddInstallComponent(component.c_str());
+
+  return true;
+}
+
+//----------------------------------------------------------------------------
+bool
+cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
+{
+  bool doing_dirs = true;
+  bool doing_destination = false;
+  bool doing_pattern = false;
+  bool doing_regex = false;
+  bool doing_permissions_file = false;
+  bool doing_permissions_dir = false;
+  bool doing_permissions_match = false;
+  bool doing_configurations = false;
+  bool doing_component = false;
+  bool in_match_mode = false;
+  std::vector<std::string> dirs;
+  const char* destination = 0;
+  std::string permissions_file;
+  std::string permissions_dir;
+  std::vector<std::string> configurations;
+  std::string component;
+  std::string literal_args;
+  for(unsigned int i=1; i < args.size(); ++i)
+    {
+    if(args[i] == "DESTINATION")
+      {
+      if(in_match_mode)
+        {
+        cmOStringStream e;
+        e << args[0] << " does not allow \""
+          << args[i] << "\" after PATTERN or REGEX.";
+        this->SetError(e.str().c_str());
+        return false;
+        }
+
+      // Switch to setting the destination property.
+      doing_dirs = false;
+      doing_destination = true;
+      doing_pattern = false;
+      doing_regex = false;
+      doing_permissions_file = false;
+      doing_permissions_dir = false;
+      doing_configurations = false;
+      doing_component = false;
+      }
+    else if(args[i] == "PATTERN")
+      {
+      // Switch to a new pattern match rule.
+      doing_dirs = false;
+      doing_destination = false;
+      doing_pattern = true;
+      doing_regex = false;
+      doing_permissions_file = false;
+      doing_permissions_dir = false;
+      doing_permissions_match = false;
+      doing_configurations = false;
+      doing_component = false;
+      in_match_mode = true;
+      }
+    else if(args[i] == "REGEX")
+      {
+      // Switch to a new regex match rule.
+      doing_dirs = false;
+      doing_destination = false;
+      doing_pattern = false;
+      doing_regex = true;
+      doing_permissions_file = false;
+      doing_permissions_dir = false;
+      doing_permissions_match = false;
+      doing_configurations = false;
+      doing_component = false;
+      in_match_mode = true;
+      }
+    else if(args[i] == "EXCLUDE")
+      {
+      // Add this property to the current match rule.
+      if(!in_match_mode || doing_pattern || doing_regex)
+        {
+        cmOStringStream e;
+        e << args[0] << " does not allow \""
+          << args[i] << "\" before a PATTERN or REGEX is given.";
+        this->SetError(e.str().c_str());
+        return false;
+        }
+      literal_args += " EXCLUDE";
+      doing_permissions_match = false;
+      }
+    else if(args[i] == "PERMISSIONS")
+      {
+      if(!in_match_mode)
+        {
+        cmOStringStream e;
+        e << args[0] << " does not allow \""
+          << args[i] << "\" before a PATTERN or REGEX is given.";
+        this->SetError(e.str().c_str());
+        return false;
+        }
+
+      // Switch to setting the current match permissions property.
+      literal_args += " PERMISSIONS";
+      doing_permissions_match = true;
+      }
+    else if(args[i] == "FILE_PERMISSIONS")
+      {
+      if(in_match_mode)
+        {
+        cmOStringStream e;
+        e << args[0] << " does not allow \""
+          << args[i] << "\" after PATTERN or REGEX.";
+        this->SetError(e.str().c_str());
+        return false;
+        }
+
+      // Switch to setting the file permissions property.
+      doing_dirs = false;
+      doing_destination = false;
+      doing_pattern = false;
+      doing_regex = false;
+      doing_permissions_file = true;
+      doing_permissions_dir = false;
+      doing_configurations = false;
+      doing_component = false;
+      }
+    else if(args[i] == "DIRECTORY_PERMISSIONS")
+      {
+      if(in_match_mode)
+        {
+        cmOStringStream e;
+        e << args[0] << " does not allow \""
+          << args[i] << "\" after PATTERN or REGEX.";
+        this->SetError(e.str().c_str());
+        return false;
+        }
+
+      // Switch to setting the directory permissions property.
+      doing_dirs = false;
+      doing_destination = false;
+      doing_pattern = false;
+      doing_regex = false;
+      doing_permissions_file = false;
+      doing_permissions_dir = true;
+      doing_configurations = false;
+      doing_component = false;
+      }
+    else if(args[i] == "USE_SOURCE_PERMISSIONS")
+      {
+      if(in_match_mode)
+        {
+        cmOStringStream e;
+        e << args[0] << " does not allow \""
+          << args[i] << "\" after PATTERN or REGEX.";
+        this->SetError(e.str().c_str());
+        return false;
+        }
+
+      // Add this option literally.
+      doing_dirs = false;
+      doing_destination = false;
+      doing_pattern = false;
+      doing_regex = false;
+      doing_permissions_file = false;
+      doing_permissions_dir = false;
+      doing_configurations = false;
+      doing_component = false;
+      literal_args += " USE_SOURCE_PERMISSIONS";
+      }
+    else if(args[i] == "CONFIGURATIONS")
+      {
+      if(in_match_mode)
+        {
+        cmOStringStream e;
+        e << args[0] << " does not allow \""
+          << args[i] << "\" after PATTERN or REGEX.";
+        this->SetError(e.str().c_str());
+        return false;
+        }
+
+      // Switch to setting the configurations property.
+      doing_dirs = false;
+      doing_destination = false;
+      doing_pattern = false;
+      doing_regex = false;
+      doing_permissions_file = false;
+      doing_permissions_dir = false;
+      doing_configurations = true;
+      doing_component = false;
+      }
+    else if(args[i] == "COMPONENT")
+      {
+      if(in_match_mode)
+        {
+        cmOStringStream e;
+        e << args[0] << " does not allow \""
+          << args[i] << "\" after PATTERN or REGEX.";
+        this->SetError(e.str().c_str());
+        return false;
+        }
+
+      // Switch to setting the component property.
+      doing_dirs = false;
+      doing_destination = false;
+      doing_pattern = false;
+      doing_regex = false;
+      doing_permissions_file = false;
+      doing_permissions_dir = false;
+      doing_configurations = false;
+      doing_component = true;
+      }
+    else if(doing_dirs)
+      {
+      // Convert this directory to a full path.
+      std::string dir = args[i];
+      if(!cmSystemTools::FileIsFullPath(dir.c_str()))
+        {
+        dir = this->Makefile->GetCurrentDirectory();
+        dir += "/";
+        dir += args[i];
+        }
+
+      // Make sure the name is a directory.
+      if(!cmSystemTools::FileIsDirectory(dir.c_str()))
+        {
+        cmOStringStream e;
+        e << args[0] << " given non-directory \""
+          << args[i] << "\" to install.";
+        this->SetError(e.str().c_str());
+        return false;
+        }
+
+      // Store the directory for installation.
+      dirs.push_back(dir);
+      }
+    else if(doing_configurations)
+      {
+      configurations.push_back(args[i]);
+      }
+    else if(doing_destination)
+      {
+      destination = args[i].c_str();
+      doing_destination = false;
+      }
+    else if(doing_pattern)
+      {
+      // Convert the pattern to a regular expression.  Require a
+      // leading slash and trailing end-of-string in the matched
+      // string to make sure the pattern matches only whole file
+      // names.
+      literal_args += " REGEX \"/";
+      std::string regex = cmsys::Glob::PatternToRegex(args[i], false);
+      cmSystemTools::ReplaceString(regex, "\\", "\\\\");
+      literal_args += regex;
+      literal_args += "$\"";
+      doing_pattern = false;
+      }
+    else if(doing_regex)
+      {
+      literal_args += " REGEX \"";
+    // Match rules are case-insensitive on some platforms.
+#if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__)
+      std::string regex = cmSystemTools::LowerCase(args[i]);
+#else
+      std::string regex = args[i];
+#endif
+      cmSystemTools::ReplaceString(regex, "\\", "\\\\");
+      literal_args += regex;
+      literal_args += "\"";
+      doing_regex = false;
+      }
+    else if(doing_component)
+      {
+      component = args[i];
+      doing_component = false;
+      }
+    else if(doing_permissions_file)
+      {
+      // Check the requested permission.
+      if(!this->CheckPermissions(args[i], permissions_file))
+        {
+        cmOStringStream e;
+        e << args[0] << " given invalid file permission \""
+          << args[i] << "\".";
+        this->SetError(e.str().c_str());
+        return false;
+        }
+      }
+    else if(doing_permissions_dir)
+      {
+      // Check the requested permission.
+      if(!this->CheckPermissions(args[i], permissions_dir))
+        {
+        cmOStringStream e;
+        e << args[0] << " given invalid directory permission \""
+          << args[i] << "\".";
+        this->SetError(e.str().c_str());
+        return false;
+        }
+      }
+    else if(doing_permissions_match)
+      {
+      // Check the requested permission.
+      if(!this->CheckPermissions(args[i], literal_args))
+        {
+        cmOStringStream e;
+        e << args[0] << " given invalid permission \""
+          << args[i] << "\".";
+        this->SetError(e.str().c_str());
+        return false;
+        }
+      }
+    else
+      {
+      // Unknown argument.
+      cmOStringStream e;
+      e << args[0] << " given unknown argument \"" << args[i] << "\".";
+      this->SetError(e.str().c_str());
+      return false;
+      }
+    }
+
+  // Support installing an empty directory.
+  if(dirs.empty() && destination)
+    {
+    dirs.push_back("");
+    }
+
+  // Check if there is something to do.
+  if(dirs.empty())
+    {
+    return true;
+    }
+  if(!destination)
+    {
+    // A destination is required.
+    cmOStringStream e;
+    e << args[0] << " given no DESTINATION!";
+    this->SetError(e.str().c_str());
+    return false;
+    }
+
+  // Compute destination path.
+  std::string dest;
+  this->ComputeDestination(destination, dest);
+
+  // Create the directory install generator.
+  this->Makefile->AddInstallGenerator(
+    new cmInstallDirectoryGenerator(dirs, dest.c_str(),
+                                    permissions_file.c_str(),
+                                    permissions_dir.c_str(),
+                                    configurations,
+                                    component.c_str(),
+                                    literal_args.c_str()));
 
   // Tell the global generator about any installation component names
   // specified.

Index: cmGlobalVisualStudio7Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.h,v
retrieving revision 1.34.2.3
retrieving revision 1.34.2.4
diff -u -d -r1.34.2.3 -r1.34.2.4
--- cmGlobalVisualStudio7Generator.h	30 Jun 2006 17:48:43 -0000	1.34.2.3
+++ cmGlobalVisualStudio7Generator.h	13 Oct 2006 14:52:02 -0000	1.34.2.4
@@ -107,7 +107,7 @@
                            const char* name, const char* path, cmTarget &t);
   virtual void WriteProjectConfigurations(std::ostream& fout, 
                                           const char* name,
-                                          bool in_all);
+                                          int targetType);
   virtual void WriteSLNFooter(std::ostream& fout);
   virtual void WriteSLNHeader(std::ostream& fout);
   virtual void AddPlatformDefinitions(cmMakefile* mf);
@@ -118,6 +118,7 @@
                             const char* name, const char* path,
                             const std::vector<std::string>& dependencies);
 
+  std::string ConvertToSolutionPath(const char* path);
 
   std::vector<std::string> Configurations;
   std::map<cmStdString, cmStdString> GUIDMap;

Index: cmMakefileLibraryTargetGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.h,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -d -r1.2 -r1.2.2.1
--- cmMakefileLibraryTargetGenerator.h	16 Feb 2006 20:19:00 -0000	1.2
+++ cmMakefileLibraryTargetGenerator.h	13 Oct 2006 14:52:06 -0000	1.2.2.1
@@ -23,6 +23,8 @@
   public cmMakefileTargetGenerator
 {
 public:
+  cmMakefileLibraryTargetGenerator();
+
   /* the main entry point for this class. Writes the Makefiles associated
      with this target */
   virtual void WriteRuleFiles();  

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.335.2.6
retrieving revision 1.335.2.7
diff -u -d -r1.335.2.6 -r1.335.2.7
--- cmMakefile.cxx	27 Jul 2006 14:37:09 -0000	1.335.2.6
+++ cmMakefile.cxx	13 Oct 2006 14:52:05 -0000	1.335.2.7
@@ -63,6 +63,7 @@
   this->SourceFileExtensions.push_back( "mm" );
 
   this->HeaderFileExtensions.push_back( "h" );
+  this->HeaderFileExtensions.push_back( "hh" );
   this->HeaderFileExtensions.push_back( "h++" );
   this->HeaderFileExtensions.push_back( "hm" );
   this->HeaderFileExtensions.push_back( "hpp" );
@@ -79,7 +80,7 @@
     ("Source Files",
                        "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|m|mm|rc|def|r|odl|idl|hpj|bat)$");
   this->AddSourceGroup("Header Files", 
-                       "\\.(h|h\\+\\+|hm|hpp|hxx|in|txx|inl)$");
+                       "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$");
   this->AddSourceGroup("CMake Rules", "\\.rule$");
   this->AddSourceGroup("Resources", "\\.plist$");
 #endif
@@ -105,6 +106,7 @@
   this->Tests = mf.Tests;
   this->IncludeDirectories = mf.IncludeDirectories;
   this->LinkDirectories = mf.LinkDirectories;
+  this->SystemIncludeDirectories = mf.SystemIncludeDirectories;
   this->ListFiles = mf.ListFiles;
   this->OutputFiles = mf.OutputFiles;
   this->LinkLibraries = mf.LinkLibraries;
@@ -553,7 +555,8 @@
                                      const cmCustomCommandLines& commandLines,
                                      cmTarget::CustomCommandType type,
                                      const char* comment,
-                                     const char* workingDir)
+                                     const char* workingDir,
+                                     bool escapeOldStyle)
 {
   // Find the target to which to add the custom command.
   cmTargets::iterator ti = this->Targets.find(target);
@@ -562,6 +565,7 @@
     // Add the command to the appropriate build step for the target.
     std::vector<std::string> no_output;
     cmCustomCommand cc(no_output, depends, commandLines, comment, workingDir);
+    cc.SetEscapeOldStyle(escapeOldStyle);
     switch(type)
       {
       case cmTarget::PRE_BUILD:
@@ -597,7 +601,8 @@
                                      const cmCustomCommandLines& commandLines,
                                      const char* comment,
                                      const char* workingDir,
-                                     bool replace)
+                                     bool replace,
+                                     bool escapeOldStyle)
 {
   // Make sure there is at least one output.
   if(outputs.empty())
@@ -685,6 +690,7 @@
     cmCustomCommand* cc =
       new cmCustomCommand(outputs, depends2, commandLines,
                           comment, workingDir);
+    cc->SetEscapeOldStyle(escapeOldStyle);
     file->SetCustomCommand(cc);
     }
 }
@@ -697,13 +703,14 @@
                                      const cmCustomCommandLines& commandLines,
                                      const char* comment,
                                      const char* workingDir,
-                                     bool replace)
+                                     bool replace,
+                                     bool escapeOldStyle)
 {
   std::vector<std::string> outputs;
   outputs.push_back(output);
   this->AddCustomCommandToOutput(outputs, depends, main_dependency,
                                  commandLines, comment, workingDir,
-                                 replace);
+                                 replace, escapeOldStyle);
 }
 
 //----------------------------------------------------------------------------
@@ -777,7 +784,6 @@
 
 //----------------------------------------------------------------------------
 void cmMakefile::AddUtilityCommand(const char* utilityName, bool all,
-                                   const char* output,
                                    const std::vector<std::string>& depends,
                                    const char* workingDirectory,
                                    const char* command,
@@ -809,30 +815,53 @@
   commandLines.push_back(commandLine);
 
   // Call the real signature of this method.
-  this->AddUtilityCommand(utilityName, all, output, workingDirectory, 
+  this->AddUtilityCommand(utilityName, all, workingDirectory, 
                           depends, commandLines);
 }
 
 //----------------------------------------------------------------------------
 void cmMakefile::AddUtilityCommand(const char* utilityName, bool all,
-                                   const char* output,
                                    const char* workingDirectory,
                                    const std::vector<std::string>& depends,
-                                   const cmCustomCommandLines& commandLines)
+                                   const cmCustomCommandLines& commandLines,
+                                   bool escapeOldStyle, const char* comment)
 {
   // Create a target instance for this utility.
   cmTarget target;
   target.SetType(cmTarget::UTILITY, utilityName);
   target.SetInAll(all);
   target.SetMakefile(this);
+
+  if(!comment)
+    {
+    // Use an empty comment to avoid generation of default comment.
+    comment = "";
+    }
+
   // Store the custom command in the target.
-  std::vector<std::string> outputs;
-  if(output)
+  std::string force = this->GetStartOutputDirectory();
+  force += cmake::GetCMakeFilesDirectory();
+  force += "/";
+  force += utilityName;
+  const char* no_main_dependency = 0;
+  bool no_replace = false;
+  this->AddCustomCommandToOutput(force.c_str(), depends,
+                                 no_main_dependency,
+                                 commandLines, comment,
+                                 workingDirectory, no_replace,
+                                 escapeOldStyle);
+  target.GetSourceLists().push_back(force);
+
+  // The output is not actually created so mark it symbolic.
+  if(cmSourceFile* sf = this->GetSource(force.c_str()))
     {
-    outputs.push_back(output);
+    sf->SetProperty("SYMBOLIC", "1");
+    }
+  else
+    {
+    cmSystemTools::Error("Could not get source file entry for ",
+                         force.c_str());
     }
-  cmCustomCommand cc(outputs, depends, commandLines, 0, workingDirectory);
-  target.GetPostBuildCommands().push_back(cc);
 
   // Add the target to the set of targets.
   cmTargets::iterator it = 
@@ -997,6 +1026,7 @@
 
   // copy include paths
   this->IncludeDirectories = parent->IncludeDirectories;
+  this->SystemIncludeDirectories = parent->SystemIncludeDirectories;
   
   // define flags
   this->DefineFlags = parent->DefineFlags;
@@ -1122,6 +1152,19 @@
     }
 }
 
+//----------------------------------------------------------------------------
+void cmMakefile::AddSystemIncludeDirectory(const char* dir)
+{
+  this->SystemIncludeDirectories.insert(dir);
+}
+
+//----------------------------------------------------------------------------
+bool cmMakefile::IsSystemIncludeDirectory(const char* dir)
+{
+  return (this->SystemIncludeDirectories.find(dir) !=
+          this->SystemIncludeDirectories.end());
+}
+
 void cmMakefile::AddDefinition(const char* name, const char* value)
 {
   if (!value )
@@ -1258,7 +1301,8 @@
 
 
 void cmMakefile::AddLibrary(const char* lname, int shared,
-                            const std::vector<std::string> &srcs)
+                            const std::vector<std::string> &srcs,
+                            bool in_all)
 {
   cmTarget target;
   switch (shared)
@@ -1280,7 +1324,7 @@
   // over changes in CMakeLists.txt, making the information stale and
   // hence useless.
   target.ClearDependencyInformation( *this, lname );
-  target.SetInAll(true);
+  target.SetInAll(in_all);
   target.GetSourceLists() = srcs;
   target.SetMakefile(this);
   this->AddGlobalLinkInformation(lname, target);
@@ -1290,11 +1334,12 @@
 }
 
 cmTarget* cmMakefile::AddExecutable(const char *exeName, 
-                                    const std::vector<std::string> &srcs)
+                                    const std::vector<std::string> &srcs,
+                                    bool in_all)
 {
   cmTarget target;
   target.SetType(cmTarget::EXECUTABLE, exeName);
-  target.SetInAll(true);
+  target.SetInAll(in_all);
   target.GetSourceLists() = srcs;
   target.SetMakefile(this);
   this->AddGlobalLinkInformation(exeName, target);
@@ -1637,7 +1682,8 @@
                                                 bool atOnly,
                                                 const char* filename,
                                                 long line,
-                                                bool removeEmpty) const
+                                                bool removeEmpty,
+                                                bool replaceAt) const
 {
   if ( source.empty() || source.find_first_of("$@\\") == source.npos)
     {
@@ -1656,6 +1702,7 @@
     parser.SetLineFile(line, filename);
     parser.SetEscapeQuotes(escapeQuotes);
     parser.SetNoEscapeMode(noEscapes);
+    parser.SetReplaceAtSyntax(replaceAt);
     int res = parser.ParseString(source.c_str(), 0);
     if ( res )
       {
@@ -1906,6 +1953,9 @@
 #if defined(__APPLE__)
   this->AddDefinition("APPLE", "1");
 #endif
+#if defined(__QNXNTO__)
+  this->AddDefinition("QNXNTO", "1");
+#endif
 
   char temp[1024];
   sprintf(temp, "%d", cmMakefile::GetMinorVersion());
@@ -1994,7 +2044,8 @@
     // Expand the variables in the argument.
     value = i->Value;
     this->ExpandVariablesInString(value, false, false, false, 
-                                  i->FilePath, i->Line);
+                                  i->FilePath, i->Line,
+                                  false, false);
 
     // If the argument is quoted, it should be one argument.
     // Otherwise, it may be a list of arguments.

Index: cmListCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmListCommand.cxx,v
retrieving revision 1.4.2.4
retrieving revision 1.4.2.5
diff -u -d -r1.4.2.4 -r1.4.2.5
--- cmListCommand.cxx	16 May 2006 18:04:08 -0000	1.4.2.4
+++ cmListCommand.cxx	13 Oct 2006 14:52:02 -0000	1.4.2.5
@@ -54,6 +54,14 @@
     {
     return this->HandleRemoveItemCommand(args);
     }
+  if(subCommand == "SORT")
+    {
+    return this->HandleSortCommand(args);
+    }
+  if(subCommand == "REVERSE")
+    {
+    return this->HandleReverseCommand(args);
+    }
   
   std::string e = "does not recognize sub-command "+subCommand;
   this->SetError(e.c_str());
@@ -258,7 +266,7 @@
 {
   if(args.size() < 3)
     {
-    this->SetError("sub-command REMOVE requires at least two arguments.");
+    this->SetError("sub-command REMOVE_ITEM requires two or more arguments.");
     return false;
     }
 
@@ -267,6 +275,7 @@
   std::vector<std::string> varArgsExpanded;
   if ( !this->GetList(varArgsExpanded, listName.c_str()) )
     {
+    this->SetError("sub-command REMOVE_ITEM requires list to be present.");
     return false;
     }
 
@@ -280,9 +289,12 @@
         {
         varArgsExpanded.erase(varArgsExpanded.begin()+kk);
         }
+      else
+        {
       kk ++;
       }
     }
+    }
 
   std::string value;
   for ( cc = 0; cc < varArgsExpanded.size(); cc ++ )
@@ -299,12 +311,82 @@
 }
 
 //----------------------------------------------------------------------------
+bool cmListCommand
+::HandleReverseCommand(std::vector<std::string> const& args)
+{
+  if(args.size() < 2)
+    {
+    this->SetError("sub-command REVERSE requires a list as an argument.");
+    return false;
+    }
+
+  const std::string& listName = args[1];
+  // expand the variable
+  std::vector<std::string> varArgsExpanded;
+  if ( !this->GetList(varArgsExpanded, listName.c_str()) )
+    {
+    this->SetError("sub-command REVERSE requires list to be present.");
+    return false;
+    }
+
+  std::string value;
+  std::vector<std::string>::reverse_iterator it;
+  for ( it = varArgsExpanded.rbegin(); it != varArgsExpanded.rend(); ++ it )
+    {
+    if (value.size())
+      {
+      value += ";";
+      }
+    value += it->c_str();
+    }
+
+  this->Makefile->AddDefinition(listName.c_str(), value.c_str());
+  return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmListCommand
+::HandleSortCommand(std::vector<std::string> const& args)
+{
+  if(args.size() < 2)
+    {
+    this->SetError("sub-command SORT requires a list as an argument.");
+    return false;
+    }
+
+  const std::string& listName = args[1];
+  // expand the variable
+  std::vector<std::string> varArgsExpanded;
+  if ( !this->GetList(varArgsExpanded, listName.c_str()) )
+    {
+    this->SetError("sub-command SORT requires list to be present.");
+    return false;
+    }
+
+  std::sort(varArgsExpanded.begin(), varArgsExpanded.end());
+
+  std::string value;
+  std::vector<std::string>::iterator it;
+  for ( it = varArgsExpanded.begin(); it != varArgsExpanded.end(); ++ it )
+    {
+    if (value.size())
+      {
+      value += ";";
+      }
+    value += it->c_str();
+    }
+
+  this->Makefile->AddDefinition(listName.c_str(), value.c_str());
+  return true;
+}
+
+//----------------------------------------------------------------------------
 bool cmListCommand::HandleRemoveAtCommand(
   std::vector<std::string> const& args)
 {
   if(args.size() < 3)
     {
-    this->SetError("sub-command REMOVE_ITEM requires at least "
+    this->SetError("sub-command REMOVE_AT requires at least "
                    "two arguments.");
     return false;
     }
@@ -314,6 +396,7 @@
   std::vector<std::string> varArgsExpanded;
   if ( !this->GetList(varArgsExpanded, listName.c_str()) )
     {
+    this->SetError("sub-command REMOVE_AT requires list to be present.");
     return false;
     }
 

Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.137.2.6
retrieving revision 1.137.2.7
diff -u -d -r1.137.2.6 -r1.137.2.7
--- cmGlobalGenerator.cxx	30 Jun 2006 17:48:43 -0000	1.137.2.6
+++ cmGlobalGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.137.2.7
@@ -31,6 +31,9 @@
 
 cmGlobalGenerator::cmGlobalGenerator()
 {
+  // By default the .SYMBOLIC dependency is not needed on symbolic rules.
+  this->NeedSymbolicMark = false;
+
   // by default use the native paths
   this->ForceUnixPaths = false;
 
@@ -42,6 +45,9 @@
 
   // Relative paths are not configured in the constructor.
   this->RelativePathsConfigured = false;
+
+  // Whether an install target is needed.
+  this->InstallTargetEnabled = false;
 }
 
 cmGlobalGenerator::~cmGlobalGenerator()
@@ -457,7 +463,7 @@
   // cmake
   std::string projectCompatibility = mf->GetDefinition("CMAKE_ROOT");
   projectCompatibility += "/Modules/";
-  projectCompatibility += mf->GetDefinition("PROJECT_NAME");
+  projectCompatibility += mf->GetSafeDefinition("PROJECT_NAME");
   projectCompatibility += "Compatibility.cmake";
   if(cmSystemTools::FileExists(projectCompatibility.c_str()))
     {
@@ -716,12 +722,13 @@
     }
   for (i = 0; i < this->LocalGenerators.size(); ++i)
     {
-    cmTargets* targets = 
-      &(this->LocalGenerators[i]->GetMakefile()->GetTargets());
+    cmMakefile* mf = this->LocalGenerators[i]->GetMakefile();
+    cmTargets* targets = &(mf->GetTargets());
     cmTargets::iterator tit;
     for ( tit = globalTargets.begin(); tit != globalTargets.end(); ++ tit )
       {
       (*targets)[tit->first] = tit->second;
+      (*targets)[tit->first].SetMakefile(mf);
       }
     }
 
@@ -926,6 +933,11 @@
     }
 }
 
+void cmGlobalGenerator::EnableInstallTarget()
+{
+  this->InstallTargetEnabled = true;
+}
+
 cmLocalGenerator *cmGlobalGenerator::CreateLocalGenerator()
 {
   cmLocalGenerator *lg = new cmLocalGenerator;
@@ -963,6 +975,10 @@
 bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root, 
                                    cmLocalGenerator* gen)
 {
+  if(gen == root)
+    {
+    return false;
+    }
   cmLocalGenerator* cur = gen->GetParent();
   while(cur && cur != root)
     {
@@ -972,7 +988,7 @@
       }
     cur = cur->GetParent();
     }
-  return false;
+  return gen->GetExcludeAll();
 }
 
 
@@ -1291,7 +1307,6 @@
     // If the file doesn't exist, then ENABLE_TESTING hasn't been run
     if (total_tests > 0)
       {
-      const char* no_output = 0;
       const char* no_working_dir = 0;
       std::vector<std::string> no_depends;
       std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
@@ -1304,7 +1319,7 @@
           cmMakefile* mf = gen[0]->GetMakefile();
           if(const char* outDir = mf->GetDefinition("CMAKE_CFG_INTDIR"))
             {
-            mf->AddUtilityCommand("RUN_TESTS", false, no_output, no_depends,
+            mf->AddUtilityCommand("RUN_TESTS", false, no_depends,
                                   no_working_dir, 
                                   ctest.c_str(), "-C", outDir);
             }
@@ -1447,8 +1462,11 @@
     }
 
   //Install
+  if(this->InstallTargetEnabled)
+    {
   std::string cmd;
-  cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end());
+    cpackCommandLines.erase(cpackCommandLines.begin(),
+                            cpackCommandLines.end());
   singleLine.erase(singleLine.begin(), singleLine.end());
   depends.erase(depends.begin(), depends.end());
   if ( this->GetPreinstallTargetName() )
@@ -1494,6 +1512,21 @@
     this->CreateGlobalTarget(
       this->GetInstallTargetName(), "Install the project...",
       &cpackCommandLines, depends);
+
+    // install_local
+    if(const char* install_local = this->GetInstallLocalTargetName())
+      {
+      singleLine.insert(singleLine.begin()+1, "-DCMAKE_INSTALL_LOCAL_ONLY=1");
+      cpackCommandLines.erase(cpackCommandLines.begin(),
+                              cpackCommandLines.end());
+      cpackCommandLines.push_back(singleLine);
+
+      (*targets)[install_local] =
+        this->CreateGlobalTarget(
+          install_local, "Installing only the local directory...",
+          &cpackCommandLines, depends);
+      }
+    }
 }
 
 cmTarget cmGlobalGenerator::CreateGlobalTarget(

Index: cmGlobalWatcomWMakeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalWatcomWMakeGenerator.cxx,v
retrieving revision 1.5.2.2
retrieving revision 1.5.2.3
diff -u -d -r1.5.2.2 -r1.5.2.3
--- cmGlobalWatcomWMakeGenerator.cxx	11 May 2006 20:05:57 -0000	1.5.2.2
+++ cmGlobalWatcomWMakeGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.5.2.3
@@ -23,6 +23,7 @@
   this->FindMakeProgramFile = "CMakeFindWMake.cmake";
   this->ForceUnixPaths = false;
   this->ToolSupportsColor = true;
+  this->NeedSymbolicMark = true;
   this->EmptyCommandsHack = "@cd .";
 }
 
@@ -47,7 +48,6 @@
 {
   cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
   lg->SetSilentNoColon(true);
-  lg->SetEchoNeedsQuote(false);
   lg->SetDefineWindowsNULL(true);
   lg->SetWindowsShell(true);
   lg->SetMakeSilentFlag("-s -h");

Index: cmLinkLibrariesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLinkLibrariesCommand.h,v
retrieving revision 1.15
retrieving revision 1.15.6.1
diff -u -d -r1.15 -r1.15.6.1
--- cmLinkLibrariesCommand.h	18 Mar 2005 15:41:40 -0000	1.15
+++ cmLinkLibrariesCommand.h	13 Oct 2006 14:52:02 -0000	1.15.6.1
@@ -75,6 +75,12 @@
       "type of build.";
     }
   
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmLinkLibrariesCommand, cmCommand);
 };
 

Index: cmGlobalKdevelopGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalKdevelopGenerator.cxx,v
retrieving revision 1.10.2.4
retrieving revision 1.10.2.5
diff -u -d -r1.10.2.4 -r1.10.2.5
--- cmGlobalKdevelopGenerator.cxx	30 Jun 2006 17:48:43 -0000	1.10.2.4
+++ cmGlobalKdevelopGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.10.2.5
@@ -23,6 +23,8 @@
 #include "cmSourceFile.h"
 #include "cmGeneratedFileStream.h"
 
+#include <cmsys/SystemTools.hxx>
+
 cmGlobalKdevelopGenerator::cmGlobalKdevelopGenerator()
 {
   // This type of makefile always requires unix style paths
@@ -160,12 +162,33 @@
            si!=sources.end(); si++)
         {
         tmp=(*si)->GetFullPath();
+        std::string headerBasename=cmSystemTools::GetFilenamePath(tmp);
+        headerBasename+="/";
+        headerBasename+=cmSystemTools::GetFilenameWithoutExtension(tmp);
+
         cmSystemTools::ReplaceString(tmp, projectDir.c_str(), "");
+
         if ((tmp[0]!='/')  && 
             (strstr(tmp.c_str(), 
-                    cmake::GetCMakeFilesDirectoryPostSlash())==0))
+                  cmake::GetCMakeFilesDirectoryPostSlash())==0) &&
+           (cmSystemTools::GetFilenameExtension(tmp)!=".moc"))
           {
           files.insert(tmp);
+
+          // check if there's a matching header around
+          for(std::vector<std::string>::const_iterator
+                ext = makefile->GetHeaderExtensions().begin();
+              ext !=  makefile->GetHeaderExtensions().end(); ++ext)
+            {
+            std::string hname=headerBasename;
+            hname += ".";
+            hname += *ext;
+            if(cmSystemTools::FileExists(hname.c_str()))
+              {
+              files.insert(hname);
+              break;
+              }
+            }
           }
         }
       for (std::vector<std::string>::const_iterator lt=listFiles.begin();
@@ -382,7 +405,7 @@
   fout<<"    <run>\n";
   fout<<"      <mainprogram>"<<executable.c_str()<<"</mainprogram>\n";
   fout<<"      <directoryradio>custom</directoryradio>\n";
-  fout<<"      <customdirectory>/</customdirectory>\n";
+  fout<<"      <customdirectory>"<<outputDir.c_str()<<"</customdirectory>\n";
   fout<<"      <programargs></programargs>\n";
   fout<<"      <terminal>false</terminal>\n";
   fout<<"      <autocompile>true</autocompile>\n";

Index: cmInstallFilesGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallFilesGenerator.cxx,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -d -r1.3.2.1 -r1.3.2.2
--- cmInstallFilesGenerator.cxx	7 May 2006 14:55:38 -0000	1.3.2.1
+++ cmInstallFilesGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.3.2.2
@@ -22,13 +22,14 @@
 cmInstallFilesGenerator
 ::cmInstallFilesGenerator(std::vector<std::string> const& files,
                           const char* dest, bool programs,
-                          const char* permissions,
+                          const char* file_permissions,
                           std::vector<std::string> const& configurations,
                           const char* component,
-                          const char* rename):
+                          const char* rename,
+                          bool optional):
   Files(files), Destination(dest), Programs(programs),
-  Permissions(permissions), Configurations(configurations),
-  Component(component), Rename(rename)
+  FilePermissions(file_permissions), Configurations(configurations),
+  Component(component), Rename(rename), Optional(optional)
 {
 }
 
@@ -45,14 +46,14 @@
   for(std::vector<std::string>::const_iterator fi = this->Files.begin();
       fi != this->Files.end(); ++fi)
     {
-    bool not_optional = false;
     const char* no_properties = 0;
+    const char* no_dir_permissions = 0;
     this->AddInstallRule(os, this->Destination.c_str(),
                          (this->Programs
                           ? cmTarget::INSTALL_PROGRAMS
                           : cmTarget::INSTALL_FILES), fi->c_str(),
-                         not_optional, no_properties,
-                         this->Permissions.c_str(),
+                         this->Optional, no_properties,
+                         this->FilePermissions.c_str(), no_dir_permissions,
                          this->Configurations,
                          this->Component.c_str(),
                          this->Rename.c_str());

Index: cmDependsFortranLexer.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortranLexer.cxx,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- cmDependsFortranLexer.cxx	15 Mar 2006 16:02:01 -0000	1.5
+++ cmDependsFortranLexer.cxx	13 Oct 2006 14:52:02 -0000	1.5.2.1
@@ -640,40 +640,16 @@
 
 */
 
+#include "cmStandardLexer.h"
+
 #define cmDependsFortranLexer_cxx
 #include "cmDependsFortranParser.h" /* Interface to parser object.  */
 
-/* Disable some warnings.  */
-#if defined(_MSC_VER)
-# pragma warning ( disable : 4127 )
-# pragma warning ( disable : 4131 )
-# pragma warning ( disable : 4244 )
-# pragma warning ( disable : 4251 )
-# pragma warning ( disable : 4267 )
-# pragma warning ( disable : 4305 )
-# pragma warning ( disable : 4309 )
-# pragma warning ( disable : 4706 )
-# pragma warning ( disable : 4786 )
-#endif
-
-/* Disable features we do not need. */
-#define YY_NEVER_INTERACTIVE 1
-#define ECHO
-
 /* Replace the lexer input function.  */
 #undef YY_INPUT
 #define YY_INPUT(buf, result, max_size) \
   { result = cmDependsFortranParser_Input(yyextra, buf, max_size); }
 
-/* Provide isatty on Windows.  */
-#if defined( _WIN32 ) && !defined( __CYGWIN__ )
-# include <io.h>
-# if defined( _MSC_VER )
-#  define isatty _isatty
-# endif
-# define YY_NO_UNISTD_H 1
-#endif
-
 /* Include the set of tokens from the parser.  */
 #include "cmDependsFortranParserTokens.h"
 

Index: cmCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommand.h,v
retrieving revision 1.23
retrieving revision 1.23.2.1
diff -u -d -r1.23 -r1.23.2.1
--- cmCommand.h	15 Mar 2006 16:01:59 -0000	1.23
+++ cmCommand.h	13 Oct 2006 14:52:02 -0000	1.23.2.1
@@ -102,6 +102,15 @@
     }
 
   /**
+   * This determines if usage of the method is discouraged or not.
+   * This is currently only used for generating the documentation.
+   */
+  virtual bool IsDiscouraged()
+    {
+    return false;
+    }
+
+  /**
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() = 0;

Index: cmLocalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.cxx,v
retrieving revision 1.128.2.7
retrieving revision 1.128.2.8
diff -u -d -r1.128.2.7 -r1.128.2.8
--- cmLocalUnixMakefileGenerator3.cxx	24 Jul 2006 15:19:35 -0000	1.128.2.7
+++ cmLocalUnixMakefileGenerator3.cxx	13 Oct 2006 14:52:04 -0000	1.128.2.8
@@ -44,11 +44,13 @@
   this->MakefileVariableSize = 0;
   this->IgnoreLibPrefix = false;
   this->PassMakeflags = false;
-  this->EchoNeedsQuote = true;
   this->DefineWindowsNULL = false;
   this->UnixCD = true;
   this->ForceVerboseMakefiles=false;
   this->ColorMakefile = false;
+  this->SkipPreprocessedSourceRules = false;
+  this->SkipAssemblySourceRules = false;
+  this->NativeEchoCommand = "@echo ";
 }
 
 //----------------------------------------------------------------------------
@@ -76,9 +78,13 @@
   // Setup our configuration variables for this directory.
   this->ConfigureOutputPaths();
 
-  // Record whether color makefiles are enabled to avoid checking many
+  // Record whether some options are enabled to avoid checking many
   // times later.
   this->ColorMakefile = this->Makefile->IsOn("CMAKE_COLOR_MAKEFILE");
+  this->SkipPreprocessedSourceRules =
+    this->Makefile->IsOn("CMAKE_SKIP_PREPROCESSED_SOURCE_RULES");
+  this->SkipAssemblySourceRules =
+    this->Makefile->IsOn("CMAKE_SKIP_ASSEMBLY_SOURCE_RULES");
 
   // Generate the rule files for each target.
   cmTargets& targets = this->Makefile->GetTargets();
@@ -155,8 +161,10 @@
 void cmLocalUnixMakefileGenerator3::WriteAllProgressVariable()
 {
   // write the top level progress for the all target
+  std::string progressFile = cmake::GetCMakeFilesDirectory();
+  progressFile += "/progress.make";
   std::string progressFileNameFull = 
-    this->ConvertToFullPath("progress.make");
+    this->ConvertToFullPath(progressFile.c_str());
   cmGeneratedFileStream ruleFileStream(progressFileNameFull.c_str());
   if(!ruleFileStream)
     {
@@ -167,7 +175,7 @@
     static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
 
   ruleFileStream << "CMAKE_ALL_PROGRESS = " 
-                 << gg->GetNumberOfProgressActionsInAll(this);
+                 << gg->GetNumberOfProgressActionsInAll(this) << "\n";
 }
 
 //----------------------------------------------------------------------------
@@ -250,12 +258,6 @@
     ruleFileStream.SetCopyIfDifferent(true);
     }
   
-  // Include the progress variables for the target.
-  ruleFileStream
-    << "# Include the progress variables for this target.\n"
-    << this->IncludeDirective << " "
-    << "progress.make\n\n";
-  
   // write the all rules
   this->WriteLocalAllRules(ruleFileStream);
   
@@ -275,34 +277,52 @@
     gg->WriteConvenienceRules(ruleFileStream,emittedTargets);
     }
   
-  std::vector<std::string> depends;
-  std::vector<std::string> commands;
+  bool do_preprocess_rules =
+    this->GetCreatePreprocessedSourceRules();
+  bool do_assembly_rules =
+    this->GetCreateAssemblySourceRules();
 
   // now write out the object rules
   // for each object file name
-  for (std::map<cmStdString,std::vector<cmTarget *> >::iterator lo = 
+  for (std::map<cmStdString, LocalObjectInfo>::iterator lo = 
          this->LocalObjectFiles.begin();
        lo != this->LocalObjectFiles.end(); ++lo)
     {
-    commands.clear();
-    // for each target using the object file
-    for (std::vector<cmTarget *>::iterator to = 
-           lo->second.begin(); to != lo->second.end(); ++to)
+    // Add a convenience rule for building the object file.
+    this->WriteObjectConvenienceRule(ruleFileStream,
+                                     "target to build an object file",
+                                     lo->first.c_str(), lo->second);
+
+    // Check whether preprocessing and assembly rules make sense.
+    // They make sense only for C and C++ sources.
+    bool lang_is_c_or_cxx = false;
+    for(std::vector<LocalObjectEntry>::const_iterator ei =
+          lo->second.begin(); ei != lo->second.end(); ++ei)
       {
-      std::string tgtMakefileName = this->GetRelativeTargetDirectory(**to);
-      std::string targetName = tgtMakefileName;
-      tgtMakefileName += "/build.make";
-      targetName += "/";
-      targetName += lo->first.c_str();
-      commands.push_back(this->GetRecursiveMakeCall
-                         (tgtMakefileName.c_str(),targetName.c_str()));  
-      this->CreateCDCommand(commands,
-                                    this->Makefile->GetHomeOutputDirectory(),
-                                    this->Makefile->GetStartOutputDirectory());
+      if(ei->Language == "C" || ei->Language == "CXX")
+        {
+        lang_is_c_or_cxx = true;
+        }
+      }
+
+    // Add convenience rules for preprocessed and assembly files.
+    if(lang_is_c_or_cxx && (do_preprocess_rules || do_assembly_rules))
+      {
+      std::string::size_type dot_pos = lo->first.rfind(".");
+      std::string base = lo->first.substr(0, dot_pos);
+      if(do_preprocess_rules)
+        {
+        this->WriteObjectConvenienceRule(
+          ruleFileStream, "target to preprocess a source file",
+          (base + ".i").c_str(), lo->second);
+        }
+      if(do_assembly_rules)
+        {
+        this->WriteObjectConvenienceRule(
+          ruleFileStream, "target to generate assembly for a file",
+          (base + ".s").c_str(), lo->second);
+        }
       }
-    this->WriteMakeRule(ruleFileStream, 
-                        "target for object file", 
-                        lo->first.c_str(), depends, commands, false);
     }
 
   // add a help target as long as there isn;t a real target named help
@@ -316,6 +336,39 @@
   this->WriteSpecialTargetsBottom(ruleFileStream);
 }
 
+//----------------------------------------------------------------------------
+void
+cmLocalUnixMakefileGenerator3
+::WriteObjectConvenienceRule(std::ostream& ruleFileStream,
+                             const char* comment, const char* output,
+                             LocalObjectInfo const& targets)
+{
+  // Recursively make the rule for each target using the object file.
+  std::vector<std::string> commands;
+  for(std::vector<LocalObjectEntry>::const_iterator t = targets.begin();
+      t != targets.end(); ++t)
+    {
+    std::string tgtMakefileName =
+      this->GetRelativeTargetDirectory(*(t->Target));
+    std::string targetName = tgtMakefileName;
+    tgtMakefileName += "/build.make";
+    targetName += "/";
+    targetName += output;
+    commands.push_back(
+      this->GetRecursiveMakeCall(tgtMakefileName.c_str(), targetName.c_str())
+      );
+    this->CreateCDCommand(commands,
+                          this->Makefile->GetHomeOutputDirectory(),
+                          this->Makefile->GetStartOutputDirectory());
+    }
+
+  // Write the rule to the makefile.
+  std::vector<std::string> no_depends;
+  this->WriteMakeRule(ruleFileStream, comment,
+                      output, no_depends, commands, true, true);
+}
+
+//----------------------------------------------------------------------------
 void cmLocalUnixMakefileGenerator3
 ::WriteLocalMakefileTargets(std::ostream& ruleFileStream,
                             std::set<cmStdString> &emitted)
@@ -416,12 +469,10 @@
   infoFileStream
     << "SET(CMAKE_C_INCLUDE_PATH\n";
   std::vector<std::string> includeDirs;
-  this->GetIncludeDirectories(includeDirs);
+  this->GetIncludeDirectories(includeDirs, false);
   for(std::vector<std::string>::iterator i = includeDirs.begin();
       i != includeDirs.end(); ++i)
     {
-    // Note: This path conversion must match that used for
-    // CMAKE_GENERATED_FILES so that the file names match.
     infoFileStream
       << "  \"" << this->Convert(i->c_str(),HOME_OUTPUT).c_str() << "\"\n";
     }
@@ -452,30 +503,6 @@
   infoFileStream
     << "SET(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN "
     "${CMAKE_C_INCLUDE_REGEX_COMPLAIN})\n";
-
-  // Store the set of available generated files.
-  infoFileStream
-    << "\n"
-    << "# The set of files generated by rules in this directory:\n";
-  infoFileStream
-    << "SET(CMAKE_GENERATED_FILES\n";
-  for(std::vector<cmSourceFile*>::const_iterator
-        i = this->Makefile->GetSourceFiles().begin();
-      i != this->Makefile->GetSourceFiles().end(); ++i)
-    {
-    cmSourceFile* src = *i;
-    if(src->GetPropertyAsBool("GENERATED"))
-      {
-      // Note: This path conversion must match that used for
-      // CMAKE_C_INCLUDE_PATH so that the file names match.
-      infoFileStream
-        << "  \""
-        << this->Convert(src->GetFullPath().c_str(), HOME_OUTPUT)
-        << "\"\n";
-      }
-    }
-  infoFileStream
-    << ")\n";
 }
 
 //----------------------------------------------------------------------------
@@ -504,7 +531,8 @@
                 const char* target,
                 const std::vector<std::string>& depends,
                 const std::vector<std::string>& commands,
-                bool symbolic)
+                bool symbolic,
+                bool in_help)
 {
   // Make sure there is a target.
   if(!target || !*target)
@@ -580,6 +608,12 @@
     os << "\t" << replace.c_str() << "\n";
     }
   os << "\n";
+
+  // Add the output to the local help if requested.
+  if(in_help)
+    {
+    this->LocalHelp.push_back(target);
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -663,15 +697,28 @@
     << "# Special targets provided by cmake.\n"
     << "\n";
 
+  std::vector<std::string> no_commands;
+  std::vector<std::string> no_depends;
+
+  // Special target to cleanup operation of make tool.
+  // This should be the first target except for the default_target in
+  // the interface Makefile.
+  this->WriteMakeRule(
+    makefileStream, "Disable implicit rules so canoncical targets will work.",
+    ".SUFFIXES", no_depends, no_commands, false);
+
+  // Add a fake suffix to keep HP happy.  Must be max 32 chars for SGI make.
+  std::vector<std::string> depends;
+  depends.push_back(".hpux_make_needs_suffix_list");
+  this->WriteMakeRule(makefileStream, 0,
+                      ".SUFFIXES", depends, no_commands, false);
+
   // Write special target to silence make output.  This must be after
   // the default target in case VERBOSE is set (which changes the
   // name).  The setting of CMAKE_VERBOSE_MAKEFILE to ON will cause a
   // "VERBOSE=1" to be added as a make variable which will change the
   // name of this special target.  This gives a make-time choice to
   // the user.
-  std::vector<std::string> commands;
-  std::vector<std::string> no_depends;
-  commands.clear();
   if((this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE")) 
      || (this->ForceVerboseMakefiles))
     {
@@ -690,21 +737,18 @@
                         "Suppress display of executed commands.",
                         "$(VERBOSE).SILENT",
                         no_depends,
-                        commands, false);
+                        no_commands, false);
     }
 
-  // Special target to cleanup operation of make tool.
-  std::vector<std::string> depends;
+  // Special symbolic target that never exists to force dependers to
+  // run their rules.
   this->WriteMakeRule
     (makefileStream,
-     "Disable implicit rules so canoncical targets will work.",
-     ".SUFFIXES",
-     depends, commands, false);
+     "A target that is always out of date.",
+     "cmake_force", no_depends, no_commands, true);
 
-  // Add a fake suffix to keep HP happy.  Must be max 32 chars for SGI make.
-  depends.push_back(".hpux_make_needs_suffix_list");
-  this->WriteMakeRule(makefileStream, 0,
-                      ".SUFFIXES", depends, commands, false);
+  // Variables for reference by other rules.
+  this->WriteMakeVariables(makefileStream);
 }
 
 //----------------------------------------------------------------------------
@@ -747,8 +791,6 @@
                       no_depends,
                       commands, true);
   }
-
-  std::vector<std::string> no_commands;
 }
 
 
@@ -859,6 +901,8 @@
     {
     dir = workingDir;
     }
+  bool escapeOldStyle = cc.GetEscapeOldStyle();
+  bool escapeAllowMakeVars = cc.GetEscapeAllowMakeVars();
 
   // Add each command line to the set of commands.
   std::vector<std::string> commands1;
@@ -887,15 +931,14 @@
       for(unsigned int j=1; j < commandLine.size(); ++j)
         {
         cmd += " ";
-        bool forceOn =  cmSystemTools::GetForceUnixPaths();
-        if(forceOn && this->WindowsShell)
+        if(escapeOldStyle)
           {
-          cmSystemTools::SetForceUnixPaths(false);
+          cmd += this->EscapeForShellOldStyle(commandLine[j].c_str());
           }
-        cmd += cmSystemTools::EscapeSpaces(commandLine[j].c_str());
-        if(forceOn && this->WindowsShell)
+        else
           {
-          cmSystemTools::SetForceUnixPaths(true);
+          cmd += this->EscapeForShell(commandLine[j].c_str(),
+                                      escapeAllowMakeVars);
           }
         }
       commands1.push_back(cmd);
@@ -1002,25 +1045,15 @@
         if(color_name.empty())
           {
           // Use the native echo command.
-          cmd = "@echo ";
-        if(this->EchoNeedsQuote)
-          {
-          cmd += "\"";
-          }
-        cmd += line;
-        if(this->EchoNeedsQuote)
-          {
-            cmd += "\"";
-            }
+          cmd = this->NativeEchoCommand;
+          cmd += this->EscapeForShell(line.c_str(), false, true);
           }
         else
           {
           // Use cmake to echo the text in color.
           cmd = "@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) ";
           cmd += color_name;
-          cmd += "\"";
-          cmd += line;
-          cmd += "\"";
+          cmd += this->EscapeForShell(line.c_str());
           }
         commands.push_back(cmd);
         }
@@ -1158,7 +1191,7 @@
 bool cmLocalUnixMakefileGenerator3::ScanDependencies(const char* tgtInfo)
 {
   // The info file for this target
-  std::string const& infoFile = tgtInfo;
+  std::string infoFile = tgtInfo;
 
   // Read the directory information file.
   cmMakefile* mf = this->Makefile;
@@ -1221,24 +1254,6 @@
   this->WriteDisclaimer(ruleFileStream);
   this->WriteDisclaimer(internalRuleFileStream);
 
-  // Get the set of generated files.
-  std::vector<std::string> generatedFilesVec;
-  if(haveDirectoryInfo)
-    {
-    if(const char* generated = mf->GetDefinition("CMAKE_GENERATED_FILES"))
-      {
-      cmSystemTools::ExpandListArgument(generated, generatedFilesVec);
-      }
-    }
-
-  // Sort for efficient lookup.
-  std::set<cmStdString> generatedFiles;
-  for(std::vector<std::string>::iterator gfi = generatedFilesVec.begin();
-      gfi != generatedFilesVec.end(); ++gfi)
-    {
-    generatedFiles.insert(*gfi);
-    }
-
   // for each language we need to scan, scan it 
   const char *langStr = mf->GetSafeDefinition("CMAKE_DEPENDS_LANGUAGES");
   std::vector<std::string> langs;
@@ -1289,14 +1304,15 @@
     if(lang == "C" || lang == "CXX" || lang == "RC")
       {
       std::string includeCacheFileName = dir;
-      includeCacheFileName += "/includecache.";
+      includeCacheFileName += "/";
       includeCacheFileName += lang;
+      includeCacheFileName += ".includecache";
       
       // TODO: Handle RC (resource files) dependencies correctly.
       scanner = new cmDependsC(includes,
                                includeRegexScan.c_str(),
                                includeRegexComplain.c_str(),
-                               generatedFiles, includeCacheFileName);
+                               includeCacheFileName);
       scanner->SetLocalGenerator(this);
       }
 #ifdef CMAKE_BUILD_WITH_CMAKE
@@ -1350,7 +1366,6 @@
 ::WriteLocalAllRules(std::ostream& ruleFileStream)
 {
   this->WriteDisclaimer(ruleFileStream);
-  this->WriteMakeVariables(ruleFileStream);
 
   // Write the main entry point target.  This must be the VERY first
   // target so that make with no arguments will run it.
@@ -1369,7 +1384,25 @@
                       no_commands, true);
   }
 
+  this->WriteSpecialTargetsTop(ruleFileStream);
+
+  // Include the progress variables for the target.
+  std::string progressFile = cmake::GetCMakeFilesDirectory();
+  progressFile += "/progress.make";
+  std::string progressFileNameFull =
+    this->ConvertToFullPath(progressFile.c_str());
+  ruleFileStream
+    << "# Include the progress variables for this target.\n"
+    << this->IncludeDirective << " "
+    << this->Convert(progressFileNameFull.c_str(),
+                     cmLocalGenerator::START_OUTPUT,
+                     cmLocalGenerator::MAKEFILE) << "\n\n";
+  
   // Write all global targets
+  this->WriteDivider(ruleFileStream);
+  ruleFileStream
+    << "# Targets provided globally by CMake.\n"
+    << "\n";
   cmTargets* targets = &(this->Makefile->GetTargets());
   cmTargets::iterator glIt;
   for ( glIt = targets->begin(); glIt != targets->end(); ++ glIt )
@@ -1410,7 +1443,7 @@
 
       // Provide a "/fast" version of the target.
       depends.clear();
-      if(targetName == "install")
+      if((targetName == "install") || (targetName == "install_local"))
         {
         // Provide a fast install target that does not depend on all
         // but has the same command.
@@ -1428,16 +1461,15 @@
       }
     }
 
-  this->WriteSpecialTargetsTop(ruleFileStream);
-
   std::vector<std::string> depends;
   std::vector<std::string> commands;
 
   // Write the all rule.
-  std::string dir = this->Makefile->GetStartOutputDirectory();
-  dir += "/all";
+  std::string dir;
+  std::string recursiveTarget = this->Makefile->GetStartOutputDirectory();
+  recursiveTarget += "/all";
 
-  dir = this->Convert(dir.c_str(),HOME_OUTPUT,MAKEFILE);
+  dir = this->Convert(recursiveTarget.c_str(),HOME_OUTPUT,MAKEFILE);
 
   depends.push_back("cmake_check_build_system");
 
@@ -1456,7 +1488,7 @@
   std::string mf2Dir = cmake::GetCMakeFilesDirectoryPostSlash();
   mf2Dir += "Makefile2";
   commands.push_back(this->GetRecursiveMakeCall(mf2Dir.c_str(),
-                                                dir.c_str()));  
+                                                recursiveTarget.c_str()));
   this->CreateCDCommand(commands,
                                 this->Makefile->GetHomeOutputDirectory(),
                                 this->Makefile->GetStartOutputDirectory());
@@ -1473,13 +1505,13 @@
                       depends, commands, true);
 
   // Write the clean rule.
-  dir = this->Makefile->GetStartOutputDirectory();
-  dir += "/clean";
-  dir = this->Convert(dir.c_str(),HOME_OUTPUT,MAKEFILE);
+  recursiveTarget = this->Makefile->GetStartOutputDirectory();
+  recursiveTarget += "/clean";
+  dir = this->Convert(recursiveTarget.c_str(),HOME_OUTPUT,MAKEFILE);
   commands.clear();
   depends.clear();
   commands.push_back(this->GetRecursiveMakeCall(mf2Dir.c_str(),
-                                                dir.c_str()));  
+                                                recursiveTarget.c_str()));
   this->CreateCDCommand(commands,
                                 this->Makefile->GetHomeOutputDirectory(),
                                 this->Makefile->GetStartOutputDirectory());
@@ -1492,9 +1524,9 @@
                       depends, commands, true);
 
   // Write the preinstall rule.
-  dir = this->Makefile->GetStartOutputDirectory();
-  dir += "/preinstall";
-  dir = this->Convert(dir.c_str(), HOME_OUTPUT,MAKEFILE);
+  recursiveTarget = this->Makefile->GetStartOutputDirectory();
+  recursiveTarget += "/preinstall";
+  dir = this->Convert(recursiveTarget.c_str(), HOME_OUTPUT,MAKEFILE);
   commands.clear();
   depends.clear();
   const char* noall =
@@ -1510,7 +1542,7 @@
     depends.push_back("cmake_check_build_system");
     }
   commands.push_back
-    (this->GetRecursiveMakeCall(mf2Dir.c_str(), dir.c_str()));
+    (this->GetRecursiveMakeCall(mf2Dir.c_str(), recursiveTarget.c_str()));
   this->CreateCDCommand(commands,
                         this->Makefile->GetHomeOutputDirectory(),
                         this->Makefile->GetStartOutputDirectory());
@@ -1884,19 +1916,3 @@
       }
     }
 }
-
-//----------------------------------------------------------------------------
-const char*
-cmLocalUnixMakefileGenerator3
-::GetSourceFileLanguage(const cmSourceFile& source)
-{
-  const char* lang = source.GetProperty("LANGUAGE");
-  if ( lang )
-    {
-    return lang;
-    }
-  // Identify the language of the source file.
-  return (this->GlobalGenerator
-          ->GetLanguageFromExtension(source.GetSourceExtension().c_str()));
-}
-

Index: cmStandardIncludes.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmStandardIncludes.h,v
retrieving revision 1.62.2.1
retrieving revision 1.62.2.2
diff -u -d -r1.62.2.1 -r1.62.2.2
--- cmStandardIncludes.h	24 Jul 2006 15:19:36 -0000	1.62.2.1
+++ cmStandardIncludes.h	13 Oct 2006 14:52:06 -0000	1.62.2.2
@@ -27,6 +27,7 @@
 // include configure generated  header to define CMAKE_NO_ANSI_STREAM_HEADERS,
 // CMAKE_NO_STD_NAMESPACE, and other macros.
 #include "cmConfigure.h"
+#include <cmsys/Configure.hxx>
 
 #define CMake_VERSION \
   CMAKE_TO_STRING(CMake_VERSION_MAJOR) "." \
@@ -40,9 +41,14 @@
 #ifdef _MSC_VER
 #pragma warning ( disable : 4786 )
 #pragma warning ( disable : 4503 )
+#pragma warning ( disable : 4512 ) /* operator=() could not be generated */
 #define CMAKE_NO_ANSI_FOR_SCOPE
 #endif
 
+#ifdef __BORLANDC__
+#pragma warn -8030 /* Temporary used for parameter */
+#endif
+
 #ifdef __ICL
 #pragma warning ( disable : 985 )
 #endif
@@ -68,6 +74,19 @@
 };
 #endif
 
+// Include stream compatibility layer from KWSys.
+// This is needed to work with large file support
+// on some platforms whose stream operators do not
+// support the large integer types.
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+# include <cmsys/IOStream.hxx>
+#endif
+
+// Avoid warnings in system headers.
+#if defined(_MSC_VER)
+# pragma warning (push,1)
+#endif
+
 #ifndef CMAKE_NO_ANSI_STREAM_HEADERS
 #  include <fstream>
 #  include <iostream>
@@ -97,6 +116,10 @@
 #include <set>
 #include <deque>
 
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif
+
 // include the "c" string header
 #include <string.h>
 #include <stdio.h>

Index: cmDependsFortranParser.y
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortranParser.y,v
retrieving revision 1.10
retrieving revision 1.10.6.1
diff -u -d -r1.10 -r1.10.6.1
--- cmDependsFortranParser.y	14 Mar 2005 13:15:08 -0000	1.10
+++ cmDependsFortranParser.y	13 Oct 2006 14:52:02 -0000	1.10.6.1
@@ -65,6 +65,9 @@
 /* Disable some warnings in the generated code.  */
 #ifdef __BORLANDC__
 # pragma warn -8004 /* Variable assigned a value that is not used.  */
+# pragma warn -8008 /* condition always returns true */
+# pragma warn -8060 /* possibly incorrect assignment */
+# pragma warn -8066 /* unreachable code */
 #endif
 #ifdef _MSC_VER
 # pragma warning (disable: 4102) /* Unused goto label.  */

Index: cmInstallFilesCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallFilesCommand.cxx,v
retrieving revision 1.20.2.1
retrieving revision 1.20.2.2
diff -u -d -r1.20.2.1 -r1.20.2.2
--- cmInstallFilesCommand.cxx	11 May 2006 20:05:58 -0000	1.20.2.1
+++ cmInstallFilesCommand.cxx	13 Oct 2006 14:52:02 -0000	1.20.2.2
@@ -25,6 +25,11 @@
     this->SetError("called with incorrect number of arguments");
     return false;
     }
+
+  // Enable the install target.
+  this->Makefile->GetLocalGenerator()
+    ->GetGlobalGenerator()->EnableInstallTarget();
+
   std::vector<std::string> args;
   this->Makefile->ExpandSourceListArguments(argsIn, args, 2);
 

Index: cmLocalVisualStudio7Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.h,v
retrieving revision 1.22.2.2
retrieving revision 1.22.2.3
diff -u -d -r1.22.2.2 -r1.22.2.3
--- cmLocalVisualStudio7Generator.h	24 Jul 2006 15:19:35 -0000	1.22.2.2
+++ cmLocalVisualStudio7Generator.h	13 Oct 2006 14:52:05 -0000	1.22.2.3
@@ -71,6 +71,7 @@
                                    std::string& flags);
   std::string GetBuildTypeLinkerFlags(std::string rootLinkerFlags,
                                       const char* configName);
+  void FixGlobalTargets();
   void OutputVCProjFile();
   void WriteVCProjHeader(std::ostream& fout, const char *libName,
                          cmTarget &tgt, std::vector<cmSourceGroup> &sgs);

Index: cmRemoveCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmRemoveCommand.h,v
retrieving revision 1.6
retrieving revision 1.6.6.1
diff -u -d -r1.6 -r1.6.6.1
--- cmRemoveCommand.h	18 Mar 2005 15:41:41 -0000	1.6
+++ cmRemoveCommand.h	13 Oct 2006 14:52:06 -0000	1.6.6.1
@@ -56,7 +56,7 @@
    */
   virtual const char* GetTerseDocumentation() 
     {
-    return "Remove a value from a list in a variable.";
+    return "Old list item removal command.  Use the LIST command.";
     }
   
   /**
@@ -65,12 +65,20 @@
   virtual const char* GetFullDocumentation()
     {
     return
+      "This command has been superceded by the LIST(REMOVE ...) command.  "
+      "It is provided for compatibility with older CMake code.\n"
       "  REMOVE(VAR VALUE VALUE ...)\n"
       "Removes VALUE from the variable VAR.  "
       "This is typically used to remove entries from a vector "
       "(e.g. semicolon separated list).  VALUE is expanded.";
     }
   
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+  
   cmTypeMacro(cmRemoveCommand, cmCommand);
 };
 

Index: cmGlobalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.h,v
retrieving revision 1.58.2.3
retrieving revision 1.58.2.4
diff -u -d -r1.58.2.3 -r1.58.2.4
--- cmGlobalGenerator.h	30 Jun 2006 17:48:43 -0000	1.58.2.3
+++ cmGlobalGenerator.h	13 Oct 2006 14:52:02 -0000	1.58.2.4
@@ -123,6 +123,7 @@
   void AddLocalGenerator(cmLocalGenerator *lg);
 
   void AddInstallComponent(const char* component);
+  void EnableInstallTarget();
   
   static int s_TryCompileTimeout;
   
@@ -155,6 +156,10 @@
   /** Get whether the generator should use a script for link commands.  */
   bool GetUseLinkScript() { return this->UseLinkScript; }
 
+  /** Get whether the generator should produce special marks on rules
+      producing symbolic (non-file) outputs.  */
+  bool GetNeedSymbolicMark() { return this->NeedSymbolicMark; }
+
   /*
    * Determine what program to use for building the project.
    */
@@ -186,6 +191,7 @@
 
   virtual const char* GetAllTargetName()          { return "ALL_BUILD"; }
   virtual const char* GetInstallTargetName()      { return "INSTALL"; }
+  virtual const char* GetInstallLocalTargetName() { return 0; }
   virtual const char* GetPreinstallTargetName()   { return 0; }
   virtual const char* GetTestTargetName()         { return "RUN_TESTS"; }
   virtual const char* GetPackageTargetName()      { return "PACKAGE"; }
@@ -208,6 +214,7 @@
     const cmCustomCommandLines* commandLines,
     std::vector<std::string> depends, bool depends_on_all = false);
 
+  bool NeedSymbolicMark;
   bool UseLinkScript;
   bool ForceUnixPaths;
   bool ToolSupportsColor;
@@ -220,6 +227,7 @@
 
   // Set of named installation components requested by the project.
   std::set<cmStdString> InstallComponents;
+  bool InstallTargetEnabled;
 
   // Manifest of all targets that will be built for each configuration.
   // This is computed just before local generators generate.

Index: cmGlobalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalUnixMakefileGenerator3.cxx,v
retrieving revision 1.56.2.8
retrieving revision 1.56.2.9
diff -u -d -r1.56.2.8 -r1.56.2.9
--- cmGlobalUnixMakefileGenerator3.cxx	27 Jul 2006 14:37:07 -0000	1.56.2.8
+++ cmGlobalUnixMakefileGenerator3.cxx	13 Oct 2006 14:52:02 -0000	1.56.2.9
@@ -215,8 +215,6 @@
                     "The main recursive preinstall target", "preinstall",
                     depends, no_commands, true);
 
-  lg->WriteMakeVariables(makefileStream);
-
   // Write out the "special" stuff
   lg->WriteSpecialTargetsTop(makefileStream);
   
@@ -466,9 +464,6 @@
   std::string makeTarget = lg->GetMakefile()->GetStartOutputDirectory();
   makeTarget += "/";
   makeTarget += pass;
-  makeTarget = lg->Convert(makeTarget.c_str(),
-                           cmLocalGenerator::HOME_OUTPUT,
-                           cmLocalGenerator::MAKEFILE);
 
   // The directory-level rule should depend on the target-level rules
   // for all targets in the directory.
@@ -504,9 +499,6 @@
     std::string subdir = slg->GetMakefile()->GetStartOutputDirectory();
     subdir += "/";
     subdir += pass;
-    subdir = slg->Convert(subdir.c_str(),
-                          cmLocalGenerator::HOME_OUTPUT,
-                          cmLocalGenerator::MAKEFILE);
     depends.push_back(subdir);
     }
 
@@ -823,8 +815,10 @@
                                cmLocalGenerator::FULL,
                                cmLocalGenerator::SHELL);
         //
+        std::set<cmStdString> emitted;
         progCmd << " " 
-                << this->GetTargetTotalNumberOfActions(t->second);
+                << this->GetTargetTotalNumberOfActions(t->second,
+                                                       emitted);
         commands.push_back(progCmd.str());
         }
         std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash();
@@ -895,18 +889,26 @@
 
 //----------------------------------------------------------------------------
 int cmGlobalUnixMakefileGenerator3
-::GetTargetTotalNumberOfActions(cmTarget& target)
+::GetTargetTotalNumberOfActions(cmTarget& target, 
+                                std::set<cmStdString> &emitted)
 {
+  // do not double count
+  int result = 0;
+
+  if(emitted.insert(target.GetName()).second)
+    {
   cmLocalUnixMakefileGenerator3 *lg = 
     static_cast<cmLocalUnixMakefileGenerator3 *>
     (target.GetMakefile()->GetLocalGenerator());
-  int result = static_cast<int>(lg->ProgressFiles[target.GetName()].size());
+    result = static_cast<int>(lg->ProgressFiles[target.GetName()].size());
+    
   std::vector<cmTarget *>& depends = this->GetTargetDepends(target);
 
   std::vector<cmTarget *>::iterator i;
   for (i = depends.begin(); i != depends.end(); ++i)
     {
-    result += this->GetTargetTotalNumberOfActions(**i);
+      result += this->GetTargetTotalNumberOfActions(**i, emitted);
+      }
     }
   
   return result;
@@ -1231,13 +1233,12 @@
             }
           }
         }
-      std::map<cmStdString,std::vector<cmTarget *> > const& objs =
-        lg->GetLocalObjectFiles();
-      for(std::map<cmStdString,std::vector<cmTarget *> >::const_iterator o =
-            objs.begin(); o != objs.end(); ++o)
+      std::vector<cmStdString> const& localHelp = lg->GetLocalHelp();
+      for(std::vector<cmStdString>::const_iterator o = localHelp.begin();
+          o != localHelp.end(); ++o)
         {
          path = "... ";
-         path += o->first;
+        path += *o;
          lg->AppendEcho(commands, path.c_str());
         }
       }

Index: cmAddCustomTargetCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddCustomTargetCommand.cxx,v
retrieving revision 1.21
retrieving revision 1.21.2.1
diff -u -d -r1.21 -r1.21.2.1
--- cmAddCustomTargetCommand.cxx	15 Mar 2006 16:01:58 -0000	1.21
+++ cmAddCustomTargetCommand.cxx	13 Oct 2006 14:52:02 -0000	1.21.2.1
@@ -26,6 +26,29 @@
     return false;
     }
 
+  // Check the target name.
+  if(args[0].find_first_of("/\\") != args[0].npos)
+    {
+    int major = 0;
+    int minor = 0;
+    if(const char* versionValue =
+       this->Makefile->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY"))
+      {
+      sscanf(versionValue, "%d.%d", &major, &minor);
+      }
+    if(!major || major > 3 || (major == 2 && minor > 2))
+      {
+      cmOStringStream e;
+      e << "called with invalid target name \"" << args[0]
+        << "\".  Target names may not contain a slash.  "
+        << "Use ADD_CUSTOM_COMMAND to generate files.  "
+        << "Set CMAKE_BACKWARDS_COMPATIBILITY to 2.2 "
+        << "or lower to skip this check.";
+      this->SetError(e.str().c_str());
+      return false;
+      }
+    }
+
   // Accumulate one command line at a time.
   cmCustomCommandLine currentLine;
 
@@ -35,12 +58,17 @@
   // Accumulate dependencies.
   std::vector<std::string> depends;
   std::string working_directory;
+  bool verbatim = false;
+  std::string comment_buffer;
+  const char* comment = 0;
 
   // Keep track of parser state.
   enum tdoing {
     doing_command,
     doing_depends,
-    doing_working_directory
+    doing_working_directory,
+    doing_comment,
+    doing_verbatim
   };
   tdoing doing = doing_command;
 
@@ -69,6 +97,15 @@
       {
       doing = doing_working_directory;
       }
+    else if(copy == "VERBATIM")
+      {
+      doing = doing_verbatim;
+      verbatim = true;
+      }
+    else if (copy == "COMMENT")
+      {
+      doing = doing_comment;
+      }
     else if(copy == "COMMAND")
       {
       doing = doing_command;
@@ -93,6 +130,10 @@
         case doing_depends:
           depends.push_back(copy);
           break;
+         case doing_comment:
+           comment_buffer = copy;
+           comment = comment_buffer.c_str();
+           break;
         default:
           this->SetError("Wrong syntax. Unknown type of argument.");
           return false;
@@ -118,10 +159,10 @@
     }
 
   // Add the utility target to the makefile.
-  const char* no_output = 0;
-  this->Makefile->AddUtilityCommand(args[0].c_str(), all, no_output,
+  bool escapeOldStyle = !verbatim;
+  this->Makefile->AddUtilityCommand(args[0].c_str(), all,
                                     working_directory.c_str(), depends,
-                                    commandLines);
+                                    commandLines, escapeOldStyle, comment);
 
   return true;
 }

Index: cmListFileCache.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmListFileCache.cxx,v
retrieving revision 1.27.2.1
retrieving revision 1.27.2.2
diff -u -d -r1.27.2.1 -r1.27.2.2
--- cmListFileCache.cxx	14 May 2006 19:22:42 -0000	1.27.2.1
+++ cmListFileCache.cxx	13 Oct 2006 14:52:02 -0000	1.27.2.2
@@ -21,6 +21,10 @@
 
 #include <cmsys/RegularExpression.hxx>
 
+#ifdef __BORLANDC__
+# pragma warn -8060 /* possibly incorrect assignment */
+#endif
+
 bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
                                   cmListFileFunction& function,
                                   const char* filename);

Index: cmAddCustomTargetCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddCustomTargetCommand.h,v
retrieving revision 1.15.2.1
retrieving revision 1.15.2.2
diff -u -d -r1.15.2.1 -r1.15.2.2
--- cmAddCustomTargetCommand.h	30 Jun 2006 17:48:43 -0000	1.15.2.1
+++ cmAddCustomTargetCommand.h	13 Oct 2006 14:52:02 -0000	1.15.2.2
@@ -65,10 +65,16 @@
     return
       "  ADD_CUSTOM_TARGET(Name [ALL] [command1 [args1...]]\n"
       "                    [COMMAND command2 [args2...] ...]\n"
-      "                    [DEPENDS depend depend depend ... ])\n"
+      "                    [DEPENDS depend depend depend ... ]\n"
       "                    [WORKING_DIRECTORY dir]\n"
-      "Adds a target with the given name that executes the given commands "
-      "every time the target is built.  If the ALL option is specified "
+      "                    [COMMENT comment] [VERBATIM])\n"
+      "Adds a target with the given name that executes the given commands. "
+      "The target has no output file and is ALWAYS CONSIDERED OUT OF DATE "
+      "even if the commands try to create a file with the name of the "
+      "target. Use ADD_CUSTOM_COMMAND to generate a file with dependencies. "
+      "By default nothing depends on the custom target. Use "
+      "ADD_DEPENDENCIES to add dependencies to or from other targets. "
+      "If the ALL option is specified "
       "it indicates that this target should be added to the default build "
       "target so that it will be run every time "
       "(the command cannot be called ALL). "
@@ -76,10 +82,18 @@
       "empty target will be created. "
       "If WORKING_DIRECTORY is set, then the command will be run in that "
       "directory. "
+      "If COMMENT is set, the value will be displayed as a "
+      "message before the commands are executed at build time. "
       "Dependencies listed with the DEPENDS argument may reference files "
-      "and outputs of custom commands created with ADD_CUSTOM_COMMAND. "
-      "Dependencies on other targets may be added using the "
-      "ADD_DEPENDENCIES command.";
+      "and outputs of custom commands created with ADD_CUSTOM_COMMAND.\n"
+      "If VERBATIM is given then all the arguments to the commands will be "
+      "passed exactly as specified no matter the build tool used. "
+      "Note that one level of escapes is still used by the CMake language "
+      "processor before ADD_CUSTOM_TARGET even sees the arguments. "
+      "Use of VERBATIM is recommended as it enables correct behavior. "
+      "When VERBATIM is not given the behavior is platform specific. "
+      "In the future VERBATIM may be enabled by default. The only reason "
+      "it is an option is to preserve compatibility with older CMake code.";
     }
   
   cmTypeMacro(cmAddCustomTargetCommand, cmCommand);

Index: cmMakefileLibraryTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.cxx,v
retrieving revision 1.14.2.3
retrieving revision 1.14.2.4
diff -u -d -r1.14.2.3 -r1.14.2.4
--- cmMakefileLibraryTargetGenerator.cxx	30 Jun 2006 17:48:46 -0000	1.14.2.3
+++ cmMakefileLibraryTargetGenerator.cxx	13 Oct 2006 14:52:06 -0000	1.14.2.4
@@ -27,6 +27,12 @@
 #include <memory> // auto_ptr
 
 //----------------------------------------------------------------------------
+cmMakefileLibraryTargetGenerator::cmMakefileLibraryTargetGenerator()
+{
+  this->DriveCustomCommandsOnDepends = true;
+}
+
+//----------------------------------------------------------------------------
 void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
 {
   // create the build.make file and directory, put in the common blocks
@@ -305,7 +311,41 @@
   // Construct a list of files associated with this library that may
   // need to be cleaned.
   std::vector<std::string> libCleanFiles;
+  if(this->Target->GetPropertyAsBool("CLEAN_DIRECT_OUTPUT"))
   {
+    // The user has requested that only the files directly built
+    // by this target be cleaned instead of all possible names.
+    libCleanFiles.push_back(this->Convert(targetFullPath.c_str(),
+          cmLocalGenerator::START_OUTPUT,
+          cmLocalGenerator::UNCHANGED));
+    if(targetNameReal != targetName)
+      {
+      libCleanFiles.push_back(this->Convert(targetFullPathReal.c_str(),
+          cmLocalGenerator::START_OUTPUT,
+          cmLocalGenerator::UNCHANGED));
+      }
+    if(targetNameSO != targetName &&
+       targetNameSO != targetNameReal)
+      {
+      libCleanFiles.push_back(this->Convert(targetFullPathSO.c_str(),
+          cmLocalGenerator::START_OUTPUT,
+          cmLocalGenerator::UNCHANGED));
+      }
+    if(!targetNameImport.empty() &&
+       targetNameImport != targetName &&
+       targetNameImport != targetNameReal &&
+       targetNameImport != targetNameSO)
+      {
+      libCleanFiles.push_back(this->Convert(targetFullPathImport.c_str(),
+          cmLocalGenerator::START_OUTPUT,
+          cmLocalGenerator::UNCHANGED));
+      }
+    }
+  else
+    {
+    // This target may switch between static and shared based
+    // on a user option or the BUILD_SHARED_LIBS switch.  Clean
+    // all possible names.
   std::string cleanStaticName;
   std::string cleanSharedName;
   std::string cleanSharedSOName;
@@ -324,7 +364,8 @@
   std::string cleanFullSharedRealName = outpath + cleanSharedRealName;
   std::string cleanFullImportName = outpath + cleanImportName;
   libCleanFiles.push_back
-    (this->Convert(cleanFullStaticName.c_str(),cmLocalGenerator::START_OUTPUT,
+      (this->Convert(cleanFullStaticName.c_str(),
+                     cmLocalGenerator::START_OUTPUT,
                    cmLocalGenerator::UNCHANGED));
   if(cleanSharedRealName != cleanStaticName)
     {
@@ -358,6 +399,19 @@
                                           cmLocalGenerator::UNCHANGED));
     }
   }
+
+#ifdef _WIN32
+  // There may be a manifest file for this target.  Add it to the
+  // clean set just in case.
+  if(this->Target->GetType() != cmTarget::STATIC_LIBRARY)
+    {
+    libCleanFiles.push_back(
+      this->Convert((targetFullPath+".manifest").c_str(),
+                    cmLocalGenerator::START_OUTPUT,
+                    cmLocalGenerator::UNCHANGED));
+    }
+#endif
+
   // Add a command to remove any existing files for this library.
   std::vector<std::string> commands1;
   this->LocalGenerator->AppendCleanCommand(commands1, libCleanFiles,
@@ -494,19 +548,9 @@
   std::string install_name_dir;
   if(this->Target->GetType() == cmTarget::SHARED_LIBRARY)
     {
-    // Select whether to generate an install_name directory for the
-    // install tree or the build tree.
+    // Get the install_name directory for the build tree.
     const char* config = this->LocalGenerator->ConfigurationName.c_str();
-    if(this->Target->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH"))
-      {
-      install_name_dir =
-        this->Target->GetInstallNameDirForInstallTree(config);
-      }
-    else
-      {
-      install_name_dir =
-        this->Target->GetInstallNameDirForBuildTree(config);
-      }
+    install_name_dir = this->Target->GetInstallNameDirForBuildTree(config);
 
     // Set the rule variable replacement value.
     if(install_name_dir.empty())
@@ -518,13 +562,8 @@
       // Convert to a path for the native build tool.
       install_name_dir =
         this->LocalGenerator->Convert(install_name_dir.c_str(),
-                                      cmLocalGenerator::FULL,
+                                      cmLocalGenerator::NONE,
                                       cmLocalGenerator::SHELL, false);
-
-      // The Convert method seems to strip trailing slashes, which should
-      // probably be fixed.  Since the only platform supporting install_name
-      // right now uses forward slashes just add one.
-      install_name_dir += "/";
       vars.TargetInstallNameDir = install_name_dir.c_str();
       }
     }

Index: cmCommandArgumentLexer.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentLexer.cxx,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -u -d -r1.4.2.1 -r1.4.2.2
--- cmCommandArgumentLexer.cxx	11 May 2006 02:15:08 -0000	1.4.2.1
+++ cmCommandArgumentLexer.cxx	13 Oct 2006 14:52:02 -0000	1.4.2.2
@@ -1,6 +1,8 @@
+#include "cmStandardIncludes.h"
 
+#line 2 "cmCommandArgumentLexer.cxx"
 
-
+#line 4 "cmCommandArgumentLexer.cxx"
 
 #define  YY_INT_ALIGNED short int
 
@@ -9,7 +11,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 31
+#define YY_FLEX_SUBMINOR_VERSION 33
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -31,7 +33,15 @@
 
 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
 
-#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#if __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
 #include <inttypes.h>
 typedef int8_t flex_int8_t;
 typedef uint8_t flex_uint8_t;
@@ -154,6 +164,10 @@
 #define YY_BUF_SIZE 16384
 #endif
 
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
 #define YY_TYPEDEF_YY_BUFFER_STATE
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
@@ -165,8 +179,7 @@
 
     #define YY_LESS_LINENO(n)
     
-/* Return all but the first "n" matched characters back to the input
-   stream. */
+/* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
   do \
     { \
@@ -180,6 +193,8 @@
     } \
   while ( 0 )
 
+#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
+
 /* The following is because we cannot portably get our hands on size_t
  * (without autoconf's help, which isn't available because we want
  * flex-generated scanners to compile on their own).
@@ -246,9 +261,9 @@
    * still have a bunch of tokens to match, though, because of
    * possible backing-up.
    *
-   * When we actually see the EOF, we change the status to "new" (via
-   * cmCommandArgument_yyrestart()), so that the user can continue scanning
-   * by just pointing yyin at a new input file.
+         * When we actually see the EOF, we change the status to "new"
+         * (via cmCommandArgument_yyrestart()), so that the user can continue scanning by
+         * just pointing yyin at a new input file.
    */
 #define YY_BUFFER_EOF_PENDING 2
 
@@ -265,29 +280,22 @@
                           ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
                           : NULL)
 
-/* Same as previous macro, but useful when we know that the buffer stack is
- * not NULL or when we need an lvalue. For internal use only.
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
  */
 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
 
 void cmCommandArgument_yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,
-                                            yyscan_t yyscanner );
-YY_BUFFER_STATE cmCommandArgument_yy_create_buffer (FILE *file,int size ,
-                                                    yyscan_t yyscanner );
-void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b ,
-                                         yyscan_t yyscanner );
-void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b ,
-                                        yyscan_t yyscanner );
-void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,
-                                            yyscan_t yyscanner );
+void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+YY_BUFFER_STATE cmCommandArgument_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
+void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
 void cmCommandArgument_yypop_buffer_state (yyscan_t yyscanner );
 
 static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner );
 static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner );
-static void cmCommandArgument_yy_init_buffer (YY_BUFFER_STATE b,
-                                              FILE *file ,
-                                              yyscan_t yyscanner );
+static void cmCommandArgument_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
 
 #define YY_FLUSH_BUFFER cmCommandArgument_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
 
@@ -370,7 +378,7 @@
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    3,    1,    1,    1,    1,
-        1,    1,    1,    1,    4,    4,    4,    4,    4,    4,
+        1,    1,    4,    1,    4,    4,    4,    4,    4,    4,
         4,    4,    4,    4,    4,    4,    4,    1,    1,    1,
         1,    1,    1,    5,    4,    4,    4,    4,    4,    4,
         4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
@@ -436,8 +444,8 @@
 #define yymore() yymore_used_but_not_detected
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
-
-
+#line 1 "cmCommandArgumentLexer.in.l"
+#line 2 "cmCommandArgumentLexer.in.l"
 /*=========================================================================
 
   Program:   CMake - Cross-Platform Makefile Generator
@@ -477,25 +485,9 @@
 
 */
 
-#include "cmCommandArgumentParserHelper.h"
-
-/* Disable some warnings.  */
-#if defined(_MSC_VER)
-# pragma warning ( disable : 4127 )
-# pragma warning ( disable : 4131 )
-# pragma warning ( disable : 4244 )
-# pragma warning ( disable : 4251 )
-# pragma warning ( disable : 4267 )
-# pragma warning ( disable : 4305 )
-# pragma warning ( disable : 4309 )
-# pragma warning ( disable : 4706 )
-# pragma warning ( disable : 4786 )
-#endif
+#include "cmStandardLexer.h"
 
-/* Disable features we do not need. */
-#define YY_NEVER_INTERACTIVE 1
-#undef ECHO /* SGI termios defines this differently. */
-#define ECHO
+#include "cmCommandArgumentParserHelper.h"
 
 /* Replace the lexer input function.  */
 #undef YY_INPUT
@@ -505,18 +497,8 @@
 /* Include the set of tokens from the parser.  */
 #include "cmCommandArgumentParserTokens.h"
 
-
-#if defined( _WIN32 ) && !defined( __CYGWIN__ )
-/* Handle Windows properly */
-#  include <io.h>
-#  if defined( _MSC_VER )
-#    define isatty _isatty
-#  endif
-#  define YY_NO_UNISTD_H 1
-#endif
-
 /*--------------------------------------------------------------------------*/
-
+#line 500 "cmCommandArgumentLexer.cxx"
 
 #define INITIAL 0
 
@@ -566,6 +548,8 @@
 
     }; /* end struct yyguts_t */
 
+static int yy_init_globals (yyscan_t yyscanner );
+
 /* Accessor methods to globals.
    These are made visible to non-reentrant scanners for convenience. */
 
@@ -638,8 +622,8 @@
 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
 #endif
 
-/* Gets input and stuffs it into "buf".  number of characters read, or
- * YY_NULL, is returned in "result".
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
  */
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
@@ -729,14 +713,14 @@
   register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
+#line 60 "cmCommandArgumentLexer.in.l"
 
 
+#line 720 "cmCommandArgumentLexer.cxx"
 
-
-
-  if ( yyg->yy_init )
+        if ( !yyg->yy_init )
     {
-    yyg->yy_init = 0;
+                yyg->yy_init = 1;
 
 #ifdef YY_USER_INIT
     YY_USER_INIT;
@@ -817,7 +801,7 @@
 
 case 1:
 YY_RULE_SETUP
-
+#line 62 "cmCommandArgumentLexer.in.l"
 { 
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
   yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2); 
@@ -825,7 +809,7 @@
 } 
 case 2:
 YY_RULE_SETUP
-
+#line 68 "cmCommandArgumentLexer.in.l"
 { 
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
   yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2); 
@@ -833,7 +817,7 @@
 } 
 case 3:
 YY_RULE_SETUP
-
+#line 74 "cmCommandArgumentLexer.in.l"
 {
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
   //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
@@ -842,7 +826,7 @@
 }
 case 4:
 YY_RULE_SETUP
-
+#line 81 "cmCommandArgumentLexer.in.l"
 {
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
   //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
@@ -851,7 +835,7 @@
 }
 case 5:
 YY_RULE_SETUP
-
+#line 88 "cmCommandArgumentLexer.in.l"
 {
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
   //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
@@ -860,7 +844,7 @@
 }
 case 6:
 YY_RULE_SETUP
-
+#line 95 "cmCommandArgumentLexer.in.l"
 { 
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
   yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
@@ -868,7 +852,7 @@
 }
 case 7:
 YY_RULE_SETUP
-
+#line 101 "cmCommandArgumentLexer.in.l"
 {
   if ( !yyextra->HandleEscapeSymbol(yylvalp, *(yytext+1)) )
     {
@@ -879,7 +863,7 @@
 case 8:
 /* rule 8 can match eol */
 YY_RULE_SETUP
-
+#line 109 "cmCommandArgumentLexer.in.l"
 { 
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
   yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
@@ -887,7 +871,7 @@
 }
 case 9:
 YY_RULE_SETUP
-
+#line 115 "cmCommandArgumentLexer.in.l"
 {
   //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
   yylvalp->str = yyextra->DOLLARVariable;
@@ -895,7 +879,7 @@
 }
 case 10:
 YY_RULE_SETUP
-
+#line 121 "cmCommandArgumentLexer.in.l"
 {
   //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
   yylvalp->str = yyextra->LCURLYVariable;
@@ -903,7 +887,7 @@
 }
 case 11:
 YY_RULE_SETUP
-
+#line 127 "cmCommandArgumentLexer.in.l"
 {
   //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
   yylvalp->str = yyextra->BSLASHVariable;
@@ -911,10 +895,10 @@
 }
 case 12:
 YY_RULE_SETUP
-
+#line 133 "cmCommandArgumentLexer.in.l"
 ECHO;
   YY_BREAK
-
+#line 913 "cmCommandArgumentLexer.cxx"
 case YY_STATE_EOF(INITIAL):
   yyterminate();
 
@@ -1101,10 +1085,10 @@
 
   else
     {
-      size_t nuto_read =
+                        int num_to_read =
       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
-    while ( nuto_read <= 0 )
+                while ( num_to_read <= 0 )
       { /* Not enough room in the buffer - grow it. */
 
       /* just a shorter name for the current buffer */
@@ -1136,17 +1120,17 @@
 
       yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
 
-      nuto_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+                        num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
             number_to_move - 1;
 
       }
 
-    if ( nuto_read > YY_READ_BUF_SIZE )
-      nuto_read = YY_READ_BUF_SIZE;
+                if ( num_to_read > YY_READ_BUF_SIZE )
+                        num_to_read = YY_READ_BUF_SIZE;
 
     /* Read in more data. */
     YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-      yyg->yy_n_chars, nuto_read );
+                        yyg->yy_n_chars, (size_t) num_to_read );
 
     YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
     }
@@ -1179,8 +1163,7 @@
   return ret_val;
 }
 
-/* yy_get_previous_state - get the state just before the EOB char was
-   reached */
+/* yy_get_previous_state - get the state just before the EOB char was reached */
 
     static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
 {
@@ -1218,7 +1201,7 @@
     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
 {
   register int yy_is_jam;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
   register char *yy_cp = yyg->yy_c_buf_p;
 
   register YY_CHAR yy_c = 1;
@@ -1361,10 +1344,10 @@
   YY_CURRENT_BUFFER_LVALUE = new_buffer;
   cmCommandArgument_yy_load_buffer_state(yyscanner );
 
-  /* We don't actually know whether we did this switch during EOF
-   * (cmCommandArgument_yywrap()) processing, but the only time this flag is
-   * looked at is after cmCommandArgument_yywrap() is called, so it's safe to
-   * go ahead and always set it.
+        /* We don't actually know whether we did this switch during
+         * EOF (cmCommandArgument_yywrap()) processing, but the only time this flag
+         * is looked at is after cmCommandArgument_yywrap() is called, so it's safe
+         * to go ahead and always set it.
    */
   yyg->yy_did_buffer_switch_on_eof = 1;
 }
@@ -1378,10 +1361,11 @@
   yyg->yy_hold_char = *yyg->yy_c_buf_p;
 }
 
-/** Allocate and initialize an input buffer state.  @param file A readable
- * stream.  @param size The character buffer size in bytes. When in doubt,
- * use @c YY_BUF_SIZE.  @param yyscanner The scanner object.  @return the
- * allocated buffer state.
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * @param yyscanner The scanner object.
+ * @return the allocated buffer state.
  */
     YY_BUFFER_STATE cmCommandArgument_yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
 {
@@ -1446,10 +1430,9 @@
   b->yy_input_file = file;
   b->yy_fill_buffer = 1;
 
-    /* If b is the current buffer, then cmCommandArgument_yy_init_buffer was
-     * _probably_ called from cmCommandArgument_yyrestart() or through
-     * yy_get_next_buffer.  In that case, we don't want to reset the lineno
-     * or column.
+    /* If b is the current buffer, then cmCommandArgument_yy_init_buffer was _probably_
+     * called from cmCommandArgument_yyrestart() or through yy_get_next_buffer.
+     * In that case, we don't want to reset the lineno or column.
      */
     if (b != YY_CURRENT_BUFFER){
         b->yy_bs_lineno = 1;
@@ -1461,9 +1444,9 @@
   errno = oerrno;
 }
 
-/** Discard all buffered characters. On the next scan, YY_INPUT will be
- * called.  @param b the buffer state to be flushed, usually @c
- * YY_CURRENT_BUFFER.  @param yyscanner The scanner object.
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * @param yyscanner The scanner object.
  */
     void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
 {
@@ -1548,7 +1531,7 @@
  */
 static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner)
 {
-  int nuto_alloc;
+        int num_to_alloc;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
   if (!yyg->yy_buffer_stack) {
@@ -1557,14 +1540,14 @@
      * scanner will even need a stack. We use 2 instead of 1 to avoid an
      * immediate realloc on the next call.
          */
-    nuto_alloc = 1;
+                num_to_alloc = 1;
     yyg->yy_buffer_stack = (struct yy_buffer_state**)cmCommandArgument_yyalloc
-                (nuto_alloc * sizeof(struct yy_buffer_state*)
+                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
                 , yyscanner);
     
-    memset(yyg->yy_buffer_stack, 0, nuto_alloc * sizeof(struct yy_buffer_state*));
+                memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
         
-    yyg->yy_buffer_stack_max = nuto_alloc;
+                yyg->yy_buffer_stack_max = num_to_alloc;
     yyg->yy_buffer_stack_top = 0;
     return;
   }
@@ -1574,21 +1557,22 @@
     /* Increase the buffer to prepare for a possible push. */
     int grow_size = 8 /* arbitrary grow size */;
 
-    nuto_alloc = yyg->yy_buffer_stack_max + grow_size;
+                num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
     yyg->yy_buffer_stack = (struct yy_buffer_state**)cmCommandArgument_yyrealloc
                 (yyg->yy_buffer_stack,
-                nuto_alloc * sizeof(struct yy_buffer_state*)
+                                                                num_to_alloc * sizeof(struct yy_buffer_state*)
                 , yyscanner);
 
     /* zero only the new slots.*/
     memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
-    yyg->yy_buffer_stack_max = nuto_alloc;
+                yyg->yy_buffer_stack_max = num_to_alloc;
   }
 }
 
-/** Setup the input buffer state to scan directly from a user-specified
- * character buffer.  @param base the character buffer @param size the size
- * in bytes of the character buffer @param yyscanner The scanner object.
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object. 
  */
 YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
@@ -1620,26 +1604,28 @@
   return b;
 }
 
-/** Setup the input buffer state to scan a string. The next call to
- * cmCommandArgument_yylex() will scan from a @e copy of @a str.  @param str
- * a NUL-terminated string to scan @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.  @note If you want to
- * scan bytes that may contain NUL values, then use
+/** Setup the input buffer state to scan a string. The next call to cmCommandArgument_yylex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
  *       cmCommandArgument_yy_scan_bytes() instead.
  */
-YY_BUFFER_STATE cmCommandArgument_yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner)
+YY_BUFFER_STATE cmCommandArgument_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
 {
     
-  return cmCommandArgument_yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner);
+        return cmCommandArgument_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
 }
 
-/** Setup the input buffer state to scan the given bytes. The next call to
- * cmCommandArgument_yylex() will scan from a @e copy of @a bytes.  @param
- * bytes the byte buffer to scan @param len the number of bytes in the buffer
- * pointed to by @a bytes.  @param yyscanner The scanner object.  @return the
- * newly allocated buffer state object.
+/** Setup the input buffer state to scan the given bytes. The next call to cmCommandArgument_yylex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE cmCommandArgument_yy_scan_bytes  (yyconst char * bytes, int  len , yyscan_t yyscanner)
+YY_BUFFER_STATE cmCommandArgument_yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
 {
   YY_BUFFER_STATE b;
   char *buf;
@@ -1647,15 +1633,15 @@
   int i;
     
   /* Get memory for full buffer, including space for trailing EOB's. */
-  n = len + 2;
+        n = _yybytes_len + 2;
   buf = (char *) cmCommandArgument_yyalloc(n ,yyscanner );
   if ( ! buf )
     YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_scan_bytes()" );
 
-  for ( i = 0; i < len; ++i )
-    buf[i] = bytes[i];
+        for ( i = 0; i < _yybytes_len; ++i )
+                buf[i] = yybytes[i];
 
-  buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+        buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
 
   b = cmCommandArgument_yy_scan_buffer(buf,n ,yyscanner);
   if ( ! b )
@@ -1805,12 +1791,7 @@
 
         /* column is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-          {
-          yy_fatal_error
-            ("cmCommandArgument_yyset_column called with no buffer" , 
-             yyscanner); 
-          }
-        
+           yy_fatal_error( "cmCommandArgument_yyset_column called with no buffer" , yyscanner); 
     
     yycolumn = column_no;
 }
@@ -1847,21 +1828,51 @@
 
 /* Accessor methods for yylval and yylloc */
 
+/* User-visible API */
+
+/* cmCommandArgument_yylex_init is special because it creates the scanner itself, so it is
+ * the ONLY reentrant function that doesn't take the scanner as the last argument.
+ * That's why we explicitly handle the declaration, instead of using our macros.
+ */
+
+int cmCommandArgument_yylex_init(yyscan_t* ptr_yy_globals)
+
+{
+    if (ptr_yy_globals == NULL){
+        errno = EINVAL;
+        return 1;
+    }
+
+    *ptr_yy_globals = (yyscan_t) cmCommandArgument_yyalloc ( sizeof( struct yyguts_t ), NULL );
+
+    if (*ptr_yy_globals == NULL){
+        errno = ENOMEM;
+        return 1;
+    }
+
+    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
+    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+
+    return yy_init_globals ( *ptr_yy_globals );
+}
+
 static int yy_init_globals (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
     /* Initialization is the same as for the non-reentrant scanner.
-       This function is called once per scanner lifetime. */
+     * This function is called from cmCommandArgument_yylex_destroy(), so don't allocate here.
+     */
 
     yyg->yy_buffer_stack = 0;
     yyg->yy_buffer_stack_top = 0;
     yyg->yy_buffer_stack_max = 0;
     yyg->yy_c_buf_p = (char *) 0;
-    yyg->yy_init = 1;
+    yyg->yy_init = 0;
     yyg->yy_start = 0;
+
     yyg->yy_start_stack_ptr = 0;
     yyg->yy_start_stack_depth = 0;
-    yyg->yy_start_stack = (int *) 0;
+    yyg->yy_start_stack =  NULL;
 
 /* Defined in main.c */
 #ifdef YY_STDINIT
@@ -1878,36 +1889,7 @@
     return 0;
 }
 
-/* User-visible API */
-
-/* cmCommandArgument_yylex_init is special because it creates the scanner
- * itself, so it is the ONLY reentrant function that doesn't take the scanner
- * as the last argument.  That's why we explicitly handle the declaration,
- * instead of using our macros.
- */
-
-int cmCommandArgument_yylex_init(yyscan_t* ptr_yy_globals)
-
-{
-    if (ptr_yy_globals == NULL){
-        errno = EINVAL;
-        return 1;
-    }
-
-    *ptr_yy_globals = (yyscan_t) cmCommandArgument_yyalloc ( sizeof( struct yyguts_t ), NULL );
-
-    if (*ptr_yy_globals == NULL){
-        errno = ENOMEM;
-        return 1;
-    }
-
-    memset(*ptr_yy_globals,0,sizeof(struct yyguts_t));
-
-    return yy_init_globals ( *ptr_yy_globals );
-}
-
-/* cmCommandArgument_yylex_destroy is for both reentrant and non-reentrant
-   scanners. */
+/* cmCommandArgument_yylex_destroy is for both reentrant and non-reentrant scanners. */
 int cmCommandArgument_yylex_destroy  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -1927,8 +1909,13 @@
         cmCommandArgument_yyfree(yyg->yy_start_stack ,yyscanner );
         yyg->yy_start_stack = NULL;
 
+    /* Reset the globals. This is important in a non-reentrant scanner so the next time
+     * cmCommandArgument_yylex() is called, initialization will occur. */
+    yy_init_globals( yyscanner);
+
     /* Destroy the main struct (reentrant only). */
     cmCommandArgument_yyfree ( yyscanner , yyscanner );
+    yyscanner = NULL;
     return 0;
 }
 
@@ -1937,11 +1924,9 @@
  */
 
 #ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , 
-                             yyscan_t yyscanner)
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
 {
   register int i;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
   for ( i = 0; i < n; ++i )
     s1[i] = s2[i];
 }
@@ -1951,7 +1936,6 @@
 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
 {
   register int n;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
   for ( n = 0; s[n]; ++n )
     ;
 
@@ -1978,25 +1962,12 @@
 
 void cmCommandArgument_yyfree (void * ptr , yyscan_t)
 {
-  free( (char *) ptr );  
-  /* see cmCommandArgument_yyrealloc() for (char *) cast */
+        free( (char *) ptr );   /* see cmCommandArgument_yyrealloc() for (char *) cast */
 }
 
 #define YYTABLES_NAME "yytables"
 
-#undef YY_NEW_FILE
-#undef YY_FLUSH_BUFFER
-#undef yy_set_bol
-#undef yy_new_buffer
-#undef yy_set_interactive
-#undef yytext_ptr
-#undef YY_DO_BEFORE_ACTION
-
-#ifdef YY_DECL_IS_OURS
-#undef YY_DECL_IS_OURS
-#undef YY_DECL
-#endif
-
+#line 133 "cmCommandArgumentLexer.in.l"
 
 
 

Index: cmGetTargetPropertyCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGetTargetPropertyCommand.h,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -u -d -r1.9 -r1.9.2.1
--- cmGetTargetPropertyCommand.h	16 Nov 2005 17:11:14 -0000	1.9
+++ cmGetTargetPropertyCommand.h	13 Oct 2006 14:52:02 -0000	1.9.2.1
@@ -58,10 +58,17 @@
         "will be set to \"NOTFOUND\".  Use SET_TARGET_PROPERTIES to set "
         "property values.  Properties are usually used to control how "
         "a target is built.\n"
+        "The read-only property \"<CONFIG>_LOCATION\" provides the full "
+        "path to the file on disk that will be created for the target when "
+        "building under configuration <CONFIG> "
+        "(in upper-case, such as \"DEBUG_LOCATION\"). "
         "The read-only property \"LOCATION\" specifies "
         "the full path to the file on disk that will be created for the "
-        "target.  This is very useful for executable targets to get "
-        "the path to the executable file for use in a custom command. "
+        "target. The path may contain a build-system-specific portion that "
+        "is replaced at build time with the configuration getting built "
+        "(such as \"$(ConfigurationName)\" in VS). "
+        "This is very useful for executable targets to get "
+        "the path to the executable file for use in a custom command.\n"
         "The read-only property \"TYPE\" returns which type the specified "
         "target has (EXECUTABLE, STATIC_LIBRARY, SHARED_LIBRARY, "
         "MODULE_LIBRARY, UTILITY, INSTALL_FILES or INSTALL_PROGRAMS). "

Index: cmCustomCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCustomCommand.cxx,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -u -d -r1.17 -r1.17.2.1
--- cmCustomCommand.cxx	11 Apr 2006 15:06:18 -0000	1.17
+++ cmCustomCommand.cxx	13 Oct 2006 14:52:02 -0000	1.17.2.1
@@ -19,6 +19,9 @@
 //----------------------------------------------------------------------------
 cmCustomCommand::cmCustomCommand()
 {
+  this->HaveComment = false;
+  this->EscapeOldStyle = true;
+  this->EscapeAllowMakeVars = false;
   this->Used = false;
 }
 
@@ -27,8 +30,11 @@
   Outputs(r.Outputs),
   Depends(r.Depends),
   CommandLines(r.CommandLines),
+  HaveComment(r.HaveComment),
   Comment(r.Comment),
-  WorkingDirectory(r.WorkingDirectory)
+  WorkingDirectory(r.WorkingDirectory),
+  EscapeAllowMakeVars(r.EscapeAllowMakeVars),
+  EscapeOldStyle(r.EscapeOldStyle)
 {
   this->Used = false;
 }
@@ -42,9 +48,14 @@
   Outputs(outputs),
   Depends(depends),
   CommandLines(commandLines),
+  HaveComment(comment?true:false),
   Comment(comment?comment:""),
-  WorkingDirectory(workingDirectory?workingDirectory:"")
+  WorkingDirectory(workingDirectory?workingDirectory:""),
+  EscapeAllowMakeVars(false),
+  EscapeOldStyle(true)
 {
+  this->EscapeOldStyle = true;
+  this->EscapeAllowMakeVars = false;
   this->Used = false;
 }
 
@@ -79,5 +90,50 @@
 //----------------------------------------------------------------------------
 const char* cmCustomCommand::GetComment() const
 {
-  return this->Comment.c_str();
+  const char* no_comment = 0;
+  return this->HaveComment? this->Comment.c_str() : no_comment;
+}
+
+//----------------------------------------------------------------------------
+void cmCustomCommand::AppendCommands(const cmCustomCommandLines& commandLines)
+{
+  for(cmCustomCommandLines::const_iterator i=commandLines.begin();
+      i != commandLines.end(); ++i)
+    {
+    this->CommandLines.push_back(*i);
+    }
+}
+
+//----------------------------------------------------------------------------
+void cmCustomCommand::AppendDepends(const std::vector<std::string>& depends)
+{
+  for(std::vector<std::string>::const_iterator i=depends.begin();
+      i != depends.end(); ++i)
+    {
+    this->Depends.push_back(*i);
+    }
+}
+
+//----------------------------------------------------------------------------
+bool cmCustomCommand::GetEscapeOldStyle() const
+{
+  return this->EscapeOldStyle;
+}
+
+//----------------------------------------------------------------------------
+void cmCustomCommand::SetEscapeOldStyle(bool b)
+{
+  this->EscapeOldStyle = b;
+}
+
+//----------------------------------------------------------------------------
+bool cmCustomCommand::GetEscapeAllowMakeVars() const
+{
+  return this->EscapeAllowMakeVars;
+}
+
+//----------------------------------------------------------------------------
+void cmCustomCommand::SetEscapeAllowMakeVars(bool b)
+{
+  this->EscapeAllowMakeVars = b;
 }

Index: cmDependsJavaLexer.in.l
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsJavaLexer.in.l,v
retrieving revision 1.7
retrieving revision 1.7.6.1
diff -u -d -r1.7 -r1.7.6.1
--- cmDependsJavaLexer.in.l	3 May 2005 19:19:34 -0000	1.7
+++ cmDependsJavaLexer.in.l	13 Oct 2006 14:52:02 -0000	1.7.6.1
@@ -23,10 +23,10 @@
 
   flex --prefix=cmDependsJava_yy --header-file=cmDependsJavaLexer.h -ocmDependsJavaLexer.cxx cmDependsJavaLexer.in.l
 
-Modify cmDependsJavaLexer.cxx:
+Modify cmDependsJavaLexer.c:
   - remove TABs
   - remove "yyscanner" argument from these methods:
-      yy_fatal_error, yyalloc, yyrealloc, yyfree
+      yy_fatal_error, cmDependsJava_yyalloc, cmDependsJava_yyrealloc, cmDependsJava_yyfree
   - remove all YY_BREAK lines occurring right after return statements
   - change while ( 1 ) to for(;;)
 
@@ -38,25 +38,9 @@
 
 */
 
-#include "cmDependsJavaParserHelper.h"
-
-/* Disable some warnings.  */
-#if defined(_MSC_VER)
-# pragma warning ( disable : 4127 )
-# pragma warning ( disable : 4131 )
-# pragma warning ( disable : 4244 )
-# pragma warning ( disable : 4251 )
-# pragma warning ( disable : 4267 )
-# pragma warning ( disable : 4305 )
-# pragma warning ( disable : 4309 )
-# pragma warning ( disable : 4706 )
-# pragma warning ( disable : 4786 )
-#endif
+#include "cmStandardLexer.h"
 
-/* Disable features we do not need. */
-#define YY_NEVER_INTERACTIVE 1
-#undef ECHO /* SGI termios defines this differently. */
-#define ECHO
+#include "cmDependsJavaParserHelper.h"
 
 /* Replace the lexer input function.  */
 #undef YY_INPUT
@@ -66,16 +50,6 @@
 /* Include the set of tokens from the parser.  */
 #include "cmDependsJavaParserTokens.h"
 
-
-#if defined( _WIN32 ) && !defined( __CYGWIN__ )
-/* Handle Windows properly */
-#  include <io.h>
-#  if defined( _MSC_VER )
-#    define isatty _isatty
-#  endif
-#  define YY_NO_UNISTD_H 1
-#endif
-
 #define KEYWORD yylvalp->str = 0
 #define SYMBOL yylvalp->str = 0
 #define PRIMITIVE  yylvalp->str = 0

Index: cmVTKWrapPythonCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmVTKWrapPythonCommand.h,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -d -r1.11 -r1.11.2.1
--- cmVTKWrapPythonCommand.h	15 Mar 2006 16:02:07 -0000	1.11
+++ cmVTKWrapPythonCommand.h	13 Oct 2006 14:52:06 -0000	1.11.2.1
@@ -77,6 +77,12 @@
       "Create Python wrappers for VTK classes.";
     }
 
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   /**
    * Helper methods
    */

Index: cmGlobalVisualStudio8Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio8Generator.cxx,v
retrieving revision 1.10.2.2
retrieving revision 1.10.2.3
diff -u -d -r1.10.2.2 -r1.10.2.3
--- cmGlobalVisualStudio8Generator.cxx	11 May 2006 20:05:57 -0000	1.10.2.2
+++ cmGlobalVisualStudio8Generator.cxx	13 Oct 2006 14:52:02 -0000	1.10.2.3
@@ -75,7 +75,6 @@
 {
   // Add a special target on which all other targets depend that
   // checks the build system and optionally re-runs CMake.
-  const char* no_output = 0;
   const char* no_working_directory = 0;
   std::vector<std::string> no_depends;
   std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
@@ -90,10 +89,10 @@
         static_cast<cmLocalVisualStudio7Generator*>(generators[0]);
       cmMakefile* mf = lg->GetMakefile();
       std::string cmake_command = mf->GetRequiredDefinition("CMAKE_COMMAND");
+      cmCustomCommandLines noCommandLines;
       mf->AddUtilityCommand(CMAKE_CHECK_BUILD_SYSTEM_TARGET, true,
-                            no_output, no_depends,
-                            no_working_directory,
-                            "echo", "Checking build system");
+                            no_working_directory, no_depends,
+                            noCommandLines);
       cmTarget* tgt = mf->FindTarget(CMAKE_CHECK_BUILD_SYSTEM_TARGET);
       if(!tgt)
         {
@@ -130,12 +129,12 @@
         std::string argH = "-H";
         argH += lg->Convert(mf->GetHomeDirectory(),
                             cmLocalGenerator::START_OUTPUT,
-                            cmLocalGenerator::SHELL, true);
+                            cmLocalGenerator::UNCHANGED, true);
         commandLine.push_back(argH);
         std::string argB = "-B";
         argB += lg->Convert(mf->GetHomeOutputDirectory(),
                             cmLocalGenerator::START_OUTPUT,
-                            cmLocalGenerator::SHELL, true);
+                            cmLocalGenerator::UNCHANGED, true);
         commandLine.push_back(argB);
         cmCustomCommandLines commandLines;
         commandLines.push_back(commandLine);
@@ -228,8 +227,8 @@
 //----------------------------------------------------------------------------
 void
 cmGlobalVisualStudio8Generator
-::WriteProjectConfigurations(std::ostream& fout,
-                             const char* name, bool in_all_build)
+::WriteProjectConfigurations(std::ostream& fout, const char* name,
+                             int targetType)
 {
   std::string guid = this->GetGUID(name);
   for(std::vector<std::string>::iterator i = this->Configurations.begin();
@@ -238,7 +237,7 @@
     fout << "\t\t{" << guid << "}." << *i 
          << "|" << this->PlatformName << ".ActiveCfg = " 
            << *i << "|" << this->PlatformName << "\n";
-    if (in_all_build)
+    if(targetType != cmTarget::GLOBAL_TARGET)
       {
       fout << "\t\t{" << guid << "}." << *i 
            << "|" << this->PlatformName << ".Build.0 = " 

Index: cmSubdirCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSubdirCommand.h,v
retrieving revision 1.14.2.1
retrieving revision 1.14.2.2
diff -u -d -r1.14.2.1 -r1.14.2.2
--- cmSubdirCommand.h	14 May 2006 19:22:43 -0000	1.14.2.1
+++ cmSubdirCommand.h	13 Oct 2006 14:52:06 -0000	1.14.2.2
@@ -80,6 +80,12 @@
       "top level project or be built each time make is run from the top.";
     }
   
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmSubdirCommand, cmCommand);
 };
 

Index: cmDependsJavaLexer.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsJavaLexer.cxx,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -d -r1.7 -r1.7.2.1
--- cmDependsJavaLexer.cxx	15 Mar 2006 16:02:01 -0000	1.7
+++ cmDependsJavaLexer.cxx	13 Oct 2006 14:52:02 -0000	1.7.2.1
@@ -1,3 +1,4 @@
+#include "cmStandardIncludes.h"
 #line 2 "cmDependsJavaLexer.cxx"
 
 #line 4 "cmDependsJavaLexer.cxx"
@@ -671,28 +672,13 @@
   - remove TABs
   - remove the yy_init_globals function
   - remove the block that includes unistd.h
+  - remove #line directives (avoids bogus warning on old Sun)
 
 */
 
-#include "cmDependsJavaParserHelper.h"
-
-/* Disable some warnings.  */
-#if defined(_MSC_VER)
-# pragma warning ( disable : 4127 )
-# pragma warning ( disable : 4131 )
-# pragma warning ( disable : 4244 )
-# pragma warning ( disable : 4251 )
-# pragma warning ( disable : 4267 )
-# pragma warning ( disable : 4305 )
-# pragma warning ( disable : 4309 )
-# pragma warning ( disable : 4706 )
-# pragma warning ( disable : 4786 )
-#endif
+#include "cmStandardLexer.h"
 
-/* Disable features we do not need. */
-#define YY_NEVER_INTERACTIVE 1
-#undef ECHO /* SGI termios defines this differently. */
-#define ECHO
+#include "cmDependsJavaParserHelper.h"
 
 /* Replace the lexer input function.  */
 #undef YY_INPUT
@@ -702,16 +688,6 @@
 /* Include the set of tokens from the parser.  */
 #include "cmDependsJavaParserTokens.h"
 
-
-#if defined( _WIN32 ) && !defined( __CYGWIN__ )
-/* Handle Windows properly */
-#  include <io.h>
-#  if defined( _MSC_VER )
-#    define isatty _isatty
-#  endif
-#  define YY_NO_UNISTD_H 1
-#endif
-
 #define KEYWORD yylvalp->str = 0
 #define SYMBOL yylvalp->str = 0
 #define PRIMITIVE  yylvalp->str = 0

Index: cmDependsC.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsC.h,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -u -d -r1.17 -r1.17.2.1
--- cmDependsC.h	16 Mar 2006 14:33:23 -0000	1.17
+++ cmDependsC.h	13 Oct 2006 14:52:02 -0000	1.17.2.1
@@ -32,7 +32,6 @@
   cmDependsC();
   cmDependsC(std::vector<std::string> const& includes,
              const char* scanRegex, const char* complainRegex,
-             std::set<cmStdString> const& generatedFiles,
              const cmStdString& cachFileName);
 
   /** Virtual destructor to cleanup subclasses properly.  */
@@ -51,14 +50,6 @@
   void Scan(std::istream& is, const char* directory,
     const cmStdString& fullName);
 
-  // Method to test for the existence of a file.
-  bool FileExistsOrIsGenerated(const std::string& fname,
-                               std::set<cmStdString>& scanned,
-                               std::set<cmStdString>& dependencies);
-  bool FileIsGenerated(const std::string& fname,
-                       std::set<cmStdString>& scanned,
-                       std::set<cmStdString>& dependencies);
-
   // The include file search path.
   std::vector<std::string> const* IncludePath;
 
@@ -70,8 +61,6 @@
   cmsys::RegularExpression IncludeRegexScan;
   cmsys::RegularExpression IncludeRegexComplain;
 
-  // Set of generated files available.
-  std::set<cmStdString> const* GeneratedFiles;
 public:
   // Data structures for dependency graph walk.
   struct UnscannedEntry
@@ -91,7 +80,8 @@
   std::queue<UnscannedEntry> Unscanned;
   t_CharBuffer Buffer;
 
-  std::map<cmStdString, cmIncludeLines *> fileCache;
+  std::map<cmStdString, cmIncludeLines *> FileCache;
+  std::map<cmStdString, cmStdString> HeaderLocationCache;
 
   cmStdString CacheFileName;
 

Index: cmGlobalVisualStudio6Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio6Generator.cxx,v
retrieving revision 1.58.2.3
retrieving revision 1.58.2.4
diff -u -d -r1.58.2.3 -r1.58.2.4
--- cmGlobalVisualStudio6Generator.cxx	30 Jun 2006 17:48:43 -0000	1.58.2.3
+++ cmGlobalVisualStudio6Generator.cxx	13 Oct 2006 14:52:02 -0000	1.58.2.4
@@ -162,7 +162,6 @@
 {
   // add a special target that depends on ALL projects for easy build
   // of one configuration only.
-  const char* no_output = 0;
   std::vector<std::string> no_depends;
   const char* no_working_dir = 0;
   std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
@@ -173,7 +172,7 @@
     if(gen.size())
       {
       gen[0]->GetMakefile()->AddUtilityCommand("ALL_BUILD", false, 
-                                               no_output, no_depends, 
+                                               no_depends, 
                                                no_working_dir,
                           "echo", "Build all projects");
       }

Index: cmExprLexer.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExprLexer.cxx,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -d -r1.2.2.1 -r1.2.2.2
--- cmExprLexer.cxx	11 May 2006 02:15:09 -0000	1.2.2.1
+++ cmExprLexer.cxx	13 Oct 2006 14:52:02 -0000	1.2.2.2
@@ -1,3 +1,4 @@
+#include "cmStandardIncludes.h"
 #line 2 "/home/andy/vtk/CMake-bin/Source/cmExprLexer.cxx"
 
 #line 4 "/home/andy/vtk/CMake-bin/Source/cmExprLexer.cxx"
@@ -458,8 +459,7 @@
 
 Run flex like this:
 
-  flex --prefix=cmExpr_yy --header-file=cmExprLexer.h -ocmExprLexer.cxx
-  cmExprLexer.in.l
+  flex --prefix=cmExpr_yy --header-file=cmExprLexer.h -ocmExprLexer.cxx cmExprLexer.in.l
 
 Modify cmExprLexer.cxx:
   - remove TABs
@@ -476,25 +476,9 @@
 
 */
 
-#include "cmExprParserHelper.h"
-
-/* Disable some warnings.  */
-#if defined(_MSC_VER)
-# pragma warning ( disable : 4127 )
-# pragma warning ( disable : 4131 )
-# pragma warning ( disable : 4244 )
-# pragma warning ( disable : 4251 )
-# pragma warning ( disable : 4267 )
-# pragma warning ( disable : 4305 )
-# pragma warning ( disable : 4309 )
-# pragma warning ( disable : 4706 )
-# pragma warning ( disable : 4786 )
-#endif
+#include "cmStandardLexer.h"
 
-/* Disable features we do not need. */
-#define YY_NEVER_INTERACTIVE 1
-#undef ECHO /* SGI termios defines this differently. */
-#define ECHO
+#include "cmExprParserHelper.h"
 
 /* Replace the lexer input function.  */
 #undef YY_INPUT
@@ -504,16 +488,6 @@
 /* Include the set of tokens from the parser.  */
 #include "cmExprParserTokens.h"
 
-
-#if defined( _WIN32 ) && !defined( __CYGWIN__ )
-/* Handle Windows properly */
-#  include <io.h>
-#  if defined( _MSC_VER )
-#    define isatty _isatty
-#  endif
-#  define YY_NO_UNISTD_H 1
-#endif
-
 /*--------------------------------------------------------------------------*/
 #line 518 "/home/andy/vtk/CMake-bin/Source/cmExprLexer.cxx"
 

Index: cmVTKMakeInstantiatorCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmVTKMakeInstantiatorCommand.h,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -d -r1.10 -r1.10.2.1
--- cmVTKMakeInstantiatorCommand.h	15 Mar 2006 16:02:07 -0000	1.10
+++ cmVTKMakeInstantiatorCommand.h	13 Oct 2006 14:52:06 -0000	1.10.2.1
@@ -75,6 +75,12 @@
       "C++ code.";
     }
   
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmVTKMakeInstantiatorCommand, cmCommand);
   
 protected:

Index: cmSubdirDependsCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSubdirDependsCommand.h,v
retrieving revision 1.7
retrieving revision 1.7.12.1
diff -u -d -r1.7 -r1.7.12.1
--- cmSubdirDependsCommand.h	10 Aug 2003 22:30:53 -0000	1.7
+++ cmSubdirDependsCommand.h	13 Oct 2006 14:52:06 -0000	1.7.12.1
@@ -67,6 +67,12 @@
       "parallel builds correctly.  This functionality is now automatic.";
     }
   
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmSubdirDependsCommand, cmCommand);
 };
 

Index: cmInstallFilesGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallFilesGenerator.h,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -d -r1.3.2.1 -r1.3.2.2
--- cmInstallFilesGenerator.h	7 May 2006 14:55:38 -0000	1.3.2.1
+++ cmInstallFilesGenerator.h	13 Oct 2006 14:52:02 -0000	1.3.2.2
@@ -27,10 +27,11 @@
 public:
   cmInstallFilesGenerator(std::vector<std::string> const& files,
                           const char* dest, bool programs,
-                          const char* permissions,
+                          const char* file_permissions,
                           std::vector<std::string> const& configurations,
                           const char* component,
-                          const char* rename);
+                          const char* rename,
+                          bool optional = false);
   virtual ~cmInstallFilesGenerator();
 
 protected:
@@ -38,10 +39,11 @@
   std::vector<std::string> Files;
   std::string Destination;
   bool Programs;
-  std::string Permissions;
+  std::string FilePermissions;
   std::vector<std::string> Configurations;
   std::string Component;
   std::string Rename;
+  bool Optional;
 };
 
 #endif

Index: cmExprLexer.in.l
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExprLexer.in.l,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- cmExprLexer.in.l	17 Oct 2005 20:42:47 -0000	1.1
+++ cmExprLexer.in.l	13 Oct 2006 14:52:02 -0000	1.1.4.1
@@ -26,7 +26,7 @@
 Modify cmExprLexer.cxx:
   - remove TABs
   - remove "yyscanner" argument from these methods:
-      yy_fatal_error, yyalloc, yyrealloc, yyfree
+      yy_fatal_error, cmExpr_yyalloc, cmExpr_yyrealloc, cmExpr_yyfree
   - remove all YY_BREAK lines occurring right after return statements
   - change while ( 1 ) to for(;;)
 
@@ -38,25 +38,9 @@
 
 */
 
-#include "cmExprParserHelper.h"
-
-/* Disable some warnings.  */
-#if defined(_MSC_VER)
-# pragma warning ( disable : 4127 )
-# pragma warning ( disable : 4131 )
-# pragma warning ( disable : 4244 )
-# pragma warning ( disable : 4251 )
-# pragma warning ( disable : 4267 )
-# pragma warning ( disable : 4305 )
-# pragma warning ( disable : 4309 )
-# pragma warning ( disable : 4706 )
-# pragma warning ( disable : 4786 )
-#endif
+#include "cmStandardLexer.h"
 
-/* Disable features we do not need. */
-#define YY_NEVER_INTERACTIVE 1
-#undef ECHO /* SGI termios defines this differently. */
-#define ECHO
+#include "cmExprParserHelper.h"
 
 /* Replace the lexer input function.  */
 #undef YY_INPUT
@@ -66,16 +50,6 @@
 /* Include the set of tokens from the parser.  */
 #include "cmExprParserTokens.h"
 
-
-#if defined( _WIN32 ) && !defined( __CYGWIN__ )
-/* Handle Windows properly */
-#  include <io.h>
-#  if defined( _MSC_VER )
-#    define isatty _isatty
-#  endif
-#  define YY_NO_UNISTD_H 1
-#endif
-
 /*--------------------------------------------------------------------------*/
 %}
 

Index: cmInstallFilesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallFilesCommand.h,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -u -d -r1.16 -r1.16.2.1
--- cmInstallFilesCommand.h	15 Mar 2006 16:02:04 -0000	1.16
+++ cmInstallFilesCommand.h	13 Oct 2006 14:52:02 -0000	1.16.2.1
@@ -94,6 +94,12 @@
       "is stored in the variable CMAKE_INSTALL_PREFIX.";
     }
   
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmInstallFilesCommand, cmCommand);
 
 protected:

Index: cmAddExecutableCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddExecutableCommand.h,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -d -r1.14 -r1.14.2.1
--- cmAddExecutableCommand.h	10 Mar 2006 18:06:25 -0000	1.14
+++ cmAddExecutableCommand.h	13 Oct 2006 14:52:02 -0000	1.14.2.1
@@ -62,8 +62,8 @@
   virtual const char* GetFullDocumentation()
     {
     return
-      "  ADD_EXECUTABLE(exename [WIN32] [MACOSX_BUNDLE] source1\n"
-      "                 source2 ... sourceN)\n"
+      "  ADD_EXECUTABLE(exename [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL]\n"
+      "                 source1 source2 ... sourceN)\n"
       "This command adds an executable target to the current directory.  "
       "The executable will be built from the list of source files "
       "specified.\n"
@@ -86,6 +86,9 @@
       "  MACOSX_BUNDLE_SHORT_VERSION_STRING\n"
       "  MACOSX_BUNDLE_BUNDLE_VERSION\n"
       "  MACOSX_BUNDLE_COPYRIGHT\n"
+      "If EXCLUDE_FROM_ALL is given the target will not be built by default. "
+      "It will be built only if the user explicitly builds the target or "
+      "another target that requires the target depends on it."
       ;
     }
 

Index: cmCommandArgumentParserHelper.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentParserHelper.h,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -d -r1.8 -r1.8.2.1
--- cmCommandArgumentParserHelper.h	15 Mar 2006 16:01:59 -0000	1.8
+++ cmCommandArgumentParserHelper.h	13 Oct 2006 14:52:02 -0000	1.8.2.1
@@ -59,6 +59,7 @@
 
   char* ExpandSpecialVariable(const char* key, const char* var);
   char* ExpandVariable(const char* var);
+  char* ExpandVariableForAt(const char* var);
   void SetResult(const char* value);
 
   void SetMakefile(const cmMakefile* mf);
@@ -68,6 +69,7 @@
   void SetLineFile(long line, const char* file);
   void SetEscapeQuotes(bool b) { this->EscapeQuotes = b; }
   void SetNoEscapeMode(bool b) { this->NoEscapeMode = b; }
+  void SetReplaceAtSyntax(bool b) { this->ReplaceAtSyntax = b; }
 
   const char* GetError() { return this->ErrorString.c_str(); } 
   char EmptyVariable[1];
@@ -101,6 +103,7 @@
   bool EscapeQuotes;
   std::string ErrorString;
   bool NoEscapeMode;
+  bool ReplaceAtSyntax;
 };
 
 #endif

Index: cmInstallTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallTargetGenerator.cxx,v
retrieving revision 1.12.2.3
retrieving revision 1.12.2.4
diff -u -d -r1.12.2.3 -r1.12.2.4
--- cmInstallTargetGenerator.cxx	30 Jun 2006 17:48:43 -0000	1.12.2.3
+++ cmInstallTargetGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.12.2.4
@@ -25,12 +25,12 @@
 //----------------------------------------------------------------------------
 cmInstallTargetGenerator
 ::cmInstallTargetGenerator(cmTarget& t, const char* dest, bool implib,
-                           const char* permissions,
+                           const char* file_permissions,
                            std::vector<std::string> const& configurations,
-                           const char* component):
+                           const char* component, bool optional):
   Target(&t), Destination(dest), ImportLibrary(implib),
-  Permissions(permissions), Configurations(configurations),
-  Component(component)
+  FilePermissions(file_permissions), Configurations(configurations),
+  Component(component), Optional(optional)
 {
   this->Target->SetHaveInstallRule(true);
 }
@@ -72,6 +72,7 @@
   std::string destination = this->Destination;
 
   // Setup special properties for some target types.
+  std::string literal_args;
   std::string props;
   const char* properties = 0;
   cmTarget::TargetType type = this->Target->GetType();
@@ -81,16 +82,26 @@
       {
       // Add shared library installation properties if this platform
       // supports them.
-      const char* lib_version = this->Target->GetProperty("VERSION");
-      const char* lib_soversion = this->Target->GetProperty("SOVERSION");
-      if(!this->Target->GetMakefile()
-         ->GetDefinition("CMAKE_SHARED_LIBRARY_SONAME_C_FLAG"))
-        {
+      const char* lib_version = 0;
+      const char* lib_soversion = 0;
+
         // Versioning is supported only for shared libraries and modules,
         // and then only when the platform supports an soname flag.
-        lib_version = 0;
-        lib_soversion = 0;
+      cmGlobalGenerator* gg =
+        (this->Target->GetMakefile()
+         ->GetLocalGenerator()->GetGlobalGenerator());
+      if(const char* linkLanguage = this->Target->GetLinkerLanguage(gg))
+        {
+        std::string sonameFlagVar = "CMAKE_SHARED_LIBRARY_SONAME_";
+        sonameFlagVar += linkLanguage;
+        sonameFlagVar += "_FLAG";
+        if(this->Target->GetMakefile()->GetDefinition(sonameFlagVar.c_str()))
+          {
+          lib_version = this->Target->GetProperty("VERSION");
+          lib_soversion = this->Target->GetProperty("SOVERSION");
         }
+        }
+
       if(lib_version)
         {
         props += " VERSION ";
@@ -130,6 +141,7 @@
                                      false, false);
         fromFile += ".app";
         type = cmTarget::INSTALL_DIRECTORY;
+        literal_args += " USE_SOURCE_PERMISSIONS";
         }
       }
       break;
@@ -148,11 +160,15 @@
     }
 
   // Write code to install the target file.
+  const char* no_dir_permissions = 0;
+  const char* no_rename = 0;
+  bool optional = this->Optional | this->ImportLibrary;
   this->AddInstallRule(os, destination.c_str(), type, fromFile.c_str(),
-                       this->ImportLibrary, properties,
-                       this->Permissions.c_str(),
+                       optional, properties,
+                       this->FilePermissions.c_str(), no_dir_permissions,
                        this->Configurations,
-                       this->Component.c_str());
+                       this->Component.c_str(),
+                       no_rename, literal_args.c_str());
 
   // Fix the install_name settings in installed binaries.
   if(type == cmTarget::SHARED_LIBRARY ||

Index: cmAddCustomCommandCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddCustomCommandCommand.cxx,v
retrieving revision 1.31
retrieving revision 1.31.2.1
diff -u -d -r1.31 -r1.31.2.1
--- cmAddCustomCommandCommand.cxx	11 Apr 2006 15:06:18 -0000	1.31
+++ cmAddCustomCommandCommand.cxx	13 Oct 2006 14:52:02 -0000	1.31.2.1
@@ -18,6 +18,8 @@
 
 #include "cmTarget.h"
 
+#include "cmSourceFile.h"
+
 // cmAddCustomCommandCommand
 bool cmAddCustomCommandCommand::InitialPass(
   std::vector<std::string> const& args)
@@ -32,9 +34,12 @@
       return false;
     }
 
-  std::string source, target, comment, main_dependency,
-    working;
+  std::string source, target, main_dependency, working;
+  std::string comment_buffer;
+  const char* comment = 0;
   std::vector<std::string> depends, outputs, output;
+  bool verbatim = false;
+  bool append = false;
 
   // Accumulate one command line at a time.
   cmCustomCommandLine currentLine;
@@ -90,6 +95,14 @@
       {
       cctype = cmTarget::POST_BUILD;
       }
+    else if(copy == "VERBATIM")
+      {
+      verbatim = true;
+      }
+    else if(copy == "APPEND")
+      {
+      append = true;
+      }
     else if(copy == "TARGET")
       {
       doing = doing_target;
@@ -173,7 +186,8 @@
            outputs.push_back(filename);
            break;
          case doing_comment:
-           comment = copy;
+           comment_buffer = copy;
+           comment = comment_buffer.c_str();
            break;
          default:
            this->SetError("Wrong syntax. Unknown type of argument.");
@@ -203,6 +217,11 @@
       "Wrong syntax. A TARGET and OUTPUT can not both be specified.");
     return false;
     }
+  if(append && output.empty())
+    {
+    this->SetError("given APPEND option with no OUTPUT.");
+    return false;
+    }
 
   // Make sure the output names and locations are safe.
   if(!this->CheckOutputs(output) || !this->CheckOutputs(outputs))
@@ -210,29 +229,55 @@
     return false;
     }
 
+  // Check for an append request.
+  if(append)
+    {
+    // Lookup an existing command.
+    if(cmSourceFile* sf =
+       this->Makefile->GetSourceFileWithOutput(output[0].c_str()))
+      {
+      if(cmCustomCommand* cc = sf->GetCustomCommand())
+        {
+        cc->AppendCommands(commandLines);
+        cc->AppendDepends(depends);
+        return true;
+        }
+      }
+
+    // No command for this output exists.
+    cmOStringStream e;
+    e << "given APPEND option with output \"" << output[0].c_str()
+      << "\" which is not already a custom command output.";
+    this->SetError(e.str().c_str());
+    return false;
+    }
+
   // Choose which mode of the command to use.
+  bool escapeOldStyle = !verbatim;
   if(source.empty() && output.empty())
     {
     // Source is empty, use the target.
     std::vector<std::string> no_depends;
     this->Makefile->AddCustomCommandToTarget(target.c_str(), no_depends,
                                          commandLines, cctype,
-                                         comment.c_str(), working.c_str());
+                                             comment, working.c_str(),
+                                             escapeOldStyle);
     }
   else if(target.empty())
     {
     // Target is empty, use the output.
     this->Makefile->AddCustomCommandToOutput(output, depends,
                                          main_dependency.c_str(),
-                                         commandLines, comment.c_str(),
-                                         working.c_str());
+                                             commandLines, comment,
+                                             working.c_str(), false,
+                                             escapeOldStyle);
     }
   else
     {
     // Use the old-style mode for backward compatibility.
     this->Makefile->AddCustomCommandOldStyle(target.c_str(), outputs, depends,
                                          source.c_str(), commandLines,
-                                         comment.c_str());
+                                             comment);
     }
   return true;
 }

Index: cmGlobalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.cxx,v
retrieving revision 1.70.2.4
retrieving revision 1.70.2.5
diff -u -d -r1.70.2.4 -r1.70.2.5
--- cmGlobalVisualStudio7Generator.cxx	30 Jun 2006 17:48:43 -0000	1.70.2.4
+++ cmGlobalVisualStudio7Generator.cxx	13 Oct 2006 14:52:02 -0000	1.70.2.5
@@ -216,7 +216,6 @@
 {
   // add a special target that depends on ALL projects for easy build
   // of one configuration only.
-  const char* no_output = 0;
   const char* no_working_dir = 0;
   std::vector<std::string> no_depends;
   std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
@@ -227,7 +226,7 @@
     if(gen.size())
       {
       gen[0]->GetMakefile()->
-        AddUtilityCommand("ALL_BUILD", false, no_output, no_depends,
+        AddUtilityCommand("ALL_BUILD", false, no_depends,
                           no_working_dir,
                           "echo", "Build all projects");
       std::string cmake_command = 
@@ -538,13 +537,13 @@
         const cmCustomCommandLines& cmds = cc.GetCommandLines();
         std::string name = cmds[0][0];
         this->WriteProjectConfigurations(fout, name.c_str(), 
-                                         l->second.IsInAll());
+                                         l->second.GetType());
         }
       else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
           && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
         {
         this->WriteProjectConfigurations(fout, si->c_str(), 
-                                         l->second.IsInAll());
+                                         l->second.GetType());
         ++si;
         }
       }
@@ -555,6 +554,21 @@
   this->WriteSLNFooter(fout);
 }
 
+//----------------------------------------------------------------------------
+std::string
+cmGlobalVisualStudio7Generator::ConvertToSolutionPath(const char* path)
+{
+  // Convert to backslashes.  Do not use ConvertToOutputPath because
+  // we will add quoting ourselves, and we know these projects always
+  // use windows slashes.
+  std::string d = path;
+  std::string::size_type pos = 0;
+  while((pos = d.find('/', pos)) != d.npos)
+    {
+    d[pos++] = '\\';
+    }
+  return d;
+}
 
 // Write a dsp file into the SLN file,
 // Note, that dependencies from executables to 
@@ -563,10 +577,10 @@
                                const char* dspname,
                                const char* dir, cmTarget&)
 {
-  std::string d = cmSystemTools::ConvertToOutputPath(dir);
   fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" 
        << dspname << "\", \""
-       << d << "\\" << dspname << ".vcproj\", \"{"
+       << this->ConvertToSolutionPath(dir)
+       << "\\" << dspname << ".vcproj\", \"{"
        << this->GetGUID(dspname) << "}\"\nEndProject\n";
 }
 
@@ -652,9 +666,8 @@
 // Write a dsp file into the SLN file, Note, that dependencies from
 // executables to the libraries it uses are also done here
 void cmGlobalVisualStudio7Generator
-::WriteProjectConfigurations(std::ostream& fout, 
-                                                           const char* name, 
-                                                           bool in_all_build)
+::WriteProjectConfigurations(std::ostream& fout, const char* name,
+                             int targetType)
 {
   std::string guid = this->GetGUID(name);
   for(std::vector<std::string>::iterator i = this->Configurations.begin();
@@ -662,7 +675,7 @@
     {
     fout << "\t\t{" << guid << "}." << *i 
          << ".ActiveCfg = " << *i << "|Win32\n";
-    if (in_all_build)
+    if(targetType != cmTarget::GLOBAL_TARGET)
       {
       fout << "\t\t{" << guid << "}." << *i 
            << ".Build.0 = " << *i << "|Win32\n";
@@ -683,7 +696,7 @@
   std::string d = cmSystemTools::ConvertToOutputPath(location);
   fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" 
        << name << "\", \""
-       << d << "\", \"{"
+       << this->ConvertToSolutionPath(location) << "\", \"{"
        << this->GetGUID(name)
        << "}\"\n";
   fout << "EndProject\n";

Index: cmAddTestCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddTestCommand.h,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -d -r1.13 -r1.13.2.1
--- cmAddTestCommand.h	16 Mar 2006 14:33:23 -0000	1.13
+++ cmAddTestCommand.h	13 Oct 2006 14:52:02 -0000	1.13.2.1
@@ -66,7 +66,7 @@
       "been run, this command does nothing.  "
       "The tests are run by the testing subsystem by executing Exename "
       "with the specified arguments.  Exename can be either an executable "
-      "built by built by this project or an arbitrary executable on the "
+      "built by this project or an arbitrary executable on the "
       "system (like tclsh).  The test will be run with the current working "
       "directory set to the CMakeList.txt files corresponding directory "
       "in the binary tree.";

Index: cmGlobalNMakeMakefileGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalNMakeMakefileGenerator.cxx,v
retrieving revision 1.19.2.3
retrieving revision 1.19.2.4
diff -u -d -r1.19.2.3 -r1.19.2.4
--- cmGlobalNMakeMakefileGenerator.cxx	30 Jun 2006 17:48:43 -0000	1.19.2.3
+++ cmGlobalNMakeMakefileGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.19.2.4
@@ -39,7 +39,6 @@
 cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator()
 {
   cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
-  lg->SetEchoNeedsQuote(false);
   lg->SetDefineWindowsNULL(true);
   lg->SetWindowsShell(true);
   lg->SetMakeSilentFlag("/nologo");

Index: cmCommandArgumentParser.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentParser.cxx,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -d -r1.5.2.1 -r1.5.2.2
--- cmCommandArgumentParser.cxx	11 May 2006 02:15:08 -0000	1.5.2.1
+++ cmCommandArgumentParser.cxx	13 Oct 2006 14:52:02 -0000	1.5.2.2
@@ -128,6 +128,8 @@
 
 */
 
+#include "cmStandardIncludes.h"
+
 /* Configure the parser to use a lexer object.  */
 #define YYPARSE_PARAM yyscanner
 #define YYLEX_PARAM yyscanner
@@ -136,6 +138,11 @@
         cmCommandArgumentError(yyscanner, x)
 #define yyGetParser (cmCommandArgument_yyget_extra(yyscanner))
 
+/* Make sure malloc and free are available on QNX.  */
+#ifdef __QNX__
+# include <malloc.h>
+#endif
+
 /* Make sure the parser uses standard memory allocation.  The default
    generated parser malloc/free declarations do not work on all
    platforms.  */
@@ -162,6 +169,9 @@
 /* Disable some warnings in the generated code.  */
 #ifdef __BORLANDC__
 # pragma warn -8004 /* Variable assigned a value that is not used.  */
+# pragma warn -8008 /* condition always returns true */
+# pragma warn -8060 /* possibly incorrect assignment */
+# pragma warn -8066 /* unreachable code */
 #endif
 #ifdef _MSC_VER
 # pragma warning (disable: 4102) /* Unused goto label.  */
@@ -1310,7 +1320,7 @@
   case 17:
 #line 178 "cmCommandArgumentParser.y"
     {
-  (yyval.str) = yyGetParser->ExpandVariable((yyvsp[0].str));
+  (yyval.str) = yyGetParser->ExpandVariableForAt((yyvsp[0].str));
 }
     break;
 

Index: cmGlobalVisualStudio71Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio71Generator.cxx,v
retrieving revision 1.30.2.2
retrieving revision 1.30.2.3
diff -u -d -r1.30.2.2 -r1.30.2.3
--- cmGlobalVisualStudio71Generator.cxx	11 May 2006 20:05:57 -0000	1.30.2.2
+++ cmGlobalVisualStudio71Generator.cxx	13 Oct 2006 14:52:02 -0000	1.30.2.3
@@ -254,13 +254,13 @@
         const cmCustomCommandLines& cmds = cc.GetCommandLines();
         std::string project = cmds[0][0];
         this->WriteProjectConfigurations(fout, project.c_str(), 
-                                         l->second.IsInAll());
+                                         l->second.GetType());
         }
       else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
                && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
         {
         this->WriteProjectConfigurations(fout, si->c_str(), 
-                                         l->second.IsInAll());
+                                         l->second.GetType());
         ++si;
         }
       }
@@ -294,10 +294,10 @@
                                               const char* dir,
                                               cmTarget& t)
 {
-  std::string d = cmSystemTools::ConvertToOutputPath(dir);
   fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" 
        << dspname << "\", \""
-       << d << "\\" << dspname << ".vcproj\", \"{"
+       << this->ConvertToSolutionPath(dir)
+       << "\\" << dspname << ".vcproj\", \"{"
        << this->GetGUID(dspname) << "}\"\n";
   fout << "\tProjectSection(ProjectDependencies) = postProject\n";
   this->WriteProjectDepends(fout, dspname, dir, t);
@@ -379,10 +379,9 @@
                                const char* location,
                                const std::vector<std::string>& depends)
 { 
-    std::string d = cmSystemTools::ConvertToOutputPath(location);
   fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" 
        << name << "\", \""
-       << d << "\", \"{"
+       << this->ConvertToSolutionPath(location) << "\", \"{"
        << this->GetGUID(name)
        << "}\"\n";
   
@@ -415,9 +414,8 @@
 // Write a dsp file into the SLN file, Note, that dependencies from
 // executables to the libraries it uses are also done here
 void cmGlobalVisualStudio71Generator
-::WriteProjectConfigurations(std::ostream& fout, 
-                                                           const char* name, 
-                                                           bool in_all_build)
+::WriteProjectConfigurations(std::ostream& fout, const char* name,
+                             int targetType)
 {
   std::string guid = this->GetGUID(name);
   for(std::vector<std::string>::iterator i = this->Configurations.begin();
@@ -425,7 +423,7 @@
     {
     fout << "\t\t{" << guid << "}." << *i 
          << ".ActiveCfg = " << *i << "|Win32\n";
-    if (in_all_build)
+    if(targetType != cmTarget::GLOBAL_TARGET)
       {
       fout << "\t\t{" << guid << "}." << *i 
            << ".Build.0 = " << *i << "|Win32\n";

Index: cmMakefile.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.h,v
retrieving revision 1.186.2.4
retrieving revision 1.186.2.5
diff -u -d -r1.186.2.4 -r1.186.2.5
--- cmMakefile.h	24 Jul 2006 15:19:36 -0000	1.186.2.4
+++ cmMakefile.h	13 Oct 2006 14:52:05 -0000	1.186.2.5
@@ -143,19 +143,22 @@
                                 const std::vector<std::string>& depends,
                                 const cmCustomCommandLines& commandLines,
                                 cmTarget::CustomCommandType type,
-                                const char* comment, const char* workingDir);
+                                const char* comment, const char* workingDir,
+                                bool escapeOldStyle = true);
   void AddCustomCommandToOutput(const std::vector<std::string>& outputs,
                                 const std::vector<std::string>& depends,
                                 const char* main_dependency,
                                 const cmCustomCommandLines& commandLines,
                                 const char* comment, const char* workingDir,
-                                bool replace = false);
+                                bool replace = false,
+                                bool escapeOldStyle = true);
   void AddCustomCommandToOutput(const char* output,
                                 const std::vector<std::string>& depends,
                                 const char* main_dependency,
                                 const cmCustomCommandLines& commandLines,
                                 const char* comment, const char* workingDir,
-                                bool replace = false);
+                                bool replace = false,
+                                bool escapeOldStyle = true);
   void AddCustomCommandOldStyle(const char* target,
                                 const std::vector<std::string>& outputs,
                                 const std::vector<std::string>& depends,
@@ -173,14 +176,14 @@
    * Add an executable to the build.
    */
   cmTarget* AddExecutable(const char *exename, 
-                          const std::vector<std::string> &srcs);
+                          const std::vector<std::string> &srcs,
+                          bool in_all = true);
 
   /**
    * Add a utility to the build.  A utiltity target is a command that
    * is run every time the target is built.
    */
   void AddUtilityCommand(const char* utilityName, bool all,
-                         const char* output,
                          const std::vector<std::string>& depends,
                          const char* workingDirectory,
                          const char* command,
@@ -189,10 +192,11 @@
                          const char* arg3=0,
                          const char* arg4=0);
   void AddUtilityCommand(const char* utilityName, bool all,
-                         const char* output,
                          const char* workingDirectory,
                          const std::vector<std::string>& depends,
-                         const cmCustomCommandLines& commandLines);
+                         const cmCustomCommandLines& commandLines,
+                         bool escapeOldStyle = true,
+                         const char* comment = 0);
 
   /**
    * Add a link library to the build.
@@ -283,7 +287,8 @@
    * Set the name of the library.
    */
   void AddLibrary(const char *libname, int shared,
-                  const std::vector<std::string> &srcs);
+                  const std::vector<std::string> &srcs,
+                  bool in_all = true);
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
   /**
@@ -436,6 +441,12 @@
       this->IncludeDirectories = vec;
     }
 
+  /**
+   * Mark include directories as system directories.
+   */
+  void AddSystemIncludeDirectory(const char* dir);
+  bool IsSystemIncludeDirectory(const char* dir);
+
   /** Expand out any arguements in the vector that have ; separated
    *  strings into multiple arguements.  A new vector is created 
    *  containing the expanded versions of all arguments in argsIn.
@@ -566,7 +577,8 @@
                                       bool atOnly = false,
                                       const char* filename = 0,
                                       long line = -1,
-                                      bool removeEmpty = false) const;
+                                      bool removeEmpty = false,
+                                      bool replaceAt = true) const;
 
   /**
    * Remove any remaining variables in the string. Anything with ${var} or
@@ -734,6 +746,10 @@
   std::vector<std::string> IncludeDirectories;
   std::vector<std::string> LinkDirectories;
   
+  // The set of include directories that are marked as system include
+  // directories.
+  std::set<cmStdString> SystemIncludeDirectories;
+
   std::vector<std::string> ListFiles; // list of command files loaded
   std::vector<std::string> OutputFiles; // list of command files loaded
   

Index: cmAddSubDirectoryCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddSubDirectoryCommand.cxx,v
retrieving revision 1.4.2.3
retrieving revision 1.4.2.4
diff -u -d -r1.4.2.3 -r1.4.2.4
--- cmAddSubDirectoryCommand.cxx	30 Jun 2006 17:48:43 -0000	1.4.2.3
+++ cmAddSubDirectoryCommand.cxx	13 Oct 2006 14:52:02 -0000	1.4.2.4
@@ -53,64 +53,76 @@
       }
     }
 
-  // check for relative arguments
-  std::string binPath = binArg;
-  std::string srcPath = std::string(this->Makefile->GetCurrentDirectory()) + 
-    "/" + srcArg;
-  // if the path does not exist then the arg was relative
-  if (!cmSystemTools::FileIsDirectory(srcPath.c_str()))
+  // Compute the full path to the specified source directory.
+  // Interpret a relative path with respect to the current source directory.
+  std::string srcPath;
+  if(cmSystemTools::FileIsFullPath(srcArg.c_str()))
     {
     srcPath = srcArg;
-    if (!cmSystemTools::FileIsDirectory(srcPath.c_str()))
+    }
+  else
       {
-      std::string error = "Incorrect ADD_SUBDIRECTORY command. Directory: ";
-      error += srcArg + " does not exists.";
+    srcPath = this->Makefile->GetCurrentDirectory();
+    srcPath += "/";
+    srcPath += srcArg;
+    }
+  if(!cmSystemTools::FileIsDirectory(srcPath.c_str()))
+    {
+    std::string error = "given source \"";
+    error += srcArg;
+    error += "\" which is not an existing directory.";
       this->SetError(error.c_str());   
       return false;
       }
-    }
-  
-  // at this point srcPath has the full path to the source directory
-  // now we need to compute the binPath if it was not provided
   srcPath = cmSystemTools::CollapseFullPath(srcPath.c_str());
   
-  // if the argument was provided then use it
-  if (binArg.size())
+  // Compute the full path to the binary directory.
+  std::string binPath;
+  if(binArg.empty())
     {
-    if (!cmSystemTools::FileIsFullPath(binPath.c_str()))
+    // No binary directory was specified.  If the source directory is
+    // not a subdirectory of the current directory then it is an
+    // error.
+    if(!cmSystemTools::FindLastString(srcPath.c_str(),
+                                      this->Makefile->GetCurrentDirectory()))
       {
-      binPath = std::string(this->Makefile->GetCurrentOutputDirectory()) + 
-        "/" + binArg.c_str();
+      cmOStringStream e;
+      e << "not given a binary directory but the given source directory "
+        << "\"" << srcPath << "\" is not a subdirectory of \""
+        << this->Makefile->GetCurrentDirectory() << "\".  "
+        << "When specifying an out-of-tree source a binary directory "
+        << "must be explicitly specified.";
+      this->SetError(e.str().c_str());
+      return false;
       }
+
+    // Remove the CurrentDirectory from the srcPath and replace it
+    // with the CurrentOutputDirectory.
+    binPath = srcPath;
+    cmSystemTools::ReplaceString(binPath,
+                                 this->Makefile->GetCurrentDirectory(),
+                                 this->Makefile->GetCurrentOutputDirectory());
     }
-  // otherwise compute the binPath from the srcPath
   else
     {
-    // we try to remove the CurrentDirectory from the srcPath and
-    // replace it with the CurrentOutputDirectory. This may not really work
-    // because the source dir they provided may not be "in" the source
-    // tree. This is an error if this happens.
-      // try replacing the home dir with the home output dir
-      binPath = srcPath;
-    if(!cmSystemTools::FindLastString(binPath.c_str(),
-                                         this->Makefile->GetHomeDirectory()))
+    // Use the binary directory specified.
+    // Interpret a relative path with respect to the current binary directory.
+    if(cmSystemTools::FileIsFullPath(binArg.c_str()))
         {
-        this->SetError("A full source directory was specified that is not "
-                       "in the source tree but no binary directory was "
-                       "specified. If you specify an out of tree source "
-                       "directory then you must provide the binary "
-                       "directory as well.");   
-        return false;
+      binPath = binArg;
+      }
+    else
+      {
+      binPath = this->Makefile->GetCurrentOutputDirectory();
+      binPath += "/";
+      binPath += binArg;
         }
-      cmSystemTools::ReplaceString(binPath,
-                                   this->Makefile->GetHomeDirectory(), 
-                                   this->Makefile->GetHomeOutputDirectory());
     }
+  binPath = cmSystemTools::CollapseFullPath(binPath.c_str());
   
-  // now we have all the arguments
+  // Add the subdirectory using the computed full paths.
   this->Makefile->AddSubDirectory(srcPath.c_str(), binPath.c_str(),
                               intoplevel, false, true);
 
   return true;
 }
-

Index: cmOrderLinkDirectories.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmOrderLinkDirectories.cxx,v
retrieving revision 1.29.2.1
retrieving revision 1.29.2.2
diff -u -d -r1.29.2.1 -r1.29.2.2
--- cmOrderLinkDirectories.cxx	14 May 2006 19:22:43 -0000	1.29.2.1
+++ cmOrderLinkDirectories.cxx	13 Oct 2006 14:52:06 -0000	1.29.2.2
@@ -3,14 +3,63 @@
 #include "cmsys/RegularExpression.hxx"
 #include <ctype.h>
 
+//#define CM_ORDER_LINK_DIRECTORIES_DEBUG
 
 //-------------------------------------------------------------------
 cmOrderLinkDirectories::cmOrderLinkDirectories()
 {
+  this->StartLinkType = LinkUnknown;
+  this->LinkTypeEnabled = false;
   this->Debug = false;
 }
 
 //-------------------------------------------------------------------
+void
+cmOrderLinkDirectories
+::SetLinkTypeInformation(LinkType start_link_type,
+                         const char* static_link_type_flag,
+                         const char* shared_link_type_flag)
+{
+  // We can support link type switching only if all needed flags are
+  // known.
+  this->StartLinkType = start_link_type;
+  if(static_link_type_flag && *static_link_type_flag &&
+     shared_link_type_flag && *shared_link_type_flag)
+    {
+    this->LinkTypeEnabled = true;
+    this->StaticLinkTypeFlag = static_link_type_flag;
+    this->SharedLinkTypeFlag = shared_link_type_flag;
+    }
+  else
+    {
+    this->LinkTypeEnabled = false;
+    this->StaticLinkTypeFlag = "";
+    this->SharedLinkTypeFlag = "";
+    }
+}
+
+//-------------------------------------------------------------------
+void cmOrderLinkDirectories::SetCurrentLinkType(LinkType lt)
+{
+  if(this->CurrentLinkType != lt)
+    {
+    this->CurrentLinkType = lt;
+
+    if(this->LinkTypeEnabled)
+      {
+      switch(this->CurrentLinkType)
+        {
+        case LinkStatic:
+          this->LinkItems.push_back(this->StaticLinkTypeFlag); break;
+        case LinkShared:
+          this->LinkItems.push_back(this->SharedLinkTypeFlag); break;
+        default: break;
+        }
+      }
+    }
+}
+
+//-------------------------------------------------------------------
 bool cmOrderLinkDirectories::LibraryInDirectory(const char* desiredLib,
                                                 const char* dir,
                                                 const char* libIn)
@@ -126,16 +175,76 @@
 void cmOrderLinkDirectories::CreateRegularExpressions()
 {
   this->SplitFramework.compile("(.*)/(.*)\\.framework$");
-  cmStdString libext = "(";
-  bool first = true;
-  for(std::vector<cmStdString>::iterator i = this->LinkExtensions.begin();
-      i != this->LinkExtensions.end(); ++i)
+
+  // Compute a regex to match link extensions.
+  cmStdString libext = this->CreateExtensionRegex(this->LinkExtensions);
+
+  // Create regex to remove any library extension.
+  cmStdString reg("(.*)");
+  reg += libext;
+  this->RemoveLibraryExtension.compile(reg.c_str());
+
+  // Create a regex to match a library name.  Match index 1 will be
+  // the prefix if it exists and empty otherwise.  Match index 2 will
+  // be the library name.  Match index 3 will be the library
+  // extension.
+  reg = "^(";
+  for(std::set<cmStdString>::iterator p = this->LinkPrefixes.begin();
+      p != this->LinkPrefixes.end(); ++p)
     {
-    if(!first)
+    reg += *p;
+    reg += "|";
+    }
+  reg += ")";
+  reg += "([^/]*)";
+
+  // Create a regex to match any library name.
+  cmStdString reg_any = reg;
+  reg_any += libext;
+#ifdef CM_ORDER_LINK_DIRECTORIES_DEBUG
+  fprintf(stderr, "any regex [%s]\n", reg_any.c_str());
+#endif
+  this->ExtractAnyLibraryName.compile(reg_any.c_str());
+
+  // Create a regex to match static library names.
+  if(!this->StaticLinkExtensions.empty())
+    {
+    cmStdString reg_static = reg;
+    reg_static += this->CreateExtensionRegex(this->StaticLinkExtensions);
+#ifdef CM_ORDER_LINK_DIRECTORIES_DEBUG
+  fprintf(stderr, "static regex [%s]\n", reg_static.c_str());
+#endif
+    this->ExtractStaticLibraryName.compile(reg_static.c_str());
+    }
+
+  // Create a regex to match shared library names.
+  if(!this->SharedLinkExtensions.empty())
       {
-      libext += "|";
+    cmStdString reg_shared = reg;
+    reg_shared += this->CreateExtensionRegex(this->SharedLinkExtensions);
+#ifdef CM_ORDER_LINK_DIRECTORIES_DEBUG
+  fprintf(stderr, "shared regex [%s]\n", reg_shared.c_str());
+#endif
+    this->ExtractSharedLibraryName.compile(reg_shared.c_str());
       }
-    first = false;
+}
+
+//-------------------------------------------------------------------
+std::string
+cmOrderLinkDirectories::CreateExtensionRegex(
+  std::vector<cmStdString> const& exts)
+{
+  // Build a list of extension choices.
+  cmStdString libext = "(";
+  const char* sep = "";
+  for(std::vector<cmStdString>::const_iterator i = exts.begin();
+      i != exts.end(); ++i)
+    {
+    // Separate this choice from the previous one.
+    libext += sep;
+    sep = "|";
+
+    // Store this extension choice with the "." escaped.
     libext += "\\";
 #if defined(_WIN32) && !defined(__CYGWIN__)
     libext += this->NoCaseExpression(i->c_str());
@@ -143,41 +252,74 @@
     libext += *i;
 #endif
     }
+
+  // Finish the list.
   libext += ").*";
-  cmStdString reg("(.*)");
-  reg += libext;
-  this->RemoveLibraryExtension.compile(reg.c_str());
-  reg = "";
-  if(this->LinkPrefix.size())
-    {
-    reg = "^";
-    reg += this->LinkPrefix;
-    }
-  reg += "([^/]*)";
-  reg += libext;
-  this->ExtractBaseLibraryName.compile(reg.c_str());
-  reg = "([^/]*)";
-  reg += libext;
-  this->ExtractBaseLibraryNameNoPrefix.compile(reg.c_str());
+  return libext;
 }
 
-
 //-------------------------------------------------------------------
 void cmOrderLinkDirectories::PrepareLinkTargets()
 {
-  for(std::vector<cmStdString>::iterator i = this->LinkItems.begin();
-      i != this->LinkItems.end(); ++i)
+  std::vector<cmStdString> originalLinkItems = this->LinkItems;
+  this->LinkItems.clear();
+  this->CurrentLinkType = this->StartLinkType;
+  for(std::vector<cmStdString>::iterator i = originalLinkItems.begin();
+      i != originalLinkItems.end(); ++i)
     {
-    // separate the library name from libfoo.a or foo.a
-    if(this->ExtractBaseLibraryName.find(*i))
+    // Parse out the prefix, base, and suffix components of the
+    // library name.  If the name matches that of a shared or static
+    // library then set the link type accordingly.
+    //
+    // Search for shared library names first because some platforms
+    // have shared libraries with names that match the static library
+    // pattern.  For example cygwin and msys use the convention
+    // libfoo.dll.a for import libraries and libfoo.a for static
+    // libraries.  On AIX a library with the name libfoo.a can be
+    // shared!
+    if(this->ExtractSharedLibraryName.find(*i))
       {
-      *i = this->ExtractBaseLibraryName.match(1);
+#ifdef CM_ORDER_LINK_DIRECTORIES_DEBUG
+      fprintf(stderr, "shared regex matched [%s] [%s] [%s]\n",
+              this->ExtractSharedLibraryName.match(1).c_str(),
+              this->ExtractSharedLibraryName.match(2).c_str(),
+              this->ExtractSharedLibraryName.match(3).c_str());
+#endif
+      this->SetCurrentLinkType(LinkShared);
+      this->LinkItems.push_back(this->ExtractSharedLibraryName.match(2));
       }
-    else if(this->ExtractBaseLibraryNameNoPrefix.find(*i))
+    else if(this->ExtractStaticLibraryName.find(*i))
+    {
+#ifdef CM_ORDER_LINK_DIRECTORIES_DEBUG
+      fprintf(stderr, "static regex matched [%s] [%s] [%s]\n",
+              this->ExtractStaticLibraryName.match(1).c_str(),
+              this->ExtractStaticLibraryName.match(2).c_str(),
+              this->ExtractStaticLibraryName.match(3).c_str());
+#endif
+      this->SetCurrentLinkType(LinkStatic);
+      this->LinkItems.push_back(this->ExtractStaticLibraryName.match(2));
+      }
+    else if(this->ExtractAnyLibraryName.find(*i))
       {
-      *i = this->ExtractBaseLibraryNameNoPrefix.match(1);
+#ifdef CM_ORDER_LINK_DIRECTORIES_DEBUG
+      fprintf(stderr, "any regex matched [%s] [%s] [%s]\n",
+              this->ExtractAnyLibraryName.match(1).c_str(),
+              this->ExtractAnyLibraryName.match(2).c_str(),
+              this->ExtractAnyLibraryName.match(3).c_str());
+#endif
+      this->SetCurrentLinkType(this->StartLinkType);
+      this->LinkItems.push_back(this->ExtractAnyLibraryName.match(2));
+      }
+    else
+      {
+      this->SetCurrentLinkType(this->StartLinkType);
+      this->LinkItems.push_back(*i);
       }
     }
+
+  // Restore the original linking type so system runtime libraries are
+  // linked properly.
+  this->SetCurrentLinkType(this->StartLinkType);
 }
 
 //-------------------------------------------------------------------
@@ -318,6 +460,9 @@
   for(unsigned int i=0; i < this->RawLinkItems.size(); ++i)
     {
     bool framework = false;
+#ifdef CM_ORDER_LINK_DIRECTORIES_DEBUG
+    fprintf(stderr, "Raw link item [%s]\n", this->RawLinkItems[i].c_str());
+#endif
     if(cmSystemTools::FileIsFullPath(this->RawLinkItems[i].c_str()))
       {
       if(cmSystemTools::FileIsDirectory(this->RawLinkItems[i].c_str()))
@@ -378,6 +523,9 @@
         aLib.File = file;
         aLib.Path = dir;
         this->FullPathLibraries[aLib.FullPath] = aLib;
+#ifdef CM_ORDER_LINK_DIRECTORIES_DEBUG
+        fprintf(stderr, "Storing item [%s]\n", file.c_str());
+#endif
         this->LinkItems.push_back(file);
         }
       }

Index: cmGlobalUnixMakefileGenerator3.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalUnixMakefileGenerator3.h,v
retrieving revision 1.27.2.4
retrieving revision 1.27.2.5
diff -u -d -r1.27.2.4 -r1.27.2.5
--- cmGlobalUnixMakefileGenerator3.h	24 Jul 2006 15:19:35 -0000	1.27.2.4
+++ cmGlobalUnixMakefileGenerator3.h	13 Oct 2006 14:52:02 -0000	1.27.2.5
@@ -124,7 +124,8 @@
    const char* config, bool ignoreErrors, bool fast);
 
   // returns some progress informaiton
-  int GetTargetTotalNumberOfActions(cmTarget& target);
+  int GetTargetTotalNumberOfActions(cmTarget& target,
+                                    std::set<cmStdString> &emitted);
   unsigned long GetNumberOfProgressActionsInAll
   (cmLocalUnixMakefileGenerator3 *lg);
 
@@ -159,6 +160,7 @@
   // Setup target names
   virtual const char* GetAllTargetName()          { return "all"; }
   virtual const char* GetInstallTargetName()      { return "install"; }
+  virtual const char* GetInstallLocalTargetName() { return "install/local"; }
   virtual const char* GetPreinstallTargetName()   { return "preinstall"; }
   virtual const char* GetTestTargetName()         { return "test"; }
   virtual const char* GetPackageTargetName()      { return "package"; }

Index: cmInstallProgramsCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallProgramsCommand.cxx,v
retrieving revision 1.13.2.1
retrieving revision 1.13.2.2
diff -u -d -r1.13.2.1 -r1.13.2.2
--- cmInstallProgramsCommand.cxx	11 May 2006 20:05:58 -0000	1.13.2.1
+++ cmInstallProgramsCommand.cxx	13 Oct 2006 14:52:02 -0000	1.13.2.2
@@ -26,6 +26,10 @@
     return false;
     }
 
+  // Enable the install target.
+  this->Makefile->GetLocalGenerator()
+    ->GetGlobalGenerator()->EnableInstallTarget();
+
   // Create an INSTALL_PROGRAMS target specifically for this path.
   this->TargetName = "INSTALL_PROGRAMS_"+args[0];
   cmTarget& target = this->Makefile->GetTargets()[this->TargetName];

Index: cmCommandArgumentParser.y
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentParser.y,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -d -r1.6 -r1.6.2.1
--- cmCommandArgumentParser.y	16 Mar 2006 19:44:13 -0000	1.6
+++ cmCommandArgumentParser.y	13 Oct 2006 14:52:02 -0000	1.6.2.1
@@ -28,6 +28,8 @@
 
 */
 
+#include "cmStandardIncludes.h"
+
 /* Configure the parser to use a lexer object.  */
 #define YYPARSE_PARAM yyscanner
 #define YYLEX_PARAM yyscanner
@@ -36,6 +38,11 @@
         cmCommandArgumentError(yyscanner, x)
 #define yyGetParser (cmCommandArgument_yyget_extra(yyscanner))
 
+/* Make sure malloc and free are available on QNX.  */
+#ifdef __QNX__
+# include <malloc.h>
+#endif
+
 /* Make sure the parser uses standard memory allocation.  The default
    generated parser malloc/free declarations do not work on all
    platforms.  */
@@ -62,10 +69,14 @@
 /* Disable some warnings in the generated code.  */
 #ifdef __BORLANDC__
 # pragma warn -8004 /* Variable assigned a value that is not used.  */
+# pragma warn -8008 /* condition always returns true */
+# pragma warn -8060 /* possibly incorrect assignment */
+# pragma warn -8066 /* unreachable code */
 #endif
 #ifdef _MSC_VER
 # pragma warning (disable: 4102) /* Unused goto label.  */
-# pragma warning (disable: 4065) /* Switch statement contains default but no case. */
+# pragma warning (disable: 4065) /* Switch statement contains default but no
+                                    case. */
 #endif
 %}
 
@@ -182,7 +193,7 @@
 |
 cal_ATNAME
 {
-  $<str>$ = yyGetParser->ExpandVariable($<str>1);
+  $<str>$ = yyGetParser->ExpandVariableForAt($<str>1);
 }
 
 MultipleIds:

Index: cmGlobalMSYSMakefileGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalMSYSMakefileGenerator.cxx,v
retrieving revision 1.7.2.3
retrieving revision 1.7.2.4
diff -u -d -r1.7.2.3 -r1.7.2.4
--- cmGlobalMSYSMakefileGenerator.cxx	30 Jun 2006 17:48:43 -0000	1.7.2.3
+++ cmGlobalMSYSMakefileGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.7.2.4
@@ -72,6 +72,7 @@
     {
     gxx = tgxx;
     }
+  mf->AddDefinition("MSYS", "1");
   mf->AddDefinition("CMAKE_GENERATOR_CC", gcc.c_str());
   mf->AddDefinition("CMAKE_GENERATOR_CXX", gxx.c_str());
   this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf);
@@ -88,6 +89,7 @@
 {
   cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
   lg->SetWindowsShell(false);
+  lg->SetMSYSShell(true);
   lg->SetGlobalGenerator(this);
   lg->SetIgnoreLibPrefix(true);
   lg->SetPassMakeflags(false);

Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.125.2.7
retrieving revision 1.125.2.8
diff -u -d -r1.125.2.7 -r1.125.2.8
--- cmLocalVisualStudio7Generator.cxx	28 Jul 2006 16:00:28 -0000	1.125.2.7
+++ cmLocalVisualStudio7Generator.cxx	13 Oct 2006 14:52:05 -0000	1.125.2.8
@@ -44,9 +44,45 @@
   lang.insert("IDL");
   lang.insert("DEF");
   this->CreateCustomTargetsAndCommands(lang);
+  this->FixGlobalTargets();
   this->OutputVCProjFile();
 }
 
+void cmLocalVisualStudio7Generator::FixGlobalTargets()
+{
+  // Visual Studio .NET 2003 Service Pack 1 will not run post-build
+  // commands for targets in which no sources are built.  Add dummy
+  // rules to force these targets to build.
+  cmTargets &tgts = this->Makefile->GetTargets();
+  for(cmTargets::iterator l = tgts.begin();
+      l != tgts.end(); l++)
+    {
+    cmTarget& tgt = l->second;
+    if(tgt.GetType() == cmTarget::GLOBAL_TARGET)
+      {
+      std::vector<std::string> no_depends;
+      cmCustomCommandLine force_command;
+      force_command.push_back(";");
+      cmCustomCommandLines force_commands;
+      force_commands.push_back(force_command);
+      const char* no_main_dependency = 0;
+      std::string force = this->Makefile->GetStartOutputDirectory();
+      force += cmake::GetCMakeFilesDirectory();
+      force += "/";
+      force += tgt.GetName();
+      force += "_force";
+      this->Makefile->AddCustomCommandToOutput(force.c_str(), no_depends,
+                                               no_main_dependency,
+                                               force_commands, " ", 0, true);
+      if(cmSourceFile* file =
+         this->Makefile->GetSourceFileWithOutput(force.c_str()))
+        {
+        tgt.GetSourceFiles().push_back(file);
+        }
+      }
+    }
+}
+
 // TODO
 // for CommandLine= need to repleace quotes with &quot
 // write out configurations
@@ -182,12 +218,12 @@
   std::string args;
   args = "-H";
   args += this->Convert(this->Makefile->GetHomeDirectory(), 
-                        START_OUTPUT, SHELL, true);
+                        START_OUTPUT, UNCHANGED, true);
   commandLine.push_back(args);
   args = "-B";
   args +=
     this->Convert(this->Makefile->GetHomeOutputDirectory(),
-                  START_OUTPUT, SHELL, true);
+                  START_OUTPUT, UNCHANGED, true);
   commandLine.push_back(args);
 
   std::string configFile =
@@ -326,6 +362,8 @@
 cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] =
 {
   // option flags (some flags map to the same option)
+  {"GenerateManifest", "MANIFEST:NO", "disable manifest generation", "FALSE"},
+  {"GenerateManifest", "MANIFEST", "enable manifest generation", "TRUE"},
   {"LinkIncremental", "INCREMENTAL:NO", "link incremental", "1"},
   {"LinkIncremental", "INCREMENTAL:YES", "link incremental", "2"},
   {0,0,0,0 }
@@ -527,7 +565,7 @@
     flagMap.find("DebugInformationFormat");
   if(mi != flagMap.end() && mi->second != "1")
     {
-    fout <<  "\t\t\t\tProgramDatabaseFileName=\""
+    fout <<  "\t\t\t\tProgramDataBaseFileName=\""
          << this->LibraryOutputPath
          << "$(OutDir)/" << libName << ".pdb\"\n";
     }
@@ -572,6 +610,17 @@
   fout << "\t\t\t\tProxyFileName=\"$(InputName)_p.c\"/>\n";
   // end of <Tool Name=VCMIDLTool
 
+  // If we are building a version 8 project file, add a flag telling the
+  // manifest tool to use a workaround for FAT32 file systems, which can cause
+  // an empty manifest to be embedded into the resulting executable.
+  // See CMake bug #2617.
+  if ( this->Version == 8 )
+    {
+    fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n"
+         << "\t\t\t\tUseFAT32Workaround=\"true\"\n"
+         << "\t\t\t/>\n";
+    }
+
   this->OutputTargetRules(fout, target, libName);
   this->OutputBuildTool(fout, configName, libName, target);
   fout << "\t\t</Configuration>\n";
@@ -765,7 +814,7 @@
     temp += "$(OutDir)/";
     temp += libName;
     temp += ".pdb";
-    fout << "\t\t\t\tProgramDatabaseFile=\"" <<
+    fout << "\t\t\t\tProgramDataBaseFile=\"" <<
       this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n";
     if(strcmp(configName, "Debug") == 0
        || strcmp(configName, "RelWithDebInfo") == 0)
@@ -844,7 +893,7 @@
     fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
     this->OutputLibraryDirectories(fout, linkDirs);
     fout << "\"\n";
-    fout << "\t\t\t\tProgramDatabaseFile=\"" << this->LibraryOutputPath
+    fout << "\t\t\t\tProgramDataBaseFile=\"" << this->LibraryOutputPath
          << "$(OutDir)\\" << libName << ".pdb\"\n";
     if(strcmp(configName, "Debug") == 0
        || strcmp(configName, "RelWithDebInfo") == 0)
@@ -982,8 +1031,20 @@
     // Double-quotes in the value of the definition must be escaped
     // with a backslash.  The entire definition should be quoted in
     // the generated xml attribute to avoid confusing the VS parser.
-    cmSystemTools::ReplaceString(define, "\"", "\\&quot;");
+    define = this->EscapeForXML(define.c_str());
+    // if the define has something in it that is not a letter or a number
+    // then quote it
+    if(define.
+       find_first_not_of(
+         "-_abcdefghigklmnopqrstuvwxyz1234567890ABCDEFGHIGKLMNOPQRSTUVWXYZ")
+       != define.npos)
+      {
     fout << "&quot;" << define << "&quot;,";
+      }
+    else
+      {
+      fout << define << ",";
+      }
     if(!done)
       {
       pos = defs.find("-D", nextpos);
@@ -1145,7 +1206,9 @@
         // Construct the entire set of commands in one string.
         std::string script = 
           this->ConstructScript(command->GetCommandLines(),
-                                                   command->GetWorkingDirectory());
+                                command->GetWorkingDirectory(),
+                                command->GetEscapeOldStyle(),
+                                command->GetEscapeAllowMakeVars());
         std::string comment = this->ConstructComment(*command);
         const char* flags = compileFlags.size() ? compileFlags.c_str(): 0;
         this->WriteCustomRule(fout, source.c_str(), script.c_str(),
@@ -1266,16 +1329,30 @@
          << "\t\t\t\t\tCommandLine=\"" 
          << this->EscapeForXML(command) << "\"\n"
          << "\t\t\t\t\tAdditionalDependencies=\"";
+    if(depends.empty())
+      {
+      // There are no real dependencies.  Produce an artificial one to
+      // make sure the rule runs reliably.
+      if(!cmSystemTools::FileExists(source))
+        {
+        std::ofstream depout(source);
+        depout << "Artificial dependency for a custom command.\n";
+        }
+      fout << this->ConvertToXMLOutputPath(source);
+      }
+    else
+      {
     // Write out the dependencies for the rule.
     std::string temp;
     for(std::vector<std::string>::const_iterator d = depends.begin();
         d != depends.end(); ++d)
       {
-      // Lookup the real name of the dependency in case it is a CMake target.
+        // Get the real name of the dependency in case it is a CMake target.
       std::string dep = this->GetRealDependency(d->c_str(), i->c_str());
       fout << this->ConvertToXMLOutputPath(dep.c_str())
            << ";";
       }
+      }
     fout << "\"\n";
     fout << "\t\t\t\t\tOutputs=\"";
     if(outputs.empty())
@@ -1339,7 +1416,10 @@
       init = true;
       }
     std::string script = 
-      this->ConstructScript(cr->GetCommandLines(), cr->GetWorkingDirectory());
+      this->ConstructScript(cr->GetCommandLines(),
+                            cr->GetWorkingDirectory(),
+                            cr->GetEscapeOldStyle(),
+                            cr->GetEscapeAllowMakeVars());
     fout << this->EscapeForXML(script.c_str()).c_str();
     }
   if (init)
@@ -1360,8 +1440,11 @@
       fout << "\nCommandLine=\"";
       init = true;
       }
-    std::string script = this->ConstructScript(cr->GetCommandLines(),
-                                               cr->GetWorkingDirectory());
+    std::string script =
+      this->ConstructScript(cr->GetCommandLines(),
+                            cr->GetWorkingDirectory(),
+                            cr->GetEscapeOldStyle(),
+                            cr->GetEscapeAllowMakeVars());
     fout << this->EscapeForXML(script.c_str()).c_str();
     }
   if (init)
@@ -1383,7 +1466,10 @@
       init = true;
       }
     std::string script = 
-      this->ConstructScript(cr->GetCommandLines(), cr->GetWorkingDirectory());
+      this->ConstructScript(cr->GetCommandLines(),
+                            cr->GetWorkingDirectory(),
+                            cr->GetEscapeOldStyle(),
+                            cr->GetEscapeAllowMakeVars());
     fout << this->EscapeForXML(script.c_str()).c_str();
     }
   if (init)

Index: cmInstallGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallGenerator.cxx,v
retrieving revision 1.6.2.2
retrieving revision 1.6.2.3
diff -u -d -r1.6.2.2 -r1.6.2.3
--- cmInstallGenerator.cxx	11 May 2006 20:05:58 -0000	1.6.2.2
+++ cmInstallGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.6.2.3
@@ -55,10 +55,12 @@
                                         const char* file,
                                         bool optional /* = false */,
                                         const char* properties /* = 0 */,
-                                        const char* permissions /* = 0 */,
+                 const char* permissions_file /* = 0 */,
+                 const char* permissions_dir /* = 0 */,
                  std::vector<std::string> const& configurations,
                                         const char* component /* = 0 */,
-  const char* rename /* = 0 */
+                 const char* rename /* = 0 */,
+                 const char* literal_args /* = 0 */
   )
 {
   // Use the FILE command to install the file.
@@ -83,9 +85,13 @@
     {
     os << " PROPERTIES" << properties;
     }
-  if(permissions && *permissions)
+  if(permissions_file && *permissions_file)
     {
-    os << " PERMISSIONS" << permissions;
+    os << " PERMISSIONS" << permissions_file;
+    }
+  if(permissions_dir && *permissions_dir)
+    {
+    os << " DIR_PERMISSIONS" << permissions_dir;
     }
   if(rename && *rename)
     {
@@ -104,5 +110,10 @@
     {
     os << " COMPONENTS \"" << component << "\"";
     }
-  os << " FILES \"" << file << "\")\n";
+  os << " FILES \"" << file << "\"";
+  if(literal_args && *literal_args)
+    {
+    os << literal_args;
+    }
+  os << ")\n";
 }

Index: cmIfCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.h,v
retrieving revision 1.32.2.2
retrieving revision 1.32.2.3
diff -u -d -r1.32.2.2 -r1.32.2.3
--- cmIfCommand.h	30 Jun 2006 17:48:43 -0000	1.32.2.2
+++ cmIfCommand.h	13 Oct 2006 14:52:02 -0000	1.32.2.3
@@ -28,7 +28,7 @@
 class cmIfFunctionBlocker : public cmFunctionBlocker
 {
 public:
-  cmIfFunctionBlocker() {}
+  cmIfFunctionBlocker() {this->HasRun = false;}
   virtual ~cmIfFunctionBlocker() {}
   virtual bool IsFunctionBlocked(const cmListFileFunction& lff,
                                  cmMakefile &mf);
@@ -38,6 +38,7 @@
   
   std::vector<cmListFileArgument> Args;
   bool IsBlocking;
+  bool HasRun;
 };
 
 /** \class cmIfCommand
@@ -128,6 +129,10 @@
       "  IF(EXISTS directory-name)\n"
       "True if the named file or directory exists.  "
       "Behavior is well-defined only for full paths.\n"
+      "  IF(FILE_IS_NEWER file1 file2)\n"
+      "True if file1 is newer than file2 or if one of the two files "
+      "doesn't exist. "
+      "Behavior is well-defined only for full paths.\n"
       "  IF(IS_DIRECTORY directory-name)\n"
       "True if the given name is a directory.  "
       "Behavior is well-defined only for full paths.\n"

Index: cmMakeDirectoryCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakeDirectoryCommand.h,v
retrieving revision 1.8
retrieving revision 1.8.8.1
diff -u -d -r1.8 -r1.8.8.1
--- cmMakeDirectoryCommand.h	23 Feb 2004 03:07:02 -0000	1.8
+++ cmMakeDirectoryCommand.h	13 Oct 2006 14:52:05 -0000	1.8.8.1
@@ -60,7 +60,7 @@
    */
   virtual const char* GetTerseDocumentation() 
     {
-    return "Create a directory on the file system.";
+    return "Old directory creation command.  Use the FILE command.";
     }
   
   /**
@@ -69,12 +69,21 @@
   virtual const char* GetFullDocumentation()
     {
     return
+      "This command has been superceded by the FILE(MAKE_DIRECTORY ...) "
+      "command.  "
+      "It is provided for compatibility with older CMake code.\n"
       "  MAKE_DIRECTORY(directory)\n"
       "Creates the specified directory.  Full paths should be given.  Any "
       "parent directories that do not exist will also be created.  Use with "
       "care.";
     }
   
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmMakeDirectoryCommand, cmCommand);
 };
 

Index: cmAddLibraryCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddLibraryCommand.cxx,v
retrieving revision 1.24
retrieving revision 1.24.2.1
diff -u -d -r1.24 -r1.24.2.1
--- cmAddLibraryCommand.cxx	15 Mar 2006 16:01:58 -0000	1.24
+++ cmAddLibraryCommand.cxx	13 Oct 2006 14:52:02 -0000	1.24.2.1
@@ -28,6 +28,7 @@
   // otherwise it defaults to static library.
   int shared = 
     !cmSystemTools::IsOff(this->Makefile->GetDefinition("BUILD_SHARED_LIBS"));
+  bool in_all = true;
   
   std::vector<std::string>::const_iterator s = args.begin();
 
@@ -56,6 +57,11 @@
       ++s;
       shared = 2;
       }
+    else if(*s == "EXCLUDE_FROM_ALL")
+      {
+      ++s;
+      in_all = false;
+      }
     }
 
   if (s == args.end())
@@ -74,7 +80,8 @@
     ++s;
     }
 
-  this->Makefile->AddLibrary(this->LibName.c_str(), shared, srclists);
+  this->Makefile->AddLibrary(this->LibName.c_str(), shared, srclists,
+                             in_all);
   
   return true;
 }

Index: cmMessageCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMessageCommand.cxx,v
retrieving revision 1.18.2.1
retrieving revision 1.18.2.2
diff -u -d -r1.18.2.1 -r1.18.2.2
--- cmMessageCommand.cxx	30 Jun 2006 17:48:46 -0000	1.18.2.1
+++ cmMessageCommand.cxx	13 Oct 2006 14:52:06 -0000	1.18.2.2
@@ -59,9 +59,15 @@
 
   if (send_error || fatal_error)
     {
-    //cmSystemTools::Error(message.c_str());
+    if( !this->Makefile->GetCMakeInstance()->GetDebugOutput())
+      {
+      cmSystemTools::Error(message.c_str());
+      }
+    else
+      {
     this->SetError(message.c_str());
     }
+    }
   else
     {
       if (status)
@@ -77,6 +83,11 @@
     {
     cmSystemTools::SetFatalErrorOccured();
     }
+  // if debug is on then retru
+  if(this->Makefile->GetCMakeInstance()->GetDebugOutput())
+    {
   return (!send_error && !fatal_error);
+    }
+  return true;
 }
 

Index: cmMakefileTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.cxx,v
retrieving revision 1.16.2.6
retrieving revision 1.16.2.7
diff -u -d -r1.16.2.6 -r1.16.2.7
--- cmMakefileTargetGenerator.cxx	24 Jul 2006 15:19:36 -0000	1.16.2.6
+++ cmMakefileTargetGenerator.cxx	13 Oct 2006 14:52:06 -0000	1.16.2.7
@@ -35,6 +35,7 @@
   this->BuildFileStream = 0;
   this->InfoFileStream = 0;
   this->FlagFileStream = 0;
+  this->DriveCustomCommandsOnDepends = false;
 }
 
 cmMakefileTargetGenerator *
@@ -58,7 +59,7 @@
       break;
     default:
       return result;
-      break;
+      // break; /* unreachable */
     }
 
   result->TargetName = tgtName;
@@ -105,7 +106,6 @@
     }
   this->LocalGenerator->WriteDisclaimer(*this->BuildFileStream);
   this->LocalGenerator->WriteSpecialTargetsTop(*this->BuildFileStream);
-  this->LocalGenerator->WriteMakeVariables(*this->BuildFileStream);
 }
 
 //----------------------------------------------------------------------------
@@ -350,7 +350,9 @@
     objNoTargetDir = cmSystemTools::GetFilenameName(objNoTargetDir);
     }
   this->LocalGenerator->LocalObjectFiles[objNoTargetDir].
-    push_back(this->Target);
+    push_back(
+      cmLocalUnixMakefileGenerator3::LocalObjectEntry(this->Target, lang)
+      );
 }
 
 //----------------------------------------------------------------------------
@@ -495,6 +497,106 @@
                                       relativeObj.c_str(),
                                       depends, commands, false);
 
+  bool lang_is_c_or_cxx = ((strcmp(lang, "C") == 0) ||
+                           (strcmp(lang, "CXX") == 0));
+  bool do_preprocess_rules = lang_is_c_or_cxx &&
+    this->LocalGenerator->GetCreatePreprocessedSourceRules();
+  bool do_assembly_rules = lang_is_c_or_cxx &&
+    this->LocalGenerator->GetCreateAssemblySourceRules();
+  if(do_preprocess_rules || do_assembly_rules)
+    {
+    std::vector<std::string> force_depends;
+    force_depends.push_back("cmake_force");
+    std::string::size_type dot_pos = relativeObj.rfind(".");
+    std::string relativeObjBase = relativeObj.substr(0, dot_pos);
+
+    if(do_preprocess_rules)
+      {
+      commands.clear();
+      std::string relativeObjI = relativeObjBase + ".i";
+
+      std::string preprocessEcho = "Preprocessing ";
+      preprocessEcho += lang;
+      preprocessEcho += " source to ";
+      preprocessEcho += relativeObjI;
+      this->LocalGenerator->AppendEcho(
+        commands, preprocessEcho.c_str(),
+        cmLocalUnixMakefileGenerator3::EchoBuild
+        );
+
+      std::string preprocessRuleVar = "CMAKE_";
+      preprocessRuleVar += lang;
+      preprocessRuleVar += "_CREATE_PREPROCESSED_SOURCE";
+      if(const char* preprocessRule =
+         this->Makefile->GetDefinition(preprocessRuleVar.c_str()))
+        {
+        cmSystemTools::ExpandListArgument(preprocessRule, commands);
+
+        vars.PreprocessedSource = relativeObjI.c_str();
+
+        // Expand placeholders in the commands.
+        for(std::vector<std::string>::iterator i = commands.begin();
+            i != commands.end(); ++i)
+          {
+          this->LocalGenerator->ExpandRuleVariables(*i, vars);
+          }
+        }
+      else
+        {
+        std::string cmd = "$(CMAKE_COMMAND) -E cmake_unimplemented_variable ";
+        cmd += preprocessRuleVar;
+        commands.push_back(cmd);
+        }
+
+      this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+                                          relativeObjI.c_str(),
+                                          force_depends, commands, false);
+      }
+
+    if(do_assembly_rules)
+      {
+      commands.clear();
+      std::string relativeObjS = relativeObjBase + ".s";
+
+      std::string assemblyEcho = "Compiling ";
+      assemblyEcho += lang;
+      assemblyEcho += " source to assembly ";
+      assemblyEcho += relativeObjS;
+      this->LocalGenerator->AppendEcho(
+        commands, assemblyEcho.c_str(),
+        cmLocalUnixMakefileGenerator3::EchoBuild
+        );
+
+      std::string assemblyRuleVar = "CMAKE_";
+      assemblyRuleVar += lang;
+      assemblyRuleVar += "_CREATE_ASSEMBLY_SOURCE";
+      if(const char* assemblyRule =
+         this->Makefile->GetDefinition(assemblyRuleVar.c_str()))
+        {
+        cmSystemTools::ExpandListArgument(assemblyRule, commands);
+
+        vars.AssemblySource = relativeObjS.c_str();
+
+        // Expand placeholders in the commands.
+        for(std::vector<std::string>::iterator i = commands.begin();
+            i != commands.end(); ++i)
+          {
+          this->LocalGenerator->ExpandRuleVariables(*i, vars);
+          }
+        }
+      else
+        {
+        std::string cmd = "$(CMAKE_COMMAND) -E cmake_unimplemented_variable ";
+        cmd += assemblyRuleVar;
+        commands.push_back(cmd);
+        }
+
+      this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+                                          relativeObjS.c_str(),
+                                          force_depends, commands, false);
+      }
+    }
+
   // If the language needs provides-requires mode, create the
   // corresponding targets.
   std::string objectRequires = relativeObj;
@@ -673,6 +775,12 @@
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL);
   commands.push_back(depCmd.str());
   
+  // Make sure all custom command outputs in this target are built.
+  if(this->DriveCustomCommandsOnDepends)
+    {
+    this->DriveCustomCommands(depends);
+    }
+
   // Write the rule.
   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
                                       depMark.c_str(),
@@ -680,6 +788,29 @@
 }
 
 //----------------------------------------------------------------------------
+void
+cmMakefileTargetGenerator
+::DriveCustomCommands(std::vector<std::string>& depends)
+{
+  // Depend on all custom command outputs.
+  const std::vector<cmSourceFile*>& sources =
+    this->Target->GetSourceFiles();
+  for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
+      source != sources.end(); ++source)
+    {
+    if(cmCustomCommand* cc = (*source)->GetCustomCommand())
+      {
+      const std::vector<std::string>& outputs = cc->GetOutputs();
+      for(std::vector<std::string>::const_iterator o = outputs.begin();
+          o != outputs.end(); ++o)
+        {
+        depends.push_back(*o);
+        }
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
 void cmMakefileTargetGenerator
 ::WriteObjectDependRules(cmSourceFile& source,
                          std::vector<std::string>& depends)
@@ -731,12 +862,25 @@
   std::vector<std::string> depends;
   this->LocalGenerator->AppendCustomDepend(depends, cc);
 
+  // Check whether we need to bother checking for a symbolic output.
+  bool need_symbolic = this->GlobalGenerator->GetNeedSymbolicMark();
+
   // Write the rule.
   const std::vector<std::string>& outputs = cc.GetOutputs();
   std::vector<std::string>::const_iterator o = outputs.begin();
+  {
+  bool symbolic = false;
+  if(need_symbolic)
+    {
+    if(cmSourceFile* sf = this->Makefile->GetSource(o->c_str()))
+      {
+      symbolic = sf->GetPropertyAsBool("SYMBOLIC");
+      }
+    }
   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
                                       o->c_str(), depends, commands,
-                                      false);
+                                      symbolic);
+  }
 
   // If the rule has multiple outputs, add a rule for the extra
   // outputs to just depend on the first output with no command.  Also
@@ -756,9 +900,17 @@
     }
   for(++o; o != outputs.end(); ++o)
     {
+    bool symbolic = false;
+    if(need_symbolic)
+      {
+      if(cmSourceFile* sf = this->Makefile->GetSource(o->c_str()))
+        {
+        symbolic = sf->GetPropertyAsBool("SYMBOLIC");
+        }
+      }
     this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
                                         o->c_str(), depends, commands,
-                                        false);
+                                        symbolic);
     gg->AddMultipleOutputPair(o->c_str(), depends[0].c_str());
     }
 }
@@ -896,9 +1048,8 @@
                                                       bool relink)
 {
   // Compute the name of the driver target.
-  std::string dir = this->Makefile->GetStartOutputDirectory();
-  dir += "/";
-  dir += this->LocalGenerator->GetTargetDirectory(*this->Target);
+  std::string dir =
+    this->LocalGenerator->GetRelativeTargetDirectory(*this->Target);
   std::string buildTargetRuleName = dir;
   buildTargetRuleName += relink?"/preinstall":"/build";
   buildTargetRuleName = this->Convert(buildTargetRuleName.c_str(),
@@ -924,20 +1075,9 @@
     comment = "Rule to build all files generated by this target.";
 
     // Make sure all custom command outputs in this target are built.
-    const std::vector<cmSourceFile*>& sources = 
-      this->Target->GetSourceFiles();
-    for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
-        source != sources.end(); ++source)
-      {
-      if(cmCustomCommand* cc = (*source)->GetCustomCommand())
-        {
-        const std::vector<std::string>& outputs = cc->GetOutputs();
-        for(std::vector<std::string>::const_iterator o = outputs.begin();
-            o != outputs.end(); ++o)
+    if(!this->DriveCustomCommandsOnDepends)
           {
-          depends.push_back(*o);
-          }
-        }
+      this->DriveCustomCommands(depends);
       }
     }
 
@@ -1012,7 +1152,7 @@
     // Don't emit the same library twice for this target.
     if(emitted.insert(lib->first).second)
       {
-      // Depend only on other CMake targets.
+      // Depend on other CMake targets.
       if(cmTarget* tgt = 
          this->GlobalGenerator->FindTarget(0, lib->first.c_str()))
         {
@@ -1022,6 +1162,11 @@
           depends.push_back(location);
           }
         }
+      // depend on full path libs as well
+      else if(cmSystemTools::FileIsFullPath(lib->first.c_str()))
+        {
+        depends.push_back(lib->first.c_str());
+        }
       }
     }
 }
@@ -1089,6 +1234,7 @@
       }
     *progressFileStream << "\n";
     }
+  *progressFileStream << "\n";
   current += this->NumberOfProgressActions;
   delete progressFileStream;
 }

Index: cmSetTargetPropertiesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetTargetPropertiesCommand.h,v
retrieving revision 1.21.2.3
retrieving revision 1.21.2.4
diff -u -d -r1.21.2.3 -r1.21.2.4
--- cmSetTargetPropertiesCommand.h	30 Jun 2006 17:48:46 -0000	1.21.2.3
+++ cmSetTargetPropertiesCommand.h	13 Oct 2006 14:52:06 -0000	1.21.2.4
@@ -133,6 +133,13 @@
         "the target in an IDE like visual studio.  VS_KEYWORD can be set "
         "to change the visual studio keyword, for example QT integration "
         "works better if this is set to Qt4VSv1.0.\n"
+        "When a library is built CMake by default generates code to remove "
+        "any existing library using all possible names.  This is needed "
+        "to support libraries that switch between STATIC and SHARED by "
+        "a user option.  However when using OUTPUT_NAME to build a static "
+        "and shared library of the same name using different logical target "
+        "names the two targets will remove each other's files.  This can be "
+        "prevented by setting the CLEAN_DIRECT_OUTPUT property to 1.\n"
         "The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the "
         "old way to specify CMake scripts to run before and after "
         "installing a target.  They are used only when the old "

Index: cmInstallGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallGenerator.h,v
retrieving revision 1.4.2.2
retrieving revision 1.4.2.3
diff -u -d -r1.4.2.2 -r1.4.2.3
--- cmInstallGenerator.h	11 May 2006 20:05:58 -0000	1.4.2.2
+++ cmInstallGenerator.h	13 Oct 2006 14:52:02 -0000	1.4.2.3
@@ -38,11 +38,13 @@
     std::ostream& os, const char* dest, int type,
     const char* file, bool optional = false,
     const char* properties = 0,
-    const char* permissions = 0,
+    const char* permissions_file = 0,
+    const char* permissions_dir = 0,
     std::vector<std::string> const& configurations 
     = std::vector<std::string>(),
     const char* component = 0,
-    const char* rename = 0
+    const char* rename = 0,
+    const char* literal_args = 0
     );
 
 protected:

Index: cmIncludeDirectoryCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIncludeDirectoryCommand.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
--- cmIncludeDirectoryCommand.cxx	14 May 2006 19:22:41 -0000	1.18.2.2
+++ cmIncludeDirectoryCommand.cxx	13 Oct 2006 14:52:02 -0000	1.18.2.3
@@ -28,6 +28,7 @@
   std::vector<std::string>::const_iterator i = args.begin();
 
   bool before = this->Makefile->IsOn("CMAKE_INCLUDE_DIRECTORIES_BEFORE");
+  bool system = false;
 
   if ((*i) == "BEFORE")
     {
@@ -42,12 +43,19 @@
 
   for(; i != args.end(); ++i)
     {
+    if(*i == "SYSTEM")
+      {
+      system = true;
+      continue;
+      }
     if(i->size() == 0)
       {
       cmSystemTools::Error
         ("Empty Include Directory Passed into INCLUDE_DIRECTORIES command.");
       }
     std::string unixPath = *i;
+    if (!cmSystemTools::IsOff(unixPath.c_str()))
+      {
     cmSystemTools::ConvertToUnixSlashes(unixPath);
     if(!cmSystemTools::FileIsFullPath(unixPath.c_str()))
       {
@@ -56,7 +64,12 @@
       tmp += unixPath;
       unixPath = tmp;
       }
+      }
     this->Makefile->AddIncludeDirectory(unixPath.c_str(), before);
+    if(system)
+      {
+      this->Makefile->AddSystemIncludeDirectory(unixPath.c_str());
+      }
     }
   return true;
 }

Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.247.2.6
retrieving revision 1.247.2.7
diff -u -d -r1.247.2.6 -r1.247.2.7
--- cmake.cxx	24 Jul 2006 15:19:36 -0000	1.247.2.6
+++ cmake.cxx	13 Oct 2006 14:52:06 -0000	1.247.2.7
@@ -111,6 +111,7 @@
 
 cmake::cmake()
 {
+  this->DebugOutput = false;
   this->DebugTryCompile = false;
   this->ClearBuildSystem = false;
   this->FileComparison = new cmFileTimeComparison;
@@ -446,6 +447,11 @@
       std::cout << "debug trycompile on\n";
       this->DebugTryCompileOn();
       }
+    else if(arg.find("--debug-output",0) == 0)
+      {
+      std::cout << "Running with debug output on.\n";
+      this->DebugOutputOn();
+      }
     else if(arg.find("-G",0) == 0)
       {
       std::string value = arg.substr(2);
@@ -1184,6 +1190,18 @@
       return cmake::ExecuteLinkScript(args);
       }
 
+    // Internal CMake unimplemented feature notification.
+    else if (args[1] == "cmake_unimplemented_variable")
+      {
+      std::cerr << "Feature not implemented for this platform.";
+      if(args.size() == 3)
+        {
+        std::cerr << "  Variable " << args[2] << " is not set.";
+        }
+      std::cerr << std::endl;
+      return 1;
+      }
+
 #ifdef CMAKE_BUILD_WITH_CMAKE
     // Internal CMake color makefile support.
     else if (args[1] == "cmake_echo_color")
@@ -1319,6 +1337,11 @@
 
 void cmake::SetGlobalGenerator(cmGlobalGenerator *gg)
 {
+  if(!gg)
+    {
+    cmSystemTools::Error("Error SetGlobalGenerator called with null");
+    return;
+    }
   // delete the old generator
   if (this->GlobalGenerator)
     {

Index: cmWin32ProcessExecution.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmWin32ProcessExecution.cxx,v
retrieving revision 1.27
retrieving revision 1.27.2.1
diff -u -d -r1.27 -r1.27.2.1
--- cmWin32ProcessExecution.cxx	15 Mar 2006 16:02:07 -0000	1.27
+++ cmWin32ProcessExecution.cxx	13 Oct 2006 14:52:06 -0000	1.27.2.1
@@ -293,14 +293,14 @@
   PROCESS_INFORMATION piProcInfo;
   STARTUPINFO siStartInfo;
   char *s1=0,*s2=0, *s3 = " /c ";
-  int i;
-  int x;
-  if (i = GetEnvironmentVariable("COMSPEC",NULL,0)) 
+  int i = GetEnvironmentVariable("COMSPEC",NULL,0);
+  if (i)
     {
     char *comshell;
 
     s1 = (char *)malloc(i);
-    if (!(x = GetEnvironmentVariable("COMSPEC", s1, i)))
+    int x = GetEnvironmentVariable("COMSPEC", s1, i);
+    if (!x)
       {
       free(s1);
       return x;
@@ -443,25 +443,25 @@
     return TRUE;
     }
   
-   LPVOID lpMsgBuf;
-
-  FormatMessage( 
-                FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
-                NULL,
-                GetLastError(),
-                MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
-                (LPTSTR) &lpMsgBuf,
-                0,
-                NULL 
-                );
-  
-  // Free the buffer.
- 
-  char* str = strcpy(new char[strlen((char*)lpMsgBuf)+1], (char*)lpMsgBuf); 
-  LocalFree( lpMsgBuf );
-  
   output += "CreateProcessError: ";
-  output += str;
+  {
+  /* Format the error message.  */
+  char message[1024];
+  DWORD original = GetLastError();
+  DWORD length = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
+                               FORMAT_MESSAGE_IGNORE_INSERTS, 0, original,
+                               MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+                               message, 1023, 0);
+  if(length < 1)
+    {
+    /* FormatMessage failed.  Use a default message.  */
+    _snprintf(message, 1023,
+              "Process execution failed with error 0x%X.  "
+              "FormatMessage failed with error 0x%X",
+              original, GetLastError());
+    }
+  output += message;
+  }
   output += "\n";
   output += "for command: ";
   output += s2;
@@ -471,7 +471,6 @@
     output += path;
     }
   output += "\n";
-  delete [] str;
   free(s2);
   free(s1);
   return FALSE;
@@ -607,7 +606,7 @@
         
     case POPEN_2:
     case POPEN_4: 
-      if ( 1 ) 
+      //if ( 1 ) 
         {
         fd1 = _open_osfhandle(TO_INTPTR(this->hChildStdinWrDup), mode);
         fd2 = _open_osfhandle(TO_INTPTR(this->hChildStdoutRdDup), mode);
@@ -615,7 +614,7 @@
         }
         
     case POPEN_3:
-      if ( 1) 
+      //if ( 1) 
         {
         fd1 = _open_osfhandle(TO_INTPTR(this->hChildStdinWrDup), mode);
         fd2 = _open_osfhandle(TO_INTPTR(this->hChildStdoutRdDup), mode);

Index: cmDependsC.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsC.cxx,v
retrieving revision 1.21.2.3
retrieving revision 1.21.2.4
diff -u -d -r1.21.2.3 -r1.21.2.4
--- cmDependsC.cxx	30 Jun 2006 17:48:43 -0000	1.21.2.3
+++ cmDependsC.cxx	13 Oct 2006 14:52:02 -0000	1.21.2.4
@@ -24,20 +24,19 @@
 
 //----------------------------------------------------------------------------
 cmDependsC::cmDependsC():
-  IncludePath(0), GeneratedFiles(0)
+  IncludePath(0)
 {
 }
 //----------------------------------------------------------------------------
 // yummy look at all those constructor arguments
 cmDependsC::cmDependsC(std::vector<std::string> const& includes,
                        const char* scanRegex, const char* complainRegex,
-                       std::set<cmStdString> const& generatedFiles,
                        const cmStdString& cacheFileName):
   IncludePath(&includes),
-  IncludeRegexLine("^[ \t]*#[ \t]*include[ \t]*[<\"]([^\">]+)([\">])"),
+  IncludeRegexLine(
+    "^[ \t]*#[ \t]*(include|import)[ \t]*[<\"]([^\">]+)([\">])"),
   IncludeRegexScan(scanRegex),
   IncludeRegexComplain(complainRegex),
-  GeneratedFiles(&generatedFiles),
   CacheFileName(cacheFileName)
 {
   this->ReadCacheFile();
@@ -49,7 +48,7 @@
   this->WriteCacheFile();
 
   for (std::map<cmStdString, cmIncludeLines*>::iterator it=
-         this->fileCache.begin(); it!=this->fileCache.end(); ++it)
+         this->FileCache.begin(); it!=this->FileCache.end(); ++it)
     {
     delete it->second;
     }
@@ -86,6 +85,13 @@
   std::set<cmStdString> dependencies;
   std::set<cmStdString> scanned;
 
+  // Use reserve to allocate enough memory for both strings,
+  // so that during the loops no memory is allocated or freed
+  std::string cacheKey;
+  cacheKey.reserve(4*1024);
+  std::string tempPathStr;
+  tempPathStr.reserve(4*1024);
+
   while(!this->Unscanned.empty())
     {
     // Get the next file to scan.
@@ -96,15 +102,13 @@
     std::string fullName;
     if(first || cmSystemTools::FileIsFullPath(current.FileName.c_str()))
       {
-      if(this->FileExistsOrIsGenerated(current.FileName, scanned,
-                                       dependencies))
+      if(cmSystemTools::FileExists(current.FileName.c_str()))
         {
         fullName = current.FileName;
         }
       }
     else if(!current.QuotedLocation.empty() &&
-            this->FileExistsOrIsGenerated(current.QuotedLocation, scanned,
-                                          dependencies))
+            cmSystemTools::FileExists(current.QuotedLocation.c_str()))
       {
       // The include statement producing this entry was a double-quote
       // include and the included file is present in the directory of
@@ -113,26 +117,49 @@
       }
     else
       {
+      // With GCC distribution of STL, assigning to a string directly
+      // throws away the internal buffer of the left-hand-side.  We
+      // want to keep the pre-allocated buffer so we use C-style
+      // string assignment and then operator+=.  We could call
+      // .clear() instead of assigning to an empty string but the
+      // method does not exist on some older compilers.
+      cacheKey = "";
+      cacheKey += current.FileName;
+
       for(std::vector<std::string>::const_iterator i = 
             this->IncludePath->begin(); i != this->IncludePath->end(); ++i)
         {
+        cacheKey+=*i;
+        }
+      std::map<cmStdString, cmStdString>::iterator
+        headerLocationIt=this->HeaderLocationCache.find(cacheKey);
+      if (headerLocationIt!=this->HeaderLocationCache.end())
+        {
+        fullName=headerLocationIt->second;
+        }
+      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
         // include directory.  Avoid using a leading "./".
-        std::string temp = *i;
-        if(temp == ".")
+
+        tempPathStr = "";
+        if((*i) == ".")
           {
-          temp = "";
+          tempPathStr += current.FileName;
           }
         else
           {
-          temp += "/";
+            tempPathStr += *i;
+            tempPathStr+="/";
+            tempPathStr+=current.FileName;
           }
-        temp += current.FileName;
 
         // Look for the file in this location.
-        if(this->FileExistsOrIsGenerated(temp, scanned, dependencies))
+        if(cmSystemTools::FileExists(tempPathStr.c_str()))
           {
-          fullName = temp;
+            fullName = tempPathStr;
+            HeaderLocationCache[cacheKey]=fullName;
           break;
           }
         }
@@ -156,8 +183,8 @@
 
       // Check whether this file is already in the cache
       std::map<cmStdString, cmIncludeLines*>::iterator fileIt=
-        this->fileCache.find(fullName);
-      if (fileIt!=this->fileCache.end())
+        this->FileCache.find(fullName);
+      if (fileIt!=this->FileCache.end())
         {
         fileIt->second->Used=true;
         dependencies.insert(fullName);
@@ -252,7 +279,7 @@
       if ((res==true) && (newer==1)) //cache is newer than the parsed file
         {
         cacheEntry=new cmIncludeLines;
-        this->fileCache[line]=cacheEntry; 
+        this->FileCache[line]=cacheEntry;
         }
       }
     else if (cacheEntry!=0)
@@ -285,8 +312,8 @@
     }
   
   for (std::map<cmStdString, cmIncludeLines*>::const_iterator fileIt=
-         this->fileCache.begin(); 
-       fileIt!=this->fileCache.end(); ++fileIt)
+         this->FileCache.begin();
+       fileIt!=this->FileCache.end(); ++fileIt)
     {
     if (fileIt->second->Used)
       {
@@ -317,7 +344,7 @@
 {
   cmIncludeLines* newCacheEntry=new cmIncludeLines;
   newCacheEntry->Used=true;
-  this->fileCache[fullName]=newCacheEntry;
+  this->FileCache[fullName]=newCacheEntry;
   
   // Read one line at a time.
   std::string line;
@@ -328,8 +355,8 @@
       {
       // Get the file being included.
       UnscannedEntry entry;
-      entry.FileName = this->IncludeRegexLine.match(1);
-      if(this->IncludeRegexLine.match(2) == "\"" &&
+      entry.FileName = this->IncludeRegexLine.match(2);
+      if(this->IncludeRegexLine.match(3) == "\"" &&
          !cmSystemTools::FileIsFullPath(entry.FileName.c_str()))
         {
         // This was a double-quoted include with a relative path.  We
@@ -359,57 +386,3 @@
       }
     }
 }
-
-//----------------------------------------------------------------------------
-bool cmDependsC::FileExistsOrIsGenerated(const std::string& fname,
-                                         std::set<cmStdString>& scanned,
-                                         std::set<cmStdString>& dependencies)
-{
-  // Check for a generated file.
-  if(this->FileIsGenerated(fname, scanned, dependencies))
-    {
-    return true;
-    }
-  else if(cmSystemTools::FileIsFullPath(fname.c_str()))
-    {
-    // The generated file may have been listed with a relative path.
-    // Note that CMAKE_GENERATED_FILES is written with a conversion
-    // relative to the home output directory.
-    std::string rname =
-      this->LocalGenerator->Convert(fname.c_str(),
-                                    cmLocalGenerator::HOME_OUTPUT,
-                                    cmLocalGenerator::UNCHANGED);
-    if(this->FileIsGenerated(rname, scanned, dependencies))
-      {
-      return true;
-      }
-    }
-
-  // Check for an existing file.
-  return cmSystemTools::FileExists(fname.c_str());
-}
-
-//----------------------------------------------------------------------------
-bool cmDependsC::FileIsGenerated(const std::string& fname,
-                                 std::set<cmStdString>& scanned,
-                                 std::set<cmStdString>& dependencies)
-{
-  if(this->GeneratedFiles &&
-     std::set<cmStdString>::const_iterator(this->GeneratedFiles->find(fname)) 
-     != this->GeneratedFiles->end())
-    {
-    // If the file does not really exist yet pretend it has already
-    // been scanned.  When it exists later then dependencies will be
-    // rescanned.
-    if(!cmSystemTools::FileExists(fname.c_str()))
-      {
-      scanned.insert(fname);
-      dependencies.insert(fname);
-      }
-    return true;
-    }
-  else
-    {
-    return false;
-    }
-}

Index: cmAddExecutableCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddExecutableCommand.cxx,v
retrieving revision 1.25.2.1
retrieving revision 1.25.2.2
diff -u -d -r1.25.2.1 -r1.25.2.2
--- cmAddExecutableCommand.cxx	11 May 2006 02:15:08 -0000	1.25.2.1
+++ cmAddExecutableCommand.cxx	13 Oct 2006 14:52:02 -0000	1.25.2.2
@@ -31,6 +31,7 @@
   ++s;
   bool use_win32 = false;
   bool use_macbundle = false;
+  bool in_all = true;
   while ( s != args.end() )
     {
     if (*s == "WIN32")
@@ -43,6 +44,11 @@
       ++s;
       use_macbundle = true;
       }
+    else if(*s == "EXCLUDE_FROM_ALL")
+      {
+      ++s;
+      in_all = false;
+      }
     else
       {
       break;
@@ -57,7 +63,8 @@
     }
 
   std::vector<std::string> srclists(s, args.end());
-  cmTarget* tgt = this->Makefile->AddExecutable(exename.c_str(), srclists); 
+  cmTarget* tgt = this->Makefile->AddExecutable(exename.c_str(), srclists,
+                                                in_all);
   if ( use_win32 )
     {
     tgt->SetProperty("WIN32_EXECUTABLE", "ON");

Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.132.2.6
retrieving revision 1.132.2.7
diff -u -d -r1.132.2.6 -r1.132.2.7
--- cmLocalGenerator.cxx	24 Jul 2006 15:19:35 -0000	1.132.2.6
+++ cmLocalGenerator.cxx	13 Oct 2006 14:52:03 -0000	1.132.2.7
@@ -28,6 +28,8 @@
 #include "cmTest.h"
 #include "cmake.h"
 
+#include <cmsys/System.h>
+
 #include <ctype.h> // for isalpha
 
 cmLocalGenerator::cmLocalGenerator()
@@ -37,6 +39,8 @@
   this->ExcludeFromAll = false;
   this->Parent = 0;
   this->WindowsShell = false;
+  this->WindowsVSIDE = false;
+  this->MSYSShell = false;
   this->IgnoreLibPrefix = false;
   this->UseRelativePaths = false;
   this->Configured = false;
@@ -397,7 +401,8 @@
   // Include install scripts from subdirectories.
   if(!this->Children.empty())
     {
-    fout << "# Include the install script for each subdirectory.\n";
+    fout << "IF(NOT CMAKE_INSTALL_LOCAL_ONLY)\n";
+    fout << "  # Include the install script for each subdirectory.\n";
     for(std::vector<cmLocalGenerator*>::const_iterator
           ci = this->Children.begin(); ci != this->Children.end(); ++ci)
       {
@@ -405,11 +410,12 @@
         {
         std::string odir = (*ci)->GetMakefile()->GetStartOutputDirectory();
         cmSystemTools::ConvertToUnixSlashes(odir);
-        fout << "INCLUDE(\"" <<  odir.c_str()
+        fout << "  INCLUDE(\"" <<  odir.c_str()
              << "/cmake_install.cmake\")" << std::endl;
         }
       }
     fout << "\n";
+    fout << "ENDIF(NOT CMAKE_INSTALL_LOCAL_ONLY)\n";
     }
 
   // Record the install manifest.
@@ -618,6 +624,10 @@
   vars.Flags = flags.c_str();
   vars.LinkFlags = linkFlags.c_str();
 
+  std::string langFlags;
+  this->AddLanguageFlags(langFlags, llang, 0);
+  vars.LanguageCompileFlags = langFlags.c_str();
+  
   cmCustomCommandLines commandLines;
   std::vector<std::string> rules;
   rules.push_back(this->Makefile->GetRequiredDefinition(createRule.c_str()));
@@ -749,6 +759,20 @@
       return replaceValues.Source;
       }
     }
+  if(replaceValues.PreprocessedSource)
+    {
+    if(variable == "PREPROCESSED_SOURCE")
+      {
+      return replaceValues.PreprocessedSource;
+      }
+    }
+  if(replaceValues.AssemblySource)
+    {
+    if(variable == "ASSEMBLY_SOURCE")
+      {
+      return replaceValues.AssemblySource;
+      }
+    }
   if(replaceValues.Object)
     {
     if(variable == "OBJECT")
@@ -795,21 +819,29 @@
         targetQuoted = '\"';
         targetQuoted += replaceValues.Target;
         targetQuoted += '\"';
-        return targetQuoted;
         }
+      return targetQuoted;
       }
+    if(replaceValues.LanguageCompileFlags)
+      {
     if(variable == "LANGUAGE_COMPILE_FLAGS")
       {
       return replaceValues.LanguageCompileFlags;
       }
+      }
+    if(replaceValues.Target)
+      {
     if(variable == "TARGET")
       {
       return replaceValues.Target;
       }
+      }
     if(variable == "TARGET_IMPLIB")
       {
       return this->TargetImplib;
       }
+    if(replaceValues.Target)
+      {
     if(variable == "TARGET_BASE")
       {
       // Strip the last extension off the target name.
@@ -825,6 +857,7 @@
         }
       }
     }
+    }
   if(replaceValues.TargetSOName)
     {
     if(variable == "TARGET_SONAME")
@@ -1011,6 +1044,17 @@
     // given once i.e.  -classpath a:b:c
     repeatFlag = false;
     }
+
+  // Support special system include flag if it is available and the
+  // normal flag is repeated for each directory.
+  std::string sysFlagVar = "CMAKE_INCLUDE_SYSTEM_FLAG_";
+  sysFlagVar += lang;
+  const char* sysIncludeFlag = 0;
+  if(repeatFlag)
+    {
+    sysIncludeFlag = this->Makefile->GetDefinition(sysFlagVar.c_str());
+    }
+
   bool flagUsed = false;
   std::set<cmStdString> emitted;
   for(i = includes.begin(); i != includes.end(); ++i)
@@ -1033,7 +1077,15 @@
     std::string include = *i;
     if(!flagUsed || repeatFlag)
       {
+      if(sysIncludeFlag &&
+         this->Makefile->IsSystemIncludeDirectory(i->c_str()))
+        {
+        includeFlags << sysIncludeFlag;
+        }
+      else
+        {
       includeFlags << includeFlag;
+        }
       flagUsed = true;
       }
     std::string includePath = this->ConvertToOutputForExisting(i->c_str());
@@ -1064,7 +1116,8 @@
 }
 
 //----------------------------------------------------------------------------
-void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs)
+void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
+                                             bool filter_system_dirs)
 {
   // Need to decide whether to automatically include the source and
   // binary directories at the beginning of the include path.
@@ -1138,6 +1191,8 @@
       }
     }
 
+  if(filter_system_dirs)
+    {
   // Do not explicitly add the standard include path "/usr/include".
   // This can cause problems with certain standard library
   // implementations because the wrong headers may be found first.
@@ -1152,6 +1207,7 @@
       emitted.insert(implicitIncludeVec[k]);
       }
     }
+    }
 
   // Get the project-specified include directories.
   std::vector<std::string>& includes = 
@@ -1610,16 +1666,68 @@
   const std::vector<std::string>&
     linkDirectories = target.GetLinkDirectories();
 
+  // Lookup link type selection flags.
+  const char* static_link_type_flag = 0;
+  const char* shared_link_type_flag = 0;
+  const char* target_type_str = 0;
+  switch(target.GetType())
+    {
+    case cmTarget::EXECUTABLE:     target_type_str = "EXE"; break;
+    case cmTarget::SHARED_LIBRARY: target_type_str = "SHARED_LIBRARY"; break;
+    case cmTarget::MODULE_LIBRARY: target_type_str = "SHARED_MODULE"; break;
+    default: break;
+    }
+  if(target_type_str)
+    {
+    // Get the language used for linking.
+    const char* linkLanguage =
+      target.GetLinkerLanguage(this->GetGlobalGenerator());
+
+    if(!linkLanguage)
+      {
+      cmSystemTools::
+        Error("CMake can not determine linker language for target:",
+              target.GetName());
+      return;
+      }
+    std::string static_link_type_flag_var = "CMAKE_";
+    static_link_type_flag_var += target_type_str;
+    static_link_type_flag_var += "_LINK_STATIC_";
+    static_link_type_flag_var += linkLanguage;
+    static_link_type_flag_var += "_FLAGS";
+    static_link_type_flag =
+      this->Makefile->GetDefinition(static_link_type_flag_var.c_str());
+
+    std::string shared_link_type_flag_var = "CMAKE_";
+    shared_link_type_flag_var += target_type_str;
+    shared_link_type_flag_var += "_LINK_DYNAMIC_";
+    shared_link_type_flag_var += linkLanguage;
+    shared_link_type_flag_var += "_FLAGS";
+    shared_link_type_flag =
+      this->Makefile->GetDefinition(shared_link_type_flag_var.c_str());
+    }
+
   // Compute the link directory order needed to link the libraries.
   cmOrderLinkDirectories orderLibs;
-  orderLibs.SetLinkPrefix(
+  orderLibs.SetLinkTypeInformation(cmOrderLinkDirectories::LinkShared,
+                                   static_link_type_flag,
+                                   shared_link_type_flag);
+  orderLibs.AddLinkPrefix(
     this->Makefile->GetDefinition("CMAKE_STATIC_LIBRARY_PREFIX"));
+  orderLibs.AddLinkPrefix(
+    this->Makefile->GetDefinition("CMAKE_SHARED_LIBRARY_PREFIX"));
+
+  // Import library names should be matched and treated as shared
+  // libraries for the purposes of linking.
   orderLibs.AddLinkExtension(
-    this->Makefile->GetDefinition("CMAKE_STATIC_LIBRARY_SUFFIX"));
+    this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"),
+    cmOrderLinkDirectories::LinkShared);
   orderLibs.AddLinkExtension(
-    this->Makefile->GetDefinition("CMAKE_SHARED_LIBRARY_SUFFIX"));
+    this->Makefile->GetDefinition("CMAKE_STATIC_LIBRARY_SUFFIX"),
+    cmOrderLinkDirectories::LinkStatic);
   orderLibs.AddLinkExtension(
-    this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"));
+    this->Makefile->GetDefinition("CMAKE_SHARED_LIBRARY_SUFFIX"),
+    cmOrderLinkDirectories::LinkShared);
   orderLibs.AddLinkExtension(
     this->Makefile->GetDefinition("CMAKE_LINK_LIBRARY_SUFFIX"));
   if(const char* linkSuffixes =
@@ -1823,61 +1931,11 @@
 
 //----------------------------------------------------------------------------
 std::string
-cmLocalGenerator::ConstructScript(const cmCustomCommandLines& commandLines,
-                                  const char* workingDirectory, 
-                                  const char* newline)
-                                  
-{
-  // Store the script in a string.
-  std::string script;
-  if(workingDirectory)
-    {
-    script += "cd ";
-    script += this->Convert(workingDirectory, START_OUTPUT, SHELL);
-    script += newline;
-    }
-  // for visual studio IDE add extra stuff to the PATH
-  // if CMAKE_MSVCIDE_RUN_PATH is set.
-  if(this->Makefile->GetDefinition("MSVC_IDE"))
-    {
-    const char* extraPath = 
-      this->Makefile->GetDefinition("CMAKE_MSVCIDE_RUN_PATH");
-    if(extraPath)
-      {
-      script += "set PATH=";
-      script += extraPath;
-      script += ";%PATH%";
-      script += newline;
-      }
-    }
-  // Write each command on a single line.
-  for(cmCustomCommandLines::const_iterator cl = commandLines.begin();
-      cl != commandLines.end(); ++cl)
-    {
-    // Start with the command name.
-    const cmCustomCommandLine& commandLine = *cl;
-    script += this->Convert(commandLine[0].c_str(),START_OUTPUT,SHELL);
-
-    // Add the arguments.
-    for(unsigned int j=1;j < commandLine.size(); ++j)
-      {
-      script += " ";
-      script += cmSystemTools::EscapeSpaces(commandLine[j].c_str());
-      }
-
-    // End the line.
-    script += newline;
-    }
-  return script;
-}
-
-//----------------------------------------------------------------------------
-std::string
 cmLocalGenerator::ConstructComment(const cmCustomCommand& cc,
                                    const char* default_comment)
 {
   // Check for a comment provided with the command.
-  if(cc.GetComment() && *cc.GetComment())
+  if(cc.GetComment())
     {
     return cc.GetComment();
     }
@@ -1975,6 +2033,18 @@
       {
       cmSystemTools::SetForceUnixPaths(true);
       }
+
+    // For the MSYS shell convert drive letters to posix paths, so
+    // that c:/some/path becomes /c/some/path.  This is needed to
+    // avoid problems with the shell path translation.
+    if(this->MSYSShell)
+      {
+      if(result.size() > 2 && result[1] == ':')
+        {
+        result[1] = result[0];
+        result[0] = '/';
+        }
+      }
     }
   return result;
 }
@@ -2198,3 +2268,77 @@
   // Convert to a safe name.
   return this->CreateSafeUniqueObjectFileName(objectName.c_str());
 }
+
+//----------------------------------------------------------------------------
+const char*
+cmLocalGenerator
+::GetSourceFileLanguage(const cmSourceFile& source)
+{
+  // Check for an explicitly assigned language.
+  if(const char* lang = source.GetProperty("LANGUAGE"))
+    {
+    return lang;
+    }
+
+  // Infer the language from the source file extension.
+  return (this->GlobalGenerator
+          ->GetLanguageFromExtension(source.GetSourceExtension().c_str()));
+}
+
+//----------------------------------------------------------------------------
+std::string cmLocalGenerator::EscapeForShellOldStyle(const char* str)
+{
+  std::string result;
+  bool forceOn =  cmSystemTools::GetForceUnixPaths();
+  if(forceOn && this->WindowsShell)
+    {
+    cmSystemTools::SetForceUnixPaths(false);
+    }
+  result = cmSystemTools::EscapeSpaces(str);
+  if(forceOn && this->WindowsShell)
+    {
+    cmSystemTools::SetForceUnixPaths(true);
+    }
+  return result;
+}
+
+//----------------------------------------------------------------------------
+std::string cmLocalGenerator::EscapeForShell(const char* str, bool makeVars,
+                                             bool forEcho)
+{
+  // Compute the flags for the target shell environment.
+  int flags = 0;
+  if(this->WindowsVSIDE)
+    {
+    flags |= cmsysSystem_Shell_Flag_VSIDE;
+    }
+  else
+    {
+    flags |= cmsysSystem_Shell_Flag_Make;
+    }
+  if(makeVars)
+    {
+    flags |= cmsysSystem_Shell_Flag_AllowMakeVariables;
+    }
+  if(forEcho)
+    {
+    flags |= cmsysSystem_Shell_Flag_EchoWindows;
+    }
+
+  // Compute the buffer size needed.
+  int size = (this->WindowsShell ?
+              cmsysSystem_Shell_GetArgumentSizeForWindows(str, flags) :
+              cmsysSystem_Shell_GetArgumentSizeForUnix(str, flags));
+
+  // Compute the shell argument itself.
+  std::vector<char> arg(size);
+  if(this->WindowsShell)
+    {
+    cmsysSystem_Shell_GetArgumentForWindows(str, &arg[0], flags);
+    }
+  else
+    {
+    cmsysSystem_Shell_GetArgumentForUnix(str, &arg[0], flags);
+    }
+  return std::string(&arg[0]);
+}

Index: cmInstallTargetsCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallTargetsCommand.h,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -d -r1.11 -r1.11.2.1
--- cmInstallTargetsCommand.h	19 Feb 2006 20:25:27 -0000	1.11
+++ cmInstallTargetsCommand.h	13 Oct 2006 14:52:02 -0000	1.11.2.1
@@ -72,6 +72,12 @@
       "(Windows DLL), the files will be copied to that directory.";
     }
   
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmInstallTargetsCommand, cmCommand);
 };
 

Index: cmGlobalBorlandMakefileGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalBorlandMakefileGenerator.cxx,v
retrieving revision 1.20.2.3
retrieving revision 1.20.2.4
diff -u -d -r1.20.2.3 -r1.20.2.4
--- cmGlobalBorlandMakefileGenerator.cxx	30 Jun 2006 17:48:43 -0000	1.20.2.3
+++ cmGlobalBorlandMakefileGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.20.2.4
@@ -43,7 +43,6 @@
 cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator()
 {
   cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
-  lg->SetEchoNeedsQuote(false);
   lg->SetIncludeDirective("!include");
   lg->SetWindowsShell(true);
   lg->SetDefineWindowsNULL(true);

Index: cmCustomCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCustomCommand.h,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -u -d -r1.17 -r1.17.2.1
--- cmCustomCommand.h	11 Apr 2006 15:06:18 -0000	1.17
+++ cmCustomCommand.h	13 Oct 2006 14:52:02 -0000	1.17.2.1
@@ -53,6 +53,21 @@
   /** Get the comment string for the command.  */
   const char* GetComment() const;
 
+  /** Append to the list of command lines.  */
+  void AppendCommands(const cmCustomCommandLines& commandLines);
+
+  /** Append to the list of dependencies.  */
+  void AppendDepends(const std::vector<std::string>& depends);
+
+  /** Set/Get whether old-style escaping should be used.  */
+  bool GetEscapeOldStyle() const;
+  void SetEscapeOldStyle(bool b);
+
+  /** Set/Get whether the build tool can replace variables in
+      arguments to the command.  */
+  bool GetEscapeAllowMakeVars() const;
+  void SetEscapeAllowMakeVars(bool b);
+
   /** set get the used status of the command */ 
   void SetUsed() { this->Used = true;}; 
   bool IsUsed() { return this->Used;};
@@ -61,8 +76,11 @@
   std::vector<std::string> Outputs;
   std::vector<std::string> Depends;
   cmCustomCommandLines CommandLines;
+  bool HaveComment;
   std::string Comment;
   std::string WorkingDirectory;
+  bool EscapeAllowMakeVars;
+  bool EscapeOldStyle;
   bool Used;
 };
 

Index: cmFileCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFileCommand.cxx,v
retrieving revision 1.56.2.4
retrieving revision 1.56.2.5
diff -u -d -r1.56.2.4 -r1.56.2.5
--- cmFileCommand.cxx	30 Jun 2006 17:48:43 -0000	1.56.2.4
+++ cmFileCommand.cxx	13 Oct 2006 14:52:02 -0000	1.56.2.5
@@ -20,6 +20,34 @@
 #include <sys/stat.h>
 #include <cmsys/Directory.hxx>
 #include <cmsys/Glob.hxx>
+#include <cmsys/RegularExpression.hxx>
+
+// Table of permissions flags.
+#if defined(_WIN32) && !defined(__CYGWIN__)
+static mode_t mode_owner_read = S_IREAD;
+static mode_t mode_owner_write = S_IWRITE;
+static mode_t mode_owner_execute = S_IEXEC;
+static mode_t mode_group_read = 0;
[...964 lines suppressed...]
@@ -938,10 +1336,6 @@
       }
     }
 
-  // Save the updated install manifest.
-  this->Makefile->AddDefinition("CMAKE_INSTALL_MANIFEST_FILES",
-                            smanifest_files.c_str());
-
   return true;
 }
 
@@ -951,7 +1345,7 @@
 {
 #if defined(__APPLE__)
   std::string ext;
-  kwsys_stl::string::size_type dot_pos = name.rfind(".");
+  cmsys_stl::string::size_type dot_pos = name.rfind(".");
   if(dot_pos != name.npos)
     {
     ext = name.substr(dot_pos, name.npos);

Index: cmMacroCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMacroCommand.cxx,v
retrieving revision 1.25.2.2
retrieving revision 1.25.2.3
diff -u -d -r1.25.2.2 -r1.25.2.3
--- cmMacroCommand.cxx	30 Jun 2006 17:48:45 -0000	1.25.2.2
+++ cmMacroCommand.cxx	13 Oct 2006 14:52:05 -0000	1.25.2.3
@@ -235,9 +235,14 @@
       }
     if(!this->Makefile->ExecuteCommand(newLFF))
       {
+      const char* filePath = args[0].FilePath;
+      if(!filePath)
+        {
+        filePath = "Unknown";
+        }
       cmOStringStream error;
       error << "Error in cmake code at\n"
-            << args[0].FilePath << ":" << args[0].Line << ":\n"
+            << filePath << ":" << args[0].Line << ":\n"
             << "A command failed during the invocation of macro \""
             << this->Args[0].c_str() << "\".";
       cmSystemTools::Error(error.str().c_str());

Index: cmSetSourceFilesPropertiesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetSourceFilesPropertiesCommand.h,v
retrieving revision 1.9.2.1
retrieving revision 1.9.2.2
diff -u -d -r1.9.2.1 -r1.9.2.2
--- cmSetSourceFilesPropertiesCommand.h	14 May 2006 19:22:43 -0000	1.9.2.1
+++ cmSetSourceFilesPropertiesCommand.h	13 Oct 2006 14:52:06 -0000	1.9.2.2
@@ -74,7 +74,10 @@
         "only used by Makefiles).  "
         "OBJECT_DEPENDS (string) adds dependencies to the object file.  "
         "COMPILE_FLAGS (string) is passed to the compiler as additional "
-        "command line arguments when the source file is compiled.  ";
+        "command line arguments when the source file is compiled.  "
+        "If SYMBOLIC (boolean) is set to true the build system will be "
+        "informed that the source file is not actually created on disk but "
+        "instead used as a symbolic name for a build rule.";
       
     }
   

Index: cmListCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmListCommand.h,v
retrieving revision 1.2.2.3
retrieving revision 1.2.2.4
diff -u -d -r1.2.2.3 -r1.2.2.4
--- cmListCommand.h	16 May 2006 18:04:08 -0000	1.2.2.3
+++ cmListCommand.h	13 Oct 2006 14:52:02 -0000	1.2.2.4
@@ -93,6 +93,8 @@
   bool HandleInsertCommand(std::vector<std::string> const& args);
   bool HandleRemoveAtCommand(std::vector<std::string> const& args);
   bool HandleRemoveItemCommand(std::vector<std::string> const& args);
+  bool HandleSortCommand(std::vector<std::string> const& args);
+  bool HandleReverseCommand(std::vector<std::string> const& args);
 
 
   bool GetList(std::vector<std::string>& list, const char* var);

Index: cmAddCustomCommandCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddCustomCommandCommand.h,v
retrieving revision 1.22.2.1
retrieving revision 1.22.2.2
diff -u -d -r1.22.2.1 -r1.22.2.2
--- cmAddCustomCommandCommand.h	30 Jun 2006 17:48:43 -0000	1.22.2.1
+++ cmAddCustomCommandCommand.h	13 Oct 2006 14:52:02 -0000	1.22.2.2
@@ -72,7 +72,7 @@
       "                     [MAIN_DEPENDENCY depend]\n"
       "                     [DEPENDS [depends...]]\n"
       "                     [WORKING_DIRECTORY dir]\n"
-      "                     [COMMENT comment])\n"
+      "                     [COMMENT comment] [VERBATIM] [APPEND])\n"
       "This defines a new command that can be executed during the build "
       "process. The outputs named should be listed as source files in the "
       "target for which they are to be generated. "
@@ -93,7 +93,7 @@
       "                     COMMAND command1 [ARGS] [args1...]\n"
       "                     [COMMAND command2 [ARGS] [args2...] ...]\n"
       "                     [WORKING_DIRECTORY dir]\n"
-      "                     [COMMENT comment])\n"
+      "                     [COMMENT comment] [VERBATIM])\n"
       "This defines a new command that will be associated with "
       "building the specified target. When the command will "
       "happen is determined by which of the following is specified:\n"
@@ -102,9 +102,29 @@
       "  POST_BUILD - run after the target has been built\n"
       "Note that the PRE_BUILD option is only supported on Visual "
       "Studio 7 or later. For all other generators PRE_BUILD "
-      "will be treated as PRE_LINK. "
+      "will be treated as PRE_LINK.\n"
       "If WORKING_DIRECTORY is specified the command will be executed "
-      "in the directory given.";
+      "in the directory given. "
+      "If COMMENT is set, the value will be displayed as a "
+      "message before the commands are executed at build time. "
+      "If APPEND is specified the COMMAND and DEPENDS option values "
+      "are appended to the custom command for the first output specified. "
+      "There must have already been a previous call to this command with "
+      "the same output. The COMMENT, WORKING_DIRECTORY, and MAIN_DEPENDENCY "
+      "options are currently ignored when APPEND is given, "
+      "but may be used in the future."
+      "\n"
+      "If VERBATIM is given then all the arguments to the commands will be "
+      "passed exactly as specified no matter the build tool used. "
+      "Note that one level of escapes is still used by the CMake language "
+      "processor before ADD_CUSTOM_TARGET even sees the arguments. "
+      "Use of VERBATIM is recommended as it enables correct behavior. "
+      "When VERBATIM is not given the behavior is platform specific. "
+      "In the future VERBATIM may be enabled by default. The only reason "
+      "it is an option is to preserve compatibility with older CMake code.\n"
+      "If the output of the custom command is not actually "
+      "created as a file on disk it should be marked as SYMBOLIC with "
+      "SET_SOURCE_FILES_PROPERTIES.";
     }
   
   cmTypeMacro(cmAddCustomCommandCommand, cmCommand);

Index: cmLocalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.h,v
retrieving revision 1.56.2.3
retrieving revision 1.56.2.4
diff -u -d -r1.56.2.3 -r1.56.2.4
--- cmLocalGenerator.h	24 Jul 2006 15:19:35 -0000	1.56.2.3
+++ cmLocalGenerator.h	13 Oct 2006 14:52:04 -0000	1.56.2.4
@@ -170,7 +170,11 @@
                               std::vector<cmStdString>* fullPathLibs=0);
 
   /** Get the include flags for the current makefile and language.  */
-  void GetIncludeDirectories(std::vector<std::string>& dirs);
+  void GetIncludeDirectories(std::vector<std::string>& dirs,
+                             bool filter_system_dirs = true);
+
+  /** Compute the language used to compile the given source file.  */
+  const char* GetSourceFileLanguage(const cmSourceFile& source);
 
   // Create a struct to hold the varibles passed into
   // ExpandRuleVariables
@@ -178,18 +182,7 @@
   {
     RuleVariables()
       {
-        this->Language= 0;
-        this->Objects= 0;
-        this->Target= 0;
-        this->LinkLibraries= 0;
-        this->Source= 0;
-        this->Object= 0;
-        this->ObjectDir= 0;
-        this->Flags= 0;
-        this->ObjectsQuoted= 0;
-        this->TargetSOName= 0;
-        this->TargetInstallNameDir = 0;
-        this->LinkFlags= 0;
+        memset(this, 0,  sizeof(*this));
       }
     const char* TargetPDB;
     const char* Language;
@@ -197,6 +190,8 @@
     const char* Target;
     const char* LinkLibraries;
     const char* Source;
+    const char* AssemblySource;
+    const char* PreprocessedSource;
     const char* Object;
     const char* ObjectDir;
     const char* Flags;
@@ -207,11 +202,18 @@
     const char* LanguageCompileFlags;
   };
 
+  /** Escape the given string to be used as a command line argument in
+      the native build system shell.  Optionally allow the build
+      system to replace make variable references.  Optionally adjust
+      escapes for the special case of passing to the native echo
+      command.  */
+  std::string EscapeForShell(const char* str, bool makeVars = false,
+                             bool forEcho = false);
+
+  /** Backwards-compatibility version of EscapeForShell.  */
+  std::string EscapeForShellOldStyle(const char* str);
+
 protected:
-  /** Construct a script from the given list of command lines.  */
-  std::string ConstructScript(const cmCustomCommandLines& commandLines,
-                              const char* workingDirectory,
-                              const char* newline = "\n");
 
   /** Construct a comment for a custom command.  */
   std::string ConstructComment(const cmCustomCommand& cc,
@@ -273,7 +275,9 @@
   std::map<cmStdString, cmStdString> LanguageToIncludeFlags;
   std::map<cmStdString, cmStdString> UniqueObjectNamesMap;
   bool WindowsShell;
+  bool WindowsVSIDE;
   bool ForceUnixPath;
+  bool MSYSShell;
   bool UseRelativePaths;
   bool IgnoreLibPrefix;
   bool Configured;

Index: cmVTKWrapTclCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmVTKWrapTclCommand.h,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -u -d -r1.12 -r1.12.2.1
--- cmVTKWrapTclCommand.h	15 Mar 2006 16:02:07 -0000	1.12
+++ cmVTKWrapTclCommand.h	13 Oct 2006 14:52:06 -0000	1.12.2.1
@@ -79,6 +79,12 @@
       "Create Tcl wrappers for VTK classes.";
     }
 
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   /**
    * Helper methods
    */

Index: cmLoadCommandCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLoadCommandCommand.cxx,v
retrieving revision 1.25
retrieving revision 1.25.2.1
diff -u -d -r1.25 -r1.25.2.1
--- cmLoadCommandCommand.cxx	16 Mar 2006 22:09:08 -0000	1.25
+++ cmLoadCommandCommand.cxx	13 Oct 2006 14:52:03 -0000	1.25.2.1
@@ -21,6 +21,12 @@
 
 #include <cmsys/DynamicLoader.hxx>
 
+#include <stdlib.h>
+
+#ifdef __QNX__
+# include <malloc.h> /* for malloc/free on QNX */
+#endif
+
 #include <signal.h>
 extern "C" void TrapsForSignalsCFunction(int sig);
 

Index: cmListFileLexer.c
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmListFileLexer.c,v
retrieving revision 1.12
retrieving revision 1.12.4.1
diff -u -d -r1.12 -r1.12.4.1
--- cmListFileLexer.c	19 Sep 2005 21:20:48 -0000	1.12
+++ cmListFileLexer.c	13 Oct 2006 14:52:03 -0000	1.12.4.1
@@ -503,33 +503,16 @@
   - add a statement "(void)yyscanner;" to the top of these methods:
       yy_fatal_error, cmListFileLexer_yyalloc, cmListFileLexer_yyrealloc, cmListFileLexer_yyfree
   - remove all YY_BREAK lines occurring right after return statements
+  - remove the isatty forward declaration
 
 */
 
-/* Disable features we do not need. */
-#define YY_NEVER_INTERACTIVE 1
-#define YY_NO_INPUT 1
-#define YY_NO_UNPUT 1
-#define YY_NO_UNISTD_H 1
-#define ECHO
+#include "cmStandardLexer.h"
 
 /* Setup the proper cmListFileLexer_yylex declaration.  */
 #define YY_EXTRA_TYPE cmListFileLexer*
 #define YY_DECL int cmListFileLexer_yylex (yyscan_t yyscanner, cmListFileLexer* lexer)
 
-/* Disable some warnings.  */
-#if defined(_MSC_VER)
-# pragma warning ( disable : 4127 )
-# pragma warning ( disable : 4131 )
-# pragma warning ( disable : 4244 )
-# pragma warning ( disable : 4251 )
-# pragma warning ( disable : 4267 )
-# pragma warning ( disable : 4305 )
-# pragma warning ( disable : 4309 )
-# pragma warning ( disable : 4706 )
-# pragma warning ( disable : 4786 )
-#endif
-
 #include "cmListFileLexer.h"
 
 /*--------------------------------------------------------------------------*/
@@ -1526,10 +1509,6 @@
         cmListFileLexer_yyfree((void *) b ,yyscanner );
 }
 
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-    
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a cmListFileLexer_yyrestart() or at EOF.

Index: cmVTKWrapJavaCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmVTKWrapJavaCommand.cxx,v
retrieving revision 1.30.2.1
retrieving revision 1.30.2.2
diff -u -d -r1.30.2.1 -r1.30.2.2
--- cmVTKWrapJavaCommand.cxx	14 May 2006 19:22:44 -0000	1.30.2.1
+++ cmVTKWrapJavaCommand.cxx	13 Oct 2006 14:52:06 -0000	1.30.2.2
@@ -190,9 +190,8 @@
     alldepends.push_back(res2);
     }
 
-  const char* no_output = 0;
   const char* no_working_directory = 0;
-  this->Makefile->AddUtilityCommand((this->LibraryName+"JavaClasses").c_str(),
-                                true, no_output, 
-                                alldepends, no_working_directory, "");
+  this->Makefile->AddUtilityCommand(
+    (this->LibraryName+"JavaClasses").c_str(),
+    true, alldepends, no_working_directory, "");
 }

Index: cmGlobalVisualStudio71Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio71Generator.h,v
retrieving revision 1.12.2.2
retrieving revision 1.12.2.3
diff -u -d -r1.12.2.2 -r1.12.2.3
--- cmGlobalVisualStudio71Generator.h	11 May 2006 20:05:57 -0000	1.12.2.2
+++ cmGlobalVisualStudio71Generator.h	13 Oct 2006 14:52:02 -0000	1.12.2.3
@@ -55,7 +55,7 @@
                            const char* name, const char* path, cmTarget &t);
   virtual void WriteProjectConfigurations(std::ostream& fout, 
                                           const char* name,
-                                          bool in_all);
+                                          int targetType);
   virtual void WriteExternalProject(std::ostream& fout, const char* name,
                                     const char* path,
                                     const std::vector<std::string>& depends);

Index: cmExprParser.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExprParser.cxx,v
retrieving revision 1.2.4.2
retrieving revision 1.2.4.3
diff -u -d -r1.2.4.2 -r1.2.4.3
--- cmExprParser.cxx	15 May 2006 22:05:23 -0000	1.2.4.2
+++ cmExprParser.cxx	13 Oct 2006 14:52:02 -0000	1.2.4.3
@@ -159,6 +159,9 @@
 /* Disable some warnings in the generated code.  */
 #ifdef __BORLANDC__
 # pragma warn -8004 /* Variable assigned a value that is not used.  */
+# pragma warn -8008 /* condition always returns true */
+# pragma warn -8060 /* possibly incorrect assignment */
+# pragma warn -8066 /* unreachable code */
 #endif
 #ifdef _MSC_VER
 # pragma warning (disable: 4102) /* Unused goto label.  */

Index: cmDependsJavaParser.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsJavaParser.cxx,v
retrieving revision 1.4.6.1
retrieving revision 1.4.6.2
diff -u -d -r1.4.6.1 -r1.4.6.2
--- cmDependsJavaParser.cxx	15 May 2006 22:05:23 -0000	1.4.6.1
+++ cmDependsJavaParser.cxx	13 Oct 2006 14:52:02 -0000	1.4.6.2
@@ -338,6 +338,9 @@
 /* Disable some warnings in the generated code.  */
 #ifdef __BORLANDC__
 # pragma warn -8004 /* Variable assigned a value that is not used.  */
+# pragma warn -8008 /* condition always returns true */
+# pragma warn -8060 /* possibly incorrect assignment */
+# pragma warn -8066 /* unreachable code */
 #endif
 #ifdef _MSC_VER
 # pragma warning (disable: 4102) /* Unused goto label.  */

Index: cmCommandArgumentLexer.in.l
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentLexer.in.l,v
retrieving revision 1.5
retrieving revision 1.5.6.1
diff -u -d -r1.5 -r1.5.6.1
--- cmCommandArgumentLexer.in.l	17 Jun 2005 19:50:08 -0000	1.5
+++ cmCommandArgumentLexer.in.l	13 Oct 2006 14:52:02 -0000	1.5.6.1
@@ -26,7 +26,7 @@
 Modify cmCommandArgumentLexer.cxx:
   - remove TABs
   - remove "yyscanner" argument from these methods:
-      yy_fatal_error, yyalloc, yyrealloc, yyfree
+      yy_fatal_error, cmCommandArgument_yyalloc, cmCommandArgument_yyrealloc, cmCommandArgument_yyfree
   - remove all YY_BREAK lines occurring right after return statements
   - change while ( 1 ) to for(;;)
 
@@ -38,25 +38,9 @@
 
 */
 
-#include "cmCommandArgumentParserHelper.h"
-
-/* Disable some warnings.  */
-#if defined(_MSC_VER)
-# pragma warning ( disable : 4127 )
-# pragma warning ( disable : 4131 )
-# pragma warning ( disable : 4244 )
-# pragma warning ( disable : 4251 )
-# pragma warning ( disable : 4267 )
-# pragma warning ( disable : 4305 )
-# pragma warning ( disable : 4309 )
-# pragma warning ( disable : 4706 )
-# pragma warning ( disable : 4786 )
-#endif
+#include "cmStandardLexer.h"
 
-/* Disable features we do not need. */
-#define YY_NEVER_INTERACTIVE 1
-#undef ECHO /* SGI termios defines this differently. */
-#define ECHO
+#include "cmCommandArgumentParserHelper.h"
 
 /* Replace the lexer input function.  */
 #undef YY_INPUT
@@ -66,16 +50,6 @@
 /* Include the set of tokens from the parser.  */
 #include "cmCommandArgumentParserTokens.h"
 
-
-#if defined( _WIN32 ) && !defined( __CYGWIN__ )
-/* Handle Windows properly */
-#  include <io.h>
-#  if defined( _MSC_VER )
-#    define isatty _isatty
-#  endif
-#  define YY_NO_UNISTD_H 1
-#endif
-
 /*--------------------------------------------------------------------------*/
 %}
 
@@ -85,13 +59,13 @@
 
 %%
 
-\$[A-Za-z0-9/_.-]+\{ { 
+\$[A-Za-z0-9/_.+-]+\{ { 
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
   yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2); 
   return cal_NCURLY; 
 } 
 
-@[A-Za-z0-9/_.-]+@ { 
+@[A-Za-z0-9/_.+-]+@ { 
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
   yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2); 
   return cal_ATNAME; 
@@ -100,25 +74,25 @@
 "${" {
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
   //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
-  yylvalp->str = yyextra->m_DCURLYVariable;
+  yylvalp->str = yyextra->DCURLYVariable;
   return cal_DCURLY;
 }
 
 "}" {
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
   //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
-  yylvalp->str = yyextra->m_RCURLYVariable;
+  yylvalp->str = yyextra->RCURLYVariable;
   return cal_RCURLY;
 }
 
 "@" {
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
   //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
-  yylvalp->str = yyextra->m_ATVariable;
+  yylvalp->str = yyextra->ATVariable;
   return cal_AT;
 }
 
-[A-Za-z0-9/_.-]+ { 
+[A-Za-z0-9/_.+-]+ { 
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
   yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
   return cal_NAME; 
@@ -140,19 +114,19 @@
 
 "$" {
   //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
-  yylvalp->str = yyextra->m_DOLLARVariable;
+  yylvalp->str = yyextra->DOLLARVariable;
   return cal_DOLLAR; 
 }
 
 "{" {
   //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
-  yylvalp->str = yyextra->m_LCURLYVariable;
+  yylvalp->str = yyextra->LCURLYVariable;
   return cal_LCURLY; 
 }
 
 "\\" {
   //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
-  yylvalp->str = yyextra->m_BSLASHVariable;
+  yylvalp->str = yyextra->BSLASHVariable;
   return cal_BSLASH; 
 }
 

Index: cmVTKWrapJavaCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmVTKWrapJavaCommand.h,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -d -r1.11 -r1.11.2.1
--- cmVTKWrapJavaCommand.h	15 Mar 2006 16:02:07 -0000	1.11
+++ cmVTKWrapJavaCommand.h	13 Oct 2006 14:52:06 -0000	1.11.2.1
@@ -77,6 +77,12 @@
       "Create Java wrappers for VTK classes.";
     }
   
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
 private:
   std::vector<cmSourceFile> WrapClasses;
   std::vector<std::string> WrapHeaders;

Index: cmDependsFortranLexer.in.l
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortranLexer.in.l,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -u -d -r1.5 -r1.5.4.1
--- cmDependsFortranLexer.in.l	17 Oct 2005 13:58:53 -0000	1.5
+++ cmDependsFortranLexer.in.l	13 Oct 2006 14:52:02 -0000	1.5.4.1
@@ -36,7 +36,7 @@
 Modify cmDependsFortranLexer.cxx:
   - remove TABs
   - remove "yyscanner" argument from these methods:
-      yy_fatal_error, yyalloc, yyrealloc, yyfree
+      yy_fatal_error, cmDependsFortran_yyalloc, cmDependsFortran_yyrealloc, cmDependsFortran_yyfree
   - remove all YY_BREAK lines occurring right after return statements
   - change while ( 1 ) to for(;;)
 
@@ -48,40 +48,16 @@
 
 */
 
+#include "cmStandardLexer.h"
+
 #define cmDependsFortranLexer_cxx
 #include "cmDependsFortranParser.h" /* Interface to parser object.  */
 
-/* Disable some warnings.  */
-#if defined(_MSC_VER)
-# pragma warning ( disable : 4127 )
-# pragma warning ( disable : 4131 )
-# pragma warning ( disable : 4244 )
-# pragma warning ( disable : 4251 )
-# pragma warning ( disable : 4267 )
-# pragma warning ( disable : 4305 )
-# pragma warning ( disable : 4309 )
-# pragma warning ( disable : 4706 )
-# pragma warning ( disable : 4786 )
-#endif
-
-/* Disable features we do not need. */
-#define YY_NEVER_INTERACTIVE 1
-#define ECHO
-
 /* Replace the lexer input function.  */
 #undef YY_INPUT
 #define YY_INPUT(buf, result, max_size) \
   { result = cmDependsFortranParser_Input(yyextra, buf, max_size); }
 
-/* Provide isatty on Windows.  */
-#if defined( _WIN32 ) && !defined( __CYGWIN__ )
-# include <io.h>
-# if defined( _MSC_VER )
-#  define isatty _isatty
-# endif
-# define YY_NO_UNISTD_H 1
-#endif
-
 /* Include the set of tokens from the parser.  */
 #include "cmDependsFortranParserTokens.h"
 

Index: cmInstallProgramsCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallProgramsCommand.h,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -d -r1.13 -r1.13.2.1
--- cmInstallProgramsCommand.h	15 Mar 2006 16:02:04 -0000	1.13
+++ cmInstallProgramsCommand.h	13 Oct 2006 14:52:02 -0000	1.13.2.1
@@ -90,6 +90,12 @@
       "is stored in the variable CMAKE_INSTALL_PREFIX.";
     }
   
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmInstallProgramsCommand, cmCommand);
 
 protected:

Index: cmCommandArgumentLexer.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentLexer.h,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -d -r1.2 -r1.2.2.1
--- cmCommandArgumentLexer.h	10 Mar 2006 18:54:57 -0000	1.2
+++ cmCommandArgumentLexer.h	13 Oct 2006 14:52:02 -0000	1.2.2.1
@@ -13,7 +13,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 31
+#define YY_FLEX_SUBMINOR_VERSION 33
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -36,6 +36,14 @@
 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
 
 #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
 #include <inttypes.h>
 typedef int8_t flex_int8_t;
 typedef uint8_t flex_uint8_t;

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CMakeLists.txt,v
retrieving revision 1.289.2.3
retrieving revision 1.289.2.4
diff -u -d -r1.289.2.3 -r1.289.2.4
--- CMakeLists.txt	24 Jul 2006 15:19:34 -0000	1.289.2.3
+++ CMakeLists.txt	13 Oct 2006 14:52:02 -0000	1.289.2.4
@@ -19,6 +19,7 @@
   ${CMAKE_ZLIB_INCLUDES}
   ${CMAKE_EXPAT_INCLUDES}
   ${CMAKE_TAR_INCLUDES}
+  ${CMAKE_COMPRESS_INCLUDES}
   )
 
 # let cmake know it is supposed to use it
@@ -122,6 +123,8 @@
   cmInstallScriptGenerator.cxx
   cmInstallTargetGenerator.h
   cmInstallTargetGenerator.cxx
+  cmInstallDirectoryGenerator.h
+  cmInstallDirectoryGenerator.cxx
   cmListFileCache.cxx
   cmListFileCache.h
   cmListFileLexer.c
@@ -215,11 +218,13 @@
 
 # create a library used by the command line and the GUI
 ADD_LIBRARY(CMakeLib ${SRCS})
-TARGET_LINK_LIBRARIES(CMakeLib cmsys ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES} ${CMAKE_TAR_LIBRARIES})
+TARGET_LINK_LIBRARIES(CMakeLib cmsys
+  ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES}
+  ${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES})
 
 # On Apple we need Carbon
 IF(APPLE)
-  TARGET_LINK_LIBRARIES(CMakeLib "-framework Carbon")
+  TARGET_LINK_LIBRARIES(CMakeLib "-framework CoreFoundation")
 ENDIF(APPLE)
 
 # On some platforms we need the rpcrt4 library for the VS 7 generators.
@@ -592,7 +597,7 @@
       "${CMake_BINARY_DIR}/Tests/Complex"
       --build-two-config
       --build-generator ${CMAKE_TEST_GENERATOR}
-      --build-project complex
+      --build-project Complex
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/Complex/bin"  
       --build-options
@@ -605,7 +610,7 @@
       "${CMake_SOURCE_DIR}/Tests/ComplexOneConfig"
       "${CMake_BINARY_DIR}/Tests/ComplexOneConfig"
       --build-generator ${CMAKE_TEST_GENERATOR}
-      --build-project complex
+      --build-project Complex
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin" 
       --build-options
@@ -691,7 +696,7 @@
     "${CMake_SOURCE_DIR}/Tests/Testing"
     "${CMake_BINARY_DIR}/Tests/Testing"
     --build-generator ${CMAKE_TEST_GENERATOR}
-    --build-project testing
+    --build-project Testing
     --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/Testing/bin"
     --test-command testing
@@ -702,7 +707,7 @@
     "${CMake_SOURCE_DIR}/Tests/Wrapping"
     "${CMake_BINARY_DIR}/Tests/Wrapping"
     --build-generator ${CMAKE_TEST_GENERATOR}
-    --build-project wrapping
+    --build-project Wrapping
     --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
     --test-command wrapping
@@ -856,7 +861,7 @@
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/LinkLine"
     --build-generator ${CMAKE_TEST_GENERATOR}
     --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
-    --build-project Linkline
+    --build-project LinkLine
     --test-command Exec
     )
 

Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.96.2.3
retrieving revision 1.96.2.4
diff -u -d -r1.96.2.3 -r1.96.2.4
--- cmTarget.cxx	30 Jun 2006 17:48:46 -0000	1.96.2.3
+++ cmTarget.cxx	13 Oct 2006 14:52:06 -0000	1.96.2.4
@@ -908,6 +908,14 @@
     this->SetProperty("LOCATION", this->GetLocation(0));
     }
   
+  // Per-configuration location can be computed.
+  int len = static_cast<int>(strlen(prop));
+  if(len > 9 && strcmp(prop+len-9, "_LOCATION") == 0)
+    {
+    std::string configName(prop, len-9);
+    this->SetProperty(prop, this->GetLocation(configName.c_str()));
+    }
+
   // the type property returns what type the target is
   if (!strcmp(prop,"TYPE"))
     {
@@ -915,31 +923,31 @@
       {
       case cmTarget::STATIC_LIBRARY:
         return "STATIC_LIBRARY";
-        break;
+        // break; /* unreachable */
       case cmTarget::MODULE_LIBRARY:
         return "MODULE_LIBRARY";
-        break;
+        // break; /* unreachable */
       case cmTarget::SHARED_LIBRARY:
         return "SHARED_LIBRARY";
-        break;
+        // break; /* unreachable */
       case cmTarget::EXECUTABLE:
         return "EXECUTABLE";
-        break;
+        // break; /* unreachable */
       case cmTarget::UTILITY:
         return "UTILITY";
-        break;
+        // break; /* unreachable */
       case cmTarget::GLOBAL_TARGET:
         return "GLOBAL_TARGET";
-        break;
+        // break; /* unreachable */
       case cmTarget::INSTALL_FILES:
         return "INSTALL_FILES";
-        break;
+        // break; /* unreachable */
       case cmTarget::INSTALL_PROGRAMS:
         return "INSTALL_PROGRAMS";
-        break;
+        // break; /* unreachable */
       case cmTarget::INSTALL_DIRECTORY:
         return "INSTALL_DIRECTORY";
-        break;
+        // break; /* unreachable */
       }
     return 0;
     }
@@ -1158,6 +1166,17 @@
     return;
     }
 
+  // Return an empty name for the import library if this platform
+  // does not support import libraries.
+  if(implib &&
+     !this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"))
+    {
+    outPrefix = "";
+    outBase = "";
+    outSuffix = "";
+    return;
+    }
+
   // The implib option is only allowed for shared libraries.
   if(type != cmTarget::SHARED_LIBRARY)
     {
@@ -1236,6 +1255,17 @@
   // Append the per-configuration postfix.
   outBase += configPostfix?configPostfix:"";
 
+  // Name shared libraries with their version number on some platforms.
+  if(const char* version = this->GetProperty("VERSION"))
+    {
+    if(type == cmTarget::SHARED_LIBRARY && !implib &&
+       this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION"))
+      {
+      outBase += "-";
+      outBase += version;
+      }
+    }
+
   // Append the suffix.
   outSuffix = targetSuffix?targetSuffix:"";
 }

Index: cmLocalUnixMakefileGenerator3.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.h,v
retrieving revision 1.45.2.2
retrieving revision 1.45.2.3
diff -u -d -r1.45.2.2 -r1.45.2.3
--- cmLocalUnixMakefileGenerator3.h	24 Jul 2006 15:19:35 -0000	1.45.2.2
+++ cmLocalUnixMakefileGenerator3.h	13 Oct 2006 14:52:05 -0000	1.45.2.3
@@ -73,7 +73,8 @@
                      const char* target,
                      const std::vector<std::string>& depends,
                      const std::vector<std::string>& commands,
-                     bool symbolic);
+                     bool symbolic,
+                     bool in_help = false);
   
   // write the main variables used by the makefiles
   void WriteMakeVariables(std::ostream& makefileStream);
@@ -96,9 +97,6 @@
   void SetMakeSilentFlag(const char* s) { this->MakeSilentFlag = s; }
   std::string &GetMakeSilentFlag() { return this->MakeSilentFlag; }
 
-  /** Set whether the echo command needs its argument quoted.  */
-  void SetEchoNeedsQuote(bool b) { this->EchoNeedsQuote = b; }
-
   /**
    * Set to true if the shell being used is the windows shell.
    * This controls if statements in the makefile and the SHELL variable.
@@ -107,6 +105,13 @@
   void SetWindowsShell(bool v)  {this->WindowsShell = v;}
 
   /**
+   * Set to true if the shell being used is the MSYS shell.
+   * This controls if statements in the makefile and the SHELL variable.
+   * The default is false.
+   */
+  void SetMSYSShell(bool v)  {this->MSYSShell = v;}
+
+  /**
    * If set to true, then NULL is set to nil for non Windows_NT.
    * This uses make syntax used by nmake and borland.
    * The default is false.
@@ -126,6 +131,14 @@
   void SetSilentNoColon(bool v)  {this->SilentNoColon = v;}
 
   /**
+   * Set the command to use for native make shell echo.  The value
+   * should include all parts of the command up to the beginning of
+   * the message (including a whitespace separator).
+   */
+  void SetNativeEchoCommand(const char* cmd)
+    { this->NativeEchoCommand = cmd; }
+
+  /**
    * Set the string used to include one makefile into another default
    * is include.
    */
@@ -174,12 +187,6 @@
   // cleanup the name of a potential target
   std::string ConvertToMakeTarget(const char* tgt);
 
-
-  const char* GetSourceFileLanguage(const cmSourceFile& source);
-
-
-  
-  
   /** Called from command-line hook to scan dependencies.  */
   virtual bool ScanDependencies(const char* tgtInfo);
 
@@ -208,13 +215,36 @@
   // write the target rules for the local Makefile into the stream
   void WriteLocalAllRules(std::ostream& ruleFileStream);
   
-  std::map<cmStdString,std::vector<cmTarget *> > GetLocalObjectFiles()
+  struct LocalObjectEntry
+  {
+    cmTarget* Target;
+    std::string Language;
+    LocalObjectEntry(): Target(0), Language() {}
+    LocalObjectEntry(cmTarget* t, const char* lang):
+      Target(t), Language(lang) {}
+  };
+  class LocalObjectInfo: public std::vector<LocalObjectEntry> {};
+  std::map<cmStdString, LocalObjectInfo> const& GetLocalObjectFiles()
     { return this->LocalObjectFiles;}
 
+  std::vector<cmStdString> const& GetLocalHelp() { return this->LocalHelp; }
+
   // return info about progress actions
   unsigned long GetNumberOfProgressActions();
   unsigned long GetNumberOfProgressActionsForTarget(const char *);
 
+  /** Get whether to create rules to generate preprocessed and
+      assembly sources.  This could be converted to a variable lookup
+      later.  */
+  bool GetCreatePreprocessedSourceRules()
+    {
+    return !this->SkipPreprocessedSourceRules;
+    }
+  bool GetCreateAssemblySourceRules()
+    {
+    return !this->SkipAssemblySourceRules;
+    }
+
 protected:
   // these two methods just compute reasonable values for LibraryOutputPath
   // and ExecutableOutputPath
@@ -223,6 +253,7 @@
 
   void WriteLocalMakefile();
   
+  
   // write the target rules for the local Makefile into the stream
   void WriteLocalMakefileTargets(std::ostream& ruleFileStream,
                                  std::set<cmStdString> &emitted);
@@ -267,6 +298,9 @@
   void WriteTargetRequiresRule(std::ostream& ruleFileStream,
                                cmTarget& target,
                                const std::vector<std::string>& objects);
+  void WriteObjectConvenienceRule(std::ostream& ruleFileStream,
+                                  const char* comment, const char* output,
+                                  LocalObjectInfo const& targets);
   
   std::string GetObjectFileName(cmTarget& target,
                                 const cmSourceFile& source,
@@ -306,12 +340,11 @@
   std::string ExecutableOutputPath;
   std::string LibraryOutputPath;
   std::string ConfigurationName;
+  std::string NativeEchoCommand;
   bool DefineWindowsNULL;
   bool UnixCD;
   bool PassMakeflags;
   bool SilentNoColon;
-  // Flag for whether echo command needs quotes.
-  bool EchoNeedsQuote;
   //==========================================================================
 
   std::string HomeRelativeOutputPath;
@@ -320,7 +353,14 @@
      beginning of generation to avoid many duplicate lookups.  */
   bool ColorMakefile;
 
-  std::map<cmStdString,std::vector<cmTarget *> > LocalObjectFiles;
+  /* Copy the setting of CMAKE_SKIP_PREPROCESSED_SOURCE_RULES and
+     CMAKE_SKIP_ASSEMBLY_SOURCE_RULES at the beginning of generation to
+     avoid many duplicate lookups.  */
+  bool SkipPreprocessedSourceRules;
+  bool SkipAssemblySourceRules;
+
+  std::map<cmStdString, LocalObjectInfo> LocalObjectFiles;
+  std::vector<cmStdString> LocalHelp;
 
   /* does the work for each target */
   std::vector<cmMakefileTargetGenerator *> TargetGenerators;

Index: cmExecProgramCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExecProgramCommand.h,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -u -d -r1.17 -r1.17.2.1
--- cmExecProgramCommand.h	10 Mar 2006 18:54:57 -0000	1.17
+++ cmExecProgramCommand.h	13 Oct 2006 14:52:02 -0000	1.17.2.1
@@ -88,6 +88,12 @@
       ;
     }
   
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmExecProgramCommand, cmCommand);
 };
 

Index: cmLocalVisualStudio6Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio6Generator.cxx,v
retrieving revision 1.100.2.3
retrieving revision 1.100.2.4
diff -u -d -r1.100.2.3 -r1.100.2.4
--- cmLocalVisualStudio6Generator.cxx	24 Jul 2006 15:19:35 -0000	1.100.2.3
+++ cmLocalVisualStudio6Generator.cxx	13 Oct 2006 14:52:05 -0000	1.100.2.4
@@ -223,12 +223,12 @@
   std::string args;
   args = "-H";
   args += this->Convert(this->Makefile->GetHomeDirectory(),
-                        START_OUTPUT, SHELL, true);
+                        START_OUTPUT, UNCHANGED, true);
   commandLine.push_back(args);
   args = "-B";
   args += 
     this->Convert(this->Makefile->GetHomeOutputDirectory(), 
-                  START_OUTPUT, SHELL, true);
+                  START_OUTPUT, UNCHANGED, true);
   commandLine.push_back(args);
 
   std::string configFile = 
@@ -461,6 +461,8 @@
         std::string script =
           this->ConstructScript(command->GetCommandLines(), 
                                 command->GetWorkingDirectory(),
+                                command->GetEscapeOldStyle(),
+                                command->GetEscapeAllowMakeVars(),
                                 "\\\n\t");
         std::string comment =
           this->ConstructComment(*command,
@@ -775,6 +777,8 @@
       }
     customRuleCode += this->ConstructScript(cr->GetCommandLines(),
                                             cr->GetWorkingDirectory(),
+                                            cr->GetEscapeOldStyle(),
+                                            cr->GetEscapeAllowMakeVars(),
                                             prelink_newline);
     }
   for (std::vector<cmCustomCommand>::const_iterator cr =
@@ -787,6 +791,8 @@
       }
     customRuleCode += this->ConstructScript(cr->GetCommandLines(),
                                             cr->GetWorkingDirectory(),
+                                            cr->GetEscapeOldStyle(),
+                                            cr->GetEscapeAllowMakeVars(),
                                             prelink_newline);
     }
   if(prelink_total > 0)
@@ -814,6 +820,8 @@
       }
     customRuleCode += this->ConstructScript(cr->GetCommandLines(),
                                             cr->GetWorkingDirectory(),
+                                            cr->GetEscapeOldStyle(),
+                                            cr->GetEscapeAllowMakeVars(),
                                             postbuild_newline);
     }
   if(postbuild_total > 0)

Index: cmIncludeExternalMSProjectCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIncludeExternalMSProjectCommand.cxx,v
retrieving revision 1.13.2.2
retrieving revision 1.13.2.3
diff -u -d -r1.13.2.2 -r1.13.2.3
--- cmIncludeExternalMSProjectCommand.cxx	11 May 2006 20:05:57 -0000	1.13.2.2
+++ cmIncludeExternalMSProjectCommand.cxx	13 Oct 2006 14:52:02 -0000	1.13.2.3
@@ -41,18 +41,33 @@
         }
       }
     
+    // Hack together a utility target storing enough information
+    // to reproduce the target inclusion.
     std::string utility_name("INCLUDE_EXTERNAL_MSPROJECT");
     utility_name += "_";
     utility_name += args[0];
     std::string path = args[1];
     cmSystemTools::ConvertToUnixSlashes(path);
-    const char* no_output = 0;
-    const char* no_working_directory = 0;
-    this->Makefile->AddUtilityCommand(utility_name.c_str(), true,
-                                  no_output, depends,
-                                  no_working_directory,
-                                  args[0].c_str(), path.c_str());
     
+    // Create a target instance for this utility.
+    cmTarget target;
+    target.SetType(cmTarget::UTILITY, utility_name.c_str());
+    target.SetInAll(true);
+    target.SetMakefile(this->Makefile);
+    std::vector<std::string> no_outputs;
+    cmCustomCommandLines commandLines;
+    cmCustomCommandLine commandLine;
+    commandLine.push_back(args[0]);
+    commandLine.push_back(path);
+    commandLines.push_back(commandLine);
+    cmCustomCommand cc(no_outputs, depends, commandLines, 0, 0);
+    target.GetPostBuildCommands().push_back(cc);
+
+    // Add the target to the set of targets.
+    cmTargets::iterator it =
+      this->Makefile->GetTargets()
+      .insert(cmTargets::value_type(utility_name.c_str(),target)).first;
+    this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->AddTarget(*it);
     }
 #endif
   return true;

Index: cmakemain.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmakemain.cxx,v
retrieving revision 1.50.2.3
retrieving revision 1.50.2.4
diff -u -d -r1.50.2.3 -r1.50.2.4
--- cmakemain.cxx	30 Jun 2006 17:48:46 -0000	1.50.2.3
+++ cmakemain.cxx	13 Oct 2006 14:52:06 -0000	1.50.2.4
@@ -85,6 +85,9 @@
   {"--debug-trycompile", "Do not delete the try compile directories..",
    "Do not delete the files and directories created for try_compile calls. "
    "This is useful in debugging failed try_compiles."},
+  {"--debug-output", "Put cmake in a debug mode.",
+   "Print extra stuff during the cmake run like stack traces with "
+   "message(send_error ) calls."},
   {"--help-command cmd [file]", "Print help for a single command and exit.",
    "Full documentation specific to the given command is displayed."},
   {"--help-command-list [file]", "List available listfile commands and exit.",

Index: cmMakefileTargetGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.h,v
retrieving revision 1.6.2.2
retrieving revision 1.6.2.3
diff -u -d -r1.6.2.2 -r1.6.2.3
--- cmMakefileTargetGenerator.h	24 Jul 2006 15:19:36 -0000	1.6.2.2
+++ cmMakefileTargetGenerator.h	13 Oct 2006 14:52:06 -0000	1.6.2.3
@@ -107,6 +107,8 @@
   // write the driver rule to build target outputs
   void WriteTargetDriverRule(const char* main_output, bool relink);
 
+  void DriveCustomCommands(std::vector<std::string>& depends);
+
   // Return the a string with -F flags on apple
   std::string GetFrameworkFlags();
 
@@ -122,6 +124,8 @@
   cmGlobalGenerator *GlobalGenerator;
   cmMakefile *Makefile;
 
+  bool DriveCustomCommandsOnDepends;
+
   // the full path to the build file
   std::string BuildFileName;
   std::string BuildFileNameFull;

Index: cmMakefileExecutableTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileExecutableTargetGenerator.cxx,v
retrieving revision 1.12.2.5
retrieving revision 1.12.2.6
diff -u -d -r1.12.2.5 -r1.12.2.6
--- cmMakefileExecutableTargetGenerator.cxx	24 Jul 2006 15:19:36 -0000	1.12.2.5
+++ cmMakefileExecutableTargetGenerator.cxx	13 Oct 2006 14:52:06 -0000	1.12.2.6
@@ -25,6 +25,12 @@
 #include "cmake.h"
 
 //----------------------------------------------------------------------------
+cmMakefileExecutableTargetGenerator::cmMakefileExecutableTargetGenerator()
+{
+  this->DriveCustomCommandsOnDepends = true;
+}
+
+//----------------------------------------------------------------------------
 void cmMakefileExecutableTargetGenerator::WriteRuleFiles()
 {
   // create the build.make file and directory, put in the common blocks
@@ -272,6 +278,13 @@
   exeCleanFiles.push_back(this->Convert(cleanFullName.c_str(),
                                         cmLocalGenerator::START_OUTPUT,
                                         cmLocalGenerator::UNCHANGED));
+#ifdef _WIN32
+  // There may be a manifest file for this target.  Add it to the
+  // clean set just in case.
+  exeCleanFiles.push_back(this->Convert((cleanFullName+".manifest").c_str(),
+                                        cmLocalGenerator::START_OUTPUT,
+                                        cmLocalGenerator::UNCHANGED));
+#endif
   if(cleanRealName != cleanName)
     {
     exeCleanFiles.push_back(this->Convert(cleanFullRealName.c_str(),

Index: cmSetCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetCommand.cxx,v
retrieving revision 1.29
retrieving revision 1.29.2.1
diff -u -d -r1.29 -r1.29.2.1
--- cmSetCommand.cxx	15 Mar 2006 16:02:07 -0000	1.29
+++ cmSetCommand.cxx	13 Oct 2006 14:52:06 -0000	1.29.2.1
@@ -92,7 +92,7 @@
     }
   
   // collect any values into a single semi-colon seperated value list
-  if(args.size() > 
+  if(static_cast<unsigned short>(args.size()) >
      static_cast<unsigned short>(1 + (cache ? 3 : 0) + (force ? 1 : 0)))
     {
     value = args[1];

Index: cmCommands.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommands.cxx,v
retrieving revision 1.103.2.1
retrieving revision 1.103.2.2
diff -u -d -r1.103.2.1 -r1.103.2.2
--- cmCommands.cxx	20 Apr 2006 20:16:32 -0000	1.103.2.1
+++ cmCommands.cxx	13 Oct 2006 14:52:02 -0000	1.103.2.2
@@ -20,7 +20,9 @@
 #include "cmAuxSourceDirectoryCommand.cxx"
 #include "cmBuildNameCommand.cxx"
 #include "cmCreateTestSourceList.cxx"
+#include "cmElseIfCommand.cxx"
 #include "cmEnableLanguageCommand.cxx"
+#include "cmEndMacroCommand.cxx"
 #include "cmEndWhileCommand.cxx"
 #include "cmExecuteProcessCommand.cxx"
 #include "cmExportLibraryDependencies.cxx"
@@ -73,7 +75,9 @@
   commands.push_back(new cmAuxSourceDirectoryCommand);
   commands.push_back(new cmBuildNameCommand);
   commands.push_back(new cmCreateTestSourceList);
+  commands.push_back(new cmElseIfCommand);
   commands.push_back(new cmEnableLanguageCommand);
+  commands.push_back(new cmEndMacroCommand);
   commands.push_back(new cmEndWhileCommand);
   commands.push_back(new cmExecuteProcessCommand);
   commands.push_back(new cmExportLibraryDependenciesCommand);

Index: cmInstallTargetsCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallTargetsCommand.cxx,v
retrieving revision 1.12.2.1
retrieving revision 1.12.2.2
diff -u -d -r1.12.2.1 -r1.12.2.2
--- cmInstallTargetsCommand.cxx	11 May 2006 20:05:58 -0000	1.12.2.1
+++ cmInstallTargetsCommand.cxx	13 Oct 2006 14:52:02 -0000	1.12.2.2
@@ -26,6 +26,10 @@
     return false;
     }
 
+  // Enable the install target.
+  this->Makefile->GetLocalGenerator()
+    ->GetGlobalGenerator()->EnableInstallTarget();
+
   cmTargets &tgts = this->Makefile->GetTargets();
   std::vector<std::string>::const_iterator s = args.begin();
   ++s;

Index: cmTryCompileCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTryCompileCommand.cxx,v
retrieving revision 1.55.2.2
retrieving revision 1.55.2.3
diff -u -d -r1.55.2.2 -r1.55.2.3
--- cmTryCompileCommand.cxx	30 Jun 2006 17:48:46 -0000	1.55.2.2
+++ cmTryCompileCommand.cxx	13 Oct 2006 14:52:06 -0000	1.55.2.3
@@ -178,6 +178,7 @@
         }
       err << "\nSee PROJECT command for help enabling other languages.";
       cmSystemTools::Error(err.str().c_str());
+      fclose(fout);
       return -1;
       }
     std::string langFlags = "CMAKE_";

Index: cmInstallCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallCommand.h,v
retrieving revision 1.9.2.2
retrieving revision 1.9.2.3
diff -u -d -r1.9.2.2 -r1.9.2.3
--- cmInstallCommand.h	11 May 2006 20:05:58 -0000	1.9.2.2
+++ cmInstallCommand.h	13 Oct 2006 14:52:02 -0000	1.9.2.3
@@ -93,13 +93,17 @@
       "The RENAME argument specifies a name for an installed file that "
       "may be different from the original file.  Renaming is allowed only "
       "when a single file is installed by the command.  "
+      "The OPTIONAL argument specifies that it is not an error if the "
+      "file to be installed does not exist.  "
       "\n"
       "The TARGETS signature:\n"
-      "  INSTALL(TARGETS targets... [[ARCHIVE|LIBRARY|RUNTIME]\n"
+      "  INSTALL(TARGETS targets...\n"
+      "          [[ARCHIVE|LIBRARY|RUNTIME]\n"
       "                              [DESTINATION <dir>]\n"
       "                              [PERMISSIONS permissions...]\n"
       "                              [CONFIGURATIONS [Debug|Release|...]]\n"
       "                              [COMPONENT <component>]\n"
+      "                              [OPTIONAL]\n"
       "                             ] [...])\n"
       "The TARGETS form specifies rules for installing targets from a "
       "project.  There are three kinds of target files that may be "
@@ -145,7 +149,7 @@
       "          [PERMISSIONS permissions...]\n"
       "          [CONFIGURATIONS [Debug|Release|...]]\n"
       "          [COMPONENT <component>]\n"
-      "          [RENAME <name>])\n"
+      "          [RENAME <name>] [OPTIONAL])\n"
       "The FILES form specifies rules for installing files for a "
       "project.  File names given as relative paths are interpreted with "
       "respect to the current source directory.  Files installed by this "
@@ -157,7 +161,7 @@
       "          [PERMISSIONS permissions...]\n"
       "          [CONFIGURATIONS [Debug|Release|...]]\n"
       "          [COMPONENT <component>]\n"
-      "          [RENAME <name>])\n"
+      "          [RENAME <name>] [OPTIONAL])\n"
       "The PROGRAMS form is identical to the FILES form except that the "
       "default permissions for the installed file also include "
       "OWNER_EXECUTE, GROUP_EXECUTE, and WORLD_EXECUTE.  "
@@ -165,6 +169,58 @@
       "such as shell scripts.  Use the TARGETS form to install targets "
       "built within the project."
       "\n"
+      "The DIRECTORY signature:\n"
+      "  INSTALL(DIRECTORY dirs... DESTINATION <dir>\n"
+      "          [FILE_PERMISSIONS permissions...]\n"
+      "          [DIRECTORY_PERMISSIONS permissions...]\n"
+      "          [USE_SOURCE_PERMISSIONS]\n"
+      "          [CONFIGURATIONS [Debug|Release|...]]\n"
+      "          [COMPONENT <component>]\n"
+      "          [[PATTERN <pattern> | REGEX <regex>]\n"
+      "           [EXCLUDE] [PERMISSIONS permissions...]] [...])\n"
+      "The DIRECTORY form installs contents of one or more directories "
+      "to a given destination.  "
+      "The directory structure is copied verbatim to the destination.  "
+      "The last component of each directory name is appended to the "
+      "destination directory but a trailing slash may be used to "
+      "avoid this because it leaves the last component empty.  "
+      "Directory names given as relative paths are interpreted with "
+      "respect to the current source directory.  "
+      "If no input directory names are given the destination directory "
+      "will be created but nothing will be installed into it.  "
+      "The FILE_PERMISSIONS and DIRECTORY_PERMISSIONS options specify "
+      "permissions given to files and directories in the destination.  "
+      "If USE_SOURCE_PERMISSIONS is specified and FILE_PERMISSIONS is not, "
+      "file permissions will be copied from the source directory structure.  "
+      "If no permissions are specified files will be given the default "
+      "permissions specified in the FILES form of the command, and the "
+      "directories will be given the default permissions specified in the "
+      "PROGRAMS form of the command.  "
+      "The PATTERN and REGEX options specify a globbing pattern or regular "
+      "expression to match directories or files encountered during traversal "
+      "of an input directory.  The full path to an input file or directory "
+      "(with forward slashes) is matched against the expression.  "
+      "A PATTERN will match only complete file names: the portion of the "
+      "full path matching the pattern must occur at the end of the file name "
+      "and be preceded by a slash.  "
+      "A REGEX will match any portion of the full path but it may use "
+      "'/' and '$' to simulate the PATTERN behavior.  "
+      "Options following one of these matching expressions "
+      "are applied only to files or directories matching them.  "
+      "The EXCLUDE option will skip the matched file or directory.  "
+      "The PERMISSIONS option overrides the permissions setting for the "
+      "matched file or directory.  "
+      "For example the code\n"
+      "  INSTALL(DIRECTORY icons scripts/ DESTINATION share/myproj\n"
+      "          PATTERN \"CVS\" EXCLUDE\n"
+      "          PATTERN \"scripts/*\"\n"
+      "          PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ\n"
+      "                      GROUP_EXECUTE GROUP_READ)\n"
+      "will install the icons directory to share/myproj/icons and the "
+      "scripts directory to share/myproj.  The icons will get default file "
+      "permissions, the scripts will be given specific permissions, and "
+      "any CVS directories will be excluded."
+      "\n"
       "The SCRIPT and CODE signature:\n"
       "  INSTALL([[SCRIPT <file>] [CODE <code>]] [...])\n"
       "The SCRIPT form will invoke the given CMake script files during "
@@ -191,6 +247,7 @@
   bool HandleScriptMode(std::vector<std::string> const& args);
   bool HandleTargetsMode(std::vector<std::string> const& args);
   bool HandleFilesMode(std::vector<std::string> const& args);
+  bool HandleDirectoryMode(std::vector<std::string> const& args);
   void ComputeDestination(const char* destination, std::string& dest);
   bool CheckPermissions(std::string const& arg, std::string& permissions);
 };

Index: cmCommandArgumentParserHelper.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentParserHelper.cxx,v
retrieving revision 1.12.2.3
retrieving revision 1.12.2.4
diff -u -d -r1.12.2.3 -r1.12.2.4
--- cmCommandArgumentParserHelper.cxx	27 Jul 2006 14:37:07 -0000	1.12.2.3
+++ cmCommandArgumentParserHelper.cxx	13 Oct 2006 14:52:02 -0000	1.12.2.4
@@ -37,6 +37,7 @@
   strcpy(this->BSLASHVariable, "\\");
 
   this->NoEscapeMode = false;
+  this->ReplaceAtSyntax = false;
 }
 
 
@@ -115,6 +116,21 @@
   return this->AddString(value);
 }
 
+char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var)
+{
+  if(this->ReplaceAtSyntax)
+    {
+    return this->ExpandVariable(var);
+    }
+  else
+    {
+    std::string ref = "@";
+    ref += var;
+    ref += "@";
+    return this->AddString(ref.c_str());
+    }
+}
+
 char* cmCommandArgumentParserHelper::CombineUnions(char* in1, char* in2)
 {
   if ( !in1 )
@@ -172,6 +188,7 @@
   case '(':
   case ')':
   case '$':
+  case '@':
   case '^':
     this->AllocateParserType(pt, &symbol, 1);
     break;

Index: cmInstallTargetGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallTargetGenerator.h,v
retrieving revision 1.5.2.2
retrieving revision 1.5.2.3
diff -u -d -r1.5.2.2 -r1.5.2.3
--- cmInstallTargetGenerator.h	11 May 2006 20:05:58 -0000	1.5.2.2
+++ cmInstallTargetGenerator.h	13 Oct 2006 14:52:02 -0000	1.5.2.3
@@ -29,10 +29,11 @@
 public:
   cmInstallTargetGenerator(
     cmTarget& t, const char* dest, bool implib,
-    const char* permissions = "",
+    const char* file_permissions = "",
     std::vector<std::string> const& configurations 
     = std::vector<std::string>(),
-    const char* component = ""
+    const char* component = "",
+    bool optional = false
     );
   virtual ~cmInstallTargetGenerator();
 
@@ -47,9 +48,10 @@
   cmTarget* Target;
   std::string Destination;
   bool ImportLibrary;
-  std::string Permissions;
+  std::string FilePermissions;
   std::vector<std::string> Configurations;
   std::string Component;
+  bool Optional;
 };
 
 #endif

Index: cmDependsJavaParser.y
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsJavaParser.y,v
retrieving revision 1.4
retrieving revision 1.4.6.1
diff -u -d -r1.4 -r1.4.6.1
--- cmDependsJavaParser.y	2 Feb 2005 22:05:38 -0000	1.4
+++ cmDependsJavaParser.y	13 Oct 2006 14:52:02 -0000	1.4.6.1
@@ -58,6 +58,9 @@
 /* Disable some warnings in the generated code.  */
 #ifdef __BORLANDC__
 # pragma warn -8004 /* Variable assigned a value that is not used.  */
+# pragma warn -8008 /* condition always returns true */
+# pragma warn -8060 /* possibly incorrect assignment */
+# pragma warn -8066 /* unreachable code */
 #endif
 #ifdef _MSC_VER
 # pragma warning (disable: 4102) /* Unused goto label.  */

Index: cmGlobalMinGWMakefileGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalMinGWMakefileGenerator.cxx,v
retrieving revision 1.4.2.3
retrieving revision 1.4.2.4
diff -u -d -r1.4.2.3 -r1.4.2.4
--- cmGlobalMinGWMakefileGenerator.cxx	30 Jun 2006 17:48:43 -0000	1.4.2.3
+++ cmGlobalMinGWMakefileGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.4.2.4
@@ -61,6 +61,22 @@
   lg->SetIgnoreLibPrefix(true);
   lg->SetPassMakeflags(false);
   lg->SetUnixCD(true);
+
+  // mingw32-make has trouble running code like
+  //
+  //  @echo message with spaces
+  //
+  // If quotes are added
+  //
+  //  @echo "message with spaces"
+  //
+  // it runs but the quotes are displayed.  Instead we can separate
+  // with a semicolon
+  //
+  //  @echo;message with spaces
+  //
+  // to hack around the problem.
+  lg->SetNativeEchoCommand("@echo;");
   return lg;
 }
 

Index: cmCPluginAPI.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCPluginAPI.cxx,v
retrieving revision 1.29
retrieving revision 1.29.2.1
diff -u -d -r1.29 -r1.29.2.1
--- cmCPluginAPI.cxx	15 Mar 2006 16:01:59 -0000	1.29
+++ cmCPluginAPI.cxx	13 Oct 2006 14:52:02 -0000	1.29.2.1
@@ -24,6 +24,12 @@
 
 #include "cmSourceFile.h"
 
+#include <stdlib.h>
+
+#ifdef __QNX__
+# include <malloc.h> /* for malloc/free on QNX */
+#endif
+
 extern "C"
 {
 
@@ -200,8 +206,8 @@
                          int all,
                          int numDepends,
                          const char **depends,
-                         int numOutputs,
-                         const char **outputs)
+                         int,
+                         const char **)
 {
   // Get the makefile instance.  Perform an extra variable expansion
   // now because the API caller expects it.
@@ -228,19 +234,9 @@
     depends2.push_back(mf->ExpandVariablesInString(expand));
     }
 
-  // Only one output is allowed.
-  const char* output = 0;
-  std::string outputStr;
-  if(numOutputs > 0)
-    {
-    expand = outputs[0];
-    outputStr = mf->ExpandVariablesInString(expand);
-    output = outputStr.c_str();
-    }
-
   // Pass the call to the makefile instance.
   mf->AddUtilityCommand(utilityName, (all ? true : false),
-                        output, 0, depends2, commandLines);
+                        0, depends2, commandLines);
 }
 void CCONV cmAddCustomCommand(void *arg, const char* source,
                         const char* command,

Index: cmIncludeDirectoryCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIncludeDirectoryCommand.h,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -u -d -r1.12 -r1.12.2.1
--- cmIncludeDirectoryCommand.h	4 Apr 2006 13:35:22 -0000	1.12
+++ cmIncludeDirectoryCommand.h	13 Oct 2006 14:52:02 -0000	1.12.2.1
@@ -61,13 +61,16 @@
   virtual const char* GetFullDocumentation()
     {
     return
-      "  INCLUDE_DIRECTORIES([AFTER|BEFORE] dir1 dir2 ...)\n"
+      "  INCLUDE_DIRECTORIES([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...)\n"
       "Add the given directories to those searched by the compiler for "
       "include files. By default the directories are appended onto "
       "the current list of directories. This default behavior can be "
       "changed by setting CMAKE_INCLUDE_DIRECTORIES_BEFORE to ON. "
       "By using BEFORE or AFTER you can select between appending and "
-      "prepending, independent from the default. ";
+      "prepending, independent from the default. "
+      "If the SYSTEM option is given the compiler will be told that the "
+      "directories are meant as system include directories on some "
+      "platforms.";
     }
   
   cmTypeMacro(cmIncludeDirectoryCommand, cmCommand);



More information about the Cmake-commits mailing list