[cmake-commits] hoffman committed CMakeLists.txt 1.289.2.4 1.289.2.5 cmCTest.cxx 1.300.2.3 1.300.2.4 cmCTest.h 1.92.2.1 1.92.2.2 cmDocumentation.cxx 1.31.2.2 1.31.2.3 cmExecuteProcessCommand.cxx 1.6.2.1 1.6.2.2 cmExecuteProcessCommand.h 1.2.2.1 1.2.2.2 cmFindBase.cxx 1.14.2.2 1.14.2.3 cmFindPackageCommand.cxx 1.17.2.2 1.17.2.3 cmFindPackageCommand.h 1.10 1.10.2.1 cmGeneratedFileStream.cxx 1.15.2.1 1.15.2.2 cmGetDirectoryPropertyCommand.cxx 1.6.2.1 1.6.2.2 cmGlobalGenerator.cxx 1.137.2.7 1.137.2.8 cmGlobalMinGWMakefileGenerator.cxx 1.4.2.4 1.4.2.5 cmGlobalWatcomWMakeGenerator.cxx 1.5.2.3 1.5.2.4 cmGlobalXCodeGenerator.cxx 1.111.2.5 1.111.2.6 cmIfCommand.cxx 1.62.2.3 1.62.2.4 cmIfCommand.h 1.32.2.3 1.32.2.4 cmLocalGenerator.cxx 1.132.2.7 1.132.2.8 cmLocalGenerator.h 1.56.2.4 1.56.2.5 cmLocalUnixMakefileGenerator3.cxx 1.128.2.8 1.128.2.9 cmLocalUnixMakefileGenerator3.h 1.45.2.3 1.45.2.4 cmLocalVisualStudio6Generator.cxx 1.100.2.4 1.100.2.5 cmLocalVisualStudio7Generator.cxx 1.125.2.8 1.125.2.9 cmLocalVisualStudio7Generator.h 1.22.2.3 1.22.2.4 cmLocalVisualStudioGenerator.cxx 1.2.2.2 1.2.2.3 cmMakefileExecutableTargetGenerator.cxx 1.12.2.6 1.12.2.7 cmMakefileLibraryTargetGenerator.cxx 1.14.2.4 1.14.2.5 cmSetTargetPropertiesCommand.h 1.21.2.4 1.21.2.5 cmSystemTools.cxx 1.327.2.2 1.327.2.3 cmTarget.cxx 1.96.2.4 1.96.2.5 cmTarget.h 1.62.2.2 1.62.2.3 cmXMLParser.cxx 1.4 1.4.2.1 cmake.cxx 1.247.2.7 1.247.2.8

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Oct 27 16:01:51 EDT 2006


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

Modified Files:
      Tag: CMake-2-4
	CMakeLists.txt cmCTest.cxx cmCTest.h cmDocumentation.cxx 
	cmExecuteProcessCommand.cxx cmExecuteProcessCommand.h 
	cmFindBase.cxx cmFindPackageCommand.cxx cmFindPackageCommand.h 
	cmGeneratedFileStream.cxx cmGetDirectoryPropertyCommand.cxx 
	cmGlobalGenerator.cxx cmGlobalMinGWMakefileGenerator.cxx 
	cmGlobalWatcomWMakeGenerator.cxx cmGlobalXCodeGenerator.cxx 
	cmIfCommand.cxx cmIfCommand.h cmLocalGenerator.cxx 
	cmLocalGenerator.h cmLocalUnixMakefileGenerator3.cxx 
	cmLocalUnixMakefileGenerator3.h 
	cmLocalVisualStudio6Generator.cxx 
	cmLocalVisualStudio7Generator.cxx 
	cmLocalVisualStudio7Generator.h 
	cmLocalVisualStudioGenerator.cxx 
	cmMakefileExecutableTargetGenerator.cxx 
	cmMakefileLibraryTargetGenerator.cxx 
	cmSetTargetPropertiesCommand.h cmSystemTools.cxx cmTarget.cxx 
	cmTarget.h cmXMLParser.cxx cmake.cxx 
Log Message:
ENH: move changes from main tree


Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.125.2.8
retrieving revision 1.125.2.9
diff -u -d -r1.125.2.8 -r1.125.2.9
--- cmLocalVisualStudio7Generator.cxx	13 Oct 2006 14:52:05 -0000	1.125.2.8
+++ cmLocalVisualStudio7Generator.cxx	27 Oct 2006 20:01:48 -0000	1.125.2.9
@@ -801,6 +801,7 @@
     temp += targetFullName;
     fout << "\t\t\t\tOutputFile=\""
          << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n";
+    this->WriteTargetVersionAttribute(fout, target);
     for(std::map<cmStdString, cmStdString>::iterator i = flagMap.begin();
         i != flagMap.end(); ++i)
       {
@@ -885,6 +886,7 @@
     temp += targetFullName;
     fout << "\t\t\t\tOutputFile=\"" 
          << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n";
+    this->WriteTargetVersionAttribute(fout, target);
     for(std::map<cmStdString, cmStdString>::iterator i = flagMap.begin();
         i != flagMap.end(); ++i)
       {
@@ -925,6 +927,17 @@
     }
 }
 
+//----------------------------------------------------------------------------
+void
+cmLocalVisualStudio7Generator
+::WriteTargetVersionAttribute(std::ostream& fout, cmTarget& target)
+{
+  int major;
+  int minor;
+  target.GetTargetVersion(major, minor);
+  fout << "\t\t\t\tVersion=\"" << major << "." << minor << "\"\n";
+}
+
 void cmLocalVisualStudio7Generator
 ::OutputModuleDefinitionFile(std::ostream& fout,
                                                                cmTarget &target)
@@ -1148,7 +1161,6 @@
       {
       objectName = "";
       }
-
     // Add per-source flags.
     const char* cflags = (*sf)->GetProperty("COMPILE_FLAGS");
     if(cflags)
@@ -1161,6 +1173,12 @@
     const char* linkLanguage = target.GetLinkerLanguage
       (this->GetGlobalGenerator());
 
+    // If lang is set, the compiler will generate code automatically.
+    // If HEADER_FILE_ONLY is set, we must suppress this generation in
+    // the project file
+    bool excludedFromBuild = 
+      (lang && (*sf)->GetPropertyAsBool("HEADER_FILE_ONLY")); 
+
     // if the source file does not match the linker language
     // then force c or c++
     if(linkLanguage && lang && strcmp(lang, linkLanguage) != 0)
