[cmake-commits] hoffman committed cmAddDependenciesCommand.cxx 1.13 1.13.2.1 cmIfCommand.cxx 1.62.2.4 1.62.2.5 cmIfCommand.h 1.32.2.4 1.32.2.5 cmLocalVisualStudio7Generator.cxx 1.125.2.10 1.125.2.11 cmSetTargetPropertiesCommand.cxx 1.3.2.1 1.3.2.2

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Feb 15 12:45:09 EST 2007


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

Modified Files:
      Tag: CMake-2-4
	cmAddDependenciesCommand.cxx cmIfCommand.cxx cmIfCommand.h 
	cmLocalVisualStudio7Generator.cxx 
	cmSetTargetPropertiesCommand.cxx 
Log Message:
ENH: merge in changes from main tree, including fix for exception stuff in vs 7


Index: cmAddDependenciesCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddDependenciesCommand.cxx,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -d -r1.13 -r1.13.2.1
--- cmAddDependenciesCommand.cxx	15 Mar 2006 16:01:58 -0000	1.13
+++ cmAddDependenciesCommand.cxx	15 Feb 2007 17:45:07 -0000	1.13.2.1
@@ -15,6 +15,8 @@
 
 =========================================================================*/
 #include "cmAddDependenciesCommand.h"
+#include "cmLocalGenerator.h"
+#include "cmGlobalGenerator.h"
 
 // cmDependenciesCommand
 bool cmAddDependenciesCommand::InitialPass(
@@ -28,14 +30,16 @@
 
   std::string target_name = args[0];
 
-  cmTargets &tgts = this->Makefile->GetTargets();
-  if (tgts.find(target_name) != tgts.end())
+  cmTarget* target = 
+    this->GetMakefile()->GetLocalGenerator()->
+    GetGlobalGenerator()->FindTarget(0, target_name.c_str());
+  if(target)
     {
     std::vector<std::string>::const_iterator s = args.begin();
-    ++s;
+    ++s; // skip over target_name
     for (; s != args.end(); ++s)
       {
-      tgts[target_name].AddUtility(s->c_str());
+      target->AddUtility(s->c_str());
       }
     }
   else
@@ -46,7 +50,6 @@
     return false;
     }
 
-
   return true;
 }
 

Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.125.2.10
retrieving revision 1.125.2.11
diff -u -d -r1.125.2.10 -r1.125.2.11
--- cmLocalVisualStudio7Generator.cxx	5 Feb 2007 18:21:32 -0000	1.125.2.10
+++ cmLocalVisualStudio7Generator.cxx	15 Feb 2007 17:45:07 -0000	1.125.2.11
@@ -429,6 +429,9 @@
   // Store options from command line flags.
   void Parse(const char* flags);
 
+  // Fix the ExceptionHandling option to default to off.
+  void FixExceptionHandlingDefault();
+
   // Store options for verbose builds.
   void SetVerboseMakefile(bool verbose);
 
@@ -554,6 +557,7 @@
 
   // Construct a set of build options for this target.
   Options targetOptions(Options::Compiler);
+  targetOptions.FixExceptionHandlingDefault();
   targetOptions.Parse(flags.c_str());
   targetOptions.Parse(defineFlags.c_str());
   targetOptions.SetVerboseMakefile(
@@ -1696,7 +1700,11 @@
       this->FlagTable = cmLocalVisualStudio7GeneratorLinkFlagTable; break;
     default: break;
     }
+}
 
