[cmake-commits] martink committed CMakeLists.txt 1.316 1.317 cmAuxSourceDirectoryCommand.cxx 1.21 1.22 cmCPluginAPI.cxx 1.32 1.33 cmCPluginAPI.h 1.24 1.25 cmCommands.cxx 1.106 1.107 cmCreateTestSourceList.cxx 1.40 1.41 cmDocumentation.cxx 1.36 1.37 cmDocumentation.h 1.15 1.16 cmFLTKWrapUICommand.cxx 1.31 1.32 cmForEachCommand.cxx 1.24 1.25 cmGlobalGenerator.cxx 1.164 1.165 cmIfCommand.cxx 1.74 1.75 cmInstallFilesCommand.cxx 1.22 1.23 cmInstallProgramsCommand.cxx 1.15 1.16 cmLocalGenerator.cxx 1.167 1.168 cmMacroCommand.cxx 1.32 1.33 cmMakefile.cxx 1.369 1.370 cmMakefile.h 1.197 1.198 cmPropertyMap.cxx 1.1 1.2 cmSetDirectoryPropertiesCommand.cxx 1.4 1.5 cmSetDirectoryPropertiesCommand.h 1.4 1.5 cmSetTargetPropertiesCommand.cxx 1.4 1.5 cmSetTargetPropertiesCommand.h 1.28 1.29 cmSourceFile.cxx 1.33 1.34 cmSourceFile.h 1.17 1.18 cmTarget.cxx 1.115 1.116 cmTarget.h 1.66 1.67 cmTest.cxx 1.4 1.5 cmTest.h 1.4 1.5 cmVTKMakeInstantiatorCommand.cxx 1.26 1.27 cmVTKWrapJavaCommand.cxx 1.32 1.33 cmVTKWrapPythonCommand.cxx 1.35 1.36 cmVTKWrapTclCommand.cxx 1.42 1.43 cmWhileCommand.cxx 1.8 1.9 cmake.cxx 1.275 1.276 cmake.h 1.74 1.75 cmakemain.cxx 1.55 1.56

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Dec 7 09:44:48 EST 2006


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

Modified Files:
	CMakeLists.txt cmAuxSourceDirectoryCommand.cxx 
	cmCPluginAPI.cxx cmCPluginAPI.h cmCommands.cxx 
	cmCreateTestSourceList.cxx cmDocumentation.cxx 
	cmDocumentation.h cmFLTKWrapUICommand.cxx cmForEachCommand.cxx 
	cmGlobalGenerator.cxx cmIfCommand.cxx 
	cmInstallFilesCommand.cxx cmInstallProgramsCommand.cxx 
	cmLocalGenerator.cxx cmMacroCommand.cxx cmMakefile.cxx 
	cmMakefile.h cmPropertyMap.cxx 
	cmSetDirectoryPropertiesCommand.cxx 
	cmSetDirectoryPropertiesCommand.h 
	cmSetTargetPropertiesCommand.cxx 
	cmSetTargetPropertiesCommand.h cmSourceFile.cxx cmSourceFile.h 
	cmTarget.cxx cmTarget.h cmTest.cxx cmTest.h 
	cmVTKMakeInstantiatorCommand.cxx cmVTKWrapJavaCommand.cxx 
	cmVTKWrapPythonCommand.cxx cmVTKWrapTclCommand.cxx 
	cmWhileCommand.cxx cmake.cxx cmake.h cmakemain.cxx 
Log Message:
ENH: make properties a bit more formal with documentation and chaining


Index: cmDocumentation.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentation.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- cmDocumentation.h	14 Apr 2006 03:15:48 -0000	1.15
+++ cmDocumentation.h	7 Dec 2006 14:44:45 -0000	1.16
@@ -29,7 +29,8 @@
   // High-level interface for standard documents:
   
   /** Types of help provided.  */