@@ -1216,7 +1234,7 @@
                               command->GetOutputs(), flags);
         }
       else if(compileFlags.size() || additionalDeps.length() 
-              || objectName.size())
+              || objectName.size() || excludedFromBuild)
         {
         const char* aCompilerTool = "VCCLCompilerTool";
         std::string ext = (*sf)->GetSourceExtension();
@@ -1238,8 +1256,13 @@
           {
           fout << "\t\t\t\t<FileConfiguration\n"
                << "\t\t\t\t\tName=\""  << *i 
-               << "|" << this->PlatformName << "\">\n"
-               << "\t\t\t\t\t<Tool\n"
+               << "|" << this->PlatformName << "\"";
+          if(excludedFromBuild)
+            {
+            fout << " ExcludedFromBuild=\"true\"";
+            }
+          fout << ">\n";
+          fout << "\t\t\t\t\t<Tool\n"
                << "\t\t\t\t\tName=\"" << aCompilerTool << "\"\n";
           if(compileFlags.size())
             {
@@ -1415,6 +1438,10 @@
       fout << "\nCommandLine=\"";
       init = true;
       }
+    else
+      {
+      fout << this->EscapeForXML("\n");
+      }
     std::string script = 
       this->ConstructScript(cr->GetCommandLines(),
                             cr->GetWorkingDirectory(),
@@ -1440,6 +1467,10 @@
       fout << "\nCommandLine=\"";
       init = true;
       }
+    else
+      {
+      fout << this->EscapeForXML("\n");
+      }
     std::string script =
       this->ConstructScript(cr->GetCommandLines(),
                             cr->GetWorkingDirectory(),
@@ -1465,6 +1496,10 @@
       fout << "\nCommandLine=\"";
       init = true;
       }
+    else
+      {
+      fout << this->EscapeForXML("\n");
+      }
     std::string script = 
       this->ConstructScript(cr->GetCommandLines(),
                             cr->GetWorkingDirectory(),

Index: cmLocalUnixMakefileGenerator3.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.h,v
retrieving revision 1.45.2.3
retrieving revision 1.45.2.4
diff -u -d -r1.45.2.3 -r1.45.2.4
--- cmLocalUnixMakefileGenerator3.h	13 Oct 2006 14:52:05 -0000	1.45.2.3
+++ cmLocalUnixMakefileGenerator3.h	27 Oct 2006 20:01:48 -0000	1.45.2.4
@@ -105,6 +105,11 @@
   void SetWindowsShell(bool v)  {this->WindowsShell = v;}
 
   /**
+   * Set to true if the make tool being used is Watcom WMake.
+   */
+  void SetWatcomWMake(bool v)  {this->WatcomWMake = 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.
@@ -135,8 +140,8 @@
    * 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; }
+  void SetNativeEchoCommand(const char* cmd, bool isWindows)
+    { this->NativeEchoCommand = cmd; this->NativeEchoWindows = isWindows; }
 
   /**
    * Set the string used to include one makefile into another default
@@ -341,6 +346,7 @@
   std::string LibraryOutputPath;
   std::string ConfigurationName;
   std::string NativeEchoCommand;
+  bool NativeEchoWindows;
   bool DefineWindowsNULL;
   bool UnixCD;
   bool PassMakeflags;

Index: cmLocalVisualStudio7Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.h,v
retrieving revision 1.22.2.3
retrieving revision 1.22.2.4
diff -u -d -r1.22.2.3 -r1.22.2.4
--- cmLocalVisualStudio7Generator.h	13 Oct 2006 14:52:05 -0000	1.22.2.3
+++ cmLocalVisualStudio7Generator.h	27 Oct 2006 20:01:48 -0000	1.22.2.4
@@ -112,6 +112,7 @@
                        const std::vector<std::string>& depends,
                        const std::vector<std::string>& outputs,
                        const char* extraFlags);
+  void WriteTargetVersionAttribute(std::ostream& fout, cmTarget& target);
 
   void WriteGroup(const cmSourceGroup *sg, 
                   cmTarget target, std::ostream &fout, 

Index: cmIfCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.cxx,v
retrieving revision 1.62.2.3
retrieving revision 1.62.2.4
diff -u -d -r1.62.2.3 -r1.62.2.4
--- cmIfCommand.cxx	13 Oct 2006 14:52:02 -0000	1.62.2.3
+++ cmIfCommand.cxx	27 Oct 2006 20:01:47 -0000	1.62.2.4
@@ -289,29 +289,6 @@
         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())
         {
@@ -417,9 +394,16 @@
         {
         def = cmIfCommand::GetVariableOrString(arg->c_str(), makefile);
         def2 = cmIfCommand::GetVariableOrString((argP2)->c_str(), makefile);
-        if (*(argP1) == "LESS")
+        double lhs;
+        double rhs;
+        if(sscanf(def, "%lg", &lhs) != 1 ||
+           sscanf(def2, "%lg", &rhs) != 1)
           {
-          if(atof(def) < atof(def2))
+          *arg = "0";
+          }
+        else if (*(argP1) == "LESS")
+          {
+          if(lhs < rhs)
             {
             *arg = "1";
             }
@@ -430,7 +414,7 @@
           }
         else if (*(argP1) == "GREATER")
           {
-          if(atof(def) > atof(def2))
+          if(lhs > rhs)
             {
             *arg = "1";
             }
@@ -441,7 +425,7 @@
           }          
         else
           {
-          if(atof(def) == atof(def2))
+          if(lhs == rhs)
             {
             *arg = "1";
             }
@@ -493,6 +477,29 @@
         reducible = 1;
         }
 
+      // is file A newer than file B
+      if (argP1 != newArgs.end() && argP2 != newArgs.end() &&
+          *(argP1) == "IS_NEWER_THAN")
+        {
+        int fileIsNewer=0;
+        bool success=cmSystemTools::FileTimeCompare(arg->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;
+        }
+
       ++arg;
       }
     }

Index: cmIfCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.h,v
retrieving revision 1.32.2.3
retrieving revision 1.32.2.4
diff -u -d -r1.32.2.3 -r1.32.2.4
--- cmIfCommand.h	13 Oct 2006 14:52:02 -0000	1.32.2.3
+++ cmIfCommand.h	27 Oct 2006 20:01:47 -0000	1.32.2.4
@@ -129,7 +129,7 @@
       "  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"
+      "  IF(file1 IS_NEWER_THAN 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"

Index: cmFindPackageCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFindPackageCommand.h,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -d -r1.10 -r1.10.2.1
--- cmFindPackageCommand.h	27 Jan 2006 18:07:23 -0000	1.10
+++ cmFindPackageCommand.h	27 Oct 2006 20:01:47 -0000	1.10.2.1
@@ -65,8 +65,8 @@
   virtual const char* GetFullDocumentation()
     {
     return
-      "  FIND_PACKAGE(<name> [major.minor] [QUIET]\n"
-      "               [REQUIRED [componets...]])\n"
+      "  FIND_PACKAGE(<name> [major.minor] [QUIET] [NO_MODULE]\n"
+      "               [[REQUIRED|COMPONENTS] [componets...]])\n"
       "Finds and loads settings from an external project.  <name>_FOUND will "
       "be set to indicate whether the package was found.  Settings that "
       "can be used when <name>_FOUND is true are package-specific.  The "
@@ -74,6 +74,7 @@
       "Directories listed in CMAKE_MODULE_PATH are searched for files called "
       "\"Find<name>.cmake\".  If such a file is found, it is read and "
       "processed by CMake, and is responsible for finding the package.  "
+      "This first step may be skipped by using the NO_MODULE option.  "
       "If no such file is found, it is expected that the package is another "
       "project built by CMake that has a \"<name>Config.cmake\" file.  "
       "A cache entry called <name>_DIR is created and is expected to be set "
@@ -84,9 +85,10 @@
       "argument is specified.  If <name>_DIR has been set to a directory "
       "not containing a \"<name>Config.cmake\" file, an error is always "
       "generated.  If REQUIRED is specified and the package is not found, "
-      "a FATAL_ERROR is generated and the configure step stops executing."
-      "  A package-specific list of components may be listed after the "
-      "REQUIRED option.";
+      "a FATAL_ERROR is generated and the configure step stops executing.  "
+      "A package-specific list of components may be listed after the "
+      "REQUIRED option, or after the COMPONENTS option if no REQUIRED "
+      "option is given.";
     }
   
   cmTypeMacro(cmFindPackageCommand, cmCommand);

Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.137.2.7
retrieving revision 1.137.2.8
diff -u -d -r1.137.2.7 -r1.137.2.8
--- cmGlobalGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.137.2.7
+++ cmGlobalGenerator.cxx	27 Oct 2006 20:01:47 -0000	1.137.2.8
@@ -1346,7 +1346,7 @@
   if ( cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[0] != '.' )
     {
     singleLine.push_back("-C");
-    singleLine.push_back(mf->GetDefinition("CMAKE_CFG_INTDIR"));
+    singleLine.push_back(cmakeCfgIntDir);
     }
   singleLine.push_back("--config");
   std::string configFile = mf->GetStartOutputDirectory();;

Index: cmGeneratedFileStream.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGeneratedFileStream.cxx,v
retrieving revision 1.15.2.1
retrieving revision 1.15.2.2
diff -u -d -r1.15.2.1 -r1.15.2.2
--- cmGeneratedFileStream.cxx	11 May 2006 02:15:09 -0000	1.15.2.1
+++ cmGeneratedFileStream.cxx	27 Oct 2006 20:01:47 -0000	1.15.2.2
@@ -27,7 +27,7 @@
 #endif
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
-# include <cmzlib/zlib.h>
+# include <cm_zlib.h>
 #endif
 
 //----------------------------------------------------------------------------
@@ -213,7 +213,7 @@
 int cmGeneratedFileStreamBase::CompressFile(const char* oldname,
                                             const char* newname)
 {
-  gzFile gf = cm_zlib_gzopen(newname, "w");
+  gzFile gf = gzopen(newname, "w");
   if ( !gf )
     {
     return 0;
@@ -228,15 +228,15 @@
   char buffer[BUFFER_SIZE];
   while ( (res = fread(buffer, 1, BUFFER_SIZE, ifs)) > 0 )
     {
-    if ( !cm_zlib_gzwrite(gf, buffer, res) )
+    if ( !gzwrite(gf, buffer, res) )
       {
       fclose(ifs);
-      cm_zlib_gzclose(gf);
+      gzclose(gf);
       return 0;
       }
     }
   fclose(ifs);
-  cm_zlib_gzclose(gf);
+  gzclose(gf);
   return 1;
 }
 #else

Index: cmMakefileLibraryTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.cxx,v
retrieving revision 1.14.2.4
retrieving revision 1.14.2.5
diff -u -d -r1.14.2.4 -r1.14.2.5
--- cmMakefileLibraryTargetGenerator.cxx	13 Oct 2006 14:52:06 -0000	1.14.2.4
+++ cmMakefileLibraryTargetGenerator.cxx	27 Oct 2006 20:01:48 -0000	1.14.2.5
@@ -531,13 +531,45 @@
   cleanObjs += ")";
   cmLocalGenerator::RuleVariables vars;
   vars.TargetPDB = targetOutPathPDB.c_str();
+
+  // Setup the target version.
+  std::string targetVersionMajor;
+  std::string targetVersionMinor;
+  {
+  cmOStringStream majorStream;
+  cmOStringStream minorStream;
+  int major;
+  int minor;
+  this->Target->GetTargetVersion(major, minor);
+  majorStream << major;
+  minorStream << minor;
+  targetVersionMajor = majorStream.str();
+  targetVersionMinor = minorStream.str();
+  }
+  vars.TargetVersionMajor = targetVersionMajor.c_str();
+  vars.TargetVersionMinor = targetVersionMinor.c_str();
+
   vars.Language = linkLanguage;
   vars.Objects = buildObjs.c_str();
   std::string objdir = cmake::GetCMakeFilesDirectoryPostSlash();
   objdir += this->Target->GetName();
   objdir += ".dir";
   vars.ObjectDir = objdir.c_str(); 
+  std::string targetLinkScriptPathReal;
+  if(useLinkScript)
+    {
+    // Paths in the link script are interpreted directly by the shell
+    // and not make.
+    targetLinkScriptPathReal =
+      this->Convert(targetFullPathReal.c_str(),
+                    cmLocalGenerator::START_OUTPUT,
+                    cmLocalGenerator::SHELL);
+    vars.Target = targetLinkScriptPathReal.c_str();
+    }
+  else
+    {
   vars.Target = targetOutPathReal.c_str();
+    }
   std::string linkString = linklibs.str();
   vars.LinkLibraries = linkString.c_str();
   vars.ObjectsQuoted = buildObjs.c_str();

Index: cmTarget.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.h,v
retrieving revision 1.62.2.2
retrieving revision 1.62.2.3
diff -u -d -r1.62.2.2 -r1.62.2.3
--- cmTarget.h	30 Jun 2006 17:48:46 -0000	1.62.2.2
+++ cmTarget.h	27 Oct 2006 20:01:48 -0000	1.62.2.3
@@ -176,6 +176,11 @@
       target property.  */
   const char* GetLocation(const char* config);
 
+  /** Get the target major and minor version numbers interpreted from
+      the VERSION property.  Version 0 is returned if the property is
+      not set or cannot be parsed.  */
+  void GetTargetVersion(int& major, int& minor);
+
   /**
    * Trace through the source files in this target and add al source files
    * that they depend on, used by the visual studio generators

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CMakeLists.txt,v
retrieving revision 1.289.2.4
retrieving revision 1.289.2.5
diff -u -d -r1.289.2.4 -r1.289.2.5
--- CMakeLists.txt	13 Oct 2006 14:52:02 -0000	1.289.2.4
+++ CMakeLists.txt	27 Oct 2006 20:01:47 -0000	1.289.2.5
@@ -352,6 +352,13 @@
     SET(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
   ENDIF(NOT CMAKE_TEST_GENERATOR)
 
+  SET(CMAKE_TEST_SYSTEM_LIBRARIES 0)
+  FOREACH(util CURL EXPAT XMLRPC ZLIB)
+    IF(CMAKE_USE_SYSTEM_${util})
+      SET(CMAKE_TEST_SYSTEM_LIBRARIES 1)
+    ENDIF(CMAKE_USE_SYSTEM_${util})
+  ENDFOREACH(util)
+
   # This variable is set by cmake, however to
   # test cmake we want to make sure that 
   # the ctest from this cmake is used for testing
@@ -602,6 +609,7 @@
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/Complex/bin"  
       --build-options
       -DCMAKE_TEST_DIFFERENT_GENERATOR:BOOL=${CMAKE_TEST_DIFFERENT_GENERATOR}
+      -DCMAKE_TEST_SYSTEM_LIBRARIES:BOOL=${CMAKE_TEST_SYSTEM_LIBRARIES}
       --test-command complex 
       )
 
@@ -615,6 +623,7 @@
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin" 
       --build-options
       -DCMAKE_TEST_DIFFERENT_GENERATOR:BOOL=${CMAKE_TEST_DIFFERENT_GENERATOR}
+      -DCMAKE_TEST_SYSTEM_LIBRARIES:BOOL=${CMAKE_TEST_SYSTEM_LIBRARIES}
       --test-command complex)
 
 #    ADD_TEST(complexRelativePaths  ${CMAKE_CTEST_COMMAND}

Index: cmCTest.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCTest.h,v
retrieving revision 1.92.2.1
retrieving revision 1.92.2.2
diff -u -d -r1.92.2.1 -r1.92.2.2
--- cmCTest.h	29 Apr 2006 15:49:19 -0000	1.92.2.1
+++ cmCTest.h	27 Oct 2006 20:01:47 -0000	1.92.2.2
@@ -53,7 +53,7 @@
   typedef std::set<cmStdString> SetOfStrings;
 
   ///! Process Command line arguments
-  int Run(std::vector<std::string>const&, std::string* output = 0);
+  int Run(std::vector<std::string> &, std::string* output = 0);
 
   /**
    * Initialize and finalize testing
@@ -137,6 +137,13 @@
   ///! Get the current time as string
   std::string CurrentTime();
 
+  /** 
+   * Return the time remaianing that the script is allowed to run in
+   * seconds if the user has set the variable CTEST_TIME_LIMIT. If that has
+   * not been set it returns 1e7 seconds
+   */
+  double GetRemainingTimeAllowed();
+    
   ///! Open file in the output directory and set the stream
   bool OpenOutputFile(const std::string& path,
                       const std::string& name,
@@ -269,6 +276,9 @@
   //! Set the output log file name
   void SetOutputLogFileName(const char* name);
 
+  //! Set the visual studio or Xcode config type
+  void SetConfigType(const char* ct);
+
   //! Various log types
   enum {
     DEBUG = 0,
@@ -369,6 +379,18 @@
   void BlockTestErrorDiagnostics();
 
 
+  //! parse the option after -D and convert it into the appropriate steps
+  bool AddTestsForDashboardType(std::string &targ);
+
+  //! parse and process most common command line arguments
+  void HandleCommandLineArguments(size_t &i, 
+                                  std::vector<std::string> &args);
+
+  //! hande the -S -SP and -SR arguments
+  void HandleScriptArguments(size_t &i, 
+                             std::vector<std::string> &args,
+                             bool &SRArgumentSpecified);
+
   //! Reread the configuration file
   bool UpdateCTestConfiguration();
 

Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.96.2.4
retrieving revision 1.96.2.5
diff -u -d -r1.96.2.4 -r1.96.2.5
--- cmTarget.cxx	13 Oct 2006 14:52:06 -0000	1.96.2.4
+++ cmTarget.cxx	27 Oct 2006 20:01:48 -0000	1.96.2.5
@@ -890,6 +890,29 @@
   return this->Location.c_str();
 }
 
+//----------------------------------------------------------------------------
+void cmTarget::GetTargetVersion(int& major, int& minor)
+{
+  // Set the default values.
+  major = 0;
+  minor = 0;
+
+  // Look for a VERSION property.
+  if(const char* version = this->GetProperty("VERSION"))
+    {
+    // Try to parse the version number and store the results that were
+    // successfully parsed.
+    int parsed_major;
+    int parsed_minor;
+    switch(sscanf(version, "%d.%d", &parsed_major, &parsed_minor))
+      {
+      case 2: minor = parsed_minor; // no break!
+      case 1: major = parsed_major; // no break!
+      default: break;
+      }
+    }
+}
+
 const char *cmTarget::GetProperty(const char* prop)
 {
   // watch for special "computed" properties that are dependent on other
@@ -1442,16 +1465,29 @@
     }
 #endif
 
+  // Get the components of the executable name.
+  std::string prefix;
+  std::string base;
+  std::string suffix;
+  this->GetFullNameInternal(type, config, false, prefix, base, suffix);
+
   // The executable name.
-  name = this->GetFullNameInternal(type, config, false);
+  name = prefix+base+suffix;
 
   // The executable's real name on disk.
+#if defined(__CYGWIN__)
+  realName = prefix+base;
+#else
   realName = name;
+#endif
   if(version)
     {
     realName += "-";
     realName += version;
     }
+#if defined(__CYGWIN__)
+  realName += suffix;
+#endif
 }
 
 //----------------------------------------------------------------------------

Index: cmSetTargetPropertiesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetTargetPropertiesCommand.h,v
retrieving revision 1.21.2.4
retrieving revision 1.21.2.5
diff -u -d -r1.21.2.4 -r1.21.2.5
--- cmSetTargetPropertiesCommand.h	13 Oct 2006 14:52:06 -0000	1.21.2.4
+++ cmSetTargetPropertiesCommand.h	27 Oct 2006 20:01:48 -0000	1.21.2.5
@@ -108,7 +108,11 @@
         "the same version number. "
         "For executables VERSION can be used to specify the build version. "
         "When building or installing appropriate symlinks are created if "
-        "the platform supports symlinks.\n"
+        "the platform supports symlinks. "
+        "For shared libraries and executables on Windows the VERSION "
+        "attribute is parsed to extract a \"major.minor\" version number. "
+        "These numbers are used as the image version of the binary. "
+        "\n"
         "There are a few properties used to specify RPATH rules. "
         "INSTALL_RPATH is a semicolon-separated list specifying the rpath "
         "to use in installed targets (for platforms that support it). "

Index: cmXMLParser.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmXMLParser.cxx,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -d -r1.4 -r1.4.2.1
--- cmXMLParser.cxx	30 Mar 2006 18:49:55 -0000	1.4
+++ cmXMLParser.cxx	27 Oct 2006 20:01:48 -0000	1.4.2.1
@@ -16,7 +16,7 @@
 =========================================================================*/
 #include "cmXMLParser.h"
 
-#include <cmexpat/expat.h>
+#include <cm_expat.h>
 #include <ctype.h>
 
 //----------------------------------------------------------------------------

Index: cmLocalVisualStudioGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudioGenerator.cxx,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -u -d -r1.2.2.2 -r1.2.2.3
--- cmLocalVisualStudioGenerator.cxx	13 Oct 2006 14:52:05 -0000	1.2.2.2
+++ cmLocalVisualStudioGenerator.cxx	27 Oct 2006 20:01:48 -0000	1.2.2.3
@@ -113,15 +113,19 @@
                   const char* workingDirectory,
                   bool escapeOldStyle,
                   bool escapeAllowMakeVars,
-                  const char* newline)
+                  const char* newline_text)
 {
+  // Avoid leading or trailing newlines.
+  const char* newline = "";
+
   // Store the script in a string.
   std::string script;
   if(workingDirectory)
     {
+    script += newline;
+    newline = newline_text;
     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.
@@ -131,16 +135,21 @@
       this->Makefile->GetDefinition("CMAKE_MSVCIDE_RUN_PATH");
     if(extraPath)
       {
+      script += newline;
+      newline = newline_text;
       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 a new line.
+    script += newline;
+    newline = newline_text;
+
     // Start with the command name.
     const cmCustomCommandLine& commandLine = *cl;
     script += this->Convert(commandLine[0].c_str(),START_OUTPUT,SHELL);
@@ -159,9 +168,6 @@
                                        escapeAllowMakeVars);
         }
       }
-
-    // End the line.
-    script += newline;
     }
   return script;
 }

Index: cmGlobalMinGWMakefileGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalMinGWMakefileGenerator.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
--- cmGlobalMinGWMakefileGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.4.2.4
+++ cmGlobalMinGWMakefileGenerator.cxx	27 Oct 2006 20:01:47 -0000	1.4.2.5
@@ -70,13 +70,9 @@
   //
   //  @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;");
+  // it runs but the quotes are displayed.  Instead just use cmake to
+  // echo.
+  lg->SetNativeEchoCommand("@$(CMAKE_COMMAND) -E echo ", false);
   return lg;
 }
 

Index: cmGlobalXCodeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v
retrieving revision 1.111.2.5
retrieving revision 1.111.2.6
diff -u -d -r1.111.2.5 -r1.111.2.6
--- cmGlobalXCodeGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.111.2.5
+++ cmGlobalXCodeGenerator.cxx	27 Oct 2006 20:01:47 -0000	1.111.2.6
@@ -866,17 +866,11 @@
   std::string::size_type pos = flags.find(flag);
   if(pos != flags.npos)
     {
-    retFlag = flag;
-    // remove the flag
-    flags[pos]=' ';
-    flags[pos+1]=' ';
-    char pos2 = flags[pos+2];
-    // if the pos after the option 
-    if(pos2 != ' ' && pos2 != 0 )
+    while(pos < flags.size() && flags[pos] != ' ')
       {
-      retFlag += pos2;
-      // remove the next part of the flag
-      flags[pos+2] = ' ';
+      retFlag += flags[pos];
+      flags[pos] = ' ';
+      pos++;
       }
     }
   return retFlag;
@@ -1392,7 +1386,19 @@
     optLevel[0] = '1';
     }
   std::string gflagc = this->ExtractFlag("-g", cflags);
+  // put back gdwarf-2 if used since there is no way
+  // to represent it in the gui, but we still want debug yes
+  if(gflagc == "-gdwarf-2")
+    {
+    cflags += " ";
+    cflags += gflagc;
+    }
   std::string gflag = this->ExtractFlag("-g", flags);
+  if(gflag == "-gdwarf-2")
+    {
+    flags += " ";
+    flags += gflag;
+    }
   const char* debugStr = "YES";
   if(gflagc.size() ==0  && gflag.size() == 0)
     {

Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.247.2.7
retrieving revision 1.247.2.8
diff -u -d -r1.247.2.7 -r1.247.2.8
--- cmake.cxx	13 Oct 2006 14:52:06 -0000	1.247.2.7
+++ cmake.cxx	27 Oct 2006 20:01:48 -0000	1.247.2.8
@@ -996,6 +996,9 @@
       std::string dirName = args[2];
       dirName += "/Progress";
       cmSystemTools::RemoveADirectory(dirName.c_str());
+      int count = atoi(args[3].c_str());
+      if (count)
+        {
       cmSystemTools::MakeDirectory(dirName.c_str());
       // write the count into the directory
       std::string fName = dirName;
@@ -1003,10 +1006,10 @@
       FILE *progFile = fopen(fName.c_str(),"w");
       if (progFile)
         {
-        int count = atoi(args[3].c_str());
         fprintf(progFile,"%i\n",count);
         fclose(progFile);
         }
+        }
       return 0;
       }
 
