[cmake-commits] hoffman committed CMakeLists.txt 1.289.2.9 1.289.2.10 cmFileCommand.h 1.16.2.2 1.16.2.3 cmGlobalGenerator.cxx 1.137.2.10 1.137.2.11 cmGlobalGenerator.h 1.58.2.5 1.58.2.6 cmGlobalVisualStudio6Generator.cxx 1.58.2.4 1.58.2.5 cmGlobalVisualStudio71Generator.cxx 1.30.2.4 1.30.2.5 cmGlobalVisualStudio7Generator.cxx 1.70.2.6 1.70.2.7 cmGlobalVisualStudio7Generator.h 1.34.2.5 1.34.2.6 cmGlobalVisualStudio8Generator.cxx 1.10.2.4 1.10.2.5 cmGlobalVisualStudio8Generator.h 1.4.2.4 1.4.2.5 cmGlobalVisualStudio8Win64Generator.cxx 1.1.2.1 1.1.2.2 cmLocalGenerator.cxx 1.132.2.10 1.132.2.11 cmLocalUnixMakefileGenerator3.cxx 1.128.2.10 1.128.2.11 cmLocalVisualStudio6Generator.cxx 1.100.2.5 1.100.2.6 cmLocalVisualStudio7Generator.cxx 1.125.2.11 1.125.2.12 cmLocalVisualStudio7Generator.h 1.22.2.5 1.22.2.6 cmLocalVisualStudioGenerator.cxx 1.2.2.4 1.2.2.5

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Mar 16 17:05:44 EST 2007


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

Modified Files:
      Tag: CMake-2-4
	CMakeLists.txt cmFileCommand.h cmGlobalGenerator.cxx 
	cmGlobalGenerator.h cmGlobalVisualStudio6Generator.cxx 
	cmGlobalVisualStudio71Generator.cxx 
	cmGlobalVisualStudio7Generator.cxx 
	cmGlobalVisualStudio7Generator.h 
	cmGlobalVisualStudio8Generator.cxx 
	cmGlobalVisualStudio8Generator.h 
	cmGlobalVisualStudio8Win64Generator.cxx cmLocalGenerator.cxx 
	cmLocalUnixMakefileGenerator3.cxx 
	cmLocalVisualStudio6Generator.cxx 
	cmLocalVisualStudio7Generator.cxx 
	cmLocalVisualStudio7Generator.h 
	cmLocalVisualStudioGenerator.cxx 
Log Message:
ENH: check in fixes from main tree to create 2.4.7 RC 5


Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.125.2.11
retrieving revision 1.125.2.12
diff -u -d -r1.125.2.11 -r1.125.2.12
--- cmLocalVisualStudio7Generator.cxx	15 Feb 2007 17:45:07 -0000	1.125.2.11
+++ cmLocalVisualStudio7Generator.cxx	16 Mar 2007 22:05:42 -0000	1.125.2.12
@@ -28,11 +28,14 @@
 
 #include <ctype.h> // for isspace
 
+extern cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[];
+
 //----------------------------------------------------------------------------
 cmLocalVisualStudio7Generator::cmLocalVisualStudio7Generator()
 {
   this->Version = 7;
   this->PlatformName = "Win32";
+  this->ExtraFlagTable = 0;
 }
 
 cmLocalVisualStudio7Generator::~cmLocalVisualStudio7Generator()
@@ -284,26 +287,6 @@
   fout << "\t</Configurations>\n";
 }
 
-// This is a table mapping XML tag IDE names to command line options
-struct cmVS7FlagTable
-{
-  const char* IDEName;  // name used in the IDE xml file
-  const char* commandFlag; // command line flag
-  const char* comment;     // comment
-  const char* value; // string value
-  unsigned int special; // flags for special handling requests
-  enum
-  {
-    UserValue    = (1<<0), // flag contains a user-specified value
-    UserIgnored  = (1<<1), // ignore any user value
-    UserRequired = (1<<2), // match only when user value is non-empty
-    Continue     = (1<<3), // continue looking for matching entries
-
-    UserValueIgnored  = UserValue | UserIgnored,
-    UserValueRequired = UserValue | UserRequired
-  };
-};
-
 // fill the table here currently the comment field is not used for
 // anything other than documentation NOTE: Make sure the longer
 // commandFlag comes FIRST!
@@ -363,16 +346,10 @@
    cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
   {"PrecompiledHeaderThrough", "Yc", "Precompiled Header Name", "",
    cmVS7FlagTable::UserValueRequired},