+//----------------------------------------------------------------------------
+void cmLocalVisualStudio7GeneratorOptions::FixExceptionHandlingDefault()
+{
   // Exception handling is on by default because the platform file has
   // "/EHsc" in the flags.  Normally, that will override this
   // initialization to off, but the user has the option of removing

Index: cmSetTargetPropertiesCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetTargetPropertiesCommand.cxx,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -d -r1.3.2.1 -r1.3.2.2
--- cmSetTargetPropertiesCommand.cxx	14 May 2006 19:22:43 -0000	1.3.2.1
+++ cmSetTargetPropertiesCommand.cxx	15 Feb 2007 17:45:07 -0000	1.3.2.2
@@ -15,6 +15,8 @@
 
 =========================================================================*/
 #include "cmSetTargetPropertiesCommand.h"
+#include "cmLocalGenerator.h"
+#include "cmGlobalGenerator.h"
 
 // cmSetTargetPropertiesCommand
 bool cmSetTargetPropertiesCommand::InitialPass(
@@ -71,25 +73,26 @@
      return false;
     }
   
-  cmTargets& targets = this->Makefile->GetTargets();
   // now loop over all the targets
   int i;
-  unsigned int k;
   for(i = 0; i < numFiles; ++i)
     {   
     // if the file is already in the makefile just set properites on it
-    cmTargets::iterator t = targets.find(args[i]);
-    if ( t != targets.end())
+    cmTarget* target = 
+      this->GetMakefile()
+      ->GetLocalGenerator()->GetGlobalGenerator()->FindTarget(0, 
+                                                              args[i].c_str());
+    if ( target )
       {
-      cmTarget& target = t->second;
       // now loop through all the props and set them
+      unsigned int k;
       for (k = 0; k < propertyPairs.size(); k = k + 2)
         {
-        target.SetProperty(propertyPairs[k].c_str(),
-                           propertyPairs[k+1].c_str());
+        target->SetProperty(propertyPairs[k].c_str(),
+                            propertyPairs[k+1].c_str());
         }
       }
-    // if file is not already in the makefile, then add it
+    // if file is not already in the makefile, then report error
     else
       { 
       std::string message = "Can not find target to add properties to: ";

Index: cmIfCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.cxx,v
retrieving revision 1.62.2.4
retrieving revision 1.62.2.5
diff -u -d -r1.62.2.4 -r1.62.2.5
--- cmIfCommand.cxx	27 Oct 2006 20:01:47 -0000	1.62.2.4
+++ cmIfCommand.cxx	15 Feb 2007 17:45:07 -0000	1.62.2.5
@@ -22,10 +22,24 @@
 bool cmIfFunctionBlocker::
 IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
 {
-  // always let if statements through
+  // if we are blocking then all we need to do is keep track of 
+  // scope depth of nested if statements
+  if (this->IsBlocking)
+    {
   if (!cmSystemTools::Strucmp(lff.Name.c_str(),"if"))
     {
-    return false;
+      this->ScopeDepth++;
+      return true;
+      }
+    }
+
+  if (this->IsBlocking && this->ScopeDepth)
+    {
+    if (!cmSystemTools::Strucmp(lff.Name.c_str(),"endif"))
+      {
+      this->ScopeDepth--;
+      }
+    return true;
     }
   
   // watch for our ELSE or ENDIF

Index: cmIfCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.h,v
retrieving revision 1.32.2.4
retrieving revision 1.32.2.5
diff -u -d -r1.32.2.4 -r1.32.2.5
--- cmIfCommand.h	27 Oct 2006 20:01:47 -0000	1.32.2.4
+++ cmIfCommand.h	15 Feb 2007 17:45:07 -0000	1.32.2.5
@@ -28,7 +28,7 @@
 class cmIfFunctionBlocker : public cmFunctionBlocker
 {
 public:
-  cmIfFunctionBlocker() {this->HasRun = false;}
+  cmIfFunctionBlocker() {this->HasRun = false; this->ScopeDepth = 0;}
   virtual ~cmIfFunctionBlocker() {}
   virtual bool IsFunctionBlocked(const cmListFileFunction& lff,
                                  cmMakefile &mf);
@@ -39,6 +39,7 @@
   std::vector<cmListFileArgument> Args;
   bool IsBlocking;
   bool HasRun;
+  unsigned int ScopeDepth;
 };
 
 /** \class cmIfCommand



More information about the Cmake-commits mailing list