@@ -1017,6 +1020,21 @@
       dirName += "/Progress";
       std::string fName;
       FILE *progFile;
+
+      // read the count
+      fName = dirName;
+      fName += "/count.txt";
+      progFile = fopen(fName.c_str(),"r");
+      int count = 0;
+      if (!progFile)
+        {
+        return 0;
+        }
+      else
+        {
+        fscanf(progFile,"%i",&count);
+        fclose(progFile);
+        }
       unsigned int i;
       for (i = 3; i < args.size(); ++i)
         {
@@ -1032,20 +1050,10 @@
         }
       int fileNum = static_cast<int>
         (cmsys::Directory::GetNumberOfFilesInDirectory(dirName.c_str()));
-      // read the count
-      fName = dirName;
-      fName += "/count.txt";
-      progFile = fopen(fName.c_str(),"r");
-      if (progFile)
-        {
-        int count = 0;
-        fscanf(progFile,"%i",&count);
         if (count > 0)
           {
           // print the progress
           fprintf(stdout,"[%3i%%] ",((fileNum-3)*100)/count);
-          }
-        fclose(progFile);
         }
       return 0;
       }
@@ -1710,7 +1718,6 @@
   this->SetArgs(args);
   if(cmSystemTools::GetErrorOccuredFlag())
     {
-    CMakeCommandUsage(args[0].c_str());
     return -1;
     }
 

Index: cmLocalVisualStudio6Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio6Generator.cxx,v
retrieving revision 1.100.2.4
retrieving revision 1.100.2.5
diff -u -d -r1.100.2.4 -r1.100.2.5
--- cmLocalVisualStudio6Generator.cxx	13 Oct 2006 14:52:05 -0000	1.100.2.4
+++ cmLocalVisualStudio6Generator.cxx	27 Oct 2006 20:01:48 -0000	1.100.2.5
@@ -766,34 +766,33 @@
     // header stuff
     customRuleCode += "PreLink_Cmds=";
     }
-  const char* prelink_newline = "\\\n\t";
   for (std::vector<cmCustomCommand>::const_iterator cr =
          target.GetPreBuildCommands().begin();
        cr != target.GetPreBuildCommands().end(); ++cr)
     {
-    if(++prelink_count == prelink_total)
+    if(prelink_count++ > 0)
       {
-      prelink_newline = "";
+      customRuleCode += "\\\n\t";
       }
     customRuleCode += this->ConstructScript(cr->GetCommandLines(),
                                             cr->GetWorkingDirectory(),
                                             cr->GetEscapeOldStyle(),
                                             cr->GetEscapeAllowMakeVars(),
-                                            prelink_newline);
+                                            "\\\n\t");
     }
   for (std::vector<cmCustomCommand>::const_iterator cr =
          target.GetPreLinkCommands().begin();
        cr != target.GetPreLinkCommands().end(); ++cr)
     {
-    if(++prelink_count == prelink_total)
+    if(prelink_count++ > 0)
       {
-      prelink_newline = "";
+      customRuleCode += "\\\n\t";
       }
     customRuleCode += this->ConstructScript(cr->GetCommandLines(),
                                             cr->GetWorkingDirectory(),
                                             cr->GetEscapeOldStyle(),
                                             cr->GetEscapeAllowMakeVars(),
-                                            prelink_newline);
+                                            "\\\n\t");
     }
   if(prelink_total > 0)
     {
@@ -805,7 +804,6 @@
   int postbuild_total = 
     static_cast<int>(target.GetPostBuildCommands().size());
   int postbuild_count = 0;
-  const char* postbuild_newline = "\\\n\t";
   if(postbuild_total > 0)
     {
     customRuleCode += "PostBuild_Cmds=";
@@ -814,15 +812,15 @@
          target.GetPostBuildCommands().begin();
        cr != target.GetPostBuildCommands().end(); ++cr)
     {
-    if(++postbuild_count == postbuild_total)
+    if(postbuild_count++ > 0)
       {
-      postbuild_newline = "";
+      customRuleCode += "\\\n\t";
       }
     customRuleCode += this->ConstructScript(cr->GetCommandLines(),
                                             cr->GetWorkingDirectory(),
                                             cr->GetEscapeOldStyle(),
                                             cr->GetEscapeAllowMakeVars(),
-                                            postbuild_newline);
+                                            "\\\n\t");
     }
   if(postbuild_total > 0)
     {
@@ -1131,6 +1129,20 @@
       }
     }
 
+  // Compute version number information.
+  std::string targetVersionFlag;
+  if(target.GetType() == cmTarget::EXECUTABLE ||
+     target.GetType() == cmTarget::SHARED_LIBRARY ||
+     target.GetType() == cmTarget::MODULE_LIBRARY)
+    {
+    int major;
+    int minor;
+    target.GetTargetVersion(major, minor);
+    cmOStringStream targetVersionStream;
+    targetVersionStream << "/version:" << major << "." << minor;
+    targetVersionFlag = targetVersionStream.str();
+    }
+
   // Compute the real name of the target.
   std::string outputName = 
     "(OUTPUT_NAME is for libraries and executables only)";
@@ -1279,6 +1291,8 @@
 
     cmSystemTools::ReplaceString(line, "BUILD_INCLUDES",
                                  this->IncludeOptions.c_str());
+    cmSystemTools::ReplaceString(line, "TARGET_VERSION_FLAG",
+                                 targetVersionFlag.c_str());
     cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",libName);
     // because LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH 
     // are already quoted in the template file,

Index: cmMakefileExecutableTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileExecutableTargetGenerator.cxx,v
retrieving revision 1.12.2.6
retrieving revision 1.12.2.7
diff -u -d -r1.12.2.6 -r1.12.2.7
--- cmMakefileExecutableTargetGenerator.cxx	13 Oct 2006 14:52:06 -0000	1.12.2.6
+++ cmMakefileExecutableTargetGenerator.cxx	27 Oct 2006 20:01:48 -0000	1.12.2.7
@@ -372,6 +372,24 @@
   vars.Objects = buildObjs.c_str();
   vars.Target = targetOutPathReal.c_str();
   vars.TargetPDB = targetOutPathPDB.c_str();
+
+  // Setup the target version.
+  std::string targetVersionMajor;
+  std::string targetVersionMinor;
+  {
+  cmOStringStream majorStream;
+  cmOStringStream minorStream;
+  int major;
+  int minor;
+  this->Target->GetTargetVersion(major, minor);
+  majorStream << major;
+  minorStream << minor;
+  targetVersionMajor = majorStream.str();
+  targetVersionMinor = minorStream.str();
+  }
+  vars.TargetVersionMajor = targetVersionMajor.c_str();
+  vars.TargetVersionMinor = targetVersionMinor.c_str();
+
   std::string linkString = linklibs.str();
   vars.LinkLibraries = linkString.c_str();
   vars.Flags = flags.c_str();

Index: cmExecuteProcessCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExecuteProcessCommand.h,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -d -r1.2.2.1 -r1.2.2.2
--- cmExecuteProcessCommand.h	11 May 2006 02:15:09 -0000	1.2.2.1
+++ cmExecuteProcessCommand.h	27 Oct 2006 20:01:47 -0000	1.2.2.2
@@ -78,7 +78,9 @@
       "                  [OUTPUT_FILE <file>]\n"
       "                  [ERROR_FILE <file>]\n"
       "                  [OUTPUT_QUIET]\n"
-      "                  [ERROR_QUIET])\n"
+      "                  [ERROR_QUIET]\n"
+      "                  [OUTPUT_STRIP_TRAILING_WHITESPACE]\n"
+      "                  [ERROR_STRIP_TRAILING_WHITESPACE])\n"
       "Runs the given sequence of one or more commands with the standard "
       "output of each process piped to the standard input of the next.  "
       "A single standard error pipe is used for all processes.  "

Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.132.2.7
retrieving revision 1.132.2.8
diff -u -d -r1.132.2.7 -r1.132.2.8
--- cmLocalGenerator.cxx	13 Oct 2006 14:52:03 -0000	1.132.2.7
+++ cmLocalGenerator.cxx	27 Oct 2006 20:01:47 -0000	1.132.2.8
@@ -40,6 +40,7 @@
   this->Parent = 0;
   this->WindowsShell = false;
   this->WindowsVSIDE = false;
+  this->WatcomWMake = false;
   this->MSYSShell = false;
   this->IgnoreLibPrefix = false;
   this->UseRelativePaths = false;
@@ -840,6 +841,28 @@
       {
       return this->TargetImplib;
       }