-  {"UsePrecompiledHeader", "YX", "Automatically Generate", "2",
-   cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
-  {"PrecompiledHeaderThrough", "YX", "Precompiled Header Name", "",
-   cmVS7FlagTable::UserValueRequired},
-  {"UsePrecompiledHeader", "Yu", "Use Precompiled Header", "3",
-   cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
-  {"PrecompiledHeaderThrough", "Yu", "Precompiled Header Name", "",
-   cmVS7FlagTable::UserValueRequired},
   {"PrecompiledHeaderFile", "Fp", "Generated Precompiled Header", "",
    cmVS7FlagTable::UserValue},
+  // The YX and Yu options are in a per-global-generator table because
+  // their values differ based on the VS IDE version.
   {"ForcedIncludeFiles", "FI", "Forced include files", "",
    cmVS7FlagTable::UserValueRequired},
 
@@ -424,7 +401,8 @@
     Compiler,
     Linker
   };
-  cmLocalVisualStudio7GeneratorOptions(Tool tool);
+  cmLocalVisualStudio7GeneratorOptions(Tool tool,
+                                       cmVS7FlagTable const* extraTable = 0);
 
   // Store options from command line flags.
   void Parse(const char* flags);
@@ -441,7 +419,6 @@
 
   // Check for specific options.
   bool UsingUnicode();
-  bool UsingDebugPDB();
 
   // Write options to output.
   void OutputPreprocessorDefinitions(std::ostream& fout,
@@ -470,7 +447,10 @@
 
   bool DoingDefine;
   cmVS7FlagTable const* FlagTable;
+  cmVS7FlagTable const* ExtraFlagTable;
   void HandleFlag(const char* flag);
+  bool CheckFlagTable(cmVS7FlagTable const* table, const char* flag,
+                      bool& flag_handled);
 };
 
 void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
@@ -556,7 +536,7 @@
   std::string defineFlags = this->Makefile->GetDefineFlags();
 
   // Construct a set of build options for this target.
-  Options targetOptions(Options::Compiler);
+  Options targetOptions(Options::Compiler, this->ExtraFlagTable);
   targetOptions.FixExceptionHandlingDefault();
   targetOptions.Parse(flags.c_str());
   targetOptions.Parse(defineFlags.c_str());
@@ -587,17 +567,6 @@
     targetOptions.AddDefine(exportSymbol);
     }
 
-  // Override the flag map with cmake-specific settings.
-  if(this->Makefile->IsOn("CMAKE_CXX_USE_RTTI"))
-    {
-    targetOptions.AddFlag("RuntimeTypeInfo", "TRUE");
-    }
-  if(const char* warningLevel =
-     this->Makefile->GetDefinition("CMAKE_CXX_WARNING_LEVEL"))
-    {
-    targetOptions.AddFlag("WarningLevel", warningLevel);
-    }
-
   // The intermediate directory name consists of a directory for the
   // target and a subdirectory for the configuration name.
   std::string intermediateDir = this->GetTargetDirectory(target);
@@ -638,22 +607,16 @@
   targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n");
   fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n";
   fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n";
-  if(targetOptions.UsingDebugPDB())
-    {
-    if(target.GetType() == cmTarget::EXECUTABLE)
-      {
-      fout <<  "\t\t\t\tProgramDataBaseFileName=\""
-           << this->ExecutableOutputPath
-           << "$(OutDir)/" << target.GetPDBName(configName) << "\"\n";
-      }
-    else if(target.GetType() == cmTarget::STATIC_LIBRARY ||
+  if(target.GetType() == cmTarget::EXECUTABLE ||
+     target.GetType() == cmTarget::STATIC_LIBRARY ||
             target.GetType() == cmTarget::SHARED_LIBRARY ||
             target.GetType() == cmTarget::MODULE_LIBRARY)
       {
+    // We need to specify a program database file name even for
+    // non-debug configurations because VS still creates .idb files.
     fout <<  "\t\t\t\tProgramDataBaseFileName=\""
-         << this->LibraryOutputPath
-           << "$(OutDir)/" << target.GetPDBName(configName) << "\"\n";
-      }
+         << target.GetDirectory(configName) << "/"
+         << target.GetPDBName(configName) << "\"\n";
     }
   fout << "/>\n";  // end of <Tool Name=VCCLCompilerTool
   fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"/>\n";
@@ -1148,9 +1111,16 @@
       }
     const char* lang = this->GlobalGenerator->GetLanguageFromExtension
       ((*sf)->GetSourceExtension().c_str());
+    const char* sourceLang = this->GetSourceFileLanguage(*(*sf));
     const char* linkLanguage = target.GetLinkerLanguage
       (this->GetGlobalGenerator());
