[Cmake-commits] CMake branch, next, updated. v2.8.7-2896-g6ba8264

Brad King brad.king at kitware.com
Mon Feb 27 08:43:55 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  6ba826427629355ba6a9b1eb58da568c8b0ce0e4 (commit)
       via  c89c879ea76e5f0cc296d5e381bf55919c334c12 (commit)
       via  a592c45165356dae467fefeec97ee1df7cf70805 (commit)
      from  777ac873f22fe478606a1e1a39c9f62dde69c1ac (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ba826427629355ba6a9b1eb58da568c8b0ce0e4
commit 6ba826427629355ba6a9b1eb58da568c8b0ce0e4
Merge: 777ac87 c89c879
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Feb 27 08:43:53 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Feb 27 08:43:53 2012 -0500

    Merge topic 'simplify-PropertyMap' into next
    
    c89c879 Remove cmProperty.{h,cxx}
    a592c45 Drop cmProperty class


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c89c879ea76e5f0cc296d5e381bf55919c334c12
commit c89c879ea76e5f0cc296d5e381bf55919c334c12
Author:     Yury G. Kudryashov <urkud.urkud at gmail.com>
AuthorDate: Sat Feb 25 12:07:37 2012 +0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Feb 27 08:26:59 2012 -0500

    Remove cmProperty.{h,cxx}
    
    After previous commit cmProperty.h contained only one enum. Move it to
    cmPropertyMap.h.

diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 0c420b9..e8404ff 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -225,8 +225,6 @@ SET(SRCS
   cmPolicies.cxx
   cmProcessTools.cxx
   cmProcessTools.h
-  cmProperty.cxx
-  cmProperty.h
   cmPropertyDefinition.cxx
   cmPropertyDefinition.h
   cmPropertyDefinitionMap.cxx
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index 11bef16..0bf3669 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -13,7 +13,7 @@
 #define _cmDocumentation_h
 
 #include "cmStandardIncludes.h"
-#include "cmProperty.h"
+#include "cmPropertyMap.h"
 #include "cmDocumentationFormatter.h"
 #include "cmDocumentationFormatterHTML.h"
 #include "cmDocumentationFormatterDocbook.h"
diff --git a/Source/cmProperty.cxx b/Source/cmProperty.cxx
deleted file mode 100644
index e69de29..0000000
diff --git a/Source/cmProperty.h b/Source/cmProperty.h
deleted file mode 100644
index a2b3219..0000000
--- a/Source/cmProperty.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#ifndef cmProperty_h
-#define cmProperty_h
-
-namespace cmProperty
-{
-  enum ScopeType { TARGET, SOURCE_FILE, DIRECTORY, GLOBAL, CACHE,
-                   TEST, VARIABLE, CACHED_VARIABLE };
-}
-
-#endif
diff --git a/Source/cmPropertyDefinition.h b/Source/cmPropertyDefinition.h
index 898e13b..e1c2648 100644
--- a/Source/cmPropertyDefinition.h
+++ b/Source/cmPropertyDefinition.h
@@ -12,7 +12,7 @@
 #ifndef cmPropertyDefinition_h
 #define cmPropertyDefinition_h
 
-#include "cmProperty.h"
+#include "cmPropertyMap.h"
 #include "cmStandardIncludes.h"
 
 class cmPropertyDefinition 
diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h
index add5aad..9759a27 100644
--- a/Source/cmPropertyMap.h
+++ b/Source/cmPropertyMap.h
@@ -12,11 +12,16 @@
 #ifndef cmPropertyMap_h
 #define cmPropertyMap_h
 
-#include "cmProperty.h"
 #include "cmStandardIncludes.h"
 
 class cmake;
 
+namespace cmProperty
+{
+  enum ScopeType { TARGET, SOURCE_FILE, DIRECTORY, GLOBAL, CACHE,
+                   TEST, VARIABLE, CACHED_VARIABLE };
+}
+
 class cmPropertyMap : public std::map<cmStdString,cmStdString>
 {
 public:
diff --git a/bootstrap b/bootstrap
index f5eacbd..327f6c8 100755
--- a/bootstrap
+++ b/bootstrap
@@ -188,7 +188,6 @@ CMAKE_CXX_SOURCES="\
   cmDocumentationFormatter \
   cmDocumentationFormatterText \
   cmPolicies \
-  cmProperty \
   cmPropertyMap \
   cmPropertyDefinition \
   cmPropertyDefinitionMap \

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a592c45165356dae467fefeec97ee1df7cf70805
commit a592c45165356dae467fefeec97ee1df7cf70805
Author:     Yury G. Kudryashov <urkud.urkud at gmail.com>
AuthorDate: Sat Feb 25 12:07:36 2012 +0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Feb 27 08:26:59 2012 -0500

    Drop cmProperty class
    
    This class contains nothing but name (already stored in cmPropertyMap key) and
    value (string).

diff --git a/Source/cmProperty.cxx b/Source/cmProperty.cxx
index 3b37cf3..e69de29 100644
--- a/Source/cmProperty.cxx
+++ b/Source/cmProperty.cxx
@@ -1,40 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#include "cmProperty.h"
-#include "cmSystemTools.h"
-
-void cmProperty::Set(const char *name, const char *value)
-{
-  this->Name = name;
-  this->Value = value;
-  this->ValueHasBeenSet = true;
-}
-
-void cmProperty::Append(const char *name, const char *value, bool asString)
-{
-  this->Name = name;
-  if(!this->Value.empty() && *value && !asString)
-    {
-    this->Value += ";";
-    }
-  this->Value += value;
-  this->ValueHasBeenSet = true;
-}
-
-const char *cmProperty::GetValue() const
-{
-  if (this->ValueHasBeenSet)
-    {
-    return this->Value.c_str();
-    }
-  return 0;
-}
diff --git a/Source/cmProperty.h b/Source/cmProperty.h
index e0fcd63..a2b3219 100644
--- a/Source/cmProperty.h
+++ b/Source/cmProperty.h
@@ -12,30 +12,10 @@
 #ifndef cmProperty_h
 #define cmProperty_h
 
-#include "cmStandardIncludes.h"
-
-class cmProperty 
+namespace cmProperty
 {
-public:
   enum ScopeType { TARGET, SOURCE_FILE, DIRECTORY, GLOBAL, CACHE,
                    TEST, VARIABLE, CACHED_VARIABLE };
-
-  // set this property
-  void Set(const char *name, const char *value);
-
-  // append to this property
-  void Append(const char *name, const char *value, bool asString = false);
-
-  // get the value
-  const char *GetValue() const;
-
-  // construct with the value not set
-  cmProperty() { this->ValueHasBeenSet = false; };
-
-protected:
-  std::string Name;
-  std::string Value;
-  bool ValueHasBeenSet;
-};
+}
 
 #endif
diff --git a/Source/cmPropertyDefinition.h b/Source/cmPropertyDefinition.h
index f68db87..898e13b 100644
--- a/Source/cmPropertyDefinition.h
+++ b/Source/cmPropertyDefinition.h
@@ -13,6 +13,7 @@
 #define cmPropertyDefinition_h
 
 #include "cmProperty.h"
+#include "cmStandardIncludes.h"
 
 class cmPropertyDefinition 
 {
diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx
index a4d0bf3..74bbec6 100644
--- a/Source/cmPropertyMap.cxx
+++ b/Source/cmPropertyMap.cxx
@@ -13,21 +13,6 @@
 #include "cmSystemTools.h"
 #include "cmake.h"
 
-cmProperty *cmPropertyMap::GetOrCreateProperty(const char *name)
-{
-  cmPropertyMap::iterator it = this->find(name);
-  cmProperty *prop;
-  if (it == this->end())
-    {
-    prop = &(*this)[name];
-    }
-  else
-    {
-    prop = &(it->second);
-    }
-  return prop;
-}
-
 void cmPropertyMap::SetProperty(const char *name, const char *value,
                                 cmProperty::ScopeType scope)
 {
@@ -54,8 +39,7 @@ void cmPropertyMap::SetProperty(const char *name, const char *value,
   (void)scope;
 #endif
 
-  cmProperty *prop = this->GetOrCreateProperty(name);
-  prop->Set(name,value);
+  (*this)[name] = value;
 }
 
 void cmPropertyMap::AppendProperty(const char* name, const char* value,
@@ -80,8 +64,12 @@ void cmPropertyMap::AppendProperty(const char* name, const char* value,
   (void)scope;
 #endif
 
-  cmProperty *prop = this->GetOrCreateProperty(name);
-  prop->Append(name,value,asString);
+  cmStdString &old = (*this)[name];
+  if(!old.empty() && !asString)
+    {
+    old += ";";
+    }
+  old += value;
 }
 
 const char *cmPropertyMap
@@ -118,6 +106,6 @@ const char *cmPropertyMap
       }
     return 0;
     }
-  return it->second.GetValue();
+  return it->second.c_str();
 }
 
diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h
index 94275e2..add5aad 100644
--- a/Source/cmPropertyMap.h
+++ b/Source/cmPropertyMap.h
@@ -13,14 +13,13 @@
 #define cmPropertyMap_h
 
 #include "cmProperty.h"
+#include "cmStandardIncludes.h"
 
 class cmake;
 
-class cmPropertyMap : public std::map<cmStdString,cmProperty>
+class cmPropertyMap : public std::map<cmStdString,cmStdString>
 {
 public:
-  cmProperty *GetOrCreateProperty(const char *name);
-
   void SetProperty(const char *name, const char *value, 
                    cmProperty::ScopeType scope);
 
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index e0892b2..45e3cd2 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -57,7 +57,7 @@ void cmTestGenerator::GenerateScriptConfigs(std::ostream& os,
       for ( pit = mpit->begin(); pit != mpit->end(); ++ pit )
         {
         fout << " " << pit->first
-             << " " << lg->EscapeForCMake(pit->second.GetValue());
+             << " " << lg->EscapeForCMake(pit->second.c_str());
         }
       fout << ")" << std::endl;
       }

-----------------------------------------------------------------------

Summary of changes:
 Source/CMakeLists.txt         |    2 --
 Source/cmDocumentation.h      |    2 +-
 Source/cmProperty.cxx         |   40 ----------------------------------------
 Source/cmProperty.h           |   41 -----------------------------------------
 Source/cmPropertyDefinition.h |    3 ++-
 Source/cmPropertyMap.cxx      |   28 ++++++++--------------------
 Source/cmPropertyMap.h        |   12 ++++++++----
 Source/cmTestGenerator.cxx    |    2 +-
 bootstrap                     |    1 -
 9 files changed, 20 insertions(+), 111 deletions(-)
 delete mode 100644 Source/cmProperty.cxx
 delete mode 100644 Source/cmProperty.h


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list