+    if(variable == "TARGET_VERSION_MAJOR")
+      {
+      if(replaceValues.TargetVersionMajor)
+        {
+        return replaceValues.TargetVersionMajor;
+        }
+      else
+        {
+        return "0";
+        }
+      }
+    if(variable == "TARGET_VERSION_MINOR")
+      {
+      if(replaceValues.TargetVersionMinor)
+        {
+        return replaceValues.TargetVersionMinor;
+        }
+      else
+        {
+        return "0";
+        }
+      }
     if(replaceValues.Target)
       {
     if(variable == "TARGET_BASE")
@@ -1629,7 +1652,9 @@
       {
       // Compute the proper name to use to link this library.
       cmTarget* tgt = this->GlobalGenerator->FindTarget(0, lib.c_str());
-      if(tgt)
+      if(tgt && (tgt->GetType() == cmTarget::STATIC_LIBRARY ||
+                 tgt->GetType() == cmTarget::SHARED_LIBRARY ||
+                 tgt->GetType() == cmTarget::MODULE_LIBRARY))
         {
         // This is a CMake target.  Ask the target for its real name.
         // Pass the full path to the target file but purposely leave
@@ -2324,6 +2349,10 @@
     {
     flags |= cmsysSystem_Shell_Flag_EchoWindows;
     }
+  if(this->WatcomWMake)
+    {
+    flags |= cmsysSystem_Shell_Flag_WatcomWMake;
+    }
 
   // Compute the buffer size needed.
   int size = (this->WindowsShell ?

Index: cmSystemTools.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSystemTools.cxx,v
retrieving revision 1.327.2.2
retrieving revision 1.327.2.3
diff -u -d -r1.327.2.2 -r1.327.2.3
--- cmSystemTools.cxx	27 Jul 2006 14:37:09 -0000	1.327.2.2
+++ cmSystemTools.cxx	27 Oct 2006 20:01:48 -0000	1.327.2.3
@@ -48,7 +48,7 @@
 #  include <libtar/libtar.h>
 #  include <memory> // auto_ptr
 #  include <fcntl.h>
-#  include <cmzlib/zlib.h>
+#  include <cm_zlib.h>
 #endif
 
 #if defined(__sgi) && !defined(__GNUC__)
@@ -1439,7 +1439,7 @@
     }
 #endif
 
-  gzf->GZFile = cm_zlib_gzdopen(fd, gzoflags);
+  gzf->GZFile = gzdopen(fd, gzoflags);
   if (!gzf->GZFile)
   {
     errno = ENOMEM;
@@ -1452,20 +1452,20 @@
 int cmSystemToolsGZStructClose(void* call_data)
 {
   cmSystemToolsGZStruct* gzf = static_cast<cmSystemToolsGZStruct*>(call_data);
-  return cm_zlib_gzclose(gzf->GZFile);
+  return gzclose(gzf->GZFile);
 }
 
 ssize_t cmSystemToolsGZStructRead(void* call_data, void* buf, size_t count)
 {
   cmSystemToolsGZStruct* gzf = static_cast<cmSystemToolsGZStruct*>(call_data);
-  return cm_zlib_gzread(gzf->GZFile, buf, count);
+  return gzread(gzf->GZFile, buf, count);
 }
 
 ssize_t cmSystemToolsGZStructWrite(void* call_data, const void* buf,
                                    size_t count)
 {
   cmSystemToolsGZStruct* gzf = static_cast<cmSystemToolsGZStruct*>(call_data);
-  return cm_zlib_gzwrite(gzf->GZFile, (void*)buf, count);
+  return gzwrite(gzf->GZFile, (void*)buf, count);
 }
 
 #endif

Index: cmGlobalWatcomWMakeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalWatcomWMakeGenerator.cxx,v
retrieving revision 1.5.2.3
retrieving revision 1.5.2.4
diff -u -d -r1.5.2.3 -r1.5.2.4
--- cmGlobalWatcomWMakeGenerator.cxx	13 Oct 2006 14:52:02 -0000	1.5.2.3
+++ cmGlobalWatcomWMakeGenerator.cxx	27 Oct 2006 20:01:47 -0000	1.5.2.4
@@ -50,6 +50,7 @@
   lg->SetSilentNoColon(true);
   lg->SetDefineWindowsNULL(true);
   lg->SetWindowsShell(true);
+  lg->SetWatcomWMake(true);
   lg->SetMakeSilentFlag("-s -h");
   lg->SetGlobalGenerator(this);
   lg->SetIgnoreLibPrefix(true);

Index: cmCTest.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCTest.cxx,v
retrieving revision 1.300.2.3
retrieving revision 1.300.2.4
diff -u -d -r1.300.2.3 -r1.300.2.4
--- cmCTest.cxx	24 Jul 2006 15:19:34 -0000	1.300.2.3
+++ cmCTest.cxx	27 Oct 2006 20:01:47 -0000	1.300.2.4
@@ -14,7 +14,7 @@
      PURPOSE.  See the above copyright notices for more information.
 
 =========================================================================*/
-#include "cmcurl/curl/curl.h"
+#include "cm_curl.h"
 
 #include "cmCTest.h"
 #include "cmake.h"
@@ -568,6 +568,11 @@
       }
     fin.close();
     }
+  if ( !this->GetCTestConfiguration("BuildDirectory").empty() )
+    {
+    this->BinaryDir = this->GetCTestConfiguration("BuildDirectory");
+    cmSystemTools::ChangeDirectory(this->BinaryDir.c_str());
+    }
   this->TimeOut = atoi(this->GetCTestConfiguration("TimeOut").c_str());
   if ( this->ProduceXML )
     {
@@ -787,7 +792,8 @@
       break;
       }
     }
-  if ( this->Tests[UPDATE_TEST] || this->Tests[ALL_TEST] )
+  if (( this->Tests[UPDATE_TEST] || this->Tests[ALL_TEST] ) &&
+      (this->GetRemainingTimeAllowed() - 120 > 0))
     {
     cmCTestGenericHandler* uphandler = this->GetHandler("update");
     uphandler->SetPersistentOption("SourceDirectory",
@@ -802,14 +808,16 @@
     {
     return 0;
     }
-  if ( this->Tests[CONFIGURE_TEST] || this->Tests[ALL_TEST] )
+  if (( this->Tests[CONFIGURE_TEST] || this->Tests[ALL_TEST] )&&
+      (this->GetRemainingTimeAllowed() - 120 > 0))
     {
     if (this->GetHandler("configure")->ProcessHandler() < 0)
       {
       res |= cmCTest::CONFIGURE_ERRORS;
       }
     }
-  if ( this->Tests[BUILD_TEST] || this->Tests[ALL_TEST] )
+  if (( this->Tests[BUILD_TEST] || this->Tests[ALL_TEST] )&&
+      (this->GetRemainingTimeAllowed() - 120 > 0))
     {
     this->UpdateCTestConfiguration();
     if (this->GetHandler("build")->ProcessHandler() < 0)
@@ -817,7 +825,8 @@
       res |= cmCTest::BUILD_ERRORS;
       }
     }
-  if ( this->Tests[TEST_TEST] || this->Tests[ALL_TEST] || notest )
+  if (( this->Tests[TEST_TEST] || this->Tests[ALL_TEST] || notest ) &&
+      (this->GetRemainingTimeAllowed() - 120 > 0))
     {
     this->UpdateCTestConfiguration();
     if (this->GetHandler("test")->ProcessHandler() < 0)
@@ -825,7 +834,8 @@
       res |= cmCTest::TEST_ERRORS;
       }
     }
-  if ( this->Tests[COVERAGE_TEST] || this->Tests[ALL_TEST] )
+  if (( this->Tests[COVERAGE_TEST] || this->Tests[ALL_TEST] ) &&
+      (this->GetRemainingTimeAllowed() - 120 > 0))
     {
     this->UpdateCTestConfiguration();
     if (this->GetHandler("coverage")->ProcessHandler() < 0)
@@ -833,7 +843,8 @@
       res |= cmCTest::COVERAGE_ERRORS;
       }
     }
-  if ( this->Tests[MEMCHECK_TEST] || this->Tests[ALL_TEST] )
+  if (( this->Tests[MEMCHECK_TEST] || this->Tests[ALL_TEST] )&&
+      (this->GetRemainingTimeAllowed() - 120 > 0))
     {
     this->UpdateCTestConfiguration();
     if (this->GetHandler("memcheck")->ProcessHandler() < 0)
@@ -1104,6 +1115,19 @@
     {
     cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
     }
+
+  // do we have time for
+  double timeout = this->GetRemainingTimeAllowed() - 120;
+  if (this->TimeOut && this->TimeOut < timeout)
+    {
+    timeout = this->TimeOut;
+    }
+  // always have at least 1 second if we got to here
+  if (timeout <= 0)
+    {
+    timeout = 1;
+    }
+
   cmsysProcess_SetTimeout(cp, this->TimeOut);
   cmsysProcess_Execute(cp);
 
@@ -1300,159 +1324,12 @@
   return this->SubmitExtraFiles(files);
 }
 
-//----------------------------------------------------------------------
-bool cmCTest::CheckArgument(const std::string& arg, const char* varg1,
-  const char* varg2)
-{
-  if ( varg1 && arg == varg1 || varg2 && arg == varg2 )
-    {
-    return true;
-    }
-  return false;
-}
 