-
+    bool needForceLang = false;
+    // source file does not match its extension language
+    if(lang && sourceLang && strcmp(lang, sourceLang) != 0)
+      {
+      needForceLang = true;
+      lang = sourceLang;
+      }
     // 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
@@ -1159,7 +1129,8 @@
 
     // if the source file does not match the linker language
     // then force c or c++
-    if(linkLanguage && lang && strcmp(lang, linkLanguage) != 0)
+    if(needForceLang || (linkLanguage && lang 
+                         && strcmp(lang, linkLanguage) != 0))
       {
       if(strcmp(lang, "CXX") == 0)
       {
@@ -1244,7 +1215,7 @@
                << "\t\t\t\t\tName=\"" << aCompilerTool << "\"\n";
           if(!compileFlags.empty())
             {
-            Options fileOptions(Options::Compiler);
+            Options fileOptions(Options::Compiler, this->ExtraFlagTable);
             fileOptions.Parse(compileFlags.c_str());
             fileOptions.OutputAdditionalOptions(fout, "\t\t\t\t\t", "\n");
             fileOptions.OutputFlagMap(fout, "\t\t\t\t\t");
@@ -1579,7 +1550,7 @@
 class cmVS7XMLParser : public cmXMLParser
 {
 public:
-  virtual void EndElement(const char* name)
+  virtual void EndElement(const char* /* name */)
     {
     }
   virtual void StartElement(const char* name, const char** atts)
@@ -1688,8 +1659,9 @@
 
 //----------------------------------------------------------------------------
 cmLocalVisualStudio7GeneratorOptions
-::cmLocalVisualStudio7GeneratorOptions(Tool tool):
-  DoingDefine(false), FlagTable(0)
+::cmLocalVisualStudio7GeneratorOptions(Tool tool,
+                                       cmVS7FlagTable const* extraTable):
+  DoingDefine(false), FlagTable(0), ExtraFlagTable(extraTable)
 {
   // Choose the flag table for the requested tool.
   switch(tool)
@@ -1756,21 +1728,6 @@
 }
 
 //----------------------------------------------------------------------------
-bool cmLocalVisualStudio7GeneratorOptions::UsingDebugPDB()
-{
-  std::map<cmStdString, cmStdString>::iterator mi =
-    this->FlagMap.find("DebugInformationFormat");
-  if(mi != this->FlagMap.end() && mi->second != "1")
-    {
-    return true;
-    }
-  else
-    {
-    return false;
-    }
-}
-
-//----------------------------------------------------------------------------
 void cmLocalVisualStudio7GeneratorOptions::Parse(const char* flags)
 {
   // Parse the input string as a windows command line since the string
@@ -1801,6 +1758,7 @@
   // Look for known arguments.
   if(flag[0] == '-' || flag[0] == '/')
     {
+    // Look for preprocessor definitions.
     if(flag[1] == 'D')
       {
       if(flag[2] == '\0')
@@ -1815,12 +1773,42 @@
         }
       return;
       }
-    else if(this->FlagTable)
+
+    // Look through the available flag tables.
+    bool flag_handled = false;
+    if(this->FlagTable &&
+       this->CheckFlagTable(this->FlagTable, flag, flag_handled))
+      {
+      return;
+      }
+    if(this->ExtraFlagTable &&
+       this->CheckFlagTable(this->ExtraFlagTable, flag, flag_handled))
       {
+      return;
+      }
+
+    // If any map entry handled the flag we are done.
+    if(flag_handled)
+      {
+      return;
+      }
+    }
+
+  // This option is not known.  Store it in the output flags.
+  this->FlagString += " ";
+  this->FlagString +=
+    cmSystemTools::EscapeWindowsShellArgument(flag,
+                                              cmsysSystem_Shell_Flag_VSIDE);
+}
+
+//----------------------------------------------------------------------------
+bool
+cmLocalVisualStudio7GeneratorOptions
+::CheckFlagTable(cmVS7FlagTable const* table, const char* flag,
+                 bool& flag_handled)
+{
       // Look for an entry in the flag table matching this flag.
-      bool flag_handled = false;
-      for(cmVS7FlagTable const* entry = this->FlagTable;
-          entry->IDEName; ++entry)
+  for(cmVS7FlagTable const* entry = table; entry->IDEName; ++entry)
         {
         bool entry_found = false;
         if(entry->special & cmVS7FlagTable::UserValue)
@@ -1857,26 +1845,14 @@
         // search continuation we are done.
         if(entry_found && !(entry->special & cmVS7FlagTable::Continue))
           {
-          return;
+      return true;
           }
 
         // If the entry was found the flag has been handled.
         flag_handled = flag_handled || entry_found;
         }
 
-      // If any map entry handled the flag we are done.
-      if(flag_handled)
-        {
-        return;
-        }
-      }
-    }
-
-  // This option is not known.  Store it in the output flags.
-  this->FlagString += " ";
-  this->FlagString +=
-    cmSystemTools::EscapeWindowsShellArgument(flag,
-                                              cmsysSystem_Shell_Flag_VSIDE);
+  return false;
 }
 
 //----------------------------------------------------------------------------

Index: cmLocalVisualStudioGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudioGenerator.cxx,v
retrieving revision 1.2.2.4
retrieving revision 1.2.2.5
diff -u -d -r1.2.2.4 -r1.2.2.5
--- cmLocalVisualStudioGenerator.cxx	5 Feb 2007 18:21:32 -0000	1.2.2.4
+++ cmLocalVisualStudioGenerator.cxx	16 Mar 2007 22:05:42 -0000	1.2.2.5
@@ -15,7 +15,7 @@
 
 =========================================================================*/
 #include "cmLocalVisualStudioGenerator.h"
-
+#include "cmGlobalGenerator.h"
 #include "cmMakefile.h"
 #include "cmSourceFile.h"
 #include "cmSystemTools.h"

Index: cmLocalVisualStudio7Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.h,v
retrieving revision 1.22.2.5
retrieving revision 1.22.2.6
diff -u -d -r1.22.2.5 -r1.22.2.6
--- cmLocalVisualStudio7Generator.h	5 Feb 2007 18:21:32 -0000	1.22.2.5
+++ cmLocalVisualStudio7Generator.h	16 Mar 2007 22:05:42 -0000	1.22.2.6
@@ -66,6 +66,9 @@
   void SetVersion8() {this->Version = 8;}
   void SetPlatformName(const char* n) { this->PlatformName = n;}
   virtual void ConfigureFinalPass();
+  
+  void SetExtraFlagTable(cmVS7FlagTable const* table)
+    { this->ExtraFlagTable = table; }
 private:
   typedef cmLocalVisualStudio7GeneratorOptions Options;
   void ReadAndStoreExternalGUID(const char* name,
@@ -118,6 +121,7 @@
                   const char *libName, std::vector<std::string> *configs);
   virtual std::string GetTargetDirectory(cmTarget&);
 
+  cmVS7FlagTable const* ExtraFlagTable;
   std::vector<std::string> CreatedProjectNames;
   std::string LibraryOutputPath;
   std::string ExecutableOutputPath;
@@ -126,5 +130,25 @@
   std::string PlatformName; // Win32 or x64 
 };
 