-  enum Type { None, Usage, Single, SingleModule, List, ModuleList,
+  enum Type { None, Usage, Single, SingleModule, SingleProperty,
+              List, ModuleList, PropertyList,
               Full, HTML, Man, Copyright, Version };
   
   /**
@@ -70,6 +71,9 @@
   /** Set the listfile commands for standard document generation.  */
   void SetCommandsSection(const cmDocumentationEntry*);
   
+  /** Set the properties for standard document generation.  */
+  void SetPropertiesSection(const cmDocumentationEntry*);
+
   /** Set the generator descriptions for standard document generation.  */
   void SetGeneratorsSection(const cmDocumentationEntry*);
   
@@ -132,8 +136,10 @@
   bool PrintVersion(std::ostream& os);
   bool PrintDocumentationList(std::ostream& os);
   bool PrintModuleList(std::ostream& os);
+  bool PrintPropertyList(std::ostream& os);
   bool PrintDocumentationSingle(std::ostream& os);
   bool PrintDocumentationSingleModule(std::ostream& os);
+  bool PrintDocumentationSingleProperty(std::ostream& os);
   bool PrintDocumentationUsage(std::ostream& os);
   bool PrintDocumentationFull(std::ostream& os);
   bool PrintDocumentationHTML(std::ostream& os);
@@ -159,11 +165,13 @@
   std::vector<cmDocumentationEntry> OptionsSection;
   std::vector<cmDocumentationEntry> CommandsSection;
   std::vector<cmDocumentationEntry> ModulesSection;
+  std::vector<cmDocumentationEntry> PropertiesSection;
   std::vector<cmDocumentationEntry> GeneratorsSection;
   std::vector<cmDocumentationEntry> SeeAlsoSection;
   std::string SeeAlsoString;
   std::string SingleCommand;
   std::string SingleModuleName;
+  std::string SinglePropertyName;
   std::string CMakeRoot;
   std::vector< char* > ModuleStrings;
   std::vector< const char* > Names;

Index: cmIfCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.cxx,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- cmIfCommand.cxx	16 Nov 2006 20:31:34 -0000	1.74
+++ cmIfCommand.cxx	7 Dec 2006 14:44:45 -0000	1.75
@@ -96,7 +96,8 @@
 {
   if (!cmSystemTools::Strucmp(lff.Name.c_str(),"endif"))
     {
-    if (mf.IsOn("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS") 
+    if (cmSystemTools::IsOn
+        (mf.GetPropertyOrDefinition("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS"))
         || lff.Arguments == this->Args)
       {
       return true;

Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -d -r1.167 -r1.168
--- cmLocalGenerator.cxx	7 Dec 2006 04:05:10 -0000	1.167
+++ cmLocalGenerator.cxx	7 Dec 2006 14:44:45 -0000	1.168
@@ -117,6 +117,7 @@
   this->GlobalGenerator = gg;
 
   // setup the home directories
+  this->Makefile->GetProperties().SetCMakeInstance(gg->GetCMakeInstance());
   this->Makefile->SetHomeDirectory(
     gg->GetCMakeInstance()->GetHomeDirectory());
   this->Makefile->SetHomeOutputDirectory(
@@ -200,15 +201,15 @@
       fout << "\"";
       }
     fout << ")" << std::endl;
-    std::map<cmStdString,cmStdString>::const_iterator pit;
-    const std::map<cmStdString,cmStdString>* mpit = &test->GetProperties();
+    cmPropertyMap::const_iterator pit;
+    cmPropertyMap* mpit = &test->GetProperties();
     if ( mpit->size() )
       {
       fout << "SET_TESTS_PROPERTIES(" << test->GetName() << " PROPERTIES ";
       for ( pit = mpit->begin(); pit != mpit->end(); ++ pit )
         {
         fout << " " << pit->first.c_str() << " \"";
-        const char* value = pit->second.c_str();
+        const char* value = pit->second.GetValue();
         for ( ; *value; ++ value )
           {
           switch ( *value )

Index: cmake.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.h,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- cmake.h	29 Nov 2006 20:59:16 -0000	1.74
+++ cmake.h	7 Dec 2006 14:44:46 -0000	1.75
@@ -41,6 +41,8 @@
 #define cmake_h
 
 #include "cmSystemTools.h"
+#include "cmPropertyDefinitionMap.h"
+#include "cmPropertyMap.h"
 
 class cmGlobalGenerator;
 class cmLocalGenerator;
@@ -235,8 +237,18 @@
   cmVariableWatch* GetVariableWatch() { return this->VariableWatch; }
 
   void GetCommandDocumentation(std::vector<cmDocumentationEntry>&) const;
+  void GetPropertiesDocumentation(std::vector<cmDocumentationEntry>&);
   void GetGeneratorDocumentation(std::vector<cmDocumentationEntry>&);
 
+  ///! Set/Get a property of this target file
+  void SetProperty(const char *prop, const char *value);
+  const char *GetProperty(const char *prop);
+  const char *GetProperty(const char *prop, cmProperty::ScopeType scope);
+  bool GetPropertyAsBool(const char *prop);
+
+  // Get the properties
+  cmPropertyMap &GetProperties() { return this->Properties; };
+
   ///! Do all the checks before running configure
   int DoPreConfigureChecks();
 
@@ -278,7 +290,24 @@
   bool GetDebugOutput() { return this->DebugOutput; }
   void DebugOutputOn() { this->DebugOutput = true;}
 
+  // Define a property
+  void DefineProperty(const char *name, cmProperty::ScopeType scope,
+                      const char *ShortDescription,
+                      const char *FullDescription,
+                      bool chain = false);
+
+  // Is a property defined?
+  bool IsPropertyDefined(const char *name, cmProperty::ScopeType scope);
+  bool IsPropertyChained(const char *name, cmProperty::ScopeType scope);
+
 protected:
+  cmPropertyMap Properties;
+  cmPropertyDefinitionMap TargetProperties;
+  cmPropertyDefinitionMap SourceFileProperties;
+  cmPropertyDefinitionMap DirectoryProperties;
+  cmPropertyDefinitionMap TestProperties;
+  cmPropertyDefinitionMap GlobalProperties;
+  
   typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)();
   typedef std::map<cmStdString,
                    CreateGeneratorFunctionType> RegisteredGeneratorsMap;

Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -d -r1.164 -r1.165
--- cmGlobalGenerator.cxx	29 Nov 2006 20:59:15 -0000	1.164
+++ cmGlobalGenerator.cxx	7 Dec 2006 14:44:45 -0000	1.165
@@ -1595,6 +1595,7 @@
 {
   // Package
   cmTarget target;
+  target.GetProperties().SetCMakeInstance(this->CMakeInstance);
   target.SetType(cmTarget::GLOBAL_TARGET, name);
   target.SetInAll(false);
 

Index: cmDocumentation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentation.cxx,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- cmDocumentation.cxx	16 Oct 2006 18:52:31 -0000	1.36
+++ cmDocumentation.cxx	7 Dec 2006 14:44:45 -0000	1.37
@@ -52,6 +52,14 @@
 };
 
 //----------------------------------------------------------------------------
+static const cmDocumentationEntry cmDocumentationPropertiesHeader[] =
+{
+  {0,
+   "The following properties are available in CMakeLists.txt code:", 0},
+  {0,0,0}
+};
+
+//----------------------------------------------------------------------------
 static const cmDocumentationEntry cmDocumentationModulesHeader[] =
 {
   {0,
@@ -226,8 +234,11 @@
       return this->PrintDocumentationSingle(os);
     case cmDocumentation::SingleModule:  
       return this->PrintDocumentationSingleModule(os);
+    case cmDocumentation::SingleProperty:  
+      return this->PrintDocumentationSingleProperty(os);
     case cmDocumentation::List:      return this->PrintDocumentationList(os);
     case cmDocumentation::ModuleList: return this->PrintModuleList(os);
+    case cmDocumentation::PropertyList: return this->PrintPropertyList(os);
     case cmDocumentation::Full:      return this->PrintDocumentationFull(os);
     case cmDocumentation::HTML:      return this->PrintDocumentationHTML(os);
     case cmDocumentation::Man:       return this->PrintDocumentationMan(os);
@@ -470,6 +481,15 @@
         i = i+1;
         }
       }
+    else if(strcmp(argv[i], "--help-property") == 0)
+      {
+      type = cmDocumentation::SingleProperty;
+      if((i+1 < argc) && !this->IsOption(argv[i+1]))
+        {
+        this->SinglePropertyName = argv[i+1];
+        i = i+1;
+        }
+      }
     else if(strcmp(argv[i], "--help-command-list") == 0)
       {
       type = cmDocumentation::List;
@@ -478,6 +498,10 @@
       {
       type = cmDocumentation::ModuleList;
       }
+    else if(strcmp(argv[i], "--help-property-list") == 0)
+      {
+      type = cmDocumentation::PropertyList;
+      }
     else if(strcmp(argv[i], "--copyright") == 0)
       {
       type = cmDocumentation::Copyright;
@@ -556,6 +580,13 @@
 }
 
 //----------------------------------------------------------------------------
+void cmDocumentation::SetPropertiesSection(const cmDocumentationEntry* section)
+{
+  this->SetSection(cmDocumentationPropertiesHeader, section, 0,
+                   this->PropertiesSection);
+}
+
+//----------------------------------------------------------------------------
 void cmDocumentation
 ::SetGeneratorsSection(const cmDocumentationEntry* section)
 {
@@ -1119,6 +1150,35 @@
 }
 
 //----------------------------------------------------------------------------
+bool cmDocumentation::PrintDocumentationSingleProperty(std::ostream& os)
+{
+  if(this->PropertiesSection.empty())
+    {
+    os << "Internal error: properties list is empty." << std::endl;
+    return false;
+    }
+  if(this->SinglePropertyName.length() == 0)
+    {
+    os << "Argument --help-property needs a property name.\n";
+    return false;
+    }
+  for(cmDocumentationEntry* entry = &this->PropertiesSection[0];
+      entry->brief; ++entry)
+    {
+    if(entry->name && this->SinglePropertyName == entry->name)
+      {
+      this->PrintDocumentationCommand(os, entry);
+      return true;
+      }
+    }
+  // Argument was not a command.  Complain.
+  os << "Argument \"" << this->SinglePropertyName.c_str()
+     << "\" to --help-property is not a CMake property.  "
+     << "Use --help-property-list to see all properties.\n";
+  return false;
+}
+
+//----------------------------------------------------------------------------
 bool cmDocumentation::PrintDocumentationList(std::ostream& os)
 {
   if(this->CommandsSection.empty())
@@ -1138,6 +1198,25 @@
 }
 
 //----------------------------------------------------------------------------
+bool cmDocumentation::PrintPropertyList(std::ostream& os)
+{
+  if(this->PropertiesSection.empty())
+    {
+    os << "Internal error: properties list is empty." << std::endl;
+    return false;
+    }
+  for(cmDocumentationEntry* entry = &this->PropertiesSection[0];
+      entry->brief; ++entry)
+    {
+    if(entry->name)
+      {
+      os << entry->name << std::endl;
+      }
+    }
+  return true;
+}
+
+//----------------------------------------------------------------------------
 bool cmDocumentation::PrintModuleList(std::ostream& os)
 {
   this->CreateModulesSection();
@@ -1261,6 +1340,10 @@
     {
     this->AddSection("Standard CMake Modules", &this->ModulesSection[0]);
     }
+  if(!this->PropertiesSection.empty())
+    {
+    this->AddSection("Standard Properties", &this->PropertiesSection[0]);
+    }
   this->AddSection("Copyright", cmDocumentationCopyright);
   this->AddSection("See Also", cmDocumentationStandardSeeAlso);
 }

Index: cmTarget.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.h,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- cmTarget.h	29 Nov 2006 16:00:17 -0000	1.66
+++ cmTarget.h	7 Dec 2006 14:44:45 -0000	1.67
@@ -18,7 +18,9 @@
 #define cmTarget_h
 
 #include "cmCustomCommand.h"
+#include "cmPropertyMap.h"
 
+class cmake;
 class cmMakefile;
 class cmSourceFile;
 class cmGlobalGenerator;
@@ -165,6 +167,7 @@
   ///! Set/Get a property of this target file
   void SetProperty(const char *prop, const char *value);
   const char *GetProperty(const char *prop);
+  const char *GetProperty(const char *prop, cmProperty::ScopeType scope);
   bool GetPropertyAsBool(const char *prop);
 
   /** Get the directory in which this target will be built.  If the
@@ -249,6 +252,12 @@
   std::string GetInstallNameDirForBuildTree(const char* config);
   std::string GetInstallNameDirForInstallTree(const char* config);
 
+  // Get the properties
+  cmPropertyMap &GetProperties() { return this->Properties; };
+
+  // Define the properties
+  static void DefineProperties(cmake *cm);
+
 private:
   /**
    * A list of direct dependencies. Use in conjunction with DependencyMap.
@@ -320,6 +329,7 @@
   // Use a makefile variable to set a default for the given property.
   // If the variable is not defined use the given default instead.
   void SetPropertyDefault(const char* property, const char* default_value);
+
 private:
   std::string Name;
   std::vector<cmCustomCommand> PreBuildCommands;
@@ -342,7 +352,7 @@
   std::string Location;
   std::set<cmStdString> Utilities;
   bool RecordDependencies; 
-  std::map<cmStdString,cmStdString> Properties;
+  cmPropertyMap Properties;
   LinkLibraryVectorType OriginalLinkLibraries;
 
   // The cmMakefile instance that owns this target.  This should

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CMakeLists.txt,v
retrieving revision 1.316
retrieving revision 1.317
diff -u -d -r1.316 -r1.317
--- CMakeLists.txt	7 Dec 2006 04:05:10 -0000	1.316
+++ CMakeLists.txt	7 Dec 2006 14:44:45 -0000	1.317
@@ -146,10 +146,10 @@
   cmProperty.h
   cmPropertyDefinition.cxx
   cmPropertyDefinition.h
-#  cmPropertyDefinitionMap.cxx
-#  cmPropertyDefinitionMap.h
-#  cmPropertyMap.cxx
-#  cmPropertyMap.h
+  cmPropertyDefinitionMap.cxx
+  cmPropertyDefinitionMap.h
+  cmPropertyMap.cxx
+  cmPropertyMap.h
   cmSourceFile.cxx
   cmSourceFile.h
   cmSourceGroup.cxx

Index: cmAuxSourceDirectoryCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAuxSourceDirectoryCommand.cxx,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- cmAuxSourceDirectoryCommand.cxx	10 May 2006 17:50:44 -0000	1.21
+++ cmAuxSourceDirectoryCommand.cxx	7 Dec 2006 14:44:45 -0000	1.22
@@ -69,6 +69,8 @@
           // add the file as a class file so 
           // depends can be done
           cmSourceFile cmfile;
+          cmfile.GetProperties().SetCMakeInstance
+            (this->Makefile->GetCMakeInstance());
           cmfile.SetName(fullname.c_str(), 
                          this->Makefile->GetCurrentDirectory(),
                          this->Makefile->GetSourceExtensions(),

Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -d -r1.115 -r1.116
--- cmTarget.cxx	7 Dec 2006 04:05:10 -0000	1.115
+++ cmTarget.cxx	7 Dec 2006 14:44:45 -0000	1.116
@@ -15,6 +15,7 @@
 
 =========================================================================*/
 #include "cmTarget.h"
+#include "cmake.h"
 #include "cmMakefile.h"
 #include "cmSourceFile.h"
 #include "cmLocalGenerator.h"
@@ -36,6 +37,230 @@
   this->LinkLibrariesAnalyzed = false;
   this->LinkDirectoriesComputed = false;
   this->HaveInstallRule = false;
+
+}
+
+// define properties
+void cmTarget::DefineProperties(cmake *cm)
+{
+  cm->DefineProperty
+    ("BUILD_WITH_INSTALL_RPATH", cmProperty::TARGET, 
+     "Should build tree targets have install tree rpaths.",
+     "BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link "
+     "the target in the build tree with the INSTALL_RPATH.  This takes "
+     "precedence over SKIP_BUILD_RPATH and avoids the need for relinking "
+     "before installation.");
+
+  cm->DefineProperty
+    ("CLEAN_DIRECT_OUTPUT", cmProperty::TARGET, 
+     "Do not delete other varients of this target.",
+     "When a library is built CMake by default generates code to remove "
+     "any existing library using all possible names.  This is needed "
+     "to support libraries that switch between STATIC and SHARED by "
+     "a user option.  However when using OUTPUT_NAME to build a static "
+     "and shared library of the same name using different logical target "
+     "names the two targets will remove each other's files.  This can be "
+     "prevented by setting the CLEAN_DIRECT_OUTPUT property to 1.");
+
+  cm->DefineProperty
+    ("COMPILE_FLAGS", cmProperty::TARGET, 
+     "Additional flags to yse when compiling this target's sources.",
+     "The COMPILE_FLAGS property sets additional compiler flags used "
+     "to build sources within the target.  It may also be used to pass "
+     "additional preprocessor definitions.");
+     
+  cm->DefineProperty
+    ("DEFINE_SYMBOL", cmProperty::TARGET, 
+     "Define a symbol when compiling this target's sources.",
+     "DEFINE_SYMBOL sets the name of the preprocessor symbol defined when "
+     "compiling sources in a shared library. "
+     "If not set here then it is set to target_EXPORTS by default "
+     "(with some substitutions if the target is not a valid C "
+     "identifier). This is useful for headers to know whether they are "
+     "being included from inside their library our outside to properly "
+     "setup dllexport/dllimport decorations. ");
+     
+  cm->DefineProperty
+    ("DEBUG_POSTFIX", cmProperty::TARGET, 
+     "A postfix that will be applied to this target when build debug.",
+     "A property on a target that sepcifies a postfix to add to the "
+     "target name when built in debug mode. For example foo.dll "
+     "versus fooD.dll");
+
+  cm->DefineProperty
+    ("EchoString", cmProperty::TARGET, 
+     "A message to be displayed when the target it built.",
+     "A message to display on some generaters (such as makefiles) when "
+     "the target is built.");
+
+  cm->DefineProperty
+    ("HAS_CXX", cmProperty::TARGET, 
+     "Force a target to use the CXX linker.",
+     "Setting HAS_CXX on a target will force the target to use the "
+     "C++ linker (and C++ runtime libraries) for linking even if the "
+     "target has no C++ code in it.");
+
+  cm->DefineProperty
+    ("IMPORT_PREFIX", cmProperty::TARGET, 
+     "What comes before the import library name.",
+     "Similar to the target property PREFIX, but used for import libraries "
+     "(typically corresponding to a DLL) instead of regular libraries. "
+     "A target property that can be set to override the prefix "
+     "(such as \"lib\") on an import library name.");
+
+  cm->DefineProperty
+    ("IMPORT_SUFFIX", cmProperty::TARGET, 
+     "What comes after the import library name.",
+     "Similar to the target property SUFFIX, but used for import libraries "
+     "(typically corresponding to a DLL) instead of regular libraries. "
+     "A target property that can be set to override the suffix "
+     "(such as \".lib\") on an import library name.");
+
+  cm->DefineProperty
+    ("IN_ALL", cmProperty::TARGET, 
+     "Is this target part of the all target.",
+     "A property on a target that indicates if the target is included as "
+     "part of the default build target. If it is, then with a Makefile "
+     "for example typing make will couse this target to be built as well. "
+     "The same concept applies to the default build of other generators.");
+
+  cm->DefineProperty
+    ("INSTALL_NAME_DIR", cmProperty::TARGET, 
+     "Mac OSX directory name for installed targets.",
+     "INSTALL_NAME_DIR is a string specifying the "
+     "directory portion of the \"install_name\" field of shared libraries "
+     "on Mac OSX to use in the installed targets. ");
+
+  cm->DefineProperty
+    ("INSTALL_RPATH", cmProperty::TARGET, 
+     "The rpath to use for installed targets.",
+     "A semicolon-separated list specifying the rpath "
+     "to use in installed targets (for platforms that support it).");
+
+  cm->DefineProperty
+    ("INSTALL_RPATH_USE_LINK_PATH", cmProperty::TARGET, 
+     "Add paths to linker search and installed rpath.",
+     "INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to true will "
+     "append directories in the linker search path and outside the "
+     "project to the INSTALL_RPATH. ");
+
+  cm->DefineProperty
+    ("LINK_FLAGS", cmProperty::TARGET, 
+     "Additional flags to use when linking this target.",
+     "The LINK_FLAGS property can be used to add extra flags to the "
+     "link step of a target. LINK_FLAGS_<CONFIG> will add to the "
+     "configuration <CONFIG>, "
+     "for example, DEBUG, RELEASE, MINSIZEREL, RELWITHDEBINFO. ");
+
+  cm->DefineProperty
+    ("LINKER_LANGUAGE", cmProperty::TARGET, 
+     "What tool to use for linking, based on language.",
+     "The LINKER_LANGUAGE property is used to change the tool "
+     "used to link an executable or shared library. The default is "
+     "set the language to match the files in the library. CXX and C "
+     "are common values for this property.");
+
+  cm->DefineProperty
+    ("LOCATION", cmProperty::TARGET, 
+     "Where a target will be written on disk.",
+     "A read only property on a target that indicates where that target "
+     "will be written. For libraries and execuatables this will be where "
+     "the file is written on disk. This property is computed based on a "
+     "number of other settings.");
+
+  cm->DefineProperty
+    ("OUTPUT_NAME", cmProperty::TARGET, 
+     "Sets the real name of a target when it is built.",
+     "Sets the real name of a target when it is built and "
+     "can be used to help create two targets of the same name even though "
+     "CMake requires unique logical target names.  There is also a "
+     "<CONFIG>_OUTPUT_NAME that can set the output name on a "
+     "per-configuration basis.");
+
+  cm->DefineProperty
+    ("PRE_INSTALL_SCRIPT", cmProperty::TARGET, 
+     "Deprecated install support.",
+     "The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the "
+     "old way to specify CMake scripts to run before and after "
+     "installing a target.  They are used only when the old "
+     "INSTALL_TARGETS command is used to install the target.  Use the "
+     "INSTALL command instead.");
+
+  cm->DefineProperty
+    ("PREFIX", cmProperty::TARGET, 
+     "What comes before the library name.",
+     "A target property that can be set to override the prefix "
+     "(such as \"lib\") on a library name.");
+
+  cm->DefineProperty
+    ("POST_INSTALL_SCRIPT", cmProperty::TARGET, 
+     "Deprecated install support.",
+     "The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the "
+     "old way to specify CMake scripts to run before and after "
+     "installing a target.  They are used only when the old "
+     "INSTALL_TARGETS command is used to install the target.  Use the "
+     "INSTALL command instead.");
+
+  cm->DefineProperty
+    ("SKIP_BUILD_RPATH", cmProperty::TARGET, 
+     "Should rpaths be used for the build tree.",
+     "SKIP_BUILD_RPATH is a boolean specifying whether to skip automatic "
+     "generation of an rpath allowing the target to run from the "
+     "build tree. ");
+
+  cm->DefineProperty
+    ("SOVERSION", cmProperty::TARGET, 
+     "What version number is this target.",
+     "For shared libraries VERSION and SOVERSION can be used to specify "
+     "the build version and api version respectively. When building or "
+     "installing appropriate symlinks are created if the platform "
+     "supports symlinks and the linker supports so-names. "
+     "If only one of both is specified the missing is assumed to have "
+     "the same version number. "
+     "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. ");
+
+  cm->DefineProperty
+    ("STATIC_LIBRARY_FLAGS", cmProperty::TARGET, 
+     "Extra flags to use when linking static libraries.",
+     "Extra flags to use when linking a static library.");
+
+  cm->DefineProperty
+    ("SUFFIX", cmProperty::TARGET, 
+     "What comes after the library name.",
+     "A target property that can be set to override the suffix "
+     "(such as \".so\") on a library name.");
+
+  cm->DefineProperty
+    ("VERSION", cmProperty::TARGET, 
+     "What version number is this target.",
+     "For shared libraries VERSION and SOVERSION can be used to specify "
+     "the build version and api version respectively. When building or "
+     "installing appropriate symlinks are created if the platform "
+     "supports symlinks and the linker supports so-names. "
+     "If only one of both is specified the missing is assumed to have "
+     "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. "
+     "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. ");
+
+
+  cm->DefineProperty
+    ("WIN32_EXECUTABLE", cmProperty::TARGET, 
+     "Used to specify Windows executable with a WinMain entry point.",
+     "This can be set to indicate that a target is a Windows executable "
+     "in contrast to a console application for example. This changes "
+     "how the executable will be linked.");
+
+
+  // define some properties without documentation
+  cm->DefineProperty("DEBUG_OUTPUT_NAME", cmProperty::TARGET,0,0);
+  cm->DefineProperty("RELEASE_OUTPUT_NAME", cmProperty::TARGET,0,0);
+  cm->DefineProperty("LINK_FLAGS_DEBUG", cmProperty::TARGET,0,0);
 }
 
 void cmTarget::SetType(TargetType type, const char* name)
@@ -60,6 +285,9 @@
   // Set our makefile.
   this->Makefile = mf;
 
+  // set the cmake instance of the properties
+  this->Properties.SetCMakeInstance(mf->GetCMakeInstance());
+
   // Setup default property values.
   this->SetPropertyDefault("INSTALL_NAME_DIR", "");
   this->SetPropertyDefault("INSTALL_RPATH", "");
@@ -332,6 +560,8 @@
     if (!done)
       {
       cmSourceFile file;
+      file.GetProperties().
+        SetCMakeInstance(this->Makefile->GetCMakeInstance());
       file.SetProperty("ABSTRACT","0");
       file.SetName(temps.c_str(), mf.GetCurrentDirectory(),
                    mf.GetSourceExtensions(),
@@ -841,7 +1071,8 @@
     {
     value = "NOTFOUND";
     }
-  this->Properties[prop] = value;
+
+  this->Properties.SetProperty(prop, value, cmProperty::TARGET);
 }
 
 const char* cmTarget::GetDirectory(const char* config)
@@ -925,6 +1156,12 @@
 
 const char *cmTarget::GetProperty(const char* prop)
 {
+  return this->GetProperty(prop, cmProperty::TARGET);
+}
+
+const char *cmTarget::GetProperty(const char* prop,
+                                  cmProperty::ScopeType scope)
+{
   // watch for special "computed" properties that are dependent on other
   // properties or variables, always recompute them
   if (!strcmp(prop,"LOCATION"))
@@ -984,25 +1221,21 @@
       }
     return 0;
     }
-      
-  std::map<cmStdString,cmStdString>::const_iterator i = 
-    this->Properties.find(prop);
-  if (i != this->Properties.end())
+  
+  bool chain = false;
+  const char *retVal = 
+    this->Properties.GetPropertyValue(prop, scope, chain);
+  if (chain)
     {
-    return i->second.c_str();
+    return this->Makefile->GetProperty(prop,scope);
     }
-  return 0;
+
+  return retVal;    
 }
 
 bool cmTarget::GetPropertyAsBool(const char* prop)
 {
-  std::map<cmStdString,cmStdString>::const_iterator i = 
-    this->Properties.find(prop);
-  if (i != this->Properties.end())
-    {
-    return cmSystemTools::IsOn(i->second.c_str());
-    }
-  return false;
+  return cmSystemTools::IsOn(this->GetProperty(prop));
 }
 
 const char* cmTarget::GetLinkerLanguage(cmGlobalGenerator* gg)

Index: cmSetTargetPropertiesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetTargetPropertiesCommand.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- cmSetTargetPropertiesCommand.h	9 Nov 2006 14:57:23 -0000	1.28
+++ cmSetTargetPropertiesCommand.h	7 Dec 2006 14:44:45 -0000	1.29
@@ -36,7 +36,7 @@
   /**
    * The name of the command as specified in CMakeList.txt.
    */
-  virtual const char* GetName() { return "SET_TARGET_PROPERTIES";}
+  virtual const char* GetName() { return "SET_TARGET_PROPERTIES";}  
 
   /**
    * Succinct documentation.
@@ -47,6 +47,13 @@
     }
   
   /**
+   *  Used by this command and cmSetPropertiesCommand
+   */
+  static bool SetOneTarget(const char *tname, 
+                           std::vector<std::string> &propertyPairs, 
+                           cmMakefile *mf);
+
+  /**
    * Longer documentation.
    */
   virtual const char* GetFullDocumentation()

Index: cmWhileCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmWhileCommand.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cmWhileCommand.cxx	31 May 2006 15:19:39 -0000	1.8
+++ cmWhileCommand.cxx	7 Dec 2006 14:44:45 -0000	1.9
@@ -81,7 +81,8 @@
   if(!cmSystemTools::Strucmp(lff.Name.c_str(),"endwhile"))
     {
     if (lff.Arguments == this->Args
-        || mf.IsOn("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS"))
+        || cmSystemTools::IsOn
+        (mf.GetPropertyOrDefinition("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS")))
       {
       return true;
       }

Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.275
retrieving revision 1.276
diff -u -d -r1.275 -r1.276
--- cmake.cxx	29 Nov 2006 22:45:55 -0000	1.275
+++ cmake.cxx	7 Dec 2006 14:44:45 -0000	1.276
@@ -23,7 +23,9 @@
 #include "cmCommand.h"
 #include "cmFileTimeComparison.h"
 #include "cmGeneratedFileStream.h"
+#include "cmSourceFile.h"
 #include "cmVersion.h"
+#include "cmTest.h"
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
 # include "cmDependsFortran.h" // For -E cmake_copy_f90_mod callback.
@@ -116,6 +118,14 @@
   this->ClearBuildSystem = false;
   this->FileComparison = new cmFileTimeComparison;
 
+  this->Properties.SetCMakeInstance(this);
+
+  // initialize properties
+  cmSourceFile::DefineProperties(this);
+  cmTarget::DefineProperties(this);
+  cmMakefile::DefineProperties(this);
+  cmTest::DefineProperties(this);
+
 #ifdef __APPLE__
   struct rlimit rlp;
   if(!getrlimit(RLIMIT_STACK, &rlp))
@@ -1990,6 +2000,28 @@
   v.push_back(empty);
 }
 
+void cmake::GetPropertiesDocumentation(std::vector<cmDocumentationEntry>& v)
+{
+  // get the properties for cmake
+  
+  // get them for any generators
+
+  // get them for Directories
+  this->DirectoryProperties.GetPropertiesDocumentation(v);
+
+  // get them for targets
+  this->TargetProperties.GetPropertiesDocumentation(v);
+  
+  // get them for source files
+  this->SourceFileProperties.GetPropertiesDocumentation(v);
+  
+  // get them for tests
+  this->TestProperties.GetPropertiesDocumentation(v);
+
+  cmDocumentationEntry empty = {0,0,0};
+  v.push_back(empty);
+}
+
 void cmake::GetGeneratorDocumentation(std::vector<cmDocumentationEntry>& v)
 {
   for(RegisteredGeneratorsMap::const_iterator i = this->Generators.begin();
@@ -2766,3 +2798,111 @@
   // Return the final resulting return value.
   return result;
 }
+
+void cmake::DefineProperty(const char *name, cmProperty::ScopeType scope,
+                           const char *ShortDescription,
+                           const char *FullDescription,
+                           bool chained)
+{
+  switch (scope)
+    {
+    case cmProperty::GLOBAL:
+      this->GlobalProperties.DefineProperty(name,scope,ShortDescription,
+                                            FullDescription, chained);
+      break;
+    case cmProperty::TARGET:
+      this->TargetProperties.DefineProperty(name,scope,ShortDescription,
+                                            FullDescription, chained);
+      break;
+    case cmProperty::SOURCE_FILE:
+      this->SourceFileProperties.DefineProperty(name,scope,ShortDescription,
+                                                FullDescription, chained);
+      break;
+    case cmProperty::DIRECTORY:
+      this->DirectoryProperties.DefineProperty(name,scope,ShortDescription,
+                                               FullDescription, chained);
+      break;
+    case cmProperty::TEST:
+      this->TestProperties.DefineProperty(name,scope,ShortDescription,
+                                          FullDescription, chained);
+      break;
+    }
+}
+
+bool cmake::IsPropertyDefined(const char *name, cmProperty::ScopeType scope)
+{
+  switch (scope)
+    {
+    case cmProperty::GLOBAL:
+      return this->GlobalProperties.IsPropertyDefined(name);
+      break;
+    case cmProperty::TARGET:
+      return this->TargetProperties.IsPropertyDefined(name);
+      break;
+    case cmProperty::SOURCE_FILE:
+      return this->SourceFileProperties.IsPropertyDefined(name);
+      break;
+    case cmProperty::DIRECTORY:
+      return this->DirectoryProperties.IsPropertyDefined(name);
+      break;
+    case cmProperty::TEST:
+      return this->TestProperties.IsPropertyDefined(name);
+      break;
+    }
+
+  return false;
+}
+
+bool cmake::IsPropertyChained(const char *name, cmProperty::ScopeType scope)
+{
+  switch (scope)
+    {
+    case cmProperty::GLOBAL:
+      return this->GlobalProperties.IsPropertyChained(name);
+      break;
+    case cmProperty::TARGET:
+      return this->TargetProperties.IsPropertyChained(name);
+      break;
+    case cmProperty::SOURCE_FILE:
+      return this->SourceFileProperties.IsPropertyChained(name);
+      break;
+    case cmProperty::DIRECTORY:
+      return this->DirectoryProperties.IsPropertyChained(name);
+      break;  
+    case cmProperty::TEST:
+      return this->DirectoryProperties.IsPropertyChained(name);
+      break;
+  }
+
+  return false;
+}
+
+void cmake::SetProperty(const char* prop, const char* value)
+{
+  if (!prop)
+    {
+    return;
+    }
+  if (!value)
+    {
+    value = "NOTFOUND";
+    }
+
+  this->Properties.SetProperty(prop, value, cmProperty::TARGET);
+}
+
+const char *cmake::GetProperty(const char* prop)
+{
+  return this->GetProperty(prop, cmProperty::GLOBAL);
+}
+
+const char *cmake::GetProperty(const char* prop, cmProperty::ScopeType scope)
+{
+  bool chain = false;
+  return this->Properties.GetPropertyValue(prop, scope, chain);
+}
+
+bool cmake::GetPropertyAsBool(const char* prop)
+{
+  return cmSystemTools::IsOn(this->GetProperty(prop));
+}

Index: cmForEachCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmForEachCommand.cxx,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- cmForEachCommand.cxx	31 May 2006 15:19:39 -0000	1.24
+++ cmForEachCommand.cxx	7 Dec 2006 14:44:45 -0000	1.25
@@ -87,7 +87,8 @@
     mf.ExpandArguments(lff.Arguments, expandedArguments);
     if ((!expandedArguments.empty() && 
          (expandedArguments[0] == this->Args[0]))
-        || mf.IsOn("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS"))
+        || cmSystemTools::IsOn
+        (mf.GetPropertyOrDefinition("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS")))
       {
       return true;
       }

Index: cmakemain.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmakemain.cxx,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- cmakemain.cxx	6 Oct 2006 15:11:59 -0000	1.55
+++ cmakemain.cxx	7 Dec 2006 14:44:46 -0000	1.56
@@ -18,6 +18,7 @@
 #include "cmCacheManager.h"
 #include "cmListFileCache.h"
 #include "cmakewizard.h"
+#include "cmSourceFile.h"
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
 #include "cmDynamicLoader.h"
@@ -100,6 +101,13 @@
    "The list contains all modules for which help may be obtained by using "
    "the --help-module argument followed by a module name.  If a file is "
    "specified, the help is written into it."},
+  {"--help-property prop [file]", 
+   "Print help for a single property and exit.",
+   "Full documentation specific to the given module is displayed."},
+  {"--help-property-list [file]", "List available properties and exit.",
+   "The list contains all properties for which help may be obtained by using "
+   "the --help-property argument followed by a property name.  If a file is "
+   "specified, the help is written into it."},
   {0,0,0}
 };
 
@@ -157,8 +165,10 @@
     hcm.AddCMakePaths(av[0]);
     doc.SetCMakeRoot(hcm.GetCacheDefinition("CMAKE_ROOT"));
     std::vector<cmDocumentationEntry> commands;
+    std::vector<cmDocumentationEntry> properties;
     std::vector<cmDocumentationEntry> generators;
     hcm.GetCommandDocumentation(commands);
+    hcm.GetPropertiesDocumentation(properties);
     hcm.GetGeneratorDocumentation(generators);
     doc.SetName("cmake");
     doc.SetNameSection(cmDocumentationName);
@@ -167,6 +177,7 @@
     doc.SetGeneratorsSection(&generators[0]);
     doc.SetOptionsSection(cmDocumentationOptions);
     doc.SetCommandsSection(&commands[0]);
+    doc.SetPropertiesSection(&properties[0]);
     doc.SetSeeAlsoList(cmDocumentationSeeAlso);
     int result = doc.PrintRequestedDocumentation(std::cout)? 0:1;
     

Index: cmVTKMakeInstantiatorCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmVTKMakeInstantiatorCommand.cxx,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- cmVTKMakeInstantiatorCommand.cxx	12 May 2006 18:12:13 -0000	1.26
+++ cmVTKMakeInstantiatorCommand.cxx	7 Dec 2006 14:44:45 -0000	1.27
@@ -164,6 +164,8 @@
   
   // Add the generated source file into the source list.
   cmSourceFile file;
+  file.GetProperties().SetCMakeInstance
+    (this->Makefile->GetCMakeInstance());
   file.SetProperty("WRAP_EXCLUDE","1");
   file.SetProperty("ABSTRACT","0");
   file.SetName(fileName.c_str(), filePath.c_str(),
@@ -204,6 +206,8 @@
       
       // Add the generated source file into the source list.
       cmSourceFile file;
+      file.GetProperties().SetCMakeInstance
+        (this->Makefile->GetCMakeInstance());
       file.SetProperty("WRAP_EXCLUDE","1");
       file.SetProperty("ABSTRACT","0");
       file.SetName(fileName.c_str(), filePath.c_str(),

Index: cmSourceFile.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSourceFile.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- cmSourceFile.h	12 May 2006 17:53:21 -0000	1.17
+++ cmSourceFile.h	7 Dec 2006 14:44:45 -0000	1.18
@@ -18,6 +18,9 @@
 #define cmSourceFile_h
 
 #include "cmCustomCommand.h"
+#include "cmPropertyMap.h"
+
+class cmake;
 
 /** \class cmSourceFile
  * \brief Represent a class loaded from a makefile.
@@ -32,10 +35,7 @@
    * Construct instance as a concrete class with both a
    * .h and .cxx file.
    */
-  cmSourceFile()
-    {
-      this->CustomCommand = 0;
-    }
+  cmSourceFile();
   ~cmSourceFile()
     {
       this->SetCustomCommand(0);
@@ -108,8 +108,14 @@
    */
   const std::string& GetSourceNameWithoutLastExtension();
 
+  // Get the properties
+  cmPropertyMap &GetProperties() { return this->Properties; };
+
+  // Define the properties
+  static void DefineProperties(cmake *cm);
+
 private:
-  std::map<cmStdString,cmStdString> Properties;
+  cmPropertyMap Properties;
   cmCustomCommand *CustomCommand;
   std::string FullPath;
   std::string SourceName;

Index: cmSetDirectoryPropertiesCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetDirectoryPropertiesCommand.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cmSetDirectoryPropertiesCommand.cxx	12 May 2006 17:53:21 -0000	1.4
+++ cmSetDirectoryPropertiesCommand.cxx	7 Dec 2006 14:44:45 -0000	1.5
@@ -27,59 +27,74 @@
     this->SetError("called with incorrect number of arguments");
     return false;
     }
+  
+  std::string errors;
+  bool ret = 
+    cmSetDirectoryPropertiesCommand::RunCommand(this->Makefile, 
+                                                args.begin() + 1, 
+                                                args.end(), errors);
+  if (!ret)
+    {
+    this->SetError(errors.c_str());
+    }
+  return ret;
+}
 
-  std::vector<std::string>::const_iterator ait;
-  for ( ait = args.begin()+1; 
-    ait != args.end(); 
-    ait += 2 )
+bool cmSetDirectoryPropertiesCommand
+::RunCommand(cmMakefile *mf,
+             std::vector<std::string>::const_iterator ait,
+             std::vector<std::string>::const_iterator aitend,
+             std::string &errors)
+{
+  for (; ait != aitend; ait += 2 )
     {
-    if ( ait +1 == args.end() )
+    if ( ait +1 == aitend)
       {
-      this->SetError("Wrong number of arguments");
+      errors = "Wrong number of arguments";
       return false;
       }
     const std::string& prop = *ait;
     const std::string& value = *(ait+1);
     if ( prop == "VARIABLES" )
       {
-      this->SetError
-        ("Variables and cache variables should be set using SET command");
+      errors = 
+        "Variables and cache variables should be set using SET command";
       return false;
       }
     else if ( prop == "MACROS" )
       {
-      this->SetError
-        ("Commands and macros cannot be set using SET_CMAKE_PROPERTIES");
+      errors = 
+        "Commands and macros cannot be set using SET_CMAKE_PROPERTIES";
       return false;
       }
     else if ( prop == "INCLUDE_DIRECTORIES" )
       {
       std::vector<std::string> varArgsExpanded;
       cmSystemTools::ExpandListArgument(value, varArgsExpanded);
-      this->Makefile->SetIncludeDirectories(varArgsExpanded);
+      mf->SetIncludeDirectories(varArgsExpanded);
       }
     else if ( prop == "LINK_DIRECTORIES" )
       {
       std::vector<std::string> varArgsExpanded;
       cmSystemTools::ExpandListArgument(value, varArgsExpanded);
-      this->Makefile->SetLinkDirectories(varArgsExpanded);
+      mf->SetLinkDirectories(varArgsExpanded);
       }
     else if ( prop == "INCLUDE_REGULAR_EXPRESSION" )
       {
-      this->Makefile->SetIncludeRegularExpression(value.c_str());
+      mf->SetIncludeRegularExpression(value.c_str());
       }
     else
       {
       if ( prop == "ADDITIONAL_MAKE_CLEAN_FILES" )
         {
         // This property is not inherrited
-        if ( strcmp(this->Makefile->GetCurrentDirectory(), 
-                    this->Makefile->GetStartDirectory()) != 0 )
+        if ( strcmp(mf->GetCurrentDirectory(), 
+                    mf->GetStartDirectory()) != 0 )
           {
           continue;
           }
         }
-      this->Makefile->SetProperty(prop.c_str(), value.c_str());
+      mf->SetProperty(prop.c_str(), value.c_str());
       }
     }
   

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.369
retrieving revision 1.370
diff -u -d -r1.369 -r1.370
--- cmMakefile.cxx	4 Dec 2006 22:26:39 -0000	1.369
+++ cmMakefile.cxx	7 Dec 2006 14:44:45 -0000	1.370
@@ -816,9 +816,9 @@
 {
   // Create a target instance for this utility.
   cmTarget target;
+  target.SetMakefile(this);
   target.SetType(cmTarget::UTILITY, utilityName);
   target.SetInAll(all);
-  target.SetMakefile(this);
 
   if(!comment)
     {
@@ -1309,6 +1309,7 @@
     default:
       target.SetType(cmTarget::STATIC_LIBRARY, lname);
     }
+  target.SetMakefile(this);
 
   // Clear its dependencies. Otherwise, dependencies might persist
   // over changes in CMakeLists.txt, making the information stale and
@@ -1316,7 +1317,6 @@
   target.ClearDependencyInformation( *this, lname );
   target.SetInAll(in_all);
   target.GetSourceLists() = srcs;
-  target.SetMakefile(this);
   this->AddGlobalLinkInformation(lname, target);
   cmTargets::iterator it = 
     this->Targets.insert(cmTargets::value_type(lname,target)).first;
@@ -1329,9 +1329,9 @@
 {
   cmTarget target;
   target.SetType(cmTarget::EXECUTABLE, exeName);
+  target.SetMakefile(this);
   target.SetInAll(in_all);
   target.GetSourceLists() = srcs;
-  target.SetMakefile(this);
   this->AddGlobalLinkInformation(exeName, target);
   cmTargets::iterator it = 
     this->Targets.insert(cmTargets::value_type(exeName,target)).first;
@@ -2281,6 +2281,7 @@
 
   // we must create one
   cmSourceFile file; 
+  file.GetProperties().SetCMakeInstance(this->GetCMakeInstance());
   std::string path = cmSystemTools::GetFilenamePath(src);
   if(generated)
     {
@@ -2328,6 +2329,7 @@
   this->AddSource(file);
   src = file.GetFullPath();
   ret = this->GetSource(src.c_str());
+  ret->GetProperties().SetCMakeInstance(this->GetCMakeInstance());
   if (!ret)
     {
     cmSystemTools::Error(
@@ -2738,11 +2740,28 @@
     {
     value = "NOTFOUND";
     }
-  this->Properties[prop] = value;
+
+  this->Properties.SetProperty(prop,value,cmProperty::DIRECTORY);
+}
+
+const char *cmMakefile::GetPropertyOrDefinition(const char* prop)
+{
+  const char *ret = this->GetProperty(prop, cmProperty::DIRECTORY);
+  if (!ret)
+    {
+    ret = this->GetDefinition(prop);
+    }
+  return ret;
 }
 
 const char *cmMakefile::GetProperty(const char* prop)
 {
+  return this->GetProperty(prop, cmProperty::DIRECTORY);
+}
+
+const char *cmMakefile::GetProperty(const char* prop,
+                                    cmProperty::ScopeType scope)
+{
   // watch for specific properties
   if (!strcmp("PARENT_DIRECTORY",prop))
     {
@@ -2764,24 +2783,21 @@
       }
     this->SetProperty("LISTFILE_STACK",tmp.c_str());
     }
-  std::map<cmStdString,cmStdString>::const_iterator i = 
-    this->Properties.find(prop);
-  if (i != this->Properties.end())
+  
+  bool chain = false;
+  const char *retVal = 
+    this->Properties.GetPropertyValue(prop, scope, chain);
+  if (chain)
     {
-    return i->second.c_str();
+    return this->GetCMakeInstance()->GetProperty(prop,scope);
     }
-  return 0;
+
+  return retVal;    
 }
 
-bool cmMakefile::GetPropertyAsBool(const char* prop) const
+bool cmMakefile::GetPropertyAsBool(const char* prop)
 {
-  std::map<cmStdString,cmStdString>::const_iterator i = 
-    this->Properties.find(prop);
-  if (i != this->Properties.end())
-    {
-    return cmSystemTools::IsOn(i->second.c_str());
-    }
-  return false;
+  return cmSystemTools::IsOn(this->GetProperty(prop));
 }
 
 
@@ -2810,6 +2826,7 @@
     }
   test = new cmTest;
   test->SetName(testName);
+  test->SetMakefile(this);
   this->Tests.push_back(test);
   return test;
 }
@@ -2855,3 +2872,43 @@
     }
   return tmp;
 }
+
+// define properties
+void cmMakefile::DefineProperties(cmake *cm)
+{
+  cm->DefineProperty
+    ("ADDITIONAL_MAKE_CLEAN_FILES", cmProperty::DIRECTORY, 
+     "Addditional files to clean during the make clean stage.",
+     "A list of files that will be cleaned as a part of the "
+     "\"make clean\" stage. ");
+
+  cm->DefineProperty
+    ("CLEAN_NO_CUSTOM", cmProperty::DIRECTORY, 
+     "Should the output of custom commands be left.",
+     "If this is true then the outputs of custom commands for this "
+     "directory will not be removed during the \"make clean\" stage. ");
+
+  cm->DefineProperty
+    ("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS", cmProperty::DIRECTORY, 
+     "Allow loops to have non-matching closing statements.",
+     "If this is set then the closing statement of control "
+     "structures in CMake will not require an exact match to the "
+     "opening statement. For example  IF(foo) will not require "
+     "ENDIF(foo) but simple ENDIF() will work.",
+     true);
+
+  cm->DefineProperty
+    ("LISTFILE_STACK", cmProperty::DIRECTORY, 
+     "The current stack of listfiles being processed.",
+     "This property is mainly useful when trying to debug errors "
+     "in your CMake scripts. It returns a list of what list files "
+     "are currently being processed, in order. So if one listfile "
+     "does an INCLUDE command then that is effectively pushing "
+     "the included listfile onto the stack.");
+
+  cm->DefineProperty
+    ("TEST_INCLUDE_FILE", cmProperty::DIRECTORY, 
+     "A cmake file that will be included when ctest is run.",
+     "If you specify TEST_INCLUDE_FILE, that file will be "
+     "included and processed when ctest is run on the directory.");
+}

Index: cmVTKWrapPythonCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmVTKWrapPythonCommand.cxx,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- cmVTKWrapPythonCommand.cxx	12 May 2006 18:12:13 -0000	1.35
+++ cmVTKWrapPythonCommand.cxx	7 Dec 2006 14:44:45 -0000	1.36
@@ -70,6 +70,8 @@
     if (!curr || !curr->GetPropertyAsBool("WRAP_EXCLUDE"))
       {
       cmSourceFile file;
+      file.GetProperties().SetCMakeInstance
+        (this->Makefile->GetCMakeInstance());
       if (curr)
         {
         file.SetProperty("ABSTRACT",curr->GetProperty("ABSTRACT"));
@@ -90,6 +92,8 @@
     }
   
   cmSourceFile cfile;
+  cfile.GetProperties().SetCMakeInstance
+    (this->Makefile->GetCMakeInstance());
   cfile.SetProperty("ABSTRACT","0");
   this->CreateInitFile(res);
   cfile.SetName(initName.c_str(), this->Makefile->GetCurrentOutputDirectory(),

Index: cmFLTKWrapUICommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFLTKWrapUICommand.cxx,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- cmFLTKWrapUICommand.cxx	11 May 2006 14:45:33 -0000	1.31
+++ cmFLTKWrapUICommand.cxx	7 Dec 2006 14:44:45 -0000	1.32
@@ -54,6 +54,8 @@
     if (!curr || !curr->GetPropertyAsBool("WRAP_EXCLUDE"))
       {
       cmSourceFile header_file;
+      header_file.GetProperties().SetCMakeInstance
+        (this->Makefile->GetCMakeInstance());
       std::string srcName = cmSystemTools::GetFilenameWithoutExtension(*i);
       const bool headerFileOnly = true;
       header_file.SetName(srcName.c_str(), 

Index: cmSetDirectoryPropertiesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetDirectoryPropertiesCommand.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cmSetDirectoryPropertiesCommand.h	7 Dec 2005 16:39:08 -0000	1.4
+++ cmSetDirectoryPropertiesCommand.h	7 Dec 2006 14:44:45 -0000	1.5
@@ -52,6 +52,14 @@
     }
   
   /**
+   * Static entry point for use by other commands
+   */
+  static bool RunCommand(cmMakefile *mf,
+                         std::vector<std::string>::const_iterator ait,
+                         std::vector<std::string>::const_iterator aitend,
+                         std::string &errors);
+
+  /**
    * Longer documentation.
    */
   virtual const char* GetFullDocumentation()

Index: cmSourceFile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSourceFile.cxx,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- cmSourceFile.cxx	12 May 2006 17:53:21 -0000	1.33
+++ cmSourceFile.cxx	7 Dec 2006 14:44:45 -0000	1.34
@@ -17,7 +17,7 @@
 #include "cmSourceFile.h"
 #include "cmSystemTools.h"
 
-
+#include "cmake.h"
 
 // Set the name of the class and the full path to the file.
 // The class must be found in dir and end in name.cxx, name.txx, 
@@ -179,7 +179,8 @@
     {
     value = "NOTFOUND";
     }
-  this->Properties[prop] = value;
+
+  this->Properties.SetProperty(prop, value, cmProperty::SOURCE_FILE);
 }
 
 const char *cmSourceFile::GetProperty(const char* prop) const
@@ -191,24 +192,14 @@
     return this->FullPath.c_str();
     }
 
-  std::map<cmStdString,cmStdString>::const_iterator i = 
-    this->Properties.find(prop);
-  if (i != this->Properties.end())
-    {
-    return i->second.c_str();
-    }
-  return 0;
+  bool chain = false;
+  return this->Properties.GetPropertyValue(prop,cmProperty::SOURCE_FILE, 
+                                           chain);
 }
 
 bool cmSourceFile::GetPropertyAsBool(const char* prop) const
 {
-  std::map<cmStdString,cmStdString>::const_iterator i = 
-    this->Properties.find(prop);
-  if (i != this->Properties.end())
-    {
-    return cmSystemTools::IsOn(i->second.c_str());
-    }
-  return false;
+  return cmSystemTools::IsOn(this->GetProperty(prop));
 }
 
 void cmSourceFile::SetCustomCommand(cmCustomCommand* cc)
@@ -229,3 +220,115 @@
     }
   return this->SourceNameWithoutLastExtension;
 }
+
+cmSourceFile::cmSourceFile()
+{
+  this->CustomCommand = 0; 
+}
+
+// define properties
+void cmSourceFile::DefineProperties(cmake *cm)
+{
+  // define properties
+  cm->DefineProperty
+    ("ABSTRACT", cmProperty::SOURCE_FILE, 
+     "Is this source file an abstract class.",
+     "A property ona source file that indicates if the source file "
+     "represents a class that is abstract. This only makes sense for "
+     "languages that have a notion of an abstract class and it is "
+     "only used by somw tools that wrap classes into other languages.");
+
+  cm->DefineProperty
+    ("COMPILE_FLAGS", cmProperty::SOURCE_FILE, 
+     "Additional flags to be added when compiling this source file.",
+     "These flags will be added to the list of compile flags when "
+     "this source file.");
+
+  cm->DefineProperty
+    ("EXTERNAL_OBJECT", cmProperty::SOURCE_FILE, 
+     "If set to true then this is an object file.",
+     "If this property is set to true then the source file "
+     "is really an object file and should not be compiled.  "
+     "It will still be linked into the target though.");
+
+  cm->DefineProperty
+    ("EXTRA_CONTENT", cmProperty::SOURCE_FILE, 
+     "Is this file part of a target's extra content.",
+     "If this property is set, the source file will be added to the "
+     "target's list of extra content. This is used by makefile "
+     "generators for some sort of Mac budle framework support.");
+
+  cm->DefineProperty
+    ("GENERATED", cmProperty::SOURCE_FILE, 
+     "Is this source file generated as part of the build process.",
+     "If a source file is generated by the build process CMake will "
+     "handle it differently in temrs of dependency checking etc. "
+     "Otherwise having a non-existent source file could create problems.");
+
+  cm->DefineProperty
+    ("HEADER_FILE_ONLY", cmProperty::SOURCE_FILE, 
+     "Is this source file only a header file.",
+     "A property ona source file that indicates if the source file "
+     "is a header file with no associated implementation. This is "
+     "set automatically based on the file extension and is used by "
+     "CMake to determine is certain dependency information should be "
+     "computed.");
+
+  cm->DefineProperty
+    ("KEEP_EXTENSION", cmProperty::SOURCE_FILE, 
+     "Make th eoutput file have the same extension as the source file.",
+     "If this property is set then the file extension of the output "
+     "file will be the same as that of the source file. Normally "
+     "the output file extension is computed based on the language "
+     "of the source file, for example .cxx will go to a .o extension.");
+
+  cm->DefineProperty
+    ("LANGUAGE", cmProperty::SOURCE_FILE, 
+     "What programming language is the file.",
+     "A property that can be set to indicate what programming language "
+     "the source file is. If it is not set the language is determined "
+     "based on the file extension. Typical values are CXX C etc.");
+
+  cm->DefineProperty
+    ("LOCATION", cmProperty::SOURCE_FILE, 
+     "The full path to a source file.",
+     "A read only property on a SOURCE FILE that contains the full path "
+     "to the source file.");
+
+  cm->DefineProperty
+    ("MACOSX_PACKAGE_LOCATION", cmProperty::SOURCE_FILE, 
+     "Location for MACOSX bundles and frameworks.",
+     "MACOSX_PACKAGE_LOCATION is the property of a file within a mac osx "
+     "bundle or framework that specifies where this file should be "
+     "copied. This makes sense for things like icons and other "
+     "resources.");
+
+  cm->DefineProperty
+    ("MACOSX_CONTENT", cmProperty::SOURCE_FILE, 
+     "If true then this is part of a MACOSX bundle or framework.",
+     "MACOSX_CONTENT is a flag that if true this file will be copied "
+     "to the bundle or framework.");
+
+  cm->DefineProperty
+    ("OBJECT_DEPENDS", cmProperty::SOURCE_FILE, 
+     "Additional dependencies.",
+     "Additional dependencies that should be checked as part of "
+     "building this source file.");
+
+  cm->DefineProperty
+    ("SYMBOLIC", cmProperty::SOURCE_FILE, 
+     "Is this just a name for a rule.",
+     "If SYMBOLIC (boolean) is set to true the build system will be "
+     "informed that the source file is not actually created on disk but "
+     "instead used as a symbolic name for a build rule.");
+  
+  cm->DefineProperty
+    ("WRAP_EXCLUDE", cmProperty::SOURCE_FILE, 
+     "Exclude this source file from any code wrapping techniques.",
+     "Some packages can wrap source files into alternate languages "
+     "to provide additional functionality. For example, C++ code "
+     "can be wrapped into Java or Python etc using SWIG etc. "
+     "If WRAP_EXCLUDE is set to true (1 etc) that indicates then "
+     "this source file should not be wrapped.");
+}
+

Index: cmVTKWrapTclCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmVTKWrapTclCommand.cxx,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- cmVTKWrapTclCommand.cxx	12 May 2006 18:12:13 -0000	1.42
+++ cmVTKWrapTclCommand.cxx	7 Dec 2006 14:44:45 -0000	1.43
@@ -106,6 +106,8 @@
       if (!curr || !curr->GetPropertyAsBool("WRAP_EXCLUDE"))
         {
         cmSourceFile file;
+        file.GetProperties().SetCMakeInstance
+          (this->Makefile->GetCMakeInstance());
         std::string srcDir = cdir;
         if (curr)
           {
@@ -128,6 +130,8 @@
       }
     // add the init file
     cmSourceFile cfile;
+    cfile.GetProperties().SetCMakeInstance
+      (this->Makefile->GetCMakeInstance());
     cfile.SetProperty("ABSTRACT","0");
     std::string newName = this->LibraryName;
     newName += "Init";

Index: cmTest.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTest.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cmTest.h	15 Mar 2006 16:02:07 -0000	1.4
+++ cmTest.h	7 Dec 2006 14:44:45 -0000	1.5
@@ -18,6 +18,8 @@
 #define cmTest_h
 
 #include "cmCustomCommand.h"
+#include "cmPropertyMap.h"
+class cmMakefile;
 
 /** \class cmTest
  * \brief Represent a test
@@ -52,16 +54,24 @@
   void SetProperty(const char *prop, const char *value);
   const char *GetProperty(const char *prop) const;
   bool GetPropertyAsBool(const char *prop) const;
-  const std::map<cmStdString,cmStdString>& GetProperties() const
-    {
-    return this->Properties;
-    }
+  cmPropertyMap &GetProperties() { return this->Properties; };
     
+  // Define the properties
+  static void DefineProperties(cmake *cm);
+
+  ///! Set the cmMakefile that owns this test
+  void SetMakefile(cmMakefile *mf);
+  cmMakefile *GetMakefile() { return this->Makefile;};
+
 private:
-  std::map<cmStdString,cmStdString> Properties;
+  cmPropertyMap Properties;
   cmStdString Name;
   cmStdString Command;
   std::vector<cmStdString> Args;
+
+  // The cmMakefile instance that owns this target.  This should
+  // always be set.
+  cmMakefile* Makefile;  
 };
 
 #endif

Index: cmTest.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTest.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cmTest.cxx	25 Apr 2006 12:34:30 -0000	1.4
+++ cmTest.cxx	7 Dec 2006 14:44:45 -0000	1.5
@@ -17,9 +17,12 @@
 #include "cmTest.h"
 #include "cmSystemTools.h"
 
+#include "cmake.h"
+#include "cmMakefile.h"
 
 cmTest::cmTest() 
 {
+  this->Makefile = 0;
 }
 
 cmTest::~cmTest()
@@ -52,24 +55,18 @@
 
 const char *cmTest::GetProperty(const char* prop) const
 {
-  std::map<cmStdString,cmStdString>::const_iterator i = 
-    this->Properties.find(prop);
-  if (i != this->Properties.end())
+  bool chain = false;
+  const char *retVal = 
+    this->Properties.GetPropertyValue(prop, cmProperty::TEST, chain);
+  if (chain)
     {
-    return i->second.c_str();
+    return this->Makefile->GetProperty(prop,cmProperty::TEST);
     }
-  return 0;
 }
 
 bool cmTest::GetPropertyAsBool(const char* prop) const
 {
-  std::map<cmStdString,cmStdString>::const_iterator i = 
-    this->Properties.find(prop);
-  if (i != this->Properties.end())
-    {
-    return cmSystemTools::IsOn(i->second.c_str());
-    }
-  return false;
+  return cmSystemTools::IsOn(this->GetProperty(prop));
 }
 
 void cmTest::SetProperty(const char* prop, const char* value)
@@ -82,6 +79,46 @@
     {
     value = "NOTFOUND";
     }
-  this->Properties[prop] = value;
+
+  this->Properties.SetProperty(prop, value, cmProperty::TEST);
+}
+
+//----------------------------------------------------------------------------
+void cmTest::SetMakefile(cmMakefile* mf)
+{
+  // Set our makefile.
+  this->Makefile = mf;
+  this->Properties.SetCMakeInstance(mf->GetCMakeInstance());
 }
 
+// define properties
+void cmTest::DefineProperties(cmake *cm)
+{
+  // define properties
+  cm->DefineProperty
+    ("FAIL_REGULAR_EXPRESSION", cmProperty::TEST, 
+     "If the output matches this regular expression tes test will fail.",
+     "If set, if the output matches one of "
+     "specified regular expressions, the test will fail."
+     "For example: PASS_REGULAR_EXPRESSION \"[^a-z]Error;ERROR;Failed\"");
+
+  cm->DefineProperty
+    ("MEASUREMENT", cmProperty::TEST, 
+     "Specify a DART meansurement and value to be reported for a test.",
+     "If set to a name then that name will be reported to DART as a "
+     "named measurement with a value of 1. You may also specify a value "
+     "by setting MEASUREMENT to \"measurement=value\".");
+
+  cm->DefineProperty
+    ("PASS_REGULAR_EXPRESSION", cmProperty::TEST, 
+     "The output must match this regular expression for the test to pass.",
+     "If set, the test output will be checked "
+     "against the specified regular expressions and at least one of the"
+     " regular expressions has to match, otherwise the test will fail.");
+
+  cm->DefineProperty
+    ("WILL_FAIL", cmProperty::TEST, 
+     "If set to true, this will invert the pass/fail flag of the test.",
+     "This property can be used for tests that are expected to fail and "
+     "return a non zero return code.");
+}

Index: cmCreateTestSourceList.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCreateTestSourceList.cxx,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- cmCreateTestSourceList.cxx	15 Mar 2006 16:01:59 -0000	1.40
+++ cmCreateTestSourceList.cxx	7 Dec 2006 14:44:45 -0000	1.41
@@ -172,6 +172,7 @@
 
   // Create the source list
   cmSourceFile cfile;
+  cfile.GetProperties().SetCMakeInstance(this->Makefile->GetCMakeInstance());
   std::string sourceListValue;
 
   cfile.SetProperty("ABSTRACT","0");
@@ -185,6 +186,8 @@
   for(i = testsBegin; i != tests.end(); ++i)
     {
     cmSourceFile icfile;
+    icfile.GetProperties().
+      SetCMakeInstance(this->Makefile->GetCMakeInstance());
     icfile.SetProperty("ABSTRACT","0");
     icfile.SetName(i->c_str(),
                   this->Makefile->GetCurrentDirectory(),

Index: cmSetTargetPropertiesCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetTargetPropertiesCommand.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cmSetTargetPropertiesCommand.cxx	12 May 2006 17:53:21 -0000	1.4
+++ cmSetTargetPropertiesCommand.cxx	7 Dec 2006 14:44:45 -0000	1.5
@@ -71,27 +71,14 @@
      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())
+    bool ret = cmSetTargetPropertiesCommand::SetOneTarget
+      (args[i].c_str(),propertyPairs,this->Makefile);
+    if (!ret)
       {
-      cmTarget& target = t->second;
-      // now loop through all the props and set them
-      for (k = 0; k < propertyPairs.size(); k = k + 2)
-        {
-        target.SetProperty(propertyPairs[k].c_str(),
-                           propertyPairs[k+1].c_str());
-        }
-      }
-    // if file is not already in the makefile, then add it
-    else
-      { 
       std::string message = "Can not find target to add properties to: ";
       message += args[i];
       this->SetError(message.c_str());
@@ -101,3 +88,30 @@
   return true;
 }
 
+bool cmSetTargetPropertiesCommand
+::SetOneTarget(const char *tname, 
+               std::vector<std::string> &propertyPairs,
+               cmMakefile *mf)
+{
+  cmTargets& targets = mf->GetTargets();
+
+  // if the file is already in the makefile just set properites on it
+  cmTargets::iterator t = targets.find(tname);
+  if ( t != targets.end())
+    {
+    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());
+      }
+    }
+  // if file is not already in the makefile, then add it
+  else
+    { 
+    return false;
+    }
+  return true;
+}

Index: cmMacroCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMacroCommand.cxx,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- cmMacroCommand.cxx	1 Dec 2006 20:28:00 -0000	1.32
+++ cmMacroCommand.cxx	7 Dec 2006 14:44:45 -0000	1.33
@@ -316,7 +316,8 @@
     mf.ExpandArguments(lff.Arguments, expandedArguments);
     if ((!expandedArguments.empty() && 
         (expandedArguments[0] == this->Args[0]))
-        || mf.IsOn("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS"))
+        || cmSystemTools::IsOn
+        (mf.GetPropertyOrDefinition("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS")))
       {
       return true;
       }

Index: cmVTKWrapJavaCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmVTKWrapJavaCommand.cxx,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- cmVTKWrapJavaCommand.cxx	28 Sep 2006 17:55:26 -0000	1.32
+++ cmVTKWrapJavaCommand.cxx	7 Dec 2006 14:44:45 -0000	1.33
@@ -70,6 +70,8 @@
     if (!curr || !curr->GetPropertyAsBool("WRAP_EXCLUDE"))
       {
       cmSourceFile file;
+      file.GetProperties().SetCMakeInstance
+        (this->Makefile->GetCMakeInstance());
       if (curr)
         {
         file.SetProperty("ABSTRACT",curr->GetProperty("ABSTRACT"));

Index: cmMakefile.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.h,v
retrieving revision 1.197
retrieving revision 1.198
diff -u -d -r1.197 -r1.198
--- cmMakefile.h	29 Nov 2006 20:59:16 -0000	1.197
+++ cmMakefile.h	7 Dec 2006 14:44:45 -0000	1.198
@@ -22,6 +22,7 @@
 #include "cmTarget.h"
 #include "cmListFileCache.h"
 #include "cmCacheManager.h"
+#include "cmPropertyMap.h"
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
 #include "cmSourceGroup.h"
@@ -697,7 +698,12 @@
   ///! Set/Get a property of this directory 
   void SetProperty(const char *prop, const char *value);
   const char *GetProperty(const char *prop);
-  bool GetPropertyAsBool(const char *prop) const;
+  const char *GetPropertyOrDefinition(const char *prop);
+  const char *GetProperty(const char *prop, cmProperty::ScopeType scope);
+  bool GetPropertyAsBool(const char *prop);
+
+  // Get the properties
+  cmPropertyMap &GetProperties() { return this->Properties; };
 
   typedef std::map<cmStdString, cmStdString> DefinitionMap;
   ///! Initialize a makefile from its parent
@@ -711,6 +717,10 @@
     { this->InstallGenerators.push_back(g); }
   std::vector<cmInstallGenerator*>& GetInstallGenerators()
     { return this->InstallGenerators; }
+
+  // Define the properties
+  static void DefineProperties(cmake *cm);
+
 protected:
   // add link libraries and directories to the target
   void AddGlobalLinkInformation(const char* name, cmTarget& target);
@@ -791,7 +801,7 @@
   cmsys::RegularExpression cmDefineRegex;
   cmsys::RegularExpression cmDefine01Regex;
 
-  std::map<cmStdString,cmStdString> Properties;
+  cmPropertyMap Properties;
 
   // should this makefile be processed before or after processing the parent
   bool PreOrder;

Index: cmCommands.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommands.cxx,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- cmCommands.cxx	3 Oct 2006 18:40:22 -0000	1.106
+++ cmCommands.cxx	7 Dec 2006 14:44:45 -0000	1.107
@@ -20,6 +20,7 @@
 #include "cmAuxSourceDirectoryCommand.cxx"
 #include "cmBuildNameCommand.cxx"
 #include "cmCreateTestSourceList.cxx"
+#include "cmDefinePropertyCommand.cxx"
 #include "cmElseIfCommand.cxx"
 #include "cmEnableLanguageCommand.cxx"
 #include "cmEndMacroCommand.cxx"
@@ -44,6 +45,7 @@
 #include "cmRemoveDefinitionsCommand.cxx"
 #include "cmSeparateArgumentsCommand.cxx"
 #include "cmSetDirectoryPropertiesCommand.cxx"
+#include "cmSetPropertiesCommand.cxx"
 #include "cmSetTargetPropertiesCommand.cxx"
 #include "cmSetTestsPropertiesCommand.cxx"
 #include "cmSourceGroupCommand.cxx"
@@ -75,6 +77,7 @@
   commands.push_back(new cmAuxSourceDirectoryCommand);
   commands.push_back(new cmBuildNameCommand);
   commands.push_back(new cmCreateTestSourceList);
+  commands.push_back(new cmDefinePropertyCommand);
   commands.push_back(new cmElseIfCommand);
   commands.push_back(new cmEnableLanguageCommand);
   commands.push_back(new cmEndMacroCommand);
@@ -100,6 +103,7 @@
   commands.push_back(new cmRemoveDefinitionsCommand);
   commands.push_back(new cmSeparateArgumentsCommand);
   commands.push_back(new cmSetDirectoryPropertiesCommand);
+  commands.push_back(new cmSetPropertiesCommand);
   commands.push_back(new cmSetTargetPropertiesCommand);
   commands.push_back(new cmSetTestsPropertiesCommand);
   commands.push_back(new cmSourceGroupCommand);

Index: cmCPluginAPI.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCPluginAPI.cxx,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- cmCPluginAPI.cxx	29 Nov 2006 20:59:15 -0000	1.32
+++ cmCPluginAPI.cxx	7 Dec 2006 14:44:45 -0000	1.33
@@ -507,6 +507,14 @@
   return (void *)(new cmSourceFile);
 }
 
+void * CCONV cmCreateNewSourceFile(void *arg)
+{
+  cmMakefile *mf = static_cast<cmMakefile *>(arg);
+  cmSourceFile *sf = new cmSourceFile;
+  sf->GetProperties().SetCMakeInstance(mf->GetCMakeInstance());
+  return (void *)sf;
+}
+
 void CCONV cmDestroySourceFile(void *arg)
 {
   cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
@@ -624,6 +632,16 @@
   free(data);
 }
 
+void CCONV DefineSourceFileProperty (void *arg, const char *name,
+  const char *briefDocs, 
+  const char *longDocs,
+  int chained)
+{
+  cmMakefile *mf = static_cast<cmMakefile *>(arg);
+  mf->GetCMakeInstance()->DefineProperty(name,cmProperty::SOURCE_FILE,
+                                         briefDocs, longDocs,chained);
+}
+
 } // close the extern "C" scope
 
 cmCAPI cmStaticCAPI =
@@ -683,5 +701,7 @@
   cmAddCustomCommandToOutput,
   cmAddCustomCommandToTarget,
   cmDisplayStatus,
+  cmCreateNewSourceFile,
+  DefineSourceFileProperty,
 };
 

Index: cmPropertyMap.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmPropertyMap.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cmPropertyMap.cxx	1 Dec 2006 18:35:03 -0000	1.1
+++ cmPropertyMap.cxx	7 Dec 2006 14:44:45 -0000	1.2
@@ -18,6 +18,9 @@
 #include "cmSystemTools.h"
 #include "cmake.h"
 
+// define STRICT to get checking of all set and get property calls
+//#define STRICT 
+
 cmProperty *cmPropertyMap::GetOrCreateProperty(const char *name)
 {
   cmPropertyMap::iterator it = this->find(name);
@@ -41,7 +44,7 @@
     return;
     }
 
-#if 0
+#ifdef STRICT
   if (!this->CMakeInstance)
     {
     cmSystemTools::Error("CMakeInstance not set on a property map!"); 
@@ -92,7 +95,7 @@
     }
 
   // has the property been defined?
-#if 0
+#ifdef STRICT
   if (!this->CMakeInstance)
     {
     cmSystemTools::Error("CMakeInstance not set on a property map!"); 
@@ -131,7 +134,10 @@
   if (it == this->end())
     {
     // should we chain up?
-    chain = this->CMakeInstance->IsPropertyChained(name,scope);
+    if (this->CMakeInstance)
+      {
+      chain = this->CMakeInstance->IsPropertyChained(name,scope);
+      }
     return 0;
     }
 

Index: cmInstallFilesCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallFilesCommand.cxx,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- cmInstallFilesCommand.cxx	31 Aug 2006 14:47:00 -0000	1.22
+++ cmInstallFilesCommand.cxx	7 Dec 2006 14:44:45 -0000	1.23
@@ -36,8 +36,9 @@
   // Create an INSTALL_FILES target specifically for this path.
   this->TargetName = "INSTALL_FILES_"+args[0];
   cmTarget& target = this->Makefile->GetTargets()[this->TargetName];
-  target.SetInAll(false);
   target.SetType(cmTarget::INSTALL_FILES, this->TargetName.c_str());
+  target.SetMakefile(this->Makefile);
+  target.SetInAll(false);
   target.SetInstallPath(args[0].c_str());
   
   if((args.size() > 1) && (args[1] == "FILES"))

Index: cmInstallProgramsCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallProgramsCommand.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- cmInstallProgramsCommand.cxx	31 Aug 2006 14:47:00 -0000	1.15
+++ cmInstallProgramsCommand.cxx	7 Dec 2006 14:44:45 -0000	1.16
@@ -33,8 +33,9 @@
   // Create an INSTALL_PROGRAMS target specifically for this path.
   this->TargetName = "INSTALL_PROGRAMS_"+args[0];
   cmTarget& target = this->Makefile->GetTargets()[this->TargetName];
-  target.SetInAll(false);
   target.SetType(cmTarget::INSTALL_PROGRAMS, this->TargetName.c_str());
+  target.SetMakefile(this->Makefile);
+  target.SetInAll(false);
   target.SetInstallPath(args[0].c_str());
 
   std::vector<std::string>::const_iterator s = args.begin();

Index: cmCPluginAPI.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCPluginAPI.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- cmCPluginAPI.h	18 Apr 2006 18:48:46 -0000	1.24
+++ cmCPluginAPI.h	7 Dec 2006 14:44:45 -0000	1.25
@@ -170,6 +170,13 @@
   /* display status information */
   void  (CCONV *DisplaySatus) (void *info, const char *message);
 
+  /* new functions added after 2.4 */
+  void *(CCONV *CreateNewSourceFile) (void *mf);
+  void (CCONV *DefineSourceFileProperty) (void *mf, const char *name,
+                                          const char *briefDocs, 
+                                          const char *longDocs,
+                                          int chained);
+  
   /* this is the end of the C function stub API structure */
 } cmCAPI;
 



More information about the Cmake-commits mailing list