-//----------------------------------------------------------------------
-int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
+//-------------------------------------------------------
+// for a -D argument convert the next argument into 
+// the proper list of dashboard steps via SetTest
+bool cmCTest::AddTestsForDashboardType(std::string &targ)
 {
-  this->FindRunningCMake(args[0].c_str());
-  const char* ctestExec = "ctest";
-  bool cmakeAndTest = false;
-  bool performSomeTest = true;
-  bool SRArgumentSpecified = false;
-
-  // copy the command line
-  for(size_t i=0; i < args.size(); ++i)
-    {
-    this->InitialCommandLineArguments.push_back(args[i]);
-    }
-  for(size_t i=1; i < args.size(); ++i)
-    {
-    std::string arg = args[i];
-    if(this->CheckArgument(arg, "--ctest-config") && i < args.size() - 1)
-      {
-      i++;
-      this->CTestConfigFile= args[i];
-      }
-
-    if(this->CheckArgument(arg, "-C", "--build-config") &&
-      i < args.size() - 1)
-      {
-      i++;
-      this->ConfigType = args[i];
-      cmSystemTools::ReplaceString(this->ConfigType, ".\\", "");
-      if ( !this->ConfigType.empty() )
-        {
-        std::string confTypeEnv
-          = "CMAKE_CONFIG_TYPE=" + this->ConfigType;
-        cmSystemTools::PutEnv(confTypeEnv.c_str());
-        }
-      }
-
-    if(this->CheckArgument(arg, "--debug"))
-      {
-      this->Debug = true;
-      this->ShowLineNumbers = true;
-      }
-    if(this->CheckArgument(arg, "--track") && i < args.size() - 1)
-      {
-      i++;
-      this->SpecificTrack = args[i];
-      }
-    if(this->CheckArgument(arg, "--show-line-numbers"))
-      {
-      this->ShowLineNumbers = true;
-      }
-    if(this->CheckArgument(arg, "-Q", "--quiet"))
-      {
-      this->Quiet = true;
-      }
-    if(this->CheckArgument(arg, "-V", "--verbose"))
-      {
-      this->Verbose = true;
-      }
-    if(this->CheckArgument(arg, "-VV", "--extra-verbose"))
-      {
-      this->ExtraVerbose = true;
-      this->Verbose = true;
-      }
-
-    if(this->CheckArgument(arg, "-N", "--show-only"))
-      {
-      this->ShowOnly = true;
-      }
-
-    if(this->CheckArgument(arg, "-SP", "--script-new-process") && 
-       i < args.size() - 1 )
-      {
-      this->RunConfigurationScript = true;
-      i++;
-      cmCTestScriptHandler* ch
-        = static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
-      // -SR is an internal argument, -SP should be ignored when it is passed
-      if (!SRArgumentSpecified)
-        {
-        ch->AddConfigurationScript(args[i].c_str(),false);
-        }
-      }
-
-    if(this->CheckArgument(arg, "-SR", "--script-run") && 
-       i < args.size() - 1 )
-      {
-      SRArgumentSpecified = true;
-      this->RunConfigurationScript = true;
-      i++;
-      cmCTestScriptHandler* ch
-        = static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
-      ch->AddConfigurationScript(args[i].c_str(),true);
-      }
-
-    if(this->CheckArgument(arg, "-S", "--script") && i < args.size() - 1 )
-      {
-      this->RunConfigurationScript = true;
-      i++;
-      cmCTestScriptHandler* ch
-        = static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
-      // -SR is an internal argument, -S should be ignored when it is passed
-      if (!SRArgumentSpecified)
-        {
-        ch->AddConfigurationScript(args[i].c_str(),true);
-        }
-      }
-
-    if(this->CheckArgument(arg, "-O", "--output-log") && i < args.size() - 1 )
-      {
-      i++;
-      this->SetOutputLogFileName(args[i].c_str());
-      }
-
-    if(this->CheckArgument(arg, "--tomorrow-tag"))
-      {
-      this->TomorrowTag = true;
-      }
-    if(this->CheckArgument(arg, "--force-new-ctest-process"))
-      {
-      this->ForceNewCTestProcess = true;
-      }
-    if(this->CheckArgument(arg, "--interactive-debug-mode") &&
-      i < args.size() - 1 )
-      {
-      i++;
-      this->InteractiveDebugMode = cmSystemTools::IsOn(args[i].c_str());
-      }
-    if(this->CheckArgument(arg, "--submit-index") && i < args.size() - 1 )
-      {
-      i++;
-      this->SubmitIndex = atoi(args[i].c_str());
-      if ( this->SubmitIndex < 0 )
-        {
-        this->SubmitIndex = 0;
-        }
-      }
-    if(this->CheckArgument(arg, "-D", "--dashboard") && i < args.size() - 1 )
-      {
-      this->ProduceXML = true;
-      i++;
-      std::string targ = args[i];
       if ( targ == "Experimental" )
         {
         this->SetTestModel(cmCTest::EXPERIMENTAL);
@@ -1631,84 +1508,144 @@
         }
       else
         {
-        performSomeTest = false;
         cmCTestLog(this, ERROR_MESSAGE,
-          "CTest -D called with incorrect option: " << targ << std::endl);
+               "CTest -D called with incorrect option: "
+               << targ << std::endl);
         cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
-          << "  " << ctestExec << " -D Continuous" << std::endl
-          << "  " << ctestExec
+               << "  " << "ctest" << " -D Continuous" << std::endl
+               << "  " << "ctest"
           << " -D Continuous(Start|Update|Configure|Build)" << std::endl
-          << "  " << ctestExec
-          << " -D Continuous(Test|Coverage|MemCheck|Submit)" << std::endl
-          << "  " << ctestExec << " -D Experimental" << std::endl
-          << "  " << ctestExec
-          << " -D Experimental(Start|Update|Configure|Build)" << std::endl
-          << "  " << ctestExec
-          << " -D Experimental(Test|Coverage|MemCheck|Submit)" << std::endl
-          << "  " << ctestExec << " -D Nightly" << std::endl
-          << "  " << ctestExec
+               << "  " << "ctest"
+               << " -D Continuous(Test|Coverage|MemCheck|Submit)"
+               << std::endl
+               << "  " << "ctest" << " -D Experimental" << std::endl
+               << "  " << "ctest"
+               << " -D Experimental(Start|Update|Configure|Build)"
+               << std::endl
+               << "  " << "ctest"
+               << " -D Experimental(Test|Coverage|MemCheck|Submit)"
+               << std::endl
+               << "  " << "ctest" << " -D Nightly" << std::endl
+               << "  " << "ctest"
           << " -D Nightly(Start|Update|Configure|Build)" << std::endl
-          << "  " << ctestExec
+               << "  " << "ctest"
           << " -D Nightly(Test|Coverage|MemCheck|Submit)" << std::endl
-          << "  " << ctestExec << " -D NightlyMemoryCheck" << std::endl);
+               << "  " << "ctest" << " -D NightlyMemoryCheck" << std::endl);
+    return false;
         }
+  return true;
+}
+
+
+//----------------------------------------------------------------------
+bool cmCTest::CheckArgument(const std::string& arg, const char* varg1,
+  const char* varg2)
+{
+  if ( varg1 && arg == varg1 || varg2 && arg == varg2 )
+    {
+    return true;
       }
+  return false;
+}
 
-    if(this->CheckArgument(arg, "-T", "--test-action") &&
-      (i < args.size() -1) )
+
+//----------------------------------------------------------------------
+// Processes one command line argument (and its arguments if any) 
+// for many simple options and then returns
+void cmCTest::HandleCommandLineArguments(size_t &i, 
+                                         std::vector<std::string> &args)
+{
+  std::string arg = args[i];
+  if(this->CheckArgument(arg, "--ctest-config") && i < args.size() - 1)
       {
-      this->ProduceXML = true;
       i++;
-      if ( !this->SetTest(args[i].c_str(), false) )
+    this->CTestConfigFile= args[i];
+    }
+  
+  if(this->CheckArgument(arg, "-C", "--build-config") &&
+     i < args.size() - 1)
         {
-        performSomeTest = false;
-        cmCTestLog(this, ERROR_MESSAGE,
-          "CTest -T called with incorrect option: "
-          << args[i].c_str() << std::endl);
-        cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
-          << "  " << ctestExec << " -T all" << std::endl
-          << "  " << ctestExec << " -T start" << std::endl
-          << "  " << ctestExec << " -T update" << std::endl
-          << "  " << ctestExec << " -T configure" << std::endl
-          << "  " << ctestExec << " -T build" << std::endl
-          << "  " << ctestExec << " -T test" << std::endl
-          << "  " << ctestExec << " -T coverage" << std::endl
-          << "  " << ctestExec << " -T memcheck" << std::endl
-          << "  " << ctestExec << " -T notes" << std::endl
-          << "  " << ctestExec << " -T submit" << std::endl);
+    i++;
+    this->SetConfigType(args[i].c_str());
+    }
+  
+  if(this->CheckArgument(arg, "--debug"))
+    {
+    this->Debug = true;
+    this->ShowLineNumbers = true;
+    }
+  if(this->CheckArgument(arg, "--track") && i < args.size() - 1)
+    {
+    i++;
+    this->SpecificTrack = args[i];
+    }
+  if(this->CheckArgument(arg, "--show-line-numbers"))
+    {
+    this->ShowLineNumbers = true;
+    }
+  if(this->CheckArgument(arg, "-Q", "--quiet"))
+    {
+    this->Quiet = true;
         }
+  if(this->CheckArgument(arg, "-V", "--verbose"))
+    {
+    this->Verbose = true;
+    }
+  if(this->CheckArgument(arg, "-VV", "--extra-verbose"))
+    {
+    this->ExtraVerbose = true;
+    this->Verbose = true;
       }
 
-    if(this->CheckArgument(arg, "-M", "--test-model") &&
-      (i < args.size() -1) )
+  if(this->CheckArgument(arg, "-N", "--show-only"))
+    {
+    this->ShowOnly = true;
+    }
+
+  if(this->CheckArgument(arg, "-O", "--output-log") && i < args.size() - 1 )
       {
       i++;
-      std::string const& str = args[i];
-      if ( cmSystemTools::LowerCase(str) == "nightly" )
+    this->SetOutputLogFileName(args[i].c_str());
+    }
+
+  if(this->CheckArgument(arg, "--tomorrow-tag"))
         {
-        this->SetTestModel(cmCTest::NIGHTLY);
+    this->TomorrowTag = true;
         }
-      else if ( cmSystemTools::LowerCase(str) == "continuous" )
+  if(this->CheckArgument(arg, "--force-new-ctest-process"))
         {
-        this->SetTestModel(cmCTest::CONTINUOUS);
+    this->ForceNewCTestProcess = true;
         }
-      else if ( cmSystemTools::LowerCase(str) == "experimental" )
+  if(this->CheckArgument(arg, "--interactive-debug-mode") &&
+     i < args.size() - 1 )
         {
-        this->SetTestModel(cmCTest::EXPERIMENTAL);
+    i++;
+    this->InteractiveDebugMode = cmSystemTools::IsOn(args[i].c_str());
         }
-      else
+  if(this->CheckArgument(arg, "--submit-index") && i < args.size() - 1 )
         {
-        performSomeTest = false;
-        cmCTestLog(this, ERROR_MESSAGE,
-          "CTest -M called with incorrect option: " << str.c_str()
-          << std::endl);
-        cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
-          << "  " << ctestExec << " -M Continuous" << std::endl
-          << "  " << ctestExec << " -M Experimental" << std::endl
-          << "  " << ctestExec << " -M Nightly" << std::endl);
+    i++;
+    this->SubmitIndex = atoi(args[i].c_str());
+    if ( this->SubmitIndex < 0 )
+      {
+      this->SubmitIndex = 0;
+      }
+    }
+  
+  if(this->CheckArgument(arg, "--overwrite") && i < args.size() - 1)
+    {
+    i++;
+    this->AddCTestConfigurationOverwrite(args[i].c_str());
         }
+  if(this->CheckArgument(arg, "-A", "--add-notes") && i < args.size() - 1)
+    {
+    this->ProduceXML = true;
+    this->SetTest("Notes");
+    i++;
+    this->SetNotesFiles(args[i].c_str());
       }
 
+  // options that control what tests are run
     if(this->CheckArgument(arg, "-I", "--tests-information") &&
       i < args.size() - 1)
       {
@@ -1741,19 +1678,150 @@
       this->GetHandler("memcheck")->
         SetPersistentOption("ExcludeRegularExpression", args[i].c_str());
       }
+}
 