+// This is a table mapping XML tag IDE names to command line options
+struct cmVS7FlagTable
+{
+  const char* IDEName;  // name used in the IDE xml file
+  const char* commandFlag; // command line flag
+  const char* comment;     // comment
+  const char* value; // string value
+  unsigned int special; // flags for special handling requests
+  enum
+  {
+    UserValue    = (1<<0), // flag contains a user-specified value
+    UserIgnored  = (1<<1), // ignore any user value
+    UserRequired = (1<<2), // match only when user value is non-empty
+    Continue     = (1<<3), // continue looking for matching entries
+
+    UserValueIgnored  = UserValue | UserIgnored,
+    UserValueRequired = UserValue | UserRequired
+  };
+};
+
 #endif
 

Index: cmGlobalVisualStudio8Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio8Generator.h,v
retrieving revision 1.4.2.4
retrieving revision 1.4.2.5
diff -u -d -r1.4.2.4 -r1.4.2.5
--- cmGlobalVisualStudio8Generator.h	10 Nov 2006 15:12:55 -0000	1.4.2.4
+++ cmGlobalVisualStudio8Generator.h	16 Mar 2007 22:05:42 -0000	1.4.2.5
@@ -50,6 +50,7 @@
   virtual void Configure();
   virtual void Generate();
 protected:
+  static cmVS7FlagTable const* GetExtraFlagTableVS8();
   virtual void AddPlatformDefinitions(cmMakefile* mf);
   virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
                             std::vector<cmLocalGenerator*>& generators);

Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.132.2.10
retrieving revision 1.132.2.11
diff -u -d -r1.132.2.10 -r1.132.2.11
--- cmLocalGenerator.cxx	3 Jan 2007 15:19:03 -0000	1.132.2.10
+++ cmLocalGenerator.cxx	16 Mar 2007 22:05:42 -0000	1.132.2.11
@@ -2286,6 +2286,16 @@
       objectName = relFromSource;
       }
     }
+  // if it is still a full path check for the try compile case
+  // try compile never have in source sources, and should not
+  // have conflicting source file names in the same target
+  if(cmSystemTools::FileIsFullPath(objectName.c_str()))
+    {
+    if(this->GetGlobalGenerator()->GetCMakeInstance()->GetIsInTryCompile())
+      {
+      objectName = cmSystemTools::GetFilenameName(source.GetFullPath());
+      }
+    }
 
   // Replace the original source file extension with the object file
   // extension.

Index: cmGlobalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.h,v
retrieving revision 1.58.2.5
retrieving revision 1.58.2.6
diff -u -d -r1.58.2.5 -r1.58.2.6
--- cmGlobalGenerator.h	10 Nov 2006 15:12:55 -0000	1.58.2.5
+++ cmGlobalGenerator.h	16 Mar 2007 22:05:42 -0000	1.58.2.6
@@ -210,8 +210,6 @@
 
   void ConfigureRelativePaths();
   bool RelativePathsConfigured;
-  void SetupTests();
-
   void CreateDefaultGlobalTargets(cmTargets* targets);
   cmTarget CreateGlobalTarget(const char* name, const char* message,
     const cmCustomCommandLines* commandLines,

Index: cmGlobalVisualStudio8Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio8Generator.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
--- cmGlobalVisualStudio8Generator.cxx	10 Nov 2006 15:12:55 -0000	1.10.2.4
+++ cmGlobalVisualStudio8Generator.cxx	16 Mar 2007 22:05:42 -0000	1.10.2.5
@@ -36,6 +36,7 @@
 {
   cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
   lg->SetVersion8();
+  lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
   lg->SetGlobalGenerator(this);
   return lg;
 }
@@ -245,3 +246,21 @@
       }
     }
 }
+
+//----------------------------------------------------------------------------
+static cmVS7FlagTable cmVS8ExtraFlagTable[] =
+{
+  // Precompiled header and related options.  Note that the
+  // UsePrecompiledHeader entries are marked as "Continue" so that the
+  // corresponding PrecompiledHeaderThrough entry can be found.
+  {"UsePrecompiledHeader", "Yu", "Use Precompiled Header", "2",
+   cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
+  {"PrecompiledHeaderThrough", "Yu", "Precompiled Header Name", "",
+   cmVS7FlagTable::UserValueRequired},
+  // There is no YX option in the VS8 IDE.
+  {0,0,0,0,0}
+};
+cmVS7FlagTable const* cmGlobalVisualStudio8Generator::GetExtraFlagTableVS8()
+{
+  return cmVS8ExtraFlagTable;
+}

Index: cmGlobalVisualStudio71Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio71Generator.cxx,v
retrieving revision 1.30.2.4
retrieving revision 1.30.2.5
diff -u -d -r1.30.2.4 -r1.30.2.5
--- cmGlobalVisualStudio71Generator.cxx	10 Nov 2006 15:12:55 -0000	1.30.2.4
+++ cmGlobalVisualStudio71Generator.cxx	16 Mar 2007 22:05:42 -0000	1.30.2.5
@@ -35,6 +35,7 @@
 {
   cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
   lg->SetVersion71();
+  lg->SetExtraFlagTable(this->GetExtraFlagTableVS7());
   lg->SetGlobalGenerator(this);
   return lg;
 }

Index: cmLocalVisualStudio6Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio6Generator.cxx,v
retrieving revision 1.100.2.5
retrieving revision 1.100.2.6
diff -u -d -r1.100.2.5 -r1.100.2.6
--- cmLocalVisualStudio6Generator.cxx	27 Oct 2006 20:01:48 -0000	1.100.2.5
+++ cmLocalVisualStudio6Generator.cxx	16 Mar 2007 22:05:42 -0000	1.100.2.6
@@ -421,13 +421,17 @@
       compileFlags += cflags;
       }
 
-    const char* lang = this->GlobalGenerator->
-      GetLanguageFromExtension((*sf)->GetSourceExtension().c_str());
+    const char* lang = this->GetSourceFileLanguage(*(*sf));
     if(lang && strcmp(lang, "CXX") == 0)
       {
       // force a C++ file type
       compileFlags += " /TP ";
       }
+    else if(strcmp(lang, "C") == 0)
+      {
+      // force to c file type
+      compileFlags += " /TC ";
+      }
       
     // Check for extra object-file dependencies.
     const char* dependsValue = (*sf)->GetProperty("OBJECT_DEPENDS");