-    if(this->CheckArgument(arg, "--overwrite") && i < args.size() - 1)
+//----------------------------------------------------------------------
+// handle the -S -SR and -SP arguments
+void cmCTest::HandleScriptArguments(size_t &i, 
+                                    std::vector<std::string> &args,
+                                    bool &SRArgumentSpecified)
+{
+  std::string arg = args[i];
+  if(this->CheckArgument(arg, "-SP", "--script-new-process") && 
+     i < args.size() - 1 )
       {
+    this->RunConfigurationScript = true;
       i++;
-      this->AddCTestConfigurationOverwrite(args[i].c_str());
+    cmCTestScriptHandler* ch
+      = static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
+    // -SR is an internal argument, -SP should be ignored when it is passed
+    if (!SRArgumentSpecified)
+      {
+      ch->AddConfigurationScript(args[i].c_str(),false);
       }
-    if(this->CheckArgument(arg, "-A", "--add-notes") && i < args.size() - 1)
+    }
+  
+  if(this->CheckArgument(arg, "-SR", "--script-run") && 
+     i < args.size() - 1 )
+    {
+    SRArgumentSpecified = true;
+    this->RunConfigurationScript = true;
+    i++;
+    cmCTestScriptHandler* ch
+      = static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
+    ch->AddConfigurationScript(args[i].c_str(),true);
+    }
+  
+  if(this->CheckArgument(arg, "-S", "--script") && i < args.size() - 1 )
+    {
+    this->RunConfigurationScript = true;
+    i++;
+    cmCTestScriptHandler* ch
+      = static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
+    // -SR is an internal argument, -S should be ignored when it is passed
+    if (!SRArgumentSpecified)
+      {
+      ch->AddConfigurationScript(args[i].c_str(),true);
+      }
+    }
+}
+
+//----------------------------------------------------------------------
+// the main entry point of ctest, called from main
+int cmCTest::Run(std::vector<std::string> &args, std::string* output)
+{
+  this->FindRunningCMake(args[0].c_str());
+  const char* ctestExec = "ctest";
+  bool cmakeAndTest = false;
+  bool performSomeTest = true;
+  bool SRArgumentSpecified = false;
+
+  // copy the command line
+  for(size_t i=0; i < args.size(); ++i)
+    {
+    this->InitialCommandLineArguments.push_back(args[i]);
+    }
+
+  // process the command line arguments
+  for(size_t i=1; i < args.size(); ++i)
+    {
+    // handle the simple commandline arguments
+    this->HandleCommandLineArguments(i,args);
+
+    // handle the script arguments -S -SR -SP
+    this->HandleScriptArguments(i,args,SRArgumentSpecified);
+
+    // handle a request for a dashboard
+    std::string arg = args[i];
+    if(this->CheckArgument(arg, "-D", "--dashboard") && i < args.size() - 1 )
       {
       this->ProduceXML = true;
-      this->SetTest("Notes");
       i++;
-      this->SetNotesFiles(args[i].c_str());
+      std::string targ = args[i];
+      // AddTestsForDashboard parses the dashborad type and converts it
+      // into the seperate stages
+      if (!this->AddTestsForDashboardType(targ))
+        {
+        performSomeTest = false;
+        }
+      }
+
+    if(this->CheckArgument(arg, "-T", "--test-action") &&
+      (i < args.size() -1) )
+      {
+      this->ProduceXML = true;
+      i++;
+      if ( !this->SetTest(args[i].c_str(), false) )
+        {
+        performSomeTest = false;
+        cmCTestLog(this, ERROR_MESSAGE,
+          "CTest -T called with incorrect option: "
+          << args[i].c_str() << std::endl);
+        cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
+          << "  " << ctestExec << " -T all" << std::endl
+          << "  " << ctestExec << " -T start" << std::endl
+          << "  " << ctestExec << " -T update" << std::endl
+          << "  " << ctestExec << " -T configure" << std::endl
+          << "  " << ctestExec << " -T build" << std::endl
+          << "  " << ctestExec << " -T test" << std::endl
+          << "  " << ctestExec << " -T coverage" << std::endl
+          << "  " << ctestExec << " -T memcheck" << std::endl
+          << "  " << ctestExec << " -T notes" << std::endl
+          << "  " << ctestExec << " -T submit" << std::endl);
+        }
+      }
+
+    // what type of test model
+    if(this->CheckArgument(arg, "-M", "--test-model") &&
+      (i < args.size() -1) )
+      {
+      i++;
+      std::string const& str = args[i];
+      if ( cmSystemTools::LowerCase(str) == "nightly" )
+        {
+        this->SetTestModel(cmCTest::NIGHTLY);
+        }
+      else if ( cmSystemTools::LowerCase(str) == "continuous" )
+        {
+        this->SetTestModel(cmCTest::CONTINUOUS);
+        }
+      else if ( cmSystemTools::LowerCase(str) == "experimental" )
+        {
+        this->SetTestModel(cmCTest::EXPERIMENTAL);
+        }
+      else
+        {
+        performSomeTest = false;
+        cmCTestLog(this, ERROR_MESSAGE,
+          "CTest -M called with incorrect option: " << str.c_str()
+          << std::endl);
+        cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
+          << "  " << ctestExec << " -M Continuous" << std::endl
+          << "  " << ctestExec << " -M Experimental" << std::endl
+                   << "  " << ctestExec << " -M Nightly" << std::endl);
+        }
       }
+
     if(this->CheckArgument(arg, "--extra-submit") && i < args.size() - 1)
       {
       this->ProduceXML = true;
@@ -1764,11 +1832,16 @@
         return 0;
         }
       }
+
     // --build-and-test options
     if(this->CheckArgument(arg, "--build-and-test") && i < args.size() - 1)
       {
       cmakeAndTest = true;
       }
+
+    // pass the argument to all the handlers as well, but i may no longer be
+    // set to what it was originally so I'm not sure this is working as
+    // intended
     cmCTest::t_TestingHandlers::iterator it;
     for ( it = this->TestingHandlers.begin();
       it != this->TestingHandlers.end();
@@ -1781,16 +1854,19 @@
         return 0;
         }
       }
-    }
+    } // the close of the for argument loop
 
-  // default to the build type of ctest itself
+
+  // default to the build type of ctest itself if there is one
+#ifdef  CMAKE_INTDIR
   if(this->ConfigType.size() == 0)
     {
-#ifdef  CMAKE_INTDIR
-    this->ConfigType = CMAKE_INTDIR;
-#endif
+    this->SetConfigType(CMAKE_INTDIR);
     }
+#endif
 
+  // now what sould cmake do? if --build-and-test was specified then 
+  // we run the build and test handler and return
   if(cmakeAndTest)
     {
     this->Verbose = true;
@@ -1804,7 +1880,8 @@
     return retv;
     }
 
-  if(performSomeTest )
+  // if some tests must be run 
+  if(performSomeTest)
     {
     int res;
     // call process directory
@@ -1837,11 +1914,9 @@
         it->second->SetVerbose(this->Verbose);
         it->second->SetSubmitIndex(this->SubmitIndex);
         }
-      cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
       if ( !this->Initialize(
           cmSystemTools::GetCurrentWorkingDirectory().c_str()) )
         {
-        cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
         res = 12;
         cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard."
           << std::endl);
@@ -1854,6 +1929,7 @@
       }
     return res;
     }
+
   return 1;
 }
 
@@ -2230,6 +2306,16 @@
 }
 
 //----------------------------------------------------------------------
+void cmCTest::SetConfigType(const char* ct)
+{
+  this->ConfigType = ct?ct:"";
+  cmSystemTools::ReplaceString(this->ConfigType, ".\\", "");
+  std::string confTypeEnv
+    = "CMAKE_CONFIG_TYPE=" + this->ConfigType;
+  cmSystemTools::PutEnv(confTypeEnv.c_str());
+}
+
+//----------------------------------------------------------------------
 bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf,
   const char* dconfig, const char* cmake_var)
 {
@@ -2480,3 +2566,16 @@
     }
 }
 
+//-------------------------------------------------------------------------
+double cmCTest::GetRemainingTimeAllowed()
+{
+  if (!this->GetHandler("script"))
+    {
+    return 1.0e7;
+    }
+
+  cmCTestScriptHandler* ch
+    = static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
+
+  return ch->GetRemainingTimeAllowed();
+}

Index: cmFindPackageCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFindPackageCommand.cxx,v
retrieving revision 1.17.2.2
retrieving revision 1.17.2.3
diff -u -d -r1.17.2.2 -r1.17.2.3
--- cmFindPackageCommand.cxx	24 Jul 2006 15:19:35 -0000	1.17.2.2
+++ cmFindPackageCommand.cxx	27 Oct 2006 20:01:47 -0000	1.17.2.3
@@ -54,44 +54,40 @@
     return false;
     }
 
+  // Record options.
   this->Name = args[0];
-
-  // Build a list of required components.
-  std::string components;
-  const char* components_sep = "";
   bool quiet = false;
   bool required = false;