Index: cmGlobalVisualStudio8Win64Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio8Win64Generator.cxx,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- cmGlobalVisualStudio8Win64Generator.cxx	11 May 2006 20:05:57 -0000	1.1.2.1
+++ cmGlobalVisualStudio8Win64Generator.cxx	16 Mar 2007 22:05:42 -0000	1.1.2.2
@@ -33,6 +33,7 @@
   cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
   lg->SetVersion8();
   lg->SetPlatformName(this->PlatformName.c_str());
+  lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
   lg->SetGlobalGenerator(this);
   return lg;
 }

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CMakeLists.txt,v
retrieving revision 1.289.2.9
retrieving revision 1.289.2.10
diff -u -d -r1.289.2.9 -r1.289.2.10
--- CMakeLists.txt	5 Feb 2007 18:21:32 -0000	1.289.2.9
+++ CMakeLists.txt	16 Mar 2007 22:05:42 -0000	1.289.2.10
@@ -345,34 +345,17 @@
 ENDIF (NOT DART_ROOT)
 
 IF(BUILD_TESTING)
-  SET(CMAKE_TEST_GENERATOR "" CACHE STRING "Generator used when running tests")
-  SET(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH "Generator used when running tests")
-  IF(NOT CMAKE_TEST_GENERATOR)
-    SET(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
-    SET(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
-  ELSE(NOT CMAKE_TEST_GENERATOR)
-    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
-  # and not the ctest from the cmake building and testing
-  # cmake.
-  SET(CMAKE_CTEST_COMMAND "${EXECUTABLE_OUTPUT_PATH}/ctest")
-  SET(CMAKE_CMAKE_COMMAND "${EXECUTABLE_OUTPUT_PATH}/cmake")
-
   # Should the long tests be run?
   OPTION(CMAKE_RUN_LONG_TESTS "Should the long tests be run (such as Bootstrap)." ON)
   MARK_AS_ADVANCED(CMAKE_RUN_LONG_TESTS)
 
+  IF (CMAKE_RUN_LONG_TESTS)
+    OPTION(CTEST_TEST_CTEST 
+      "Should the tests that run a full sub ctest process be run?" 
+      OFF)
+    MARK_AS_ADVANCED(CTEST_TEST_CTEST)
+  ENDIF (CMAKE_RUN_LONG_TESTS)
+    
   ADD_TEST(CommandLineTest ${CMAKE_CTEST_COMMAND}
     --build-and-test 
     "${CMake_SOURCE_DIR}/Tests/CommandLineTest"
@@ -665,6 +648,27 @@
       -DCMAKE_TEST_SYSTEM_LIBRARIES:BOOL=${CMAKE_TEST_SYSTEM_LIBRARIES}
       --test-command complex)
 
+    ADD_TEST(SetLang ${CMAKE_CTEST_COMMAND}
+      --build-and-test
+      "${CMake_SOURCE_DIR}/Tests/SetLang"
+      "${CMake_BINARY_DIR}/Tests/SetLang"
+      --build-two-config
+      --build-generator ${CMAKE_TEST_GENERATOR}
+      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+      --build-project SetLang
+      --test-command bar)
+
+#     ADD_TEST(ConvLibrary ${CMAKE_CTEST_COMMAND}
+#       --build-and-test
+#       "${CMake_SOURCE_DIR}/Tests/ConvLibrary"
+#       "${CMake_BINARY_DIR}/Tests/ConvLibrary"
+#       --build-two-config
+#       --build-generator ${CMAKE_TEST_GENERATOR}
+#       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+#       --build-project ConvLibrary
+#       --test-command bartest)
+
+
 #    ADD_TEST(complexRelativePaths  ${CMAKE_CTEST_COMMAND}
 #      --build-and-test
 #      "${CMake_SOURCE_DIR}/Tests/ComplexRelativePaths"
@@ -988,6 +992,18 @@
       )
   ENDIF (WIN32)    
 
+  IF(CMAKE_TEST_MSVC)
+    ADD_TEST(PrecompiledHeader ${CMAKE_CTEST_COMMAND}
+      --build-and-test
+      "${CMake_SOURCE_DIR}/Tests/PrecompiledHeader"
+      "${CMake_BINARY_DIR}/Tests/PrecompiledHeader"
+      --build-generator ${CMAKE_TEST_GENERATOR}
+      --build-project PrecompiledHeader
+      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+      --build-two-config
+      --test-command foo)
+  ENDIF(CMAKE_TEST_MSVC)
+
   IF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
     ADD_TEST(MakeClean ${CMAKE_CTEST_COMMAND}
       --build-and-test

Index: cmLocalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.cxx,v
retrieving revision 1.128.2.10
retrieving revision 1.128.2.11
diff -u -d -r1.128.2.10 -r1.128.2.11
--- cmLocalUnixMakefileGenerator3.cxx	5 Feb 2007 18:21:32 -0000	1.128.2.10
+++ cmLocalUnixMakefileGenerator3.cxx	16 Mar 2007 22:05:42 -0000	1.128.2.11
@@ -741,6 +741,16 @@
                         no_commands, false);
     }
 
+  // Work-around for makes that drop rules that have no dependencies
+  // or commands.
+  cmGlobalUnixMakefileGenerator3* gg =
+    static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
+  std::string hack = gg->GetEmptyRuleHackDepends();
+  if(!hack.empty())
+    {
+    no_depends.push_back(hack);
+    }
+
   // Special symbolic target that never exists to force dependers to
   // run their rules.
   this->WriteMakeRule

Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.137.2.10
retrieving revision 1.137.2.11
diff -u -d -r1.137.2.10 -r1.137.2.11
--- cmGlobalGenerator.cxx	10 Nov 2006 15:54:35 -0000	1.137.2.10
+++ cmGlobalGenerator.cxx	16 Mar 2007 22:05:42 -0000	1.137.2.11
@@ -1276,83 +1276,6 @@
   this->CMakeInstance = cm;
 }
 
-void cmGlobalGenerator::SetupTests()
-{
-  std::string ctest = this->LocalGenerators[0]->GetMakefile()->
-    GetRequiredDefinition("CMAKE_COMMAND");
-  ctest = removeQuotes(ctest);
-  ctest = cmSystemTools::GetFilenamePath(ctest.c_str());
-  ctest += "/";
-  ctest += "ctest";
-  ctest += cmSystemTools::GetExecutableExtension();
-  if(!cmSystemTools::FileExists(ctest.c_str()))
-    {
-    ctest = this->LocalGenerators[0]->GetMakefile()->
-      GetRequiredDefinition("CMAKE_COMMAND");
-    ctest = cmSystemTools::GetFilenamePath(ctest.c_str());
-    ctest += "/Debug/";
-    ctest += "ctest";
-    ctest += cmSystemTools::GetExecutableExtension();
-    }
-  if(!cmSystemTools::FileExists(ctest.c_str()))
-    {
-    ctest = this->LocalGenerators[0]->GetMakefile()->
-      GetRequiredDefinition("CMAKE_COMMAND");
-    ctest = cmSystemTools::GetFilenamePath(ctest.c_str());
-    ctest += "/Release/";
-    ctest += "ctest";
-    ctest += cmSystemTools::GetExecutableExtension();
-    }
-  // if we found ctest
-  if (cmSystemTools::FileExists(ctest.c_str()))
-    {
-    // Create a full path filename for output Testfile
-    std::string fname;
-    fname = this->CMakeInstance->GetStartOutputDirectory();
-    fname += "/";
-    if ( this->LocalGenerators[0]->GetMakefile()->IsSet("CTEST_NEW_FORMAT") )
-      {
-      fname += "CTestTestfile.txt";
-      }
-    else
-      {
-      fname += "DartTestfile.txt";
-      }
-
-    // Add run_test only if any tests are foun
-    size_t total_tests = 0;
-    size_t i;
-    for (i = 0; i < this->LocalGenerators.size(); ++i)
-      {
-      total_tests += 
-        this->LocalGenerators[i]->GetMakefile()->GetTests()->size();
-      }
-
-    // If the file doesn't exist, then ENABLE_TESTING hasn't been run
-    if (total_tests > 0)
-      {
-      const char* no_working_dir = 0;
-      std::vector<std::string> no_depends;
-      std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
-      for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
-        {
-        std::vector<cmLocalGenerator*>& gen = it->second;
-        // add the RUN_TESTS to the first local generator of each project
-        if(gen.size())
-          {
-          cmMakefile* mf = gen[0]->GetMakefile();
-          if(const char* outDir = mf->GetDefinition("CMAKE_CFG_INTDIR"))
-            {
-            mf->AddUtilityCommand("RUN_TESTS", false, no_depends,
-                                  no_working_dir, 
-                                  ctest.c_str(), "-C", outDir);
-            }
-          }
-        }
-      }
-    }
-}
-
 void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
 {
   cmMakefile* mf = this->LocalGenerators[0]->GetMakefile();

Index: cmGlobalVisualStudio7Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.h,v
retrieving revision 1.34.2.5
retrieving revision 1.34.2.6
diff -u -d -r1.34.2.5 -r1.34.2.6
--- cmGlobalVisualStudio7Generator.h	10 Nov 2006 15:12:55 -0000	1.34.2.5
+++ cmGlobalVisualStudio7Generator.h	16 Mar 2007 22:05:42 -0000	1.34.2.6
@@ -20,6 +20,7 @@
 #include "cmGlobalGenerator.h"
 
 class cmTarget;
+struct cmVS7FlagTable;
 
 /** \class cmGlobalVisualStudio7Generator
  * \brief Write a Unix makefiles.
@@ -97,6 +98,7 @@
   virtual const char* GetCMakeCFGInitDirectory()  { return "$(OutDir)"; }
 
 protected:
+  static cmVS7FlagTable const* GetExtraFlagTableVS7();
   virtual void OutputSLNFile(cmLocalGenerator* root, 
                              std::vector<cmLocalGenerator*>& generators);
   virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,

Index: cmFileCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFileCommand.h,v
retrieving revision 1.16.2.2
retrieving revision 1.16.2.3
diff -u -d -r1.16.2.2 -r1.16.2.3
--- cmFileCommand.h	30 Jun 2006 17:48:43 -0000	1.16.2.2
+++ cmFileCommand.h	16 Mar 2007 22:05:42 -0000	1.16.2.3
@@ -104,7 +104,7 @@
       "MAKE_DIRECTORY will create a directory at the specified location\n"
       "RELATIVE_PATH will determine relative path from directory to the given"
       " file.\n"
-      "TO_CMAKE_PATH will convert path into a cmake sytle path with unix /. "
+      "TO_CMAKE_PATH will convert path into a cmake style path with unix /. "
       " The input can be a single path or a system path like \"$ENV{PATH}\". "
       " Note the double quotes around the ENV call TO_CMAKE_PATH only takes "
       " one argument.\n"

Index: cmGlobalVisualStudio6Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio6Generator.cxx,v
retrieving revision 1.58.2.4
retrieving revision 1.58.2.5
diff -u -d -r1.58.2.4 -r1.58.2.5
--- cmGlobalVisualStudio6Generator.cxx	13 Oct 2006 14:52:02 -0000	1.58.2.4
+++ cmGlobalVisualStudio6Generator.cxx	16 Mar 2007 22:05:42 -0000	1.58.2.5
@@ -178,9 +178,6 @@
       }
     }
   
-  // add the Run Tests command
-  this->SetupTests();
-  
   // first do the superclass method
   this->cmGlobalGenerator::Generate();
   

Index: cmGlobalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.cxx,v
retrieving revision 1.70.2.6
retrieving revision 1.70.2.7
diff -u -d -r1.70.2.6 -r1.70.2.7
--- cmGlobalVisualStudio7Generator.cxx	10 Nov 2006 15:12:55 -0000	1.70.2.6
+++ cmGlobalVisualStudio7Generator.cxx	16 Mar 2007 22:05:42 -0000	1.70.2.7
@@ -138,7 +138,8 @@
 ///! Create a local generator appropriate to this Global Generator
 cmLocalGenerator *cmGlobalVisualStudio7Generator::CreateLocalGenerator()
 {
-  cmLocalGenerator *lg = new cmLocalVisualStudio7Generator;
+  cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
+  lg->SetExtraFlagTable(this->GetExtraFlagTableVS7());
   lg->SetGlobalGenerator(this);
   return lg;
 }
@@ -235,9 +236,6 @@
       }
     }
 
-  // add the Run Tests command
-  this->SetupTests();
-  
   // first do the superclass method
   this->cmGlobalGenerator::Generate();
   
@@ -824,3 +822,24 @@
   // default is to be part of the build
   return true;
 }
+
+//----------------------------------------------------------------------------
+static cmVS7FlagTable cmVS7ExtraFlagTable[] =
+{
+  // Precompiled header and related options.  Note that the
+  // UsePrecompiledHeader entries are marked as "Continue" so that the
+  // corresponding PrecompiledHeaderThrough entry can be found.
+  {"UsePrecompiledHeader", "YX", "Automatically Generate", "2",
+   cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
+  {"PrecompiledHeaderThrough", "YX", "Precompiled Header Name", "",
+   cmVS7FlagTable::UserValueRequired},
+  {"UsePrecompiledHeader", "Yu", "Use Precompiled Header", "3",
+   cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
+  {"PrecompiledHeaderThrough", "Yu", "Precompiled Header Name", "",
+   cmVS7FlagTable::UserValueRequired},
+  {0,0,0,0,0}
+};
+cmVS7FlagTable const* cmGlobalVisualStudio7Generator::GetExtraFlagTableVS7()
+{
+  return cmVS7ExtraFlagTable;
+}



More information about the Cmake-commits mailing list