-  if(args.size() > 1)
-    {
+  bool no_module = false;
+  std::string components;
+  const char* components_sep = "";
+
+  // Parse the arguments.
+  bool doing_components = false;
     cmsys::RegularExpression version("^[0-9.]+$");
     bool haveVersion = false;
     for(unsigned int i=1; i < args.size(); ++i)
       {
-      if(!haveVersion && version.find(args[i].c_str()))
+    if(args[i] == "QUIET")
         {
-        haveVersion = true;
+      quiet = true;
+      doing_components = false;
         }
-      else if(args[i] == "QUIET")
+    else if(args[i] == "NO_MODULE")
         {
-        quiet = true;
+      no_module = true;
+      doing_components = false;
         }
       else if(args[i] == "REQUIRED")
         {
-        // The package is required.
         required = true;
-
-        // Look for a list of required components.
-        while(++i < args.size())
-          {
-          // Stop looking when a known keyword argument is
-          // encountered.
-          if((args[i] == "QUIET") ||
-             (args[i] == "REQUIRED"))
+      doing_components = true;
+      }
+    else if(args[i] == "COMPONENTS")
             {
-            --i;
-            break;
+      doing_components = true;
             }
-          else
+    else if(doing_components)
           {
             // Set a variable telling the find script this component
             // is required.
@@ -103,7 +99,9 @@
             components += args[i];
             components_sep = ";";
             }
-          }
+    else if(!haveVersion && version.find(args[i].c_str()))
+      {
+      haveVersion = true;
         }
       else
         {
@@ -117,9 +115,10 @@
     // Store the list of components.
     std::string components_var = Name + "_FIND_COMPONENTS";
     this->Makefile->AddDefinition(components_var.c_str(), components.c_str());
-    }
 
   // See if there is a Find<name>.cmake module.
+  if(!no_module)
+    {
   bool foundModule = false;
   if(!this->FindModule(foundModule, quiet, required))
     {
@@ -129,6 +128,7 @@
     {
     return true;
     }
+    }
 
   // No find module.  Assume the project has a CMake config file.  Use
   // a <NAME>_DIR cache variable to locate it.

Index: cmFindBase.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFindBase.cxx,v
retrieving revision 1.14.2.2
retrieving revision 1.14.2.3
diff -u -d -r1.14.2.2 -r1.14.2.3
--- cmFindBase.cxx	24 Jul 2006 15:19:35 -0000	1.14.2.2
+++ cmFindBase.cxx	27 Oct 2006 20:01:47 -0000	1.14.2.3
@@ -57,8 +57,13 @@
     ""
     "This command is used to find a SEARCH_XXX_DESC. "
     "A cache entry named by <VAR> is created to store the result "
-    "of this command.  If nothing is found, the result will be "
-    "<VAR>-NOTFOUND.  The name of the SEARCH_XXX that "
+    "of this command.  "
+    "If the SEARCH_XXX is found the result is stored in the variable "
+    "and the search will not be repeated unless the variable is cleared.  "
+    "If nothing is found, the result will be "
+    "<VAR>-NOTFOUND, and the search will be attempted again the "
+    "next time FIND_XXX is invoked with the same variable.  "
+    "The name of the SEARCH_XXX that "
     "is searched for is specified by the names listed "
     "after the NAMES argument.   Additional search locations "
     "can be specified after the PATHS argument.  If ENV var is "

Index: cmDocumentation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentation.cxx,v
retrieving revision 1.31.2.2
retrieving revision 1.31.2.3
diff -u -d -r1.31.2.2 -r1.31.2.3
--- cmDocumentation.cxx	13 Oct 2006 14:52:02 -0000	1.31.2.2
+++ cmDocumentation.cxx	27 Oct 2006 20:01:47 -0000	1.31.2.3
@@ -969,8 +969,20 @@
 }
 
 //----------------------------------------------------------------------------
-void cmDocumentation::PrintHTMLEscapes(std::ostream& os, const char* text)
+static bool cmDocumentationIsHyperlinkChar(char c)
 {
+  // This is not a complete list but works for CMake documentation.
+  return ((c >= 'A' && c <= 'Z') ||
+          (c >= 'a' && c <= 'z') ||
+          (c >= '0' && c <= '9') ||
+          c == '-' || c == '.' || c == '/' || c == '~' || c == '@' ||
+          c == ':' || c == '_' || c == '&' || c == '?' || c == '=');
+}
+
+//----------------------------------------------------------------------------
+static void cmDocumentationPrintHTMLChar(std::ostream& os, char c)
+{
+  // Use an escape sequence if necessary.
   static cmDocumentationEntry escapes[] =
   {
     {"<", "&lt;", 0},
@@ -979,20 +991,73 @@
     {"\n", "<br>", 0},
     {0,0,0}
   };
-  for(const char* p = text; *p; ++p)
+  for(const cmDocumentationEntry* op = escapes; op->name; ++op)
     {
-    bool found = false;
-    for(const cmDocumentationEntry* op = escapes; !found && op->name; ++op)
-      {
-      if(op->name[0] == *p)
+    if(op->name[0] == c)
         {
         os << op->brief;
-        found = true;
+      return;
+      }
+    }
+
+  // No escape sequence is needed.
+  os << c;
+}
+
+//----------------------------------------------------------------------------
+const char* cmDocumentationPrintHTMLLink(std::ostream& os, const char* begin)
+{
+  // Look for the end of the link.
+  const char* end = begin;
+  while(cmDocumentationIsHyperlinkChar(*end))
+    {
+    ++end;
+    }
+
+  // Print the hyperlink itself.
+  os << "<a href=\"";
+  for(const char* c = begin; c != end; ++c)
+    {
+    cmDocumentationPrintHTMLChar(os, *c);
+    }
+  os << "\">";
+
+  // The name of the hyperlink is the text itself.
+  for(const char* c = begin; c != end; ++c)
+    {
+    cmDocumentationPrintHTMLChar(os, *c);
+    }
+  os << "</a>";
+
+  // Return the position at which to continue scanning the input
+  // string.
+  return end;
+}
+
+//----------------------------------------------------------------------------
+void cmDocumentation::PrintHTMLEscapes(std::ostream& os, const char* text)
+{
+  // Hyperlink prefixes.
+  static const char* hyperlinks[] = {"http://", "ftp://", "mailto:", 0};
+
+  // Print each character.
+  for(const char* p = text; *p;)
+    {
+    // Handle hyperlinks specially to make them active.
+    bool found_hyperlink = false;
+    for(const char** h = hyperlinks; !found_hyperlink && *h; ++h)
+      {
+      if(strncmp(p, *h, strlen(*h)) == 0)
+        {
+        p = cmDocumentationPrintHTMLLink(os, p);
+        found_hyperlink = true;
         }
       }
-    if(!found)
+
+    // Print other characters normally.
+    if(!found_hyperlink)
       {
-      os << *p;
+      cmDocumentationPrintHTMLChar(os, *p++);
       }
     }
 }

Index: cmLocalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.h,v
retrieving revision 1.56.2.4
retrieving revision 1.56.2.5
diff -u -d -r1.56.2.4 -r1.56.2.5
--- cmLocalGenerator.h	13 Oct 2006 14:52:04 -0000	1.56.2.4
+++ cmLocalGenerator.h	27 Oct 2006 20:01:48 -0000	1.56.2.5
@@ -185,6 +185,8 @@
         memset(this, 0,  sizeof(*this));
       }
     const char* TargetPDB;
+    const char* TargetVersionMajor;
+    const char* TargetVersionMinor;
     const char* Language;
     const char* Objects;
     const char* Target;
@@ -276,6 +278,7 @@
   std::map<cmStdString, cmStdString> UniqueObjectNamesMap;
   bool WindowsShell;
   bool WindowsVSIDE;
+  bool WatcomWMake;
   bool ForceUnixPath;
   bool MSYSShell;
   bool UseRelativePaths;

Index: cmGetDirectoryPropertyCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGetDirectoryPropertyCommand.cxx,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -d -r1.6.2.1 -r1.6.2.2
--- cmGetDirectoryPropertyCommand.cxx	11 May 2006 02:15:09 -0000	1.6.2.1
+++ cmGetDirectoryPropertyCommand.cxx	27 Oct 2006 20:01:47 -0000	1.6.2.2
@@ -53,6 +53,10 @@
       sd += "/";
       sd += *i;
       }
+
+    // The local generators are associated with collapsed paths.
+    sd = cmSystemTools::CollapseFullPath(sd.c_str());
+
     // lookup the makefile from the directory name
     cmLocalGenerator *lg = 
       this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->

Index: cmLocalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.cxx,v
retrieving revision 1.128.2.8
retrieving revision 1.128.2.9
diff -u -d -r1.128.2.8 -r1.128.2.9
--- cmLocalUnixMakefileGenerator3.cxx	13 Oct 2006 14:52:04 -0000	1.128.2.8
+++ cmLocalUnixMakefileGenerator3.cxx	27 Oct 2006 20:01:48 -0000	1.128.2.9
@@ -51,6 +51,7 @@
   this->SkipPreprocessedSourceRules = false;
   this->SkipAssemblySourceRules = false;
   this->NativeEchoCommand = "@echo ";
+  this->NativeEchoWindows = true;
 }
 
 //----------------------------------------------------------------------------
@@ -1046,7 +1047,8 @@
           {
           // Use the native echo command.
           cmd = this->NativeEchoCommand;
-          cmd += this->EscapeForShell(line.c_str(), false, true);
+          cmd += this->EscapeForShell(line.c_str(), false,
+                                      this->NativeEchoWindows);
           }
         else
           {

Index: cmExecuteProcessCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExecuteProcessCommand.cxx,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -d -r1.6.2.1 -r1.6.2.2
--- cmExecuteProcessCommand.cxx	11 May 2006 02:15:09 -0000	1.6.2.1
+++ cmExecuteProcessCommand.cxx	27 Oct 2006 20:01:47 -0000	1.6.2.2
@@ -19,7 +19,15 @@
 
 #include <cmsys/Process.h>
 
-void cmExecuteProcessCommandFixText(std::vector<char>& output);
+#include <ctype.h> /* isspace */
+
+static bool cmExecuteProcessCommandIsWhitespace(char c)
+{
+  return (isspace((int)c) || c == '\n' || c == '\r');
+}
+
+void cmExecuteProcessCommandFixText(std::vector<char>& output,
+                                    bool strip_trailing_whitespace);
 
 // cmExecuteProcessCommand
 bool cmExecuteProcessCommand
@@ -36,6 +44,8 @@
   size_t command_index = 0;
   bool output_quiet = false;
   bool error_quiet = false;
+  bool output_strip_trailing_whitespace = false;
+  bool error_strip_trailing_whitespace = false;
   std::string timeout_string;
   std::string input_file;
   std::string output_file;
@@ -166,10 +176,27 @@
       doing_command = false;
       error_quiet = true;
       }
+    else if(args[i] == "OUTPUT_STRIP_TRAILING_WHITESPACE")
+      {
+      doing_command = false;
+      output_strip_trailing_whitespace = true;
+      }
+    else if(args[i] == "ERROR_STRIP_TRAILING_WHITESPACE")
+      {
+      doing_command = false;
+      error_strip_trailing_whitespace = true;
+      }
     else if(doing_command)
       {
       cmds[command_index].push_back(args[i].c_str());
       }
+    else
+      {
+      cmOStringStream e;
+      e << " given unknown argument \"" << args[i] << "\".";
+      this->SetError(e.str().c_str());
+      return false;
+      }
     }
 
   if ( !this->Makefile->CanIWriteThisFile(output_file.c_str()) )
@@ -294,8 +321,10 @@
   cmsysProcess_WaitForExit(cp, 0);
 
   // Fix the text in the output strings.
-  cmExecuteProcessCommandFixText(tempOutput);
-  cmExecuteProcessCommandFixText(tempError);
+  cmExecuteProcessCommandFixText(tempOutput,
+                                 output_strip_trailing_whitespace);
+  cmExecuteProcessCommandFixText(tempError,
+                                 error_strip_trailing_whitespace);
 
   // Store the output obtained.
   if(!output_variable.empty() && tempOutput.size())
@@ -344,7 +373,8 @@
 }
 
 //----------------------------------------------------------------------------
-void cmExecuteProcessCommandFixText(std::vector<char>& output)
+void cmExecuteProcessCommandFixText(std::vector<char>& output,
+                                    bool strip_trailing_whitespace)
 {
   // Remove \0 characters and the \r part of \r\n pairs.
   unsigned int in_index = 0;
@@ -358,6 +388,18 @@
       output[out_index++] = c;
       }
     }
+
+  // Remove trailing whitespace if requested.
+  if(strip_trailing_whitespace)
+    {
+    while(out_index > 0 &&
+          cmExecuteProcessCommandIsWhitespace(output[out_index-1]))
+      {
+      --out_index;
+      }
+    }
+
+  // Shrink the vector to the size needed.
   output.resize(out_index);
 
   // Put a terminator on the text string.



More information about the Cmake-commits mailing list