[Cmake-commits] CMake branch, next, updated. v2.8.12.2-1546-gf744bee

Stephen Kelly steveire at gmail.com
Wed Feb 19 11:35:56 EST 2014


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  f744bee0497921d23487b83b1d06613f89ff6f12 (commit)
       via  639bf2c1845238cca08756fad2461bdf4c357ebf (commit)
      from  26da467e79cee3e0e9909bb3ff68c72410e8b486 (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=f744bee0497921d23487b83b1d06613f89ff6f12
commit f744bee0497921d23487b83b1d06613f89ff6f12
Merge: 26da467 639bf2c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 19 11:35:52 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Feb 19 11:35:52 2014 -0500

    Merge topic 'target-SOURCES-refactor' into next
    
    639bf2c1 Revert accidentally merged topic.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=639bf2c1845238cca08756fad2461bdf4c357ebf
commit 639bf2c1845238cca08756fad2461bdf4c357ebf
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 19 17:32:24 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Feb 19 17:34:59 2014 +0100

    Revert accidentally merged topic.
    
    I assumed, but apparently didn't test, that dev/string-apis had been
    through next already.

diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 94f82f6..7bc8d49 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -987,7 +987,7 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path)
     endif()
   endif()
 
-  # This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
+  # This recipie is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
   # CMake source.
 
   # Remove leading /
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index b1b12b9..96491aa 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -972,7 +972,7 @@ bool cmCPackGenerator::ReadListFile(const char* moduleName)
 }
 
 //----------------------------------------------------------------------
-void cmCPackGenerator::SetOptionIfNotSet(const std::string& op,
+void cmCPackGenerator::SetOptionIfNotSet(const char* op,
   const char* value)
 {
   const char* def = this->MakefileMap->GetDefinition(op);
@@ -984,8 +984,12 @@ void cmCPackGenerator::SetOptionIfNotSet(const std::string& op,
 }
 
 //----------------------------------------------------------------------
-void cmCPackGenerator::SetOption(const std::string& op, const char* value)
+void cmCPackGenerator::SetOption(const char* op, const char* value)
 {
+  if ( !op )
+    {
+    return;
+    }
   if ( !value )
     {
     this->MakefileMap->RemoveDefinition(op);
@@ -1172,19 +1176,19 @@ int cmCPackGenerator::InitializeInternal()
 }
 
 //----------------------------------------------------------------------
-bool cmCPackGenerator::IsSet(const std::string& name) const
+bool cmCPackGenerator::IsSet(const char* name) const
 {
   return this->MakefileMap->IsSet(name);
 }
 
 //----------------------------------------------------------------------
-bool cmCPackGenerator::IsOn(const std::string& name) const
+bool cmCPackGenerator::IsOn(const char* name) const
 {
   return cmSystemTools::IsOn(GetOption(name));
 }
 
 //----------------------------------------------------------------------
-const char* cmCPackGenerator::GetOption(const std::string& op) const
+const char* cmCPackGenerator::GetOption(const char* op) const
 {
   const char* ret = this->MakefileMap->GetDefinition(op);
   if(!ret)
@@ -1476,8 +1480,8 @@ bool cmCPackGenerator::WantsComponentInstallation() const
 
 //----------------------------------------------------------------------
 cmCPackInstallationType*
-cmCPackGenerator::GetInstallationType(const std::string& projectName,
-                                      const std::string& name)
+cmCPackGenerator::GetInstallationType(const char *projectName,
+                                      const char *name)
 {
   (void) projectName;
   bool hasInstallationType = this->InstallationTypes.count(name) != 0;
@@ -1508,8 +1512,7 @@ cmCPackGenerator::GetInstallationType(const std::string& projectName,
 
 //----------------------------------------------------------------------
 cmCPackComponent*
-cmCPackGenerator::GetComponent(const std::string& projectName,
-                               const std::string& name)
+cmCPackGenerator::GetComponent(const char *projectName, const char *name)
 {
   bool hasComponent = this->Components.count(name) != 0;
   cmCPackComponent *component = &this->Components[name];
@@ -1577,7 +1580,7 @@ cmCPackGenerator::GetComponent(const std::string& projectName,
            ++installTypesIt)
         {
         component->InstallationTypes.push_back(
-          this->GetInstallationType(projectName, *installTypesIt));
+          this->GetInstallationType(projectName, installTypesIt->c_str()));
         }
       }
 
@@ -1604,8 +1607,7 @@ cmCPackGenerator::GetComponent(const std::string& projectName,
 
 //----------------------------------------------------------------------
 cmCPackComponentGroup*
-cmCPackGenerator::GetComponentGroup(const std::string& projectName,
-                                    const std::string& name)
+cmCPackGenerator::GetComponentGroup(const char *projectName, const char *name)
 {
   (void) projectName;
   std::string macroPrefix = "CPACK_COMPONENT_GROUP_"
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index bd45dde..bb33aa0 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -99,11 +99,11 @@ public:
   virtual ~cmCPackGenerator();
 
   //! Set and get the options
-  void SetOption(const std::string& op, const char* value);
-  void SetOptionIfNotSet(const std::string& op, const char* value);
-  const char* GetOption(const std::string& op) const;
-  bool IsSet(const std::string& name) const;
-  bool IsOn(const std::string& name) const;
+  void SetOption(const char* op, const char* value);
+  void SetOptionIfNotSet(const char* op, const char* value);
+  const char* GetOption(const char* op) const;
+  bool IsSet(const char* name) const;
+  bool IsOn(const char* name) const;
 
   //! Set the logger
   void SetLogger(cmCPackLog* log) { this->Logger = log; }
@@ -244,14 +244,12 @@ protected:
    * @return true if component installation is supported and wanted.
    */
   virtual bool WantsComponentInstallation() const;
-  virtual cmCPackInstallationType* GetInstallationType(
-                                                const std::string& projectName,
-                                                const std::string& name);
-  virtual cmCPackComponent* GetComponent(const std::string& projectName,
-                                         const std::string& name);
-  virtual cmCPackComponentGroup* GetComponentGroup(
-                                                const std::string& projectName,
-                                                const std::string& name);
+  virtual cmCPackInstallationType* GetInstallationType(const char *projectName,
+                                                       const char* name);
+  virtual cmCPackComponent* GetComponent(const char *projectName,
+                                         const char* name);
+  virtual cmCPackComponentGroup* GetComponentGroup(const char *projectName,
+                                                   const char* name);
 
   cmSystemTools::OutputOption GeneratorVerbose;
   std::string Name;
diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx
index 9faf2b0..b36c2a2 100644
--- a/Source/CPack/cmCPackGeneratorFactory.cxx
+++ b/Source/CPack/cmCPackGeneratorFactory.cxx
@@ -151,8 +151,7 @@ cmCPackGeneratorFactory::~cmCPackGeneratorFactory()
 }
 
 //----------------------------------------------------------------------
-cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator(
-                                                const std::string& name)
+cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator(const char* name)
 {
   cmCPackGenerator* gen = this->NewGeneratorInternal(name);
   if ( !gen )
@@ -166,8 +165,12 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator(
 
 //----------------------------------------------------------------------
 cmCPackGenerator* cmCPackGeneratorFactory::NewGeneratorInternal(
-  const std::string& name)
+  const char* name)
 {
+  if ( !name )
+    {
+    return 0;
+    }
   cmCPackGeneratorFactory::t_GeneratorCreatorsMap::iterator it
     = this->GeneratorCreators.find(name);
   if ( it == this->GeneratorCreators.end() )
@@ -178,11 +181,11 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGeneratorInternal(
 }
 
 //----------------------------------------------------------------------
-void cmCPackGeneratorFactory::RegisterGenerator(const std::string& name,
+void cmCPackGeneratorFactory::RegisterGenerator(const char* name,
   const char* generatorDescription,
   CreateGeneratorCall* createGenerator)
 {
-  if ( !createGenerator )
+  if ( !name || !createGenerator )
     {
     cmCPack_Log(this->Logger, cmCPackLog::LOG_ERROR,
       "Cannot register generator" << std::endl);
diff --git a/Source/CPack/cmCPackGeneratorFactory.h b/Source/CPack/cmCPackGeneratorFactory.h
index 010777f..dff2e49 100644
--- a/Source/CPack/cmCPackGeneratorFactory.h
+++ b/Source/CPack/cmCPackGeneratorFactory.h
@@ -31,26 +31,26 @@ public:
   ~cmCPackGeneratorFactory();
 
   //! Get the generator
-  cmCPackGenerator* NewGenerator(const std::string& name);
+  cmCPackGenerator* NewGenerator(const char* name);
   void DeleteGenerator(cmCPackGenerator* gen);
 
   typedef cmCPackGenerator* CreateGeneratorCall();
 
-  void RegisterGenerator(const std::string& name,
+  void RegisterGenerator(const char* name,
     const char* generatorDescription,
     CreateGeneratorCall* createGenerator);
 
   void SetLogger(cmCPackLog* logger) { this->Logger = logger; }
 
-  typedef std::map<std::string, std::string> DescriptionsMap;
+  typedef std::map<cmStdString, cmStdString> DescriptionsMap;
   const DescriptionsMap& GetGeneratorsList() const
     { return this->GeneratorDescriptions; }
 
 private:
-  cmCPackGenerator* NewGeneratorInternal(const std::string& name);
+  cmCPackGenerator* NewGeneratorInternal(const char* name);
   std::vector<cmCPackGenerator*> Generators;
 
-  typedef std::map<std::string, CreateGeneratorCall*> t_GeneratorCreatorsMap;
+  typedef std::map<cmStdString, CreateGeneratorCall*> t_GeneratorCreatorsMap;
   t_GeneratorCreatorsMap GeneratorCreators;
   DescriptionsMap GeneratorDescriptions;
   cmCPackLog* Logger;
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index d33b734..76e15fb 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -227,7 +227,7 @@ int cmCPackOSXX11Generator::InitializeInternal()
 
 //----------------------------------------------------------------------
 /*
-bool cmCPackOSXX11Generator::CopyCreateResourceFile(const std::string& name)
+bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name)
 {
   std::string uname = cmSystemTools::UpperCase(name);
   std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname;
@@ -271,8 +271,8 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const std::string& name)
 */
 
 //----------------------------------------------------------------------
-bool cmCPackOSXX11Generator::CopyResourcePlistFile(const std::string& name,
-  const std::string& dir, const char* outputFileName /* = 0 */,
+bool cmCPackOSXX11Generator::CopyResourcePlistFile(const char* name,
+  const char* dir, const char* outputFileName /* = 0 */,
   bool copyOnly /* = false */)
 {
   std::string inFName = "CPack.";
diff --git a/Source/CPack/cmCPackOSXX11Generator.h b/Source/CPack/cmCPackOSXX11Generator.h
index 25d9a18..b7bd243 100644
--- a/Source/CPack/cmCPackOSXX11Generator.h
+++ b/Source/CPack/cmCPackOSXX11Generator.h
@@ -37,10 +37,9 @@ protected:
   virtual const char* GetPackagingInstallPrefix();
   virtual const char* GetOutputExtension() { return ".dmg"; }
 
-  //bool CopyCreateResourceFile(const std::string& name,
-  //                            const std::string& dir);
-  bool CopyResourcePlistFile(const std::string& name, const char* dir,
-    const std::string& outputFileName = 0, bool copyOnly = false);
+  //bool CopyCreateResourceFile(const char* name, const char* dir);
+  bool CopyResourcePlistFile(const char* name, const char* dir,
+    const char* outputFileName = 0, bool copyOnly = false);
   std::string InstallPrefix;
 };
 
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index d001f84..c5b9c6f 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -553,9 +553,8 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
 }
 
 //----------------------------------------------------------------------
-bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(
-                                            const std::string& name,
-                                            const std::string& dirName)
+bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
+                                                          const char* dirName)
 {
   std::string uname = cmSystemTools::UpperCase(name);
   std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname;
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h
index bebb633..ba3d968 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.h
+++ b/Source/CPack/cmCPackPackageMakerGenerator.h
@@ -51,8 +51,7 @@ protected:
   // CPACK_RESOURCE_FILE_${NAME} (where ${NAME} is the uppercased
   // version of name) specifies the input file to use for this file,
   // which will be configured via ConfigureFile.
-  bool CopyCreateResourceFile(const std::string& name,
-                              const std::string& dirName);
+  bool CopyCreateResourceFile(const char* name, const char *dirName);
   bool CopyResourcePlistFile(const char* name, const char* outName = 0);
 
   // Run PackageMaker with the given command line, which will (if
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index d74c38d..a19b778 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -68,7 +68,7 @@ int cpackUnknownArgument(const char*, void*)
 //----------------------------------------------------------------------------
 struct cpackDefinitions
 {
-  typedef std::map<std::string, std::string> MapType;
+  typedef std::map<cmStdString, cmStdString> MapType;
   MapType Map;
   cmCPackLog *Log;
 };
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx
index 840ebc9..381c70c 100644
--- a/Source/CTest/cmCTestBZR.cxx
+++ b/Source/CTest/cmCTestBZR.cxx
@@ -409,7 +409,7 @@ bool cmCTestBZR::UpdateImpl()
     {
     opts = this->CTest->GetCTestConfiguration("BZRUpdateOptions");
     }
-  std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
+  std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str());
 
   // TODO: if(this->CTest->GetTestModel() == cmCTest::NIGHTLY)
 
@@ -418,7 +418,7 @@ bool cmCTestBZR::UpdateImpl()
   bzr_update.push_back(this->CommandLineTool.c_str());
   bzr_update.push_back("pull");
 
-  for(std::vector<std::string>::const_iterator ai = args.begin();
+  for(std::vector<cmStdString>::const_iterator ai = args.begin();
       ai != args.end(); ++ai)
     {
     bzr_update.push_back(ai->c_str());
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h
index d1e9a4d..ca50c64 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.h
+++ b/Source/CTest/cmCTestBuildAndTestHandler.h
@@ -54,7 +54,7 @@ protected:
                std::string &cmakeOutString,
                std::string &cwd, cmake *cm);
 
-  std::string  Output;
+  cmStdString  Output;
 
   std::string              BuildGenerator;
   std::string              BuildGeneratorToolset;
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 291c70a..c5deb96 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -380,7 +380,7 @@ int cmCTestBuildHandler::ProcessHandler()
 
   // Create lists of regular expression strings for errors, error exceptions,
   // warnings and warning exceptions.
-  std::vector<std::string>::size_type cc;
+  std::vector<cmStdString>::size_type cc;
   for ( cc = 0; cmCTestErrorMatches[cc]; cc ++ )
     {
     this->CustomErrorMatches.push_back(cmCTestErrorMatches[cc]);
@@ -400,7 +400,7 @@ int cmCTestBuildHandler::ProcessHandler()
     }
 
   // Pre-compile regular expressions objects for all regular expressions
-  std::vector<std::string>::iterator it;
+  std::vector<cmStdString>::iterator it;
 
 #define cmCTestBuildHandlerPopulateRegexVector(strings, regexes) \
   regexes.clear(); \
@@ -602,7 +602,7 @@ void cmCTestBuildHandler::GenerateXMLLaunched(std::ostream& os)
   // Sort XML fragments in chronological order.
   cmFileTimeComparison ftc;
   FragmentCompare fragmentCompare(&ftc);
-  typedef std::set<std::string, FragmentCompare> Fragments;
+  typedef std::set<cmStdString, FragmentCompare> Fragments;
   Fragments fragments(fragmentCompare);
 
   // Identify fragments on disk.
@@ -889,7 +889,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
   int* retVal, const char* dir, int timeout, std::ostream& ofs)
 {
   // First generate the command and arguments
-  std::vector<std::string> args = cmSystemTools::ParseArguments(command);
+  std::vector<cmStdString> args = cmSystemTools::ParseArguments(command);
 
   if(args.size() < 1)
     {
@@ -897,7 +897,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
     }
 
   std::vector<const char*> argv;
-  for(std::vector<std::string>::const_iterator a = args.begin();
+  for(std::vector<cmStdString>::const_iterator a = args.begin();
     a != args.end(); ++a)
     {
     argv.push_back(a->c_str());
@@ -1133,7 +1133,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
         errorwarning.PostContext = "";
 
         // Copy pre-context to report
-        std::deque<std::string>::iterator pcit;
+        std::deque<cmStdString>::iterator pcit;
         for ( pcit = this->PreContext.begin();
           pcit != this->PreContext.end();
           ++pcit )
diff --git a/Source/CTest/cmCTestBuildHandler.h b/Source/CTest/cmCTestBuildHandler.h
index 09346f9..ff7cfd6 100644
--- a/Source/CTest/cmCTestBuildHandler.h
+++ b/Source/CTest/cmCTestBuildHandler.h
@@ -97,10 +97,10 @@ private:
   double                  StartBuildTime;
   double                  EndBuildTime;
 
-  std::vector<std::string> CustomErrorMatches;
-  std::vector<std::string> CustomErrorExceptions;
-  std::vector<std::string> CustomWarningMatches;
-  std::vector<std::string> CustomWarningExceptions;
+  std::vector<cmStdString> CustomErrorMatches;
+  std::vector<cmStdString> CustomErrorExceptions;
+  std::vector<cmStdString> CustomWarningMatches;
+  std::vector<cmStdString> CustomWarningExceptions;
   std::vector<std::string> ReallyCustomWarningMatches;
   std::vector<std::string> ReallyCustomWarningExceptions;
   std::vector<cmCTestCompileErrorWarningRex> ErrorWarningFileLineRegex;
@@ -121,8 +121,8 @@ private:
   size_t                                BuildOutputLogSize;
   std::vector<char>                     CurrentProcessingLine;
 
-  std::string                           SimplifySourceDir;
-  std::string                           SimplifyBuildDir;
+  cmStdString                           SimplifySourceDir;
+  cmStdString                           SimplifyBuildDir;
   size_t                                OutputLineCounter;
   typedef std::vector<cmCTestBuildErrorWarning> t_ErrorsAndWarningsVector;
   t_ErrorsAndWarningsVector             ErrorsAndWarnings;
@@ -130,7 +130,7 @@ private:
   size_t                                PostContextCount;
   size_t                                MaxPreContext;
   size_t                                MaxPostContext;
-  std::deque<std::string>               PreContext;
+  std::deque<cmStdString>               PreContext;
 
   int                                   TotalErrors;
   int                                   TotalWarnings;
diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx
index ab363d0..17dbb55 100644
--- a/Source/CTest/cmCTestCVS.cxx
+++ b/Source/CTest/cmCTestCVS.cxx
@@ -99,7 +99,7 @@ bool cmCTestCVS::UpdateImpl()
       opts = "-dP";
       }
     }
-  std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
+  std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str());
 
   // Specify the start time for nightly testing.
   if(this->CTest->GetTestModel() == cmCTest::NIGHTLY)
@@ -112,7 +112,7 @@ bool cmCTestCVS::UpdateImpl()
   cvs_update.push_back(this->CommandLineTool.c_str());
   cvs_update.push_back("-z3");
   cvs_update.push_back("update");
-  for(std::vector<std::string>::const_iterator ai = args.begin();
+  for(std::vector<cmStdString>::const_iterator ai = args.begin();
       ai != args.end(); ++ai)
     {
     cvs_update.push_back(ai->c_str());
@@ -308,7 +308,7 @@ bool cmCTestCVS::WriteXMLUpdates(std::ostream& xml)
              "   Gathering version information (one . per updated file):\n"
              "    " << std::flush);
 
-  for(std::map<std::string, Directory>::const_iterator
+  for(std::map<cmStdString, Directory>::const_iterator
         di = this->Dirs.begin(); di != this->Dirs.end(); ++di)
     {
     this->WriteXMLDirectory(xml, di->first, di->second);
diff --git a/Source/CTest/cmCTestCVS.h b/Source/CTest/cmCTestCVS.h
index 64e1747..b7fe567 100644
--- a/Source/CTest/cmCTestCVS.h
+++ b/Source/CTest/cmCTestCVS.h
@@ -32,8 +32,8 @@ private:
   virtual bool WriteXMLUpdates(std::ostream& xml);
 
   // Update status for files in each directory.
-  class Directory: public std::map<std::string, PathStatus> {};
-  std::map<std::string, Directory> Dirs;
+  class Directory: public std::map<cmStdString, PathStatus> {};
+  std::map<cmStdString, Directory> Dirs;
 
   std::string ComputeBranchFlag(std::string const& dir);
   void LoadRevisions(std::string const& file, const char* branchFlag,
diff --git a/Source/CTest/cmCTestCoverageCommand.h b/Source/CTest/cmCTestCoverageCommand.h
index 3731592..11bb411 100644
--- a/Source/CTest/cmCTestCoverageCommand.h
+++ b/Source/CTest/cmCTestCoverageCommand.h
@@ -56,7 +56,7 @@ protected:
   };
 
   bool LabelsMentioned;
-  std::set<std::string> Labels;
+  std::set<cmStdString> Labels;
 };
 
 
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 7ddc28b..3c65c55 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -363,7 +363,7 @@ int cmCTestCoverageHandler::ProcessHandler()
 
   // setup the regex exclude stuff
   this->CustomCoverageExcludeRegex.clear();
-  std::vector<std::string>::iterator rexIt;
+  std::vector<cmStdString>::iterator rexIt;
   for ( rexIt = this->CustomCoverageExclude.begin();
     rexIt != this->CustomCoverageExclude.end();
     ++ rexIt )
@@ -713,7 +713,7 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile *mf)
                                 this->CustomCoverageExclude);
   this->CTest->PopulateCustomVector(mf, "CTEST_EXTRA_COVERAGE_GLOB",
                                 this->ExtraCoverageGlobs);
-  std::vector<std::string>::iterator it;
+  std::vector<cmStdString>::iterator it;
   for ( it = this->CustomCoverageExclude.begin();
     it != this->CustomCoverageExclude.end();
     ++ it )
@@ -983,8 +983,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
       << "--------------------------------------------------------------"
       << std::endl);
 
-    std::vector<std::string> lines;
-    std::vector<std::string>::iterator line;
+    std::vector<cmStdString> lines;
+    std::vector<cmStdString>::iterator line;
 
     cmSystemTools::Split(output.c_str(), lines);
 
@@ -1498,7 +1498,7 @@ namespace
 //----------------------------------------------------------------------
 int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
   cmCTestCoverageHandlerContainer* cont,
-  std::set<std::string>& coveredFileNames,
+  std::set<cmStdString>& coveredFileNames,
   std::vector<std::string>& files,
   std::vector<std::string>& filesFullPath)
 {
@@ -1539,7 +1539,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
                outputFile.c_str() << std::endl);
     return 0;
     }
-  std::map<std::string, std::string> fileMap;
+  std::map<cmStdString, cmStdString> fileMap;
   std::vector<std::string>::iterator fp = filesFullPath.begin();
   for(std::vector<std::string>::iterator f =  files.begin();
       f != files.end(); ++f, ++fp)
@@ -1552,7 +1552,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
   std::string lineIn;
   bool valid = false; // are we in a valid output file
   int line = 0; // line of the current file
-  std::string file;
+  cmStdString file;
   while(cmSystemTools::GetLineFromStream(fin, lineIn))
     {
     bool startFile = false;
@@ -1587,7 +1587,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
           }
         count++; // move on one
         }
-      std::map<std::string, std::string>::iterator
+      std::map<cmStdString, cmStdString>::iterator
         i = fileMap.find(file);
       // if the file should be covered write out the header for that file
       if(i != fileMap.end())
@@ -1752,7 +1752,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
                outputFile.c_str() << std::endl);
     return 0;
     }
-  std::set<std::string> coveredFileNames;
+  std::set<cmStdString> coveredFileNames;
   while(cmSystemTools::GetLineFromStream(fin, stdline))
     {
     // if we have a line of output from stdout
@@ -2099,10 +2099,10 @@ void cmCTestCoverageHandler::WriteXMLLabels(std::ostream& os,
 
 //----------------------------------------------------------------------------
 void
-cmCTestCoverageHandler::SetLabelFilter(std::set<std::string> const& labels)
+cmCTestCoverageHandler::SetLabelFilter(std::set<cmStdString> const& labels)
 {
   this->LabelFilter.clear();
-  for(std::set<std::string>::const_iterator li = labels.begin();
+  for(std::set<cmStdString>::const_iterator li = labels.begin();
       li != labels.end(); ++li)
     {
     this->LabelFilter.insert(this->GetLabelId(*li));
@@ -2152,7 +2152,7 @@ std::set<std::string> cmCTestCoverageHandler::FindUncoveredFiles(
 {
   std::set<std::string> extraMatches;
 
-  for(std::vector<std::string>::iterator i = this->ExtraCoverageGlobs.begin();
+  for(std::vector<cmStdString>::iterator i = this->ExtraCoverageGlobs.begin();
       i != this->ExtraCoverageGlobs.end(); ++i)
     {
     cmsys::Glob gl;
diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h
index 6a8f55d..660f501 100644
--- a/Source/CTest/cmCTestCoverageHandler.h
+++ b/Source/CTest/cmCTestCoverageHandler.h
@@ -55,7 +55,7 @@ public:
   void PopulateCustomVectors(cmMakefile *mf);
 
   /** Report coverage only for sources with these labels.  */
-  void SetLabelFilter(std::set<std::string> const& labels);
+  void SetLabelFilter(std::set<cmStdString> const& labels);
 
 private:
   bool ShouldIDoCoverage(const char* file, const char* srcDir,
@@ -81,7 +81,7 @@ private:
   int HandleBullseyeCoverage(cmCTestCoverageHandlerContainer* cont);
   int RunBullseyeSourceSummary(cmCTestCoverageHandlerContainer* cont);
   int RunBullseyeCoverageBranch(cmCTestCoverageHandlerContainer* cont,
-                                std::set<std::string>& coveredFileNames,
+                                std::set<cmStdString>& coveredFileNames,
                                 std::vector<std::string>& files,
                                 std::vector<std::string>& filesFullPath);
 
@@ -112,19 +112,19 @@ private:
 
   std::set<std::string> FindUncoveredFiles(
     cmCTestCoverageHandlerContainer* cont);
-  std::vector<std::string> CustomCoverageExclude;
+  std::vector<cmStdString> CustomCoverageExclude;
   std::vector<cmsys::RegularExpression> CustomCoverageExcludeRegex;
-  std::vector<std::string> ExtraCoverageGlobs;
+  std::vector<cmStdString> ExtraCoverageGlobs;
 
 
   // Map from source file to label ids.
   class LabelSet: public std::set<int> {};
-  typedef std::map<std::string, LabelSet> LabelMapType;
+  typedef std::map<cmStdString, LabelSet> LabelMapType;
   LabelMapType SourceLabels;
   LabelMapType TargetDirs;
 
   // Map from label name to label id.
-  typedef std::map<std::string, int> LabelIdMapType;
+  typedef std::map<cmStdString, int> LabelIdMapType;
   LabelIdMapType LabelIdMap;
   std::vector<std::string> Labels;
   int GetLabelId(std::string const& label);
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index aaa01b2..0e0e797 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -179,8 +179,8 @@ bool cmCTestGIT::UpdateByFetchAndReset()
     {
     opts = this->CTest->GetCTestConfiguration("GITUpdateOptions");
     }
-  std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
-  for(std::vector<std::string>::const_iterator ai = args.begin();
+  std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str());
+  for(std::vector<cmStdString>::const_iterator ai = args.begin();
       ai != args.end(); ++ai)
     {
     git_fetch.push_back(ai->c_str());
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx
index ae498ea..5338f30 100644
--- a/Source/CTest/cmCTestGenericHandler.cxx
+++ b/Source/CTest/cmCTestGenericHandler.cxx
@@ -30,8 +30,12 @@ cmCTestGenericHandler::~cmCTestGenericHandler()
 }
 
 //----------------------------------------------------------------------
-void cmCTestGenericHandler::SetOption(const std::string& op, const char* value)
+void cmCTestGenericHandler::SetOption(const char* op, const char* value)
 {
+  if ( !op )
+    {
+    return;
+    }
   if ( !value )
     {
     cmCTestGenericHandler::t_StringToString::iterator remit
@@ -47,10 +51,14 @@ void cmCTestGenericHandler::SetOption(const std::string& op, const char* value)
 }
 
 //----------------------------------------------------------------------
-void cmCTestGenericHandler::SetPersistentOption(const std::string& op,
+void cmCTestGenericHandler::SetPersistentOption(const char* op,
                                                 const char* value)
 {
   this->SetOption(op, value);
+  if ( !op )
+    {
+    return;
+    }
   if ( !value )
     {
     cmCTestGenericHandler::t_StringToString::iterator remit
@@ -80,7 +88,7 @@ void cmCTestGenericHandler::Initialize()
 }
 
 //----------------------------------------------------------------------
-const char* cmCTestGenericHandler::GetOption(const std::string& op)
+const char* cmCTestGenericHandler::GetOption(const char* op)
 {
   cmCTestGenericHandler::t_StringToString::iterator remit
     = this->Options.find(op);
diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h
index 2788cba..ba8febb 100644
--- a/Source/CTest/cmCTestGenericHandler.h
+++ b/Source/CTest/cmCTestGenericHandler.h
@@ -71,12 +71,12 @@ public:
   cmCTestGenericHandler();
   virtual ~cmCTestGenericHandler();
 
-  typedef std::map<std::string,std::string> t_StringToString;
+  typedef std::map<cmStdString,cmStdString> t_StringToString;
 
 
-  void SetPersistentOption(const std::string& op, const char* value);
-  void SetOption(const std::string& op, const char* value);
-  const char* GetOption(const std::string& op);
+  void SetPersistentOption(const char* op, const char* value);
+  void SetOption(const char* op, const char* value);
+  const char* GetOption(const char* op);
 
   void SetCommand(cmCTestCommand* command)
     {
diff --git a/Source/CTest/cmCTestGlobalVC.cxx b/Source/CTest/cmCTestGlobalVC.cxx
index 5f570b5..8c51102 100644
--- a/Source/CTest/cmCTestGlobalVC.cxx
+++ b/Source/CTest/cmCTestGlobalVC.cxx
@@ -132,7 +132,7 @@ bool cmCTestGlobalVC::WriteXMLUpdates(std::ostream& xml)
 
   this->WriteXMLGlobal(xml);
 
-  for(std::map<std::string, Directory>::const_iterator
+  for(std::map<cmStdString, Directory>::const_iterator
         di = this->Dirs.begin(); di != this->Dirs.end(); ++di)
     {
     this->WriteXMLDirectory(xml, di->first, di->second);
diff --git a/Source/CTest/cmCTestGlobalVC.h b/Source/CTest/cmCTestGlobalVC.h
index cb0d165..a648a59 100644
--- a/Source/CTest/cmCTestGlobalVC.h
+++ b/Source/CTest/cmCTestGlobalVC.h
@@ -39,8 +39,8 @@ protected:
   };
 
   // Update status for files in each directory.
-  class Directory: public std::map<std::string, File> {};
-  std::map<std::string, Directory> Dirs;
+  class Directory: public std::map<cmStdString, File> {};
+  std::map<cmStdString, Directory> Dirs;
 
   // Old and new repository revisions.
   std::string OldRevision;
diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx
index 5bf9949..86a7617 100644
--- a/Source/CTest/cmCTestHG.cxx
+++ b/Source/CTest/cmCTestHG.cxx
@@ -149,8 +149,8 @@ bool cmCTestHG::UpdateImpl()
     {
     opts = this->CTest->GetCTestConfiguration("HGUpdateOptions");
     }
-  std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
-  for(std::vector<std::string>::const_iterator ai = args.begin();
+  std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str());
+  for(std::vector<cmStdString>::const_iterator ai = args.begin();
       ai != args.end(); ++ai)
     {
     hg_update.push_back(ai->c_str());
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index dbcfcaf..7d9c034 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -567,7 +567,7 @@ void cmCTestLaunch::WriteXMLLabels(std::ostream& fxml)
     fxml << "\n";
     fxml << "\t\t<!-- Interested parties -->\n";
     fxml << "\t\t<Labels>\n";
-    for(std::set<std::string>::const_iterator li = this->Labels.begin();
+    for(std::set<cmStdString>::const_iterator li = this->Labels.begin();
         li != this->Labels.end(); ++li)
       {
       fxml << "\t\t\t<Label>" << cmXMLSafe(*li) << "</Label>\n";
diff --git a/Source/CTest/cmCTestLaunch.h b/Source/CTest/cmCTestLaunch.h
index 69f1ca5..a86a9df 100644
--- a/Source/CTest/cmCTestLaunch.h
+++ b/Source/CTest/cmCTestLaunch.h
@@ -73,7 +73,7 @@ private:
   bool HaveErr;
 
   // Labels associated with the build rule.
-  std::set<std::string> Labels;
+  std::set<cmStdString> Labels;
   void LoadLabels();
   bool SourceMatches(std::string const& lhs,
                      std::string const& rhs);
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index f2982a4..fdce04d 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -246,8 +246,8 @@ int cmCTestMemCheckHandler::PostProcessHandler()
 void cmCTestMemCheckHandler::GenerateTestCommand(
   std::vector<std::string>& args, int test)
 {
-  std::vector<std::string>::size_type pp;
-  std::string index;
+  std::vector<cmStdString>::size_type pp;
+  cmStdString index;
   cmOStringStream stream;
   std::string memcheckcommand
     = cmSystemTools::ConvertToOutputPath(this->MemoryTester.c_str());
@@ -255,9 +255,9 @@ void cmCTestMemCheckHandler::GenerateTestCommand(
   index = stream.str();
   for ( pp = 0; pp < this->MemoryTesterDynamicOptions.size(); pp ++ )
     {
-      std::string arg = this->MemoryTesterDynamicOptions[pp];
-      std::string::size_type pos = arg.find("??");
-    if (pos != std::string::npos)
+    cmStdString arg = this->MemoryTesterDynamicOptions[pp];
+    cmStdString::size_type pos = arg.find("??");
+    if (pos != cmStdString::npos)
       {
       arg.replace(pos, 2, index);
       }
@@ -580,7 +580,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
       return false;
     }
 
-  std::vector<std::string>::size_type cc;
+  std::vector<cmStdString>::size_type cc;
   for ( cc = 0; cmCTestMemCheckResultStrings[cc]; cc ++ )
     {
     this->MemoryTesterGlobalResults[cc] = 0;
@@ -627,7 +627,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
   const std::string& str, std::string& log,
   int* results)
 {
-  std::vector<std::string> lines;
+  std::vector<cmStdString> lines;
   cmSystemTools::Split(str.c_str(), lines);
   cmOStringStream ostr;
   log = "";
@@ -636,7 +636,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
 
   int defects = 0;
 
-  for( std::vector<std::string>::iterator i = lines.begin();
+  for( std::vector<cmStdString>::iterator i = lines.begin();
        i != lines.end(); ++i)
     {
     int failure = cmCTestMemCheckHandler::NO_MEMORY_FAULT;
@@ -681,7 +681,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
   const std::string& str, std::string& log,
   int* results)
 {
-  std::vector<std::string> lines;
+  std::vector<cmStdString> lines;
   cmSystemTools::Split(str.c_str(), lines);
   bool unlimitedOutput = false;
   if(str.find("CTEST_FULL_OUTPUT") != str.npos ||
@@ -864,10 +864,10 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
 {
   log = "";
   double sttime = cmSystemTools::GetTime();
-  std::vector<std::string> lines;
+  std::vector<cmStdString> lines;
   cmSystemTools::Split(str.c_str(), lines);
   cmCTestLog(this->CTest, DEBUG, "Start test: " << lines.size() << std::endl);
-  std::vector<std::string>::size_type cc;
+  std::vector<cmStdString>::size_type cc;
   for ( cc = 0; cc < lines.size(); cc ++ )
     {
     if(lines[cc] == BOUNDS_CHECKER_MARKER)
@@ -923,7 +923,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
   cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
              "PostProcessBoundsCheckerTest for : "
              << res.Name.c_str() << std::endl);
-  std::string ofile = testOutputFileName(test);
+  cmStdString ofile = testOutputFileName(test);
   if ( ofile.empty() )
     {
     return;
@@ -979,7 +979,7 @@ void
 cmCTestMemCheckHandler::appendMemTesterOutput(cmCTestTestResult& res,
                                               int test)
 {
-  std::string ofile = testOutputFileName(test);
+  cmStdString ofile = testOutputFileName(test);
 
   if ( ofile.empty() )
     {
@@ -1000,15 +1000,15 @@ cmCTestMemCheckHandler::appendMemTesterOutput(cmCTestTestResult& res,
     }
 }
 
-std::string
+cmStdString
 cmCTestMemCheckHandler::testOutputFileName(int test)
 {
-  std::string index;
+  cmStdString index;
   cmOStringStream stream;
   stream << test;
   index = stream.str();
-  std::string ofile = this->MemoryTesterOutputFile;
-  std::string::size_type pos = ofile.find("??");
+  cmStdString ofile = this->MemoryTesterOutputFile;
+  cmStdString::size_type pos = ofile.find("??");
   ofile.replace(pos, 2, index);
 
   if ( !cmSystemTools::FileExists(ofile.c_str()) )
diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h
index 0521a48..040d2e0 100644
--- a/Source/CTest/cmCTestMemCheckHandler.h
+++ b/Source/CTest/cmCTestMemCheckHandler.h
@@ -89,8 +89,8 @@ private:
   std::string              BoundsCheckerDPBDFile;
   std::string              BoundsCheckerXMLFile;
   std::string              MemoryTester;
-  std::vector<std::string> MemoryTesterDynamicOptions;
-  std::vector<std::string> MemoryTesterOptions;
+  std::vector<cmStdString> MemoryTesterDynamicOptions;
+  std::vector<cmStdString> MemoryTesterOptions;
   int                      MemoryTesterStyle;
   std::string              MemoryTesterOutputFile;
   int                      MemoryTesterGlobalResults[NO_MEMORY_FAULT];
@@ -103,8 +103,8 @@ private:
    */
   void GenerateDartOutput(std::ostream& os);
 
-  std::vector<std::string> CustomPreMemCheck;
-  std::vector<std::string> CustomPostMemCheck;
+  std::vector<cmStdString> CustomPreMemCheck;
+  std::vector<cmStdString> CustomPostMemCheck;
 
   //! Parse Valgrind/Purify/Bounds Checker result out of the output
   //string. After running, log holds the output and results hold the
@@ -127,7 +127,7 @@ private:
                              int test);
 
   ///! generate the output filename for the given test index
-  std::string testOutputFileName(int test);
+  cmStdString testOutputFileName(int test);
 };
 
 #endif
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index c979be3..ddd1707 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -369,7 +369,7 @@ void cmCTestMultiProcessHandler::UpdateCostData()
 
   // Write list of failed tests
   fout << "---\n";
-  for(std::vector<std::string>::iterator i = this->Failed->begin();
+  for(std::vector<cmStdString>::iterator i = this->Failed->begin();
       i != this->Failed->end(); ++i)
     {
     fout << i->c_str() << "\n";
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index 605de31..1b53ec7 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -41,8 +41,8 @@ public:
   void PrintTestList();
   void PrintLabels();
 
-  void SetPassFailVectors(std::vector<std::string>* passed,
-                          std::vector<std::string>* failed)
+  void SetPassFailVectors(std::vector<cmStdString>* passed,
+                          std::vector<cmStdString>* failed)
     {
     this->Passed = passed;
     this->Failed = failed;
@@ -107,9 +107,9 @@ protected:
   PropertiesMap Properties;
   std::map<int, bool> TestRunningMap;
   std::map<int, bool> TestFinishMap;
-  std::map<int, std::string> TestOutput;
-  std::vector<std::string>* Passed;
-  std::vector<std::string>* Failed;
+  std::map<int, cmStdString> TestOutput;
+  std::vector<cmStdString>* Passed;
+  std::vector<cmStdString>* Failed;
   std::vector<std::string> LastTestsFailed;
   std::set<std::string> LockedResources;
   std::vector<cmCTestTestHandler::cmCTestTestResult>* TestResults;
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index 1ad94bc..b09d6f5 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -346,10 +346,10 @@ void cmCTestP4::SetP4Options(std::vector<char const*> &CommandOptions)
     //The CTEST_P4_OPTIONS variable adds additional Perforce command line
     //options before the main command
     std::string opts = this->CTest->GetCTestConfiguration("P4Options");
-    std::vector<std::string> args =
+    std::vector<cmStdString> args =
             cmSystemTools::ParseArguments(opts.c_str());
 
-    for(std::vector<std::string>::const_iterator ai = args.begin();
+    for(std::vector<cmStdString>::const_iterator ai = args.begin();
         ai != args.end(); ++ai)
       {
       P4Options.push_back(ai->c_str());
@@ -538,8 +538,8 @@ bool cmCTestP4::UpdateImpl()
     {
     opts = this->CTest->GetCTestConfiguration("P4UpdateOptions");
     }
-  std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
-  for(std::vector<std::string>::const_iterator ai = args.begin();
+  std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str());
+  for(std::vector<cmStdString>::const_iterator ai = args.begin();
       ai != args.end(); ++ai)
     {
     p4_sync.push_back(ai->c_str());
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index 89592dd..2668c8e 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -277,7 +277,7 @@ bool cmCTestSVN::UpdateImpl()
     {
     opts = this->CTest->GetCTestConfiguration("SVNUpdateOptions");
     }
-  std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
+  std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str());
 
   // Specify the start time for nightly testing.
   if(this->CTest->GetTestModel() == cmCTest::NIGHTLY)
@@ -287,7 +287,7 @@ bool cmCTestSVN::UpdateImpl()
 
   std::vector<char const*> svn_update;
   svn_update.push_back("update");
-  for(std::vector<std::string>::const_iterator ai = args.begin();
+  for(std::vector<cmStdString>::const_iterator ai = args.begin();
       ai != args.end(); ++ai)
     {
     svn_update.push_back(ai->c_str());
@@ -314,9 +314,9 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
   std::string userOptions =
     this->CTest->GetCTestConfiguration("SVNOptions");
 
-  std::vector<std::string> parsedUserOptions =
+  std::vector<cmStdString> parsedUserOptions =
     cmSystemTools::ParseArguments(userOptions.c_str());
-  for(std::vector<std::string>::iterator i = parsedUserOptions.begin();
+  for(std::vector<cmStdString>::iterator i = parsedUserOptions.begin();
       i != parsedUserOptions.end(); ++i)
     {
     args.push_back(i->c_str());
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 7f13855..00a0a09 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -231,7 +231,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
              cmSystemTools::GetCTestCommand() << "\n");
 
   // now pass through all the other arguments
-  std::vector<std::string> &initArgs =
+  std::vector<cmStdString> &initArgs =
     this->CTest->GetInitialCommandLineArguments();
   //*** need to make sure this does not have the current script ***
   for(size_t i=1; i < initArgs.size(); ++i)
@@ -766,7 +766,7 @@ int cmCTestScriptHandler::PerformExtraUpdates()
 
   // do an initial cvs update as required
   command = this->UpdateCmd;
-  std::vector<std::string>::iterator it;
+  std::vector<cmStdString>::iterator it;
   for (it = this->ExtraUpdates.begin();
     it != this->ExtraUpdates.end();
     ++ it )
diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h
index 42c2f20..44e9dd0 100644
--- a/Source/CTest/cmCTestScriptHandler.h
+++ b/Source/CTest/cmCTestScriptHandler.h
@@ -138,26 +138,26 @@ private:
   // Try to remove the binary directory once
   static bool TryToRemoveBinaryDirectoryOnce(const std::string& directoryPath);
 
-  std::vector<std::string> ConfigurationScripts;
+  std::vector<cmStdString> ConfigurationScripts;
   std::vector<bool> ScriptProcessScope;
 
   bool Backup;
   bool EmptyBinDir;
   bool EmptyBinDirOnce;
 
-  std::string SourceDir;
-  std::string BinaryDir;
-  std::string BackupSourceDir;
-  std::string BackupBinaryDir;
-  std::string CTestRoot;
-  std::string CVSCheckOut;
-  std::string CTestCmd;
-  std::string UpdateCmd;
-  std::string CTestEnv;
-  std::string InitialCache;
-  std::string CMakeCmd;
-  std::string CMOutFile;
-  std::vector<std::string> ExtraUpdates;
+  cmStdString SourceDir;
+  cmStdString BinaryDir;
+  cmStdString BackupSourceDir;
+  cmStdString BackupBinaryDir;
+  cmStdString CTestRoot;
+  cmStdString CVSCheckOut;
+  cmStdString CTestCmd;
+  cmStdString UpdateCmd;
+  cmStdString CTestEnv;
+  cmStdString InitialCache;
+  cmStdString CMakeCmd;
+  cmStdString CMOutFile;
+  std::vector<cmStdString> ExtraUpdates;
 
   double MinimumInterval;
   double ContinuousDuration;
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index 07a994d..24974e3 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -72,7 +72,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
   if (notesFilesVariable)
     {
     std::vector<std::string> notesFiles;
-    cmCTest::VectorOfStrings newNotesFiles;
+    std::vector<cmStdString> newNotesFiles;
     cmSystemTools::ExpandListArgument(notesFilesVariable,notesFiles);
     std::vector<std::string>::iterator it;
     for ( it = notesFiles.begin();
@@ -89,7 +89,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
   if (extraFilesVariable)
     {
     std::vector<std::string> extraFiles;
-    cmCTest::VectorOfStrings newExtraFiles;
+    std::vector<cmStdString> newExtraFiles;
     cmSystemTools::ExpandListArgument(extraFilesVariable,extraFiles);
     std::vector<std::string>::iterator it;
     for ( it = extraFiles.begin();
@@ -222,7 +222,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
 
   if(this->ArgumentDoing == ArgumentDoingFiles)
     {
-    std::string filename(arg);
+    cmStdString filename(arg);
     if(cmSystemTools::FileExists(filename.c_str()))
       {
       this->Files.insert(filename);
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 1cd8fc7..139f515 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -170,10 +170,10 @@ void cmCTestSubmitHandler::Initialize()
 }
 
 //----------------------------------------------------------------------------
-bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
-  const std::set<std::string>& files,
-  const std::string& remoteprefix,
-  const std::string& url)
+bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix,
+  const std::set<cmStdString>& files,
+  const cmStdString& remoteprefix,
+  const cmStdString& url)
 {
   CURL *curl;
   CURLcode res;
@@ -217,12 +217,12 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
 
       ::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
 
-      std::string local_file = *file;
+      cmStdString local_file = *file;
       if ( !cmSystemTools::FileExists(local_file.c_str()) )
         {
         local_file = localprefix + "/" + *file;
         }
-      std::string upload_as
+      cmStdString upload_as
         = url + "/" + remoteprefix + cmSystemTools::GetFilenameName(*file);
 
       struct stat st;
@@ -324,10 +324,10 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
 
 //----------------------------------------------------------------------------
 // Uploading files is simpler
-bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
-  const std::set<std::string>& files,
-  const std::string& remoteprefix,
-  const std::string& url)
+bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
+  const std::set<cmStdString>& files,
+  const cmStdString& remoteprefix,
+  const cmStdString& url)
 {
   CURL *curl;
   CURLcode res;
@@ -336,8 +336,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
 
   /* In windows, this will init the winsock stuff */
   ::curl_global_init(CURL_GLOBAL_ALL);
-  std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
-  std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
+  cmStdString dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
+  cmStdString curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
   std::vector<std::string> args;
   cmSystemTools::ExpandListArgument(curlopt.c_str(), args);
   bool verifyPeerOff = false;
@@ -354,7 +354,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
       verifyHostOff = true;
       }
     }
-  std::string::size_type kk;
+  cmStdString::size_type kk;
   cmCTest::SetOfStrings::const_iterator file;
   for ( file = files.begin(); file != files.end(); ++file )
     {
@@ -414,18 +414,18 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
       ::curl_easy_setopt(curl, CURLOPT_PUT, 1);
       ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
 
-      std::string local_file = *file;
+      cmStdString local_file = *file;
       if ( !cmSystemTools::FileExists(local_file.c_str()) )
         {
         local_file = localprefix + "/" + *file;
         }
-      std::string remote_file
+      cmStdString remote_file
         = remoteprefix + cmSystemTools::GetFilenameName(*file);
 
       *this->LogFile << "\tUpload file: " << local_file.c_str() << " to "
           << remote_file.c_str() << std::endl;
 
-      std::string ofile = "";
+      cmStdString ofile = "";
       for ( kk = 0; kk < remote_file.size(); kk ++ )
         {
         char c = remote_file[kk];
@@ -448,8 +448,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
           ofile.append(hexCh);
           }
         }
-      std::string upload_as
-        = url + ((url.find("?",0) == std::string::npos) ? "?" : "&")
+      cmStdString upload_as
+        = url + ((url.find("?",0) == cmStdString::npos) ? "?" : "&")
         + "FileName=" + ofile;
 
       upload_as += "&MD5=";
@@ -666,9 +666,9 @@ void cmCTestSubmitHandler
 
 //----------------------------------------------------------------------------
 bool cmCTestSubmitHandler::TriggerUsingHTTP(
-  const std::set<std::string>& files,
-  const std::string& remoteprefix,
-  const std::string& url)
+  const std::set<cmStdString>& files,
+  const cmStdString& remoteprefix,
+  const cmStdString& url)
 {
   CURL *curl;
   char error_buffer[1024];
@@ -721,10 +721,10 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
       ::curl_easy_setopt(curl, CURLOPT_FILE, (void *)&chunk);
       ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void *)&chunkDebug);
 
-      std::string rfile
+      cmStdString rfile
         = remoteprefix + cmSystemTools::GetFilenameName(*file);
-      std::string ofile = "";
-      std::string::iterator kk;
+      cmStdString ofile = "";
+      cmStdString::iterator kk;
       for ( kk = rfile.begin(); kk < rfile.end(); ++ kk)
         {
         char c = *kk;
@@ -747,8 +747,8 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
           ofile.append(hexCh);
           }
         }
-      std::string turl
-        = url + ((url.find("?",0) == std::string::npos) ? "?" : "&")
+      cmStdString turl
+        = url + ((url.find("?",0) == cmStdString::npos) ? "?" : "&")
         + "xmlfile=" + ofile;
       *this->LogFile << "Trigger url: " << turl.c_str() << std::endl;
       cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "   Trigger url: "
@@ -805,11 +805,11 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
 
 //----------------------------------------------------------------------------
 bool cmCTestSubmitHandler::SubmitUsingSCP(
-  const std::string& scp_command,
-  const std::string& localprefix,
-  const std::set<std::string>& files,
-  const std::string& remoteprefix,
-  const std::string& url)
+  const cmStdString& scp_command,
+  const cmStdString& localprefix,
+  const std::set<cmStdString>& files,
+  const cmStdString& remoteprefix,
+  const cmStdString& url)
 {
   if ( !scp_command.size() || !localprefix.size() ||
     !files.size() || !remoteprefix.size() || !url.size() )
@@ -906,10 +906,10 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(
 
 //----------------------------------------------------------------------------
 bool cmCTestSubmitHandler::SubmitUsingCP(
-  const std::string& localprefix,
-  const std::set<std::string>& files,
-  const std::string& remoteprefix,
-  const std::string& destination)
+  const cmStdString& localprefix,
+  const std::set<cmStdString>& files,
+  const cmStdString& remoteprefix,
+  const cmStdString& destination)
 {
   if ( !localprefix.size() ||
     !files.size() || !remoteprefix.size() || !destination.size() )
@@ -947,17 +947,17 @@ bool cmCTestSubmitHandler::SubmitUsingCP(
 
 //----------------------------------------------------------------------------
 #if defined(CTEST_USE_XMLRPC)
-bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
-  const std::set<std::string>& files,
-  const std::string& remoteprefix,
-  const std::string& url)
+bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix,
+  const std::set<cmStdString>& files,
+  const cmStdString& remoteprefix,
+  const cmStdString& url)
 {
   xmlrpc_env env;
   char ctestString[] = "CTest";
   std::string ctestVersionString = cmVersion::GetCMakeVersion();
   char* ctestVersion = const_cast<char*>(ctestVersionString.c_str());
 
-  std::string realURL = url + "/" + remoteprefix + "/Command/";
+  cmStdString realURL = url + "/" + remoteprefix + "/Command/";
 
   /* Start up our XML-RPC client library. */
   xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, ctestString, ctestVersion);
@@ -973,7 +973,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
     {
     xmlrpc_value *result;
 
-    std::string local_file = *file;
+    cmStdString local_file = *file;
     if ( !cmSystemTools::FileExists(local_file.c_str()) )
       {
       local_file = localprefix + "/" + *file;
@@ -1045,10 +1045,10 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
   return true;
 }
 #else
-bool cmCTestSubmitHandler::SubmitUsingXMLRPC(std::string const&,
-                                             std::set<std::string> const&,
-                                             std::string const&,
-                                             std::string const&)
+bool cmCTestSubmitHandler::SubmitUsingXMLRPC(cmStdString const&,
+                                             std::set<cmStdString> const&,
+                                             cmStdString const&,
+                                             cmStdString const&)
 {
   return false;
 }
@@ -1085,7 +1085,7 @@ int cmCTestSubmitHandler::ProcessHandler()
       }
     if ( getenv("HTTP_PROXY_TYPE") )
       {
-      std::string type = getenv("HTTP_PROXY_TYPE");
+      cmStdString type = getenv("HTTP_PROXY_TYPE");
       // HTTP/SOCKS4/SOCKS5
       if ( type == "HTTP" )
         {
@@ -1122,7 +1122,7 @@ int cmCTestSubmitHandler::ProcessHandler()
       }
     if ( getenv("FTP_PROXY_TYPE") )
       {
-      std::string type = getenv("FTP_PROXY_TYPE");
+      cmStdString type = getenv("FTP_PROXY_TYPE");
       // HTTP/SOCKS4/SOCKS5
       if ( type == "HTTP" )
         {
@@ -1178,7 +1178,7 @@ int cmCTestSubmitHandler::ProcessHandler()
   this->CTest->AddIfExists(cmCTest::PartTest, "Test.xml");
   if(this->CTest->AddIfExists(cmCTest::PartCoverage, "Coverage.xml"))
     {
-    std::vector<std::string> gfiles;
+    cmCTest::VectorOfStrings gfiles;
     std::string gpath
       = buildDirectory + "/Testing/" + this->CTest->GetCurrentTag();
     std::string::size_type glen = gpath.size() + 1;
@@ -1247,7 +1247,7 @@ int cmCTestSubmitHandler::ProcessHandler()
     }
   this->SetLogFile(&ofs);
 
-  std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
+  cmStdString dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
 
   if ( dropMethod == "" || dropMethod == "ftp" )
     {
diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h
index accabd1..14eac80 100644
--- a/Source/CTest/cmCTestSubmitHandler.h
+++ b/Source/CTest/cmCTestSubmitHandler.h
@@ -47,33 +47,33 @@ private:
   /**
    * Submit file using various ways
    */
-  bool SubmitUsingFTP(const std::string& localprefix,
-                      const std::set<std::string>& files,
-                      const std::string& remoteprefix,
-                      const std::string& url);
-  bool SubmitUsingHTTP(const std::string& localprefix,
-                       const std::set<std::string>& files,
-                       const std::string& remoteprefix,
-                       const std::string& url);
-  bool SubmitUsingSCP(const std::string& scp_command,
-                      const std::string& localprefix,
-                      const std::set<std::string>& files,
-                      const std::string& remoteprefix,
-                      const std::string& url);
-
-  bool SubmitUsingCP( const std::string& localprefix,
-                      const std::set<std::string>& files,
-                      const std::string& remoteprefix,
-                      const std::string& url);
-
-  bool TriggerUsingHTTP(const std::set<std::string>& files,
-                        const std::string& remoteprefix,
-                        const std::string& url);
-
-  bool SubmitUsingXMLRPC(const std::string& localprefix,
-                       const std::set<std::string>& files,
-                       const std::string& remoteprefix,
-                       const std::string& url);
+  bool SubmitUsingFTP(const cmStdString& localprefix,
+                      const std::set<cmStdString>& files,
+                      const cmStdString& remoteprefix,
+                      const cmStdString& url);
+  bool SubmitUsingHTTP(const cmStdString& localprefix,
+                       const std::set<cmStdString>& files,
+                       const cmStdString& remoteprefix,
+                       const cmStdString& url);
+  bool SubmitUsingSCP(const cmStdString& scp_command,
+                      const cmStdString& localprefix,
+                      const std::set<cmStdString>& files,
+                      const cmStdString& remoteprefix,
+                      const cmStdString& url);
+
+  bool SubmitUsingCP( const cmStdString& localprefix,
+                      const std::set<cmStdString>& files,
+                      const cmStdString& remoteprefix,
+                      const cmStdString& url);
+
+  bool TriggerUsingHTTP(const std::set<cmStdString>& files,
+                        const cmStdString& remoteprefix,
+                        const cmStdString& url);
+
+  bool SubmitUsingXMLRPC(const cmStdString& localprefix,
+                       const std::set<cmStdString>& files,
+                       const cmStdString& remoteprefix,
+                       const cmStdString& url);
 
   typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
 
@@ -82,10 +82,10 @@ private:
   std::string GetSubmitResultsPrefix();
 
   class         ResponseParser;
-  std::string   HTTPProxy;
+  cmStdString   HTTPProxy;
   int           HTTPProxyType;
-  std::string   HTTPProxyAuth;
-  std::string   FTPProxy;
+  cmStdString   HTTPProxyAuth;
+  cmStdString   FTPProxy;
   int           FTPProxyType;
   std::ostream* LogFile;
   bool SubmitPart[cmCTest::PartCount];
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index b1dddcb..3a04b33 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -540,8 +540,8 @@ int cmCTestTestHandler::ProcessHandler()
   this->StartLogFile((this->MemCheck ? "DynamicAnalysis" : "Test"), mLogFile);
   this->LogFile = &mLogFile;
 
-  std::vector<std::string> passed;
-  std::vector<std::string> failed;
+  std::vector<cmStdString> passed;
+  std::vector<cmStdString> failed;
   int total;
 
   //start the real time clock
@@ -569,7 +569,7 @@ int cmCTestTestHandler::ProcessHandler()
       {
       cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
         << "The following tests passed:" << std::endl);
-      for(std::vector<std::string>::iterator j = passed.begin();
+      for(std::vector<cmStdString>::iterator j = passed.begin();
           j != passed.end(); ++j)
         {
         cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "\t" << *j
@@ -661,8 +661,8 @@ void cmCTestTestHandler::PrintLabelSummary()
   cmCTestTestHandler::ListOfTests::iterator it = this->TestList.begin();
   cmCTestTestHandler::TestResultsVector::iterator ri =
     this->TestResults.begin();
-  std::map<std::string, double> labelTimes;
-  std::set<std::string> labels;
+  std::map<cmStdString, double> labelTimes;
+  std::set<cmStdString> labels;
   // initialize maps
   std::string::size_type maxlen = 0;
   for(; it != this->TestList.end(); ++it)
@@ -702,7 +702,7 @@ void cmCTestTestHandler::PrintLabelSummary()
     {
     cmCTestLog(this->CTest, HANDLER_OUTPUT, "\nLabel Time Summary:");
     }
-  for(std::set<std::string>::const_iterator i = labels.begin();
+  for(std::set<cmStdString>::const_iterator i = labels.begin();
       i != labels.end(); ++i)
     {
     std::string label = *i;
@@ -1050,8 +1050,8 @@ bool cmCTestTestHandler::GetValue(const char* tag,
 }
 
 //---------------------------------------------------------------------
-void cmCTestTestHandler::ProcessDirectory(std::vector<std::string> &passed,
-                                         std::vector<std::string> &failed)
+void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed,
+                                         std::vector<cmStdString> &failed)
 {
   this->ComputeTestList();
   this->StartTest = this->CTest->CurrentTime();
@@ -1216,7 +1216,7 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os)
       << "name=\"Command Line\"><Value>"
       << cmXMLSafe(result->FullCommandLine)
       << "</Value></NamedMeasurement>\n";
-    std::map<std::string,std::string>::iterator measureIt;
+    std::map<cmStdString,cmStdString>::iterator measureIt;
     for ( measureIt = result->Properties->Measurements.begin();
       measureIt != result->Properties->Measurements.end();
       ++ measureIt )
@@ -1328,9 +1328,9 @@ void cmCTestTestHandler::AttachFiles(std::ostream& os,
 }
 
 //----------------------------------------------------------------------
-int cmCTestTestHandler::ExecuteCommands(std::vector<std::string>& vec)
+int cmCTestTestHandler::ExecuteCommands(std::vector<cmStdString>& vec)
 {
-  std::vector<std::string>::iterator it;
+  std::vector<cmStdString>::iterator it;
   for ( it = vec.begin(); it != vec.end(); ++it )
     {
     int retVal = 0;
@@ -2112,7 +2112,7 @@ bool cmCTestTestHandler::SetTestsProperties(
   const std::vector<std::string>& args)
 {
   std::vector<std::string>::const_iterator it;
-  std::vector<std::string> tests;
+  std::vector<cmStdString> tests;
   bool found = false;
   for ( it = args.begin(); it != args.end(); ++ it )
     {
@@ -2137,7 +2137,7 @@ bool cmCTestTestHandler::SetTestsProperties(
       break;
       }
     std::string val = *it;
-    std::vector<std::string>::const_iterator tit;
+    std::vector<cmStdString>::const_iterator tit;
     for ( tit = tests.begin(); tit != tests.end(); ++ tit )
       {
       cmCTestTestHandler::ListOfTests::iterator rtit;
@@ -2319,7 +2319,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
     }
   if ( this->MemCheck )
     {
-    std::vector<std::string>::iterator it;
+    std::vector<cmStdString>::iterator it;
     bool found = false;
     for ( it = this->CustomTestsIgnore.begin();
       it != this->CustomTestsIgnore.end(); ++ it )
@@ -2339,7 +2339,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
     }
   else
     {
-    std::vector<std::string>::iterator it;
+    std::vector<cmStdString>::iterator it;
     bool found = false;
     for ( it = this->CustomTestsIgnore.begin();
       it != this->CustomTestsIgnore.end(); ++ it )
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index fe43bb8..63f9c93 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -87,8 +87,8 @@ public:
   // ctest -j N will break for that feature
   struct cmCTestTestProperties
   {
-    std::string Name;
-    std::string Directory;
+    cmStdString Name;
+    cmStdString Directory;
     std::vector<std::string> Args;
     std::vector<std::string> RequiredFiles;
     std::vector<std::string> Depends;
@@ -98,7 +98,7 @@ public:
                           std::string> > ErrorRegularExpressions;
     std::vector<std::pair<cmsys::RegularExpression,
                           std::string> > RequiredRegularExpressions;
-    std::map<std::string, std::string> Measurements;
+    std::map<cmStdString, cmStdString> Measurements;
     bool IsInBasedOnREOptions;
     bool WillFail;
     float Cost;
@@ -162,7 +162,7 @@ protected:
   virtual int PreProcessHandler();
   virtual int PostProcessHandler();
   virtual void GenerateTestCommand(std::vector<std::string>& args, int test);
-  int ExecuteCommands(std::vector<std::string>& vec);
+  int ExecuteCommands(std::vector<cmStdString>& vec);
 
   void WriteTestResultHeader(std::ostream& os, cmCTestTestResult* result);
   void WriteTestResultFooter(std::ostream& os, cmCTestTestResult* result);
@@ -177,7 +177,7 @@ protected:
   typedef std::vector<cmCTestTestResult> TestResultsVector;
   TestResultsVector    TestResults;
 
-  std::vector<std::string> CustomTestsIgnore;
+  std::vector<cmStdString> CustomTestsIgnore;
   std::string             StartTest;
   std::string             EndTest;
   unsigned int            StartTestTime;
@@ -210,8 +210,8 @@ private:
   /**
    * Run the tests for a directory and any subdirectories
    */
-  void ProcessDirectory(std::vector<std::string> &passed,
-                        std::vector<std::string> &failed);
+  void ProcessDirectory(std::vector<cmStdString> &passed,
+                        std::vector<cmStdString> &failed);
 
   /**
    * Get the list of tests in directory and subdirectories.
@@ -251,8 +251,8 @@ private:
   void ExpandTestsToRunInformation(size_t numPossibleTests);
   void ExpandTestsToRunInformationForRerunFailed();
 
-  std::vector<std::string> CustomPreTest;
-  std::vector<std::string> CustomPostTest;
+  std::vector<cmStdString> CustomPreTest;
+  std::vector<cmStdString> CustomPostTest;
 
   std::vector<int>        TestsToRun;
 
diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx
index f7de294..731c1c7 100644
--- a/Source/CTest/cmCTestUploadCommand.cxx
+++ b/Source/CTest/cmCTestUploadCommand.cxx
@@ -47,7 +47,7 @@ bool cmCTestUploadCommand::CheckArgumentValue(std::string const& arg)
 {
   if(this->ArgumentDoing == ArgumentDoingFiles)
     {
-    std::string filename(arg);
+    cmStdString filename(arg);
     if(cmSystemTools::FileExists(filename.c_str()))
       {
       this->Files.insert(filename);
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index f89fa2b..fbee227 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -63,9 +63,9 @@ bool cmCTestVC::InitialCheckout(const char* command)
     }
 
   // Construct the initial checkout command line.
-  std::vector<std::string> args = cmSystemTools::ParseArguments(command);
+  std::vector<cmStdString> args = cmSystemTools::ParseArguments(command);
   std::vector<char const*> vc_co;
-  for(std::vector<std::string>::const_iterator ai = args.begin();
+  for(std::vector<cmStdString>::const_iterator ai = args.begin();
       ai != args.end(); ++ai)
     {
     vc_co.push_back(ai->c_str());
diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx
index 5bcfeac..528d0db 100644
--- a/Source/CTest/cmParseGTMCoverage.cxx
+++ b/Source/CTest/cmParseGTMCoverage.cxx
@@ -182,7 +182,7 @@ bool cmParseGTMCoverage::ParseMCOVLine(std::string const& line,
   //          ( file  , entry ) = "number_executed:timing_info"
   // ^COVERAGE("%RSEL","init",8,"FOR_LOOP",1)=1
   //          ( file  , entry, line, IGNORE ) =number_executed
-  std::vector<std::string> args;
+  std::vector<cmStdString> args;
   std::string::size_type pos = line.find('(', 0);
   // if no ( is found, then return line has no coverage
   if(pos == std::string::npos)
diff --git a/Source/CTest/cmParseMumpsCoverage.cxx b/Source/CTest/cmParseMumpsCoverage.cxx
index fe98964..6226feb 100644
--- a/Source/CTest/cmParseMumpsCoverage.cxx
+++ b/Source/CTest/cmParseMumpsCoverage.cxx
@@ -140,7 +140,7 @@ bool cmParseMumpsCoverage::LoadPackages(const char* d)
 bool cmParseMumpsCoverage::FindMumpsFile(std::string const& routine,
                                          std::string& filepath)
 {
-  std::map<std::string, std::string>::iterator i =
+  std::map<cmStdString, cmStdString>::iterator i =
     this->RoutineToDirectory.find(routine);
   if(i != this->RoutineToDirectory.end())
     {
diff --git a/Source/CTest/cmParseMumpsCoverage.h b/Source/CTest/cmParseMumpsCoverage.h
index bc71891..c1effa7 100644
--- a/Source/CTest/cmParseMumpsCoverage.h
+++ b/Source/CTest/cmParseMumpsCoverage.h
@@ -44,7 +44,7 @@ protected:
   bool FindMumpsFile(std::string const& routine,
                      std::string& filepath);
 protected:
-  std::map<std::string, std::string> RoutineToDirectory;
+  std::map<cmStdString, cmStdString> RoutineToDirectory;
   cmCTestCoverageHandlerContainer& Coverage;
   cmCTest* CTest;
 };
diff --git a/Source/CTest/cmParsePHPCoverage.cxx b/Source/CTest/cmParsePHPCoverage.cxx
index 3b7f968..1c26c1c 100644
--- a/Source/CTest/cmParsePHPCoverage.cxx
+++ b/Source/CTest/cmParsePHPCoverage.cxx
@@ -34,7 +34,7 @@ bool cmParsePHPCoverage::ReadUntil(std::istream& in, char until)
   return true;
 }
 bool cmParsePHPCoverage::ReadCoverageArray(std::istream& in,
-                                           std::string const& fileName)
+                                           cmStdString const& fileName)
 {
   cmCTestCoverageHandlerContainer::SingleFileCoverageVector& coverageVector
     = this->Coverage.TotalCoverage[fileName];
@@ -166,7 +166,7 @@ bool cmParsePHPCoverage::ReadFileInformation(std::istream& in)
     // read the string data
     in.read(s, size-1);
     s[size-1] = 0;
-    std::string fileName = s;
+    cmStdString fileName = s;
     delete [] s;
     // read close quote
     if(in.get(c) && c != '"')
diff --git a/Source/CTest/cmParsePHPCoverage.h b/Source/CTest/cmParsePHPCoverage.h
index 92a7634..035a093 100644
--- a/Source/CTest/cmParsePHPCoverage.h
+++ b/Source/CTest/cmParsePHPCoverage.h
@@ -35,7 +35,7 @@ private:
   bool ReadArraySize(std::istream& in, int& size);
   bool ReadFileInformation(std::istream& in);
   bool ReadInt(std::istream& in, int& v);
-  bool ReadCoverageArray(std::istream& in, std::string const&);
+  bool ReadCoverageArray(std::istream& in, cmStdString const&);
   bool ReadUntil(std::istream& in, char until);
   cmCTestCoverageHandlerContainer& Coverage;
   cmCTest* CTest;
diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx
index 893ca99..14c325b 100644
--- a/Source/CursesDialog/cmCursesPathWidget.cxx
+++ b/Source/CursesDialog/cmCursesPathWidget.cxx
@@ -57,7 +57,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w)
     {
     glob = cstr + "*";
     }
-  std::vector<std::string> dirs;
+  std::vector<cmStdString> dirs;
 
   cmSystemTools::SimpleGlob(glob.c_str(), dirs, (this->Type == cmCacheManager::PATH?-1:0));
   if ( this->CurrentIndex < dirs.size() )
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx
index d22c74f..01f64b7 100644
--- a/Source/cmAuxSourceDirectoryCommand.cxx
+++ b/Source/cmAuxSourceDirectoryCommand.cxx
@@ -62,7 +62,9 @@ bool cmAuxSourceDirectoryCommand::InitialPass
         std::string base = file.substr(0, dotpos);
         // Process only source files
         if( base.size() != 0
-            && (this->Makefile->GetSourceExtensions().count(ext) > 0) )
+            && std::find( this->Makefile->GetSourceExtensions().begin(),
+                          this->Makefile->GetSourceExtensions().end(), ext )
+                 != this->Makefile->GetSourceExtensions().end() )
           {
           std::string fullname = templateDirectory;
           fullname += "/";
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index ee9b664..acedc1a 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1153,7 +1153,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
   int* retVal, const char* dir, int timeout, std::ostream& ofs)
 {
   // First generate the command and arguments
-  std::vector<std::string> args = cmSystemTools::ParseArguments(command);
+  std::vector<cmStdString> args = cmSystemTools::ParseArguments(command);
 
   if(args.size() < 1)
     {
@@ -1161,7 +1161,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
     }
 
   std::vector<const char*> argv;
-  for(std::vector<std::string>::const_iterator a = args.begin();
+  for(std::vector<cmStdString>::const_iterator a = args.begin();
     a != args.end(); ++a)
     {
     argv.push_back(a->c_str());
@@ -1637,7 +1637,7 @@ int cmCTest::GenerateCTestNotesOutput(std::ostream& os,
 }
 
 //----------------------------------------------------------------------
-int cmCTest::GenerateNotesFile(const VectorOfStrings &files)
+int cmCTest::GenerateNotesFile(const std::vector<cmStdString> &files)
 {
   cmGeneratedFileStream ofs;
   if ( !this->OpenOutputFile(this->CurrentTag, "Notes.xml", ofs) )
@@ -1658,7 +1658,7 @@ int cmCTest::GenerateNotesFile(const char* cfiles)
     return 1;
     }
 
-  VectorOfStrings files;
+  std::vector<cmStdString> files;
 
   cmCTestLog(this, OUTPUT, "Create notes file" << std::endl);
 
@@ -1675,7 +1675,7 @@ int cmCTest::GenerateNotesFile(const char* cfiles)
 std::string cmCTest::Base64GzipEncodeFile(std::string file)
 {
   std::string tarFile = file + "_temp.tar.gz";
-  std::vector<std::string> files;
+  std::vector<cmStdString> files;
   files.push_back(file);
 
   if(!cmSystemTools::CreateTar(tarFile.c_str(), files, true, false, false))
@@ -1722,9 +1722,9 @@ std::string cmCTest::Base64EncodeFile(std::string file)
 
 
 //----------------------------------------------------------------------
-bool cmCTest::SubmitExtraFiles(const VectorOfStrings &files)
+bool cmCTest::SubmitExtraFiles(const std::vector<cmStdString> &files)
 {
-  VectorOfStrings::const_iterator it;
+  std::vector<cmStdString>::const_iterator it;
   for ( it = files.begin();
     it != files.end();
     ++ it )
@@ -1749,7 +1749,7 @@ bool cmCTest::SubmitExtraFiles(const char* cfiles)
     return 1;
     }
 
-  VectorOfStrings files;
+  std::vector<cmStdString> files;
 
   cmCTestLog(this, OUTPUT, "Submit extra files" << std::endl);
 
@@ -2126,7 +2126,7 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
   if(this->CheckArgument(arg, "--overwrite") && i < args.size() - 1)
     {
     i++;
-    this->AddCTestConfigurationOverwrite(args[i]);
+    this->AddCTestConfigurationOverwrite(args[i].c_str());
     }
   if(this->CheckArgument(arg, "-A", "--add-notes") && i < args.size() - 1)
     {
@@ -2593,9 +2593,13 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
 }
 
 //----------------------------------------------------------------------
-void cmCTest::PopulateCustomVector(cmMakefile* mf, const std::string& def,
-  std::vector<std::string>& vec)
+void cmCTest::PopulateCustomVector(cmMakefile* mf, const char* def,
+  VectorOfStrings& vec)
 {
+  if ( !def)
+    {
+    return;
+    }
   const char* dval = mf->GetDefinition(def);
   if ( !dval )
     {
@@ -2616,9 +2620,12 @@ void cmCTest::PopulateCustomVector(cmMakefile* mf, const std::string& def,
 }
 
 //----------------------------------------------------------------------
-void cmCTest::PopulateCustomInteger(cmMakefile* mf, const std::string& def,
-  int& val)
+void cmCTest::PopulateCustomInteger(cmMakefile* mf, const char* def, int& val)
 {
+  if ( !def)
+    {
+    return;
+    }
   const char* dval = mf->GetDefinition(def);
   if ( !dval )
     {
@@ -2695,7 +2702,7 @@ std::string cmCTest::GetShortPathToFile(const char* cfname)
 }
 
 //----------------------------------------------------------------------
-std::string cmCTest::GetCTestConfiguration(const std::string& name)
+std::string cmCTest::GetCTestConfiguration(const char *name)
 {
   if ( this->CTestConfigurationOverwrites.find(name) !=
     this->CTestConfigurationOverwrites.end() )
@@ -2840,8 +2847,9 @@ void cmCTest::AddSubmitFile(Part part, const char* name)
 }
 
 //----------------------------------------------------------------------
-void cmCTest::AddCTestConfigurationOverwrite(const std::string& overStr)
+void cmCTest::AddCTestConfigurationOverwrite(const char* encstr)
 {
+  std::string overStr = encstr;
   size_t epos = overStr.find("=");
   if ( epos == overStr.npos )
     {
@@ -2869,7 +2877,7 @@ void cmCTest::SetConfigType(const char* ct)
 
 //----------------------------------------------------------------------
 bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf,
-  const char* dconfig, const std::string& cmake_var)
+  const char* dconfig, const char* cmake_var)
 {
   const char* ctvar;
   ctvar = mf->GetDefinition(cmake_var);
@@ -2892,7 +2900,7 @@ bool cmCTest::RunCommand(
   const char* dir,
   double timeout)
 {
-  std::vector<std::string> args = cmSystemTools::ParseArguments(command);
+  std::vector<cmStdString> args = cmSystemTools::ParseArguments(command);
 
   if(args.size() < 1)
     {
@@ -2900,7 +2908,7 @@ bool cmCTest::RunCommand(
     }
 
   std::vector<const char*> argv;
-  for(std::vector<std::string>::const_iterator a = args.begin();
+  for(std::vector<cmStdString>::const_iterator a = args.begin();
       a != args.end(); ++a)
     {
     argv.push_back(a->c_str());
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 836e41d..becb0f5 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -70,8 +70,8 @@ public:
   {
     PartInfo(): Enabled(false) {}
 
-    void SetName(const std::string& name) { this->Name = name; }
-    const std::string& GetName() const { return this->Name; }
+    void SetName(const char* name) { this->Name = name; }
+    const char* GetName() const { return this->Name.c_str(); }
 
     void Enable() { this->Enabled = true; }
     operator bool() const { return this->Enabled; }
@@ -101,8 +101,8 @@ public:
       if the string does not name a valid part.  */
   Part GetPartFromName(const char* name);
 
-  typedef std::vector<cmsys::String> VectorOfStrings;
-  typedef std::set<std::string> SetOfStrings;
+  typedef std::vector<cmStdString> VectorOfStrings;
+  typedef std::set<cmStdString> SetOfStrings;
 
   ///! Process Command line arguments
   int Run(std::vector<std::string> &, std::string* output = 0);
@@ -172,7 +172,7 @@ public:
   std::string GetTestModelString();
   static int GetTestModelFromString(const char* str);
   static std::string CleanString(const std::string& str);
-  std::string GetCTestConfiguration(const std::string& name);
+  std::string GetCTestConfiguration(const char *name);
   void SetCTestConfiguration(const char *name, const char* value);
   void EmptyCTestConfiguration();
 
@@ -185,9 +185,9 @@ public:
   //! Set the notes files to be created.
   void SetNotesFiles(const char* notes);
 
-  void PopulateCustomVector(cmMakefile* mf, const std::string& definition,
-    std::vector<std::string>& vec);
-  void PopulateCustomInteger(cmMakefile* mf, const std::string& def,
+  void PopulateCustomVector(cmMakefile* mf, const char* definition,
+    VectorOfStrings& vec);
+  void PopulateCustomInteger(cmMakefile* mf, const char* def,
     int& val);
 
   ///! Get the current time as string
@@ -332,7 +332,7 @@ public:
    * Set the CTest variable from CMake variable
    */
   bool SetCTestConfigurationFromCMakeVariable(cmMakefile* mf,
-    const char* dconfig, const std::string& cmake_var);
+    const char* dconfig, const char* cmake_var);
 
   //! Make string safe to be send as an URL
   static std::string MakeURLSafe(const std::string&);
@@ -349,14 +349,14 @@ public:
 
   //! Add overwrite to ctest configuration.
   // The format is key=value
-  void AddCTestConfigurationOverwrite(const std::string& encstr);
+  void AddCTestConfigurationOverwrite(const char* encstr);
 
   //! Create XML file that contains all the notes specified
-  int GenerateNotesFile(const VectorOfStrings &files);
+  int GenerateNotesFile(const std::vector<cmStdString> &files);
 
   //! Submit extra files to the server
   bool SubmitExtraFiles(const char* files);
-  bool SubmitExtraFiles(const VectorOfStrings &files);
+  bool SubmitExtraFiles(const std::vector<cmStdString> &files);
 
   //! Set the output log file name
   void SetOutputLogFileName(const char* name);
@@ -391,7 +391,7 @@ public:
   //! Read the custom configuration files and apply them to the current ctest
   int ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf);
 
-  std::vector<std::string> &GetInitialCommandLineArguments()
+  std::vector<cmStdString> &GetInitialCommandLineArguments()
   { return this->InitialCommandLineArguments; };
 
   //! Set the track to submit to
@@ -447,13 +447,13 @@ private:
   void DetermineNextDayStop();
 
   // these are helper classes
-  typedef std::map<std::string,cmCTestGenericHandler*> t_TestingHandlers;
+  typedef std::map<cmStdString,cmCTestGenericHandler*> t_TestingHandlers;
   t_TestingHandlers TestingHandlers;
 
   bool ShowOnly;
 
   //! Map of configuration properties
-  typedef std::map<std::string, std::string> CTestConfigurationMap;
+  typedef std::map<cmStdString, cmStdString> CTestConfigurationMap;
 
   std::string             CTestConfigFile;
   // TODO: The ctest configuration should be a hierarchy of
@@ -463,7 +463,7 @@ private:
   CTestConfigurationMap CTestConfiguration;
   CTestConfigurationMap CTestConfigurationOverwrites;
   PartInfo                Parts[PartCount];
-  typedef std::map<std::string, Part> PartMapType;
+  typedef std::map<cmStdString, Part> PartMapType;
   PartMapType             PartMap;
 
   std::string             CurrentTag;
@@ -556,7 +556,7 @@ private:
   int  DartVersion;
   bool DropSiteCDash;
 
-  std::vector<std::string> InitialCommandLineArguments;
+  std::vector<cmStdString> InitialCommandLineArguments;
 
   int SubmitIndex;
 
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 39b9ae5..9e0064e 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -82,15 +82,15 @@ bool cmCacheManager::LoadCache(cmMakefile* mf)
 }
 
 
-bool cmCacheManager::LoadCache(const std::string& path)
+bool cmCacheManager::LoadCache(const char* path)
 {
   return this->LoadCache(path,true);
 }
 
-bool cmCacheManager::LoadCache(const std::string& path,
+bool cmCacheManager::LoadCache(const char* path,
                                bool internal)
 {
-  std::set<std::string> emptySet;
+  std::set<cmStdString> emptySet;
   return this->LoadCache(path, internal, emptySet, emptySet);
 }
 
@@ -178,7 +178,7 @@ bool cmCacheManager::ParseEntry(const char* entry,
   return flag;
 }
 
-void cmCacheManager::CleanCMakeFiles(const std::string& path)
+void cmCacheManager::CleanCMakeFiles(const char* path)
 {
   std::string glob = path;
   glob += cmake::GetCMakeFilesDirectory();
@@ -193,10 +193,10 @@ void cmCacheManager::CleanCMakeFiles(const std::string& path)
     }
 }
 
-bool cmCacheManager::LoadCache(const std::string& path,
+bool cmCacheManager::LoadCache(const char* path,
                                bool internal,
-                               std::set<std::string>& excludes,
-                               std::set<std::string>& includes)
+                               std::set<cmStdString>& excludes,
+                               std::set<cmStdString>& includes)
 {
   std::string cacheFile = path;
   cacheFile += "/CMakeCache.txt";
@@ -428,7 +428,7 @@ bool cmCacheManager::SaveCache(cmMakefile* mf)
 }
 
 
-bool cmCacheManager::SaveCache(const std::string& path)
+bool cmCacheManager::SaveCache(const char* path)
 {
   std::string cacheFile = path;
   cacheFile += "/CMakeCache.txt";
@@ -500,7 +500,7 @@ bool cmCacheManager::SaveCache(const std::string& path)
   fout << "########################\n";
   fout << "\n";
 
-  for( std::map<std::string, CacheEntry>::const_iterator i =
+  for( std::map<cmStdString, CacheEntry>::const_iterator i =
          this->Cache.begin(); i != this->Cache.end(); ++i)
     {
     const CacheEntry& ce = (*i).second;
@@ -578,7 +578,7 @@ bool cmCacheManager::SaveCache(const std::string& path)
   return true;
 }
 
-bool cmCacheManager::DeleteCache(const std::string& path)
+bool cmCacheManager::DeleteCache(const char* path)
 {
   std::string cacheFile = path;
   cmSystemTools::ConvertToUnixSlashes(cacheFile);
@@ -650,7 +650,7 @@ void cmCacheManager::OutputHelpString(std::ostream& fout,
     }
 }
 
-void cmCacheManager::RemoveCacheEntry(const std::string& key)
+void cmCacheManager::RemoveCacheEntry(const char* key)
 {
   CacheEntryMap::iterator i = this->Cache.find(key);
   if(i != this->Cache.end())
@@ -660,8 +660,7 @@ void cmCacheManager::RemoveCacheEntry(const std::string& key)
 }
 
 
-cmCacheManager::CacheEntry *cmCacheManager::GetCacheEntry(
-    const std::string& key)
+cmCacheManager::CacheEntry *cmCacheManager::GetCacheEntry(const char* key)
 {
   CacheEntryMap::iterator i = this->Cache.find(key);
   if(i != this->Cache.end())
@@ -677,7 +676,7 @@ cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator(
   return CacheIterator(*this, key);
 }
 
-const char* cmCacheManager::GetCacheValue(const std::string& key) const
+const char* cmCacheManager::GetCacheValue(const char* key) const
 {
   CacheEntryMap::const_iterator i = this->Cache.find(key);
   if(i != this->Cache.end() &&
@@ -693,7 +692,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const
 {
   out << "=================================================" << std::endl;
   out << "CMakeCache Contents:" << std::endl;
-  for(std::map<std::string, CacheEntry>::const_iterator i =
+  for(std::map<cmStdString, CacheEntry>::const_iterator i =
         this->Cache.begin(); i != this->Cache.end(); ++i)
     {
     if((*i).second.Type != INTERNAL)
@@ -709,7 +708,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const
 }
 
 
-void cmCacheManager::AddCacheEntry(const std::string& key,
+void cmCacheManager::AddCacheEntry(const char* key,
                                    const char* value,
                                    const char* helpString,
                                    CacheEntryType type)
@@ -768,7 +767,7 @@ void cmCacheManager::CacheIterator::Begin()
   this->Position = this->Container.Cache.begin();
 }
 
-bool cmCacheManager::CacheIterator::Find(const std::string& key)
+bool cmCacheManager::CacheIterator::Find(const char* key)
 {
   this->Position = this->Container.Cache.find(key);
   return !this->IsAtEnd();
@@ -808,13 +807,13 @@ bool cmCacheManager::CacheIterator::GetValueAsBool() const
 
 //----------------------------------------------------------------------------
 const char*
-cmCacheManager::CacheEntry::GetProperty(const std::string& prop) const
+cmCacheManager::CacheEntry::GetProperty(const char* prop) const
 {
-  if(prop == "TYPE")
+  if(strcmp(prop, "TYPE") == 0)
     {
     return cmCacheManagerTypes[this->Type];
     }
-  else if(prop == "VALUE")
+  else if(strcmp(prop, "VALUE") == 0)
     {
     return this->Value.c_str();
     }
@@ -824,14 +823,14 @@ cmCacheManager::CacheEntry::GetProperty(const std::string& prop) const
 }
 
 //----------------------------------------------------------------------------
-void cmCacheManager::CacheEntry::SetProperty(const std::string& prop,
+void cmCacheManager::CacheEntry::SetProperty(const char* prop,
                                              const char* value)
 {
-  if(prop == "TYPE")
+  if(strcmp(prop, "TYPE") == 0)
     {
     this->Type = cmCacheManager::StringToType(value? value : "STRING");
     }
-  else if(prop == "VALUE")
+  else if(strcmp(prop, "VALUE") == 0)
     {
     this->Value = value? value : "";
     }
@@ -842,15 +841,15 @@ void cmCacheManager::CacheEntry::SetProperty(const std::string& prop,
 }
 
 //----------------------------------------------------------------------------
-void cmCacheManager::CacheEntry::AppendProperty(const std::string& prop,
+void cmCacheManager::CacheEntry::AppendProperty(const char* prop,
                                                 const char* value,
                                                 bool asString)
 {
-  if(prop == "TYPE")
+  if(strcmp(prop, "TYPE") == 0)
     {
     this->Type = cmCacheManager::StringToType(value? value : "STRING");
     }
-  else if(prop == "VALUE")
+  else if(strcmp(prop, "VALUE") == 0)
     {
     if(value)
       {
@@ -868,8 +867,7 @@ void cmCacheManager::CacheEntry::AppendProperty(const std::string& prop,
 }
 
 //----------------------------------------------------------------------------
-const char* cmCacheManager::CacheIterator::GetProperty(
-    const std::string& prop) const
+const char* cmCacheManager::CacheIterator::GetProperty(const char* prop) const
 {
   if(!this->IsAtEnd())
     {
@@ -879,8 +877,7 @@ const char* cmCacheManager::CacheIterator::GetProperty(
 }
 
 //----------------------------------------------------------------------------
-void cmCacheManager::CacheIterator::SetProperty(const std::string& p,
-                                                const char* v)
+void cmCacheManager::CacheIterator::SetProperty(const char* p, const char* v)
 {
   if(!this->IsAtEnd())
     {
@@ -889,7 +886,7 @@ void cmCacheManager::CacheIterator::SetProperty(const std::string& p,
 }
 
 //----------------------------------------------------------------------------
-void cmCacheManager::CacheIterator::AppendProperty(const std::string& p,
+void cmCacheManager::CacheIterator::AppendProperty(const char* p,
                                                    const char* v,
                                                    bool asString)
 {
@@ -900,8 +897,7 @@ void cmCacheManager::CacheIterator::AppendProperty(const std::string& p,
 }
 
 //----------------------------------------------------------------------------
-bool cmCacheManager::CacheIterator::GetPropertyAsBool(
-    const std::string& prop) const
+bool cmCacheManager::CacheIterator::GetPropertyAsBool(const char* prop) const
 {
   if(const char* value = this->GetProperty(prop))
     {
@@ -911,14 +907,13 @@ bool cmCacheManager::CacheIterator::GetPropertyAsBool(
 }
 
 //----------------------------------------------------------------------------
-void cmCacheManager::CacheIterator::SetProperty(const std::string& p, bool v)
+void cmCacheManager::CacheIterator::SetProperty(const char* p, bool v)
 {
   this->SetProperty(p, v ? "ON" : "OFF");
 }
 
 //----------------------------------------------------------------------------
-bool cmCacheManager::CacheIterator::PropertyExists(
-    const std::string& prop) const
+bool cmCacheManager::CacheIterator::PropertyExists(const char* prop) const
 {
   return this->GetProperty(prop)? true:false;
 }
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 573f828..f487e8e 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -39,9 +39,9 @@ private:
     std::string Value;
     CacheEntryType Type;
     cmPropertyMap Properties;
-    const char* GetProperty(const std::string&) const;
-    void SetProperty(const std::string& property, const char* value);
-    void AppendProperty(const std::string& property, const char* value,
+    const char* GetProperty(const char*) const;
+    void SetProperty(const char* property, const char* value);
+    void AppendProperty(const char* property, const char* value,
                         bool asString=false);
     bool Initialized;
     CacheEntry() : Value(""), Type(UNINITIALIZED), Initialized(false)
@@ -53,18 +53,18 @@ public:
   {
   public:
     void Begin();
-    bool Find(const std::string&);
+    bool Find(const char*);
     bool IsAtEnd() const;
     void Next();
     const char *GetName() const {
       return this->Position->first.c_str(); }
-    const char* GetProperty(const std::string&) const ;
-    bool GetPropertyAsBool(const std::string&) const ;
-    bool PropertyExists(const std::string&) const;
-    void SetProperty(const std::string& property, const char* value);
-    void AppendProperty(const std::string& property, const char* value,
+    const char* GetProperty(const char*) const ;
+    bool GetPropertyAsBool(const char*) const ;
+    bool PropertyExists(const char*) const;
+    void SetProperty(const char* property, const char* value);
+    void AppendProperty(const char* property, const char* value,
                         bool asString=false);
-    void SetProperty(const std::string& property, bool value);
+    void SetProperty(const char* property, bool value);
     const char* GetValue() const { return this->GetEntry().Value.c_str(); }
     bool GetValueAsBool() const;
     void SetValue(const char*);
@@ -72,7 +72,7 @@ public:
     void SetType(CacheEntryType ty) { this->GetEntry().Type = ty; }
     bool Initialized() { return this->GetEntry().Initialized; }
     cmCacheManager &Container;
-    std::map<std::string, CacheEntry>::iterator Position;
+    std::map<cmStdString, CacheEntry>::iterator Position;
     CacheIterator(cmCacheManager &cm) : Container(cm) {
       this->Begin();
     }
@@ -108,19 +108,19 @@ public:
   ///! Load a cache for given makefile.  Loads from ouput home.
   bool LoadCache(cmMakefile*);
   ///! Load a cache for given makefile.  Loads from path/CMakeCache.txt.
-  bool LoadCache(const std::string& path);
-  bool LoadCache(const std::string& path, bool internal);
-  bool LoadCache(const std::string& path, bool internal,
-                 std::set<std::string>& excludes,
-                 std::set<std::string>& includes);
+  bool LoadCache(const char* path);
+  bool LoadCache(const char* path, bool internal);
+  bool LoadCache(const char* path, bool internal,
+                 std::set<cmStdString>& excludes,
+                 std::set<cmStdString>& includes);
 
   ///! Save cache for given makefile.  Saves to ouput home CMakeCache.txt.
   bool SaveCache(cmMakefile*) ;
   ///! Save cache for given makefile.  Saves to ouput path/CMakeCache.txt
-  bool SaveCache(const std::string& path) ;
+  bool SaveCache(const char* path) ;
 
   ///! Delete the cache given
-  bool DeleteCache(const std::string& path);
+  bool DeleteCache(const char* path);
 
   ///! Print the cache to a stream
   void PrintCache(std::ostream&) const;
@@ -129,7 +129,7 @@ public:
   cmCacheManager::CacheIterator GetCacheIterator(const char *key=0);
 
   ///! Remove an entry from the cache
-  void RemoveCacheEntry(const std::string& key);
+  void RemoveCacheEntry(const char* key);
 
   ///! Get the number of entries in the cache
   int GetSize() {
@@ -142,7 +142,7 @@ public:
                          CacheEntryType& type);
 
   ///! Get a value from the cache given a key
-  const char* GetCacheValue(const std::string& key) const;
+  const char* GetCacheValue(const char* key) const;
 
   /** Get the version of CMake that wrote the cache.  */
   unsigned int GetCacheMajorVersion() const
@@ -153,20 +153,20 @@ public:
 
 protected:
   ///! Add an entry into the cache
-  void AddCacheEntry(const std::string& key, const char* value,
+  void AddCacheEntry(const char* key, const char* value,
                      const char* helpString, CacheEntryType type);
 
   ///! Get a cache entry object for a key
-  CacheEntry *GetCacheEntry(const std::string& key);
+  CacheEntry *GetCacheEntry(const char *key);
   ///! Clean out the CMakeFiles directory if no CMakeCache.txt
-  void CleanCMakeFiles(const std::string& path);
+  void CleanCMakeFiles(const char* path);
 
   // Cache version info
   unsigned int CacheMajorVersion;
   unsigned int CacheMinorVersion;
 private:
   cmake* CMakeInstance;
-  typedef  std::map<std::string, CacheEntry> CacheEntryMap;
+  typedef  std::map<cmStdString, CacheEntry> CacheEntryMap;
   static void OutputHelpString(std::ostream& fout,
                                const std::string& helpString);
   static void OutputKey(std::ostream& fout, std::string const& key);
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index 2378ef0..e148857 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -166,7 +166,7 @@ public:
   /**
    * Set the error message
    */
-  void SetError(const std::string& e)
+  void SetError(const char* e)
     {
     this->Error = this->GetName();
     this->Error += " ";
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index 6284cb7..dbeeb07 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -49,14 +49,14 @@ void cmCommandArgumentParserHelper::SetLineFile(long line, const char* file)
   this->FileName = file;
 }
 
-char* cmCommandArgumentParserHelper::AddString(const std::string& str)
+char* cmCommandArgumentParserHelper::AddString(const char* str)
 {
-  if ( str.empty() )
+  if ( !str || !*str )
     {
     return this->EmptyVariable;
     }
-  char* stVal = new char[str.size()+1];
-  strcpy(stVal, str.c_str());
+  char* stVal = new char[strlen(str)+1];
+  strcpy(stVal, str);
   this->Variables.push_back(stVal);
   return stVal;
 }
@@ -153,7 +153,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
     {
     return this->AddString(cmSystemTools::EscapeQuotes(value).c_str());
     }
-  return this->AddString(value ? value : "");
+  return this->AddString(value);
 }
 
 char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var)
@@ -166,7 +166,7 @@ char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var)
     // then return an empty string
     if(!ret && this->RemoveEmpty)
       {
-      return this->AddString("");
+      return this->AddString(ret);
       }
     // if the ret was not 0, then return it
     if(ret)
diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h
index d375ae6..f8c672f 100644
--- a/Source/cmCommandArgumentParserHelper.h
+++ b/Source/cmCommandArgumentParserHelper.h
@@ -77,8 +77,8 @@ public:
   char BSLASHVariable[3];
 
 private:
-  std::string::size_type InputBufferPos;
-  std::string InputBuffer;
+  cmStdString::size_type InputBufferPos;
+  cmStdString InputBuffer;
   std::vector<char> OutputBuffer;
   int CurrentLine;
   int Verbose;
@@ -86,7 +86,7 @@ private:
   void Print(const char* place, const char* str);
   void SafePrintMissing(const char* str, int line, int cnt);
 
-  char* AddString(const std::string& str);
+  char* AddString(const char* str);
 
   void CleanupParser();
   void SetError(std::string const& msg);
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 6c81f20..1be5980 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -184,8 +184,7 @@ cmComputeLinkDepends
   this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance();
 
   // The configuration being linked.
-  this->HasConfig = config && *config;
-  this->Config = (this->HasConfig)? config : "";
+  this->Config = (config && *config)? config : 0;
   this->LinkType = this->Target->ComputeLinkType(this->Config);
 
   // Enable debug mode if requested.
@@ -255,8 +254,7 @@ cmComputeLinkDepends::Compute()
             "---------------------------------------"
             "---------------------------------------\n");
     fprintf(stderr, "Link dependency analysis for target %s, config %s\n",
-            this->Target->GetName(),
-            this-HasConfig?this->Config.c_str():"noconfig");
+            this->Target->GetName(), this->Config?this->Config:"noconfig");
     this->DisplayConstraintGraph();
     }
 
@@ -280,12 +278,12 @@ cmComputeLinkDepends::Compute()
 }
 
 //----------------------------------------------------------------------------
-std::map<std::string, int>::iterator
+std::map<cmStdString, int>::iterator
 cmComputeLinkDepends::AllocateLinkEntry(std::string const& item)
 {
-  std::map<std::string, int>::value_type
+  std::map<cmStdString, int>::value_type
     index_entry(item, static_cast<int>(this->EntryList.size()));
-  std::map<std::string, int>::iterator
+  std::map<cmStdString, int>::iterator
     lei = this->LinkEntryIndex.insert(index_entry).first;
   this->EntryList.push_back(LinkEntry());
   this->InferredDependSets.push_back(0);
@@ -298,7 +296,7 @@ int cmComputeLinkDepends::AddLinkEntry(int depender_index,
                                        std::string const& item)
 {
   // Check if the item entry has already been added.
-  std::map<std::string, int>::iterator lei = this->LinkEntryIndex.find(item);
+  std::map<cmStdString, int>::iterator lei = this->LinkEntryIndex.find(item);
   if(lei != this->LinkEntryIndex.end())
     {
     // Yes.  We do not need to follow the item's dependencies again.
@@ -424,7 +422,7 @@ cmComputeLinkDepends
 void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep)
 {
   // Check if the target already has an entry.
-  std::map<std::string, int>::iterator lei =
+  std::map<cmStdString, int>::iterator lei =
     this->LinkEntryIndex.find(dep.Item);
   if(lei == this->LinkEntryIndex.end())
     {
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index 9460e54..9776f55 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -68,8 +68,7 @@ private:
   bool DebugMode;
 
   // Configuration information.
-  bool HasConfig;
-  std::string Config;
+  const char* Config;
   cmTarget::LinkLibraryType LinkType;
 
   // Output information.
@@ -77,7 +76,7 @@ private:
 
   typedef cmTarget::LinkLibraryVectorType LinkLibraryVectorType;
 
-  std::map<std::string, int>::iterator
+  std::map<cmStdString, int>::iterator
   AllocateLinkEntry(std::string const& item);
   int AddLinkEntry(int depender_index, std::string const& item);
   void AddVarLinkEntries(int depender_index, const char* value);
@@ -88,7 +87,7 @@ private:
 
   // One entry for each unique item.
   std::vector<LinkEntry> EntryList;
-  std::map<std::string, int> LinkEntryIndex;
+  std::map<cmStdString, int> LinkEntryIndex;
 
   // BFS of initial dependencies.
   struct BFSEntry
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index b5fd4f1..6986965 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -239,7 +239,7 @@ because this need be done only for shared libraries without soname-s.
 
 //----------------------------------------------------------------------------
 cmComputeLinkInformation
-::cmComputeLinkInformation(cmTarget const* target, const std::string& config,
+::cmComputeLinkInformation(cmTarget const* target, const char* config,
                            cmTarget const* headTarget)
 {
   // Store context information.
@@ -505,8 +505,7 @@ bool cmComputeLinkInformation::Compute()
     }
 
   // Compute the ordered link line items.
-  cmComputeLinkDepends cld(this->Target, this->Config.c_str(),
-                           this->HeadTarget);
+  cmComputeLinkDepends cld(this->Target, this->Config, this->HeadTarget);
   cld.SetOldLinkDirMode(this->OldLinkDirMode);
   cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
 
@@ -625,7 +624,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
                                        cmTarget const* tgt)
 {
   // Compute the proper name to use to link this library.
-  const std::string& config = this->Config;
+  const char* config = this->Config;
   bool impexe = (tgt && tgt->IsExecutableWithExports());
   if(impexe && !this->UseImportLibrary && !this->LoaderFlag)
     {
@@ -903,7 +902,7 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
   // be the library name.  Match index 3 will be the library
   // extension.
   reg = "^(";
-  for(std::set<std::string>::iterator p = this->LinkPrefixes.begin();
+  for(std::set<cmStdString>::iterator p = this->LinkPrefixes.begin();
       p != this->LinkPrefixes.end(); ++p)
     {
     reg += *p;
@@ -1641,7 +1640,7 @@ void cmComputeLinkInformation::PrintLinkPolicyDiagnosis(std::ostream& os)
 
   // List the paths old behavior is adding.
   os << "and other libraries with known full path:\n";
-  std::set<std::string> emitted;
+  std::set<cmStdString> emitted;
   for(std::vector<std::string>::const_iterator
         i = this->OldLinkDirItems.begin();
       i != this->OldLinkDirItems.end(); ++i)
@@ -1857,7 +1856,7 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath)
 //----------------------------------------------------------------------------
 static void cmCLI_ExpandListUnique(const char* str,
                                    std::vector<std::string>& out,
-                                   std::set<std::string>& emitted)
+                                   std::set<cmStdString>& emitted)
 {
   std::vector<std::string> tmp;
   cmSystemTools::ExpandListArgument(str, tmp);
@@ -1895,7 +1894,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
     this->Target->GetPropertyAsBool("INSTALL_RPATH_USE_LINK_PATH");
 
   // Construct the RPATH.
-  std::set<std::string> emitted;
+  std::set<cmStdString> emitted;
   if(use_install_rpath)
     {
     const char* install_rpath = this->Target->GetProperty("INSTALL_RPATH");
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index 0e4b22a..356e6ed 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -29,7 +29,7 @@ class cmOrderDirectories;
 class cmComputeLinkInformation
 {
 public:
-  cmComputeLinkInformation(cmTarget const* target, const std::string& config,
+  cmComputeLinkInformation(cmTarget const* target, const char* config,
                            cmTarget const* headTarget);
   ~cmComputeLinkInformation();
   bool Compute();
@@ -82,7 +82,7 @@ private:
   cmake* CMakeInstance;
 
   // Configuration information.
-  std::string Config;
+  const char* Config;
   const char* LinkLanguage;
   bool LinkDependsNoShared;
 
@@ -126,7 +126,7 @@ private:
   std::vector<std::string> StaticLinkExtensions;
   std::vector<std::string> SharedLinkExtensions;
   std::vector<std::string> LinkExtensions;
-  std::set<std::string> LinkPrefixes;
+  std::set<cmStdString> LinkPrefixes;
   cmsys::RegularExpression ExtractStaticLibraryName;
   cmsys::RegularExpression ExtractSharedLibraryName;
   cmsys::RegularExpression ExtractAnyLibraryName;
@@ -153,7 +153,7 @@ private:
   // Framework info.
   void ComputeFrameworkInfo();
   void AddFrameworkPath(std::string const& p);
-  std::set<std::string> FrameworkPathsEmmitted;
+  std::set<cmStdString> FrameworkPathsEmmitted;
   cmsys::RegularExpression SplitFramework;
 
   // Linker search path computation.
@@ -165,14 +165,14 @@ private:
   void LoadImplicitLinkInfo();
   void AddImplicitLinkInfo();
   void AddImplicitLinkInfo(std::string const& lang);
-  std::set<std::string> ImplicitLinkDirs;
-  std::set<std::string> ImplicitLinkLibs;
+  std::set<cmStdString> ImplicitLinkDirs;
+  std::set<cmStdString> ImplicitLinkLibs;
 
   // Additional paths configured by the runtime linker
   std::vector<std::string> RuntimeLinkDirs;
 
   // Linker search path compatibility mode.
-  std::set<std::string> OldLinkDirMask;
+  std::set<cmStdString> OldLinkDirMask;
   std::vector<std::string> OldLinkDirItems;
   std::vector<std::string> OldUserFlagItems;
   bool OldLinkDirMode;
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 999a1f9..6511510 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -211,10 +211,10 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
   // dependencies in all targets, because the generated build-systems can't
   // deal with config-specific dependencies.
   {
-  std::set<std::string> emitted;
+  std::set<cmStdString> emitted;
   {
   std::vector<std::string> tlibs;
-  depender->GetDirectLinkLibraries("", tlibs, depender);
+  depender->GetDirectLinkLibraries(0, tlibs, depender);
   // A target should not depend on itself.
   emitted.insert(depender->GetName());
   for(std::vector<std::string>::const_iterator lib = tlibs.begin();
@@ -255,11 +255,11 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
 
   // Loop over all utility dependencies.
   {
-  std::set<std::string> const& tutils = depender->GetUtilities();
-  std::set<std::string> emitted;
+  std::set<cmStdString> const& tutils = depender->GetUtilities();
+  std::set<cmStdString> emitted;
   // A target should not depend on itself.
   emitted.insert(depender->GetName());
-  for(std::set<std::string>::const_iterator util = tutils.begin();
+  for(std::set<cmStdString>::const_iterator util = tutils.begin();
       util != tutils.end(); ++util)
     {
     // Don't emit the same utility twice for this target.
@@ -274,8 +274,8 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
 //----------------------------------------------------------------------------
 void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
                                                  cmTarget const* dependee,
-                                                 const std::string& config,
-                                               std::set<std::string> &emitted)
+                                                 const char *config,
+                                               std::set<cmStdString> &emitted)
 {
   cmTarget const* depender = this->Targets[depender_index];
   if(cmTarget::LinkInterface const* iface =
@@ -298,9 +298,9 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
 
 //----------------------------------------------------------------------------
 void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
-                                             const std::string& dependee_name,
+                                             const char* dependee_name,
                                              bool linking,
-                                             std::set<std::string> &emitted)
+                                             std::set<cmStdString> &emitted)
 {
   cmTarget const* depender = this->Targets[depender_index];
   cmTarget const* dependee =
@@ -317,7 +317,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
 
   if(dependee)
     {
-    this->AddInterfaceDepends(depender_index, dependee, "", emitted);
+    this->AddInterfaceDepends(depender_index, dependee, 0, emitted);
     std::vector<std::string> configs;
     depender->GetMakefile()->GetConfigurations(configs);
     for (std::vector<std::string>::const_iterator it = configs.begin();
@@ -333,7 +333,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
 
 //----------------------------------------------------------------------------
 void cmComputeTargetDepends::AddTargetDepend(int depender_index,
-                                             const std::string& dependee_name,
+                                             const char* dependee_name,
                                              bool linking)
 {
   // Get the depender.
@@ -406,8 +406,8 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
   if(dependee->IsImported())
     {
     // Skip imported targets but follow their utility dependencies.
-    std::set<std::string> const& utils = dependee->GetUtilities();
-    for(std::set<std::string>::const_iterator i = utils.begin();
+    std::set<cmStdString> const& utils = dependee->GetUtilities();
+    for(std::set<cmStdString>::const_iterator i = utils.begin();
         i != utils.end(); ++i)
       {
       if(cmTarget const* transitive_dependee =
diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h
index 84fa2f1..6cd6da0 100644
--- a/Source/cmComputeTargetDepends.h
+++ b/Source/cmComputeTargetDepends.h
@@ -45,18 +45,16 @@ private:
   void CollectTargets();
   void CollectDepends();
   void CollectTargetDepends(int depender_index);
-  void AddTargetDepend(int depender_index,
-                       const std::string& dependee_name,
+  void AddTargetDepend(int depender_index, const char* dependee_name,
                        bool linking);
   void AddTargetDepend(int depender_index, cmTarget const* dependee,
                        bool linking);
   bool ComputeFinalDepends(cmComputeComponentGraph const& ccg);
-  void AddInterfaceDepends(int depender_index,
-                           const std::string& dependee_name,
-                           bool linking, std::set<std::string> &emitted);
+  void AddInterfaceDepends(int depender_index, const char* dependee_name,
+                           bool linking, std::set<cmStdString> &emitted);
   void AddInterfaceDepends(int depender_index, cmTarget const* dependee,
-                           const std::string& config,
-                           std::set<std::string> &emitted);
+                           const char *config,
+                           std::set<cmStdString> &emitted);
   cmGlobalGenerator* GlobalGenerator;
   bool DebugMode;
   bool NoCycles;
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index a73d4b9..7b52069 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -564,7 +564,7 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir)
   cmsys::Directory dir;
   dir.Load(binDir);
   size_t fileNum;
-  std::set<std::string> deletedFiles;
+  std::set<cmStdString> deletedFiles;
   for (fileNum = 0; fileNum <  dir.GetNumberOfFiles(); ++fileNum)
     {
     if (strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)),".") &&
diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx
index 0d3c6bb..7f4b10f 100644
--- a/Source/cmCryptoHash.cxx
+++ b/Source/cmCryptoHash.cxx
@@ -35,18 +35,18 @@ cmsys::auto_ptr<cmCryptoHash> cmCryptoHash::New(const char* algo)
 }
 
 //----------------------------------------------------------------------------
-std::string cmCryptoHash::HashString(const std::string& input)
+std::string cmCryptoHash::HashString(const char* input)
 {
   this->Initialize();
-  this->Append(reinterpret_cast<unsigned char const*>(&input[0]),
-               static_cast<int>(input.size()));
+  this->Append(reinterpret_cast<unsigned char const*>(input),
+               static_cast<int>(strlen(input)));
   return this->Finalize();
 }
 
 //----------------------------------------------------------------------------
-std::string cmCryptoHash::HashFile(const std::string& file)
+std::string cmCryptoHash::HashFile(const char* file)
 {
-  cmsys::ifstream fin(file.c_str(), std::ios::in | cmsys_ios_binary);
+  cmsys::ifstream fin(file, std::ios::in | cmsys_ios_binary);
   if(!fin)
     {
     return "";
diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h
index 88cd240..1bea9ab 100644
--- a/Source/cmCryptoHash.h
+++ b/Source/cmCryptoHash.h
@@ -21,8 +21,8 @@ class cmCryptoHash
 public:
   virtual ~cmCryptoHash() {}
   static cmsys::auto_ptr<cmCryptoHash> New(const char* algo);
-  std::string HashString(const std::string& input);
-  std::string HashFile(const std::string& file);
+  std::string HashString(const char* input);
+  std::string HashFile(const char* file);
 protected:
   virtual void Initialize()=0;
   virtual void Append(unsigned char const*, int)=0;
diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h
index 67c305e..6851105 100644
--- a/Source/cmCustomCommand.h
+++ b/Source/cmCustomCommand.h
@@ -72,7 +72,7 @@ public:
   /** Backtrace of the command that created this custom command.  */
   cmListFileBacktrace const& GetBacktrace() const;
 
-  typedef std::pair<std::string, std::string> ImplicitDependsPair;
+  typedef std::pair<cmStdString, cmStdString> ImplicitDependsPair;
   class ImplicitDependsList: public std::vector<ImplicitDependsPair> {};
   void SetImplicitDepends(ImplicitDependsList const&);
   void AppendImplicitDepends(ImplicitDependsList const&);
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index d8a756d..f24dfa2 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -18,7 +18,7 @@
 
 //----------------------------------------------------------------------------
 cmCustomCommandGenerator::cmCustomCommandGenerator(
-  cmCustomCommand const& cc, const std::string& config, cmMakefile* mf):
+  cmCustomCommand const& cc, const char* config, cmMakefile* mf):
   CC(cc), Config(config), Makefile(mf), LG(mf->GetLocalGenerator()),
   OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()),
   GE(new cmGeneratorExpression(cc.GetBacktrace()))
diff --git a/Source/cmCustomCommandGenerator.h b/Source/cmCustomCommandGenerator.h
index 17d644a..4e89f27 100644
--- a/Source/cmCustomCommandGenerator.h
+++ b/Source/cmCustomCommandGenerator.h
@@ -22,15 +22,14 @@ class cmGeneratorExpression;
 class cmCustomCommandGenerator
 {
   cmCustomCommand const& CC;
-  std::string Config;
+  const char* Config;
   cmMakefile* Makefile;
   cmLocalGenerator* LG;
   bool OldStyle;
   bool MakeVars;
   cmGeneratorExpression* GE;
 public:
-  cmCustomCommandGenerator(cmCustomCommand const& cc,
-                           const std::string& config,
+  cmCustomCommandGenerator(cmCustomCommand const& cc, const char* config,
                            cmMakefile* mf);
   ~cmCustomCommandGenerator();
   unsigned int GetNumberOfCommands() const;
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index babf1c4..9d28700 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -28,7 +28,7 @@ void cmDefinitions::Reset(cmDefinitions* parent)
 
 //----------------------------------------------------------------------------
 cmDefinitions::Def const&
-cmDefinitions::GetInternal(const std::string& key)
+cmDefinitions::GetInternal(const char* key)
 {
   MapType::const_iterator i = this->Map.find(key);
   if(i != this->Map.end())
@@ -46,7 +46,7 @@ cmDefinitions::GetInternal(const std::string& key)
 
 //----------------------------------------------------------------------------
 cmDefinitions::Def const&
-cmDefinitions::SetInternal(const std::string& key, Def const& def)
+cmDefinitions::SetInternal(const char* key, Def const& def)
 {
   if(this->Up || def.Exists)
     {
@@ -71,23 +71,23 @@ cmDefinitions::SetInternal(const std::string& key, Def const& def)
 }
 
 //----------------------------------------------------------------------------
-const char* cmDefinitions::Get(const std::string& key)
+const char* cmDefinitions::Get(const char* key)
 {
   Def const& def = this->GetInternal(key);
   return def.Exists? def.c_str() : 0;
 }
 
 //----------------------------------------------------------------------------
-const char* cmDefinitions::Set(const std::string& key, const char* value)
+const char* cmDefinitions::Set(const char* key, const char* value)
 {
   Def const& def = this->SetInternal(key, Def(value));
   return def.Exists? def.c_str() : 0;
 }
 
 //----------------------------------------------------------------------------
-std::set<std::string> cmDefinitions::LocalKeys() const
+std::set<cmStdString> cmDefinitions::LocalKeys() const
 {
-  std::set<std::string> keys;
+  std::set<cmStdString> keys;
   // Consider local definitions.
   for(MapType::const_iterator mi = this->Map.begin();
       mi != this->Map.end(); ++mi)
@@ -110,12 +110,12 @@ cmDefinitions cmDefinitions::Closure() const
 cmDefinitions::cmDefinitions(ClosureTag const&, cmDefinitions const* root):
   Up(0)
 {
-  std::set<std::string> undefined;
+  std::set<cmStdString> undefined;
   this->ClosureImpl(undefined, root);
 }
 
 //----------------------------------------------------------------------------
-void cmDefinitions::ClosureImpl(std::set<std::string>& undefined,
+void cmDefinitions::ClosureImpl(std::set<cmStdString>& undefined,
                                 cmDefinitions const* defs)
 {
   // Consider local definitions.
@@ -145,17 +145,17 @@ void cmDefinitions::ClosureImpl(std::set<std::string>& undefined,
 }
 
 //----------------------------------------------------------------------------
-std::set<std::string> cmDefinitions::ClosureKeys() const
+std::set<cmStdString> cmDefinitions::ClosureKeys() const
 {
-  std::set<std::string> defined;
-  std::set<std::string> undefined;
+  std::set<cmStdString> defined;
+  std::set<cmStdString> undefined;
   this->ClosureKeys(defined, undefined);
   return defined;
 }
 
 //----------------------------------------------------------------------------
-void cmDefinitions::ClosureKeys(std::set<std::string>& defined,
-                                std::set<std::string>& undefined) const
+void cmDefinitions::ClosureKeys(std::set<cmStdString>& defined,
+                                std::set<cmStdString>& undefined) const
 {
   // Consider local definitions.
   for(MapType::const_iterator mi = this->Map.begin();
@@ -165,7 +165,7 @@ void cmDefinitions::ClosureKeys(std::set<std::string>& defined,
     if(defined.find(mi->first) == defined.end() &&
        undefined.find(mi->first) == undefined.end())
       {
-      std::set<std::string>& m = mi->second.Exists? defined : undefined;
+      std::set<cmStdString>& m = mi->second.Exists? defined : undefined;
       m.insert(mi->first);
       }
     }
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index e1c543d..4834d84 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -35,28 +35,28 @@ public:
 
   /** Get the value associated with a key; null if none.
       Store the result locally if it came from a parent.  */
-  const char* Get(const std::string& key);
+  const char* Get(const char* key);
 
   /** Set (or unset if null) a value associated with a key.  */
-  const char* Set(const std::string& key, const char* value);
+  const char* Set(const char* key, const char* value);
 
   /** Get the set of all local keys.  */
-  std::set<std::string> LocalKeys() const;
+  std::set<cmStdString> LocalKeys() const;
 
   /** Compute the closure of all defined keys with values.
       This flattens the scope.  The result has no parent.  */
   cmDefinitions Closure() const;
 
   /** Compute the set of all defined keys.  */
-  std::set<std::string> ClosureKeys() const;
+  std::set<cmStdString> ClosureKeys() const;
 
 private:
   // String with existence boolean.
-  struct Def: public std::string
+  struct Def: public cmStdString
   {
-    Def(): std::string(), Exists(false) {}
-    Def(const char* v): std::string(v?v:""), Exists(v?true:false) {}
-    Def(Def const& d): std::string(d), Exists(d.Exists) {}
+    Def(): cmStdString(), Exists(false) {}
+    Def(const char* v): cmStdString(v?v:""), Exists(v?true:false) {}
+    Def(Def const& d): cmStdString(d), Exists(d.Exists) {}
     bool Exists;
   };
   static Def NoDef;
@@ -65,22 +65,22 @@ private:
   cmDefinitions* Up;
 
   // Local definitions, set or unset.
-  typedef std::map<std::string, Def> MapType;
+  typedef std::map<cmStdString, Def> MapType;
   MapType Map;
 
   // Internal query and update methods.
-  Def const& GetInternal(const std::string& key);
-  Def const& SetInternal(const std::string& key, Def const& def);
+  Def const& GetInternal(const char* key);
+  Def const& SetInternal(const char* key, Def const& def);
 
   // Implementation of Closure() method.
   struct ClosureTag {};
   cmDefinitions(ClosureTag const&, cmDefinitions const* root);
-  void ClosureImpl(std::set<std::string>& undefined,
+  void ClosureImpl(std::set<cmStdString>& undefined,
                    cmDefinitions const* defs);
 
   // Implementation of ClosureKeys() method.
-  void ClosureKeys(std::set<std::string>& defined,
-                   std::set<std::string>& undefined) const;
+  void ClosureKeys(std::set<cmStdString>& defined,
+                   std::set<cmStdString>& undefined) const;
 };
 
 #endif
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index 067fcee..4fc5efb 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -91,7 +91,7 @@ cmDependsC::~cmDependsC()
 {
   this->WriteCacheFile();
 
-  for (std::map<std::string, cmIncludeLines*>::iterator it=
+  for (std::map<cmStdString, cmIncludeLines*>::iterator it=
          this->FileCache.begin(); it!=this->FileCache.end(); ++it)
     {
     delete it->second;
@@ -116,7 +116,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
     return false;
     }
 
-  std::set<std::string> dependencies;
+  std::set<cmStdString> dependencies;
   bool haveDeps = false;
 
   if (this->ValidDeps != 0)
@@ -149,7 +149,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
       this->Encountered.insert(*srcIt);
       }
 
-    std::set<std::string> scanned;
+    std::set<cmStdString> scanned;
 
     // Use reserve to allocate enough memory for tempPathStr
     // so that during the loops no memory is allocated or freed
@@ -182,7 +182,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
         }
       else
         {
-        std::map<std::string, std::string>::iterator
+        std::map<cmStdString, cmStdString>::iterator
           headerLocationIt=this->HeaderLocationCache.find(current.FileName);
         if (headerLocationIt!=this->HeaderLocationCache.end())
           {
@@ -224,7 +224,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
         scanned.insert(fullName);
 
         // Check whether this file is already in the cache
-        std::map<std::string, cmIncludeLines*>::iterator fileIt=
+        std::map<cmStdString, cmIncludeLines*>::iterator fileIt=
           this->FileCache.find(fullName);
         if (fileIt!=this->FileCache.end())
           {
@@ -270,7 +270,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
   // convert the dependencies to paths relative to the home output
   // directory.  We must do the same here.
   internalDepends << obj << std::endl;
-  for(std::set<std::string>::const_iterator i=dependencies.begin();
+  for(std::set<cmStdString>::const_iterator i=dependencies.begin();
       i != dependencies.end(); ++i)
     {
     makeDepends << obj << ": " <<
@@ -392,7 +392,7 @@ void cmDependsC::WriteCacheFile() const
   cacheOut << this->IncludeRegexComplainString << "\n\n";
   cacheOut << this->IncludeRegexTransformString << "\n\n";
 
-  for (std::map<std::string, cmIncludeLines*>::const_iterator fileIt=
+  for (std::map<cmStdString, cmIncludeLines*>::const_iterator fileIt=
          this->FileCache.begin();
        fileIt!=this->FileCache.end(); ++fileIt)
     {
@@ -421,7 +421,7 @@ void cmDependsC::WriteCacheFile() const
 
 //----------------------------------------------------------------------------
 void cmDependsC::Scan(std::istream& is, const char* directory,
-  const std::string& fullName)
+  const cmStdString& fullName)
 {
   cmIncludeLines* newCacheEntry=new cmIncludeLines;
   newCacheEntry->Used=true;
diff --git a/Source/cmDependsC.h b/Source/cmDependsC.h
index 2ff43ba..16dfad7 100644
--- a/Source/cmDependsC.h
+++ b/Source/cmDependsC.h
@@ -40,7 +40,7 @@ protected:
 
   // Method to scan a single file.
   void Scan(std::istream& is, const char* directory,
-    const std::string& fullName);
+    const cmStdString& fullName);
 
   // Regular expression to identify C preprocessor include directives.
   cmsys::RegularExpression IncludeRegexLine;
@@ -56,7 +56,7 @@ protected:
   // Regex to transform #include lines.
   std::string IncludeRegexTransformString;
   cmsys::RegularExpression IncludeRegexTransform;
-  typedef std::map<std::string, std::string> TransformRulesType;
+  typedef std::map<cmStdString, cmStdString> TransformRulesType;
   TransformRulesType TransformRules;
   void SetupTransforms();
   void ParseTransform(std::string const& xform);
@@ -66,8 +66,8 @@ public:
   // Data structures for dependency graph walk.
   struct UnscannedEntry
   {
-    std::string FileName;
-    std::string QuotedLocation;
+    cmStdString FileName;
+    cmStdString QuotedLocation;
   };
 
   struct cmIncludeLines
@@ -78,13 +78,13 @@ public:
   };
 protected:
   const std::map<std::string, DependencyVector>* ValidDeps;
-  std::set<std::string> Encountered;
+  std::set<cmStdString> Encountered;
   std::queue<UnscannedEntry> Unscanned;
 
-  std::map<std::string, cmIncludeLines *> FileCache;
-  std::map<std::string, std::string> HeaderLocationCache;
+  std::map<cmStdString, cmIncludeLines *> FileCache;
+  std::map<cmStdString, cmStdString> HeaderLocationCache;
 
-  std::string CacheFileName;
+  cmStdString CacheFileName;
 
   void WriteCacheFile() const;
   void ReadCacheFile();
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index b3fbaa2..d5472a1 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -34,11 +34,11 @@ public:
   std::string Source;
 
   // Set of provided and required modules.
-  std::set<std::string> Provides;
-  std::set<std::string> Requires;
+  std::set<cmStdString> Provides;
+  std::set<cmStdString> Requires;
 
   // Set of files included in the translation unit.
-  std::set<std::string> Includes;
+  std::set<cmStdString> Includes;
 };
 
 //----------------------------------------------------------------------------
@@ -98,24 +98,24 @@ class cmDependsFortranInternals
 {
 public:
   // The set of modules provided by this target.
-  std::set<std::string> TargetProvides;
+  std::set<cmStdString> TargetProvides;
 
   // Map modules required by this target to locations.
-  typedef std::map<std::string, std::string> TargetRequiresMap;
+  typedef std::map<cmStdString, cmStdString> TargetRequiresMap;
   TargetRequiresMap TargetRequires;
 
   // Information about each object file.
-  typedef std::map<std::string, cmDependsFortranSourceInfo> ObjectInfoMap;
+  typedef std::map<cmStdString, cmDependsFortranSourceInfo> ObjectInfoMap;
   ObjectInfoMap ObjectInfo;
 
   cmDependsFortranSourceInfo& CreateObjectInfo(const char* obj,
                                                const char* src)
     {
-    std::map<std::string, cmDependsFortranSourceInfo>::iterator i =
+    std::map<cmStdString, cmDependsFortranSourceInfo>::iterator i =
       this->ObjectInfo.find(obj);
     if(i == this->ObjectInfo.end())
       {
-      std::map<std::string, cmDependsFortranSourceInfo>::value_type
+      std::map<cmStdString, cmDependsFortranSourceInfo>::value_type
         entry(obj, cmDependsFortranSourceInfo());
       i = this->ObjectInfo.insert(entry).first;
       i->second.Source = src;
@@ -260,8 +260,8 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends,
   cmGeneratedFileStream fiStream(fiName.c_str());
   fiStream << "# The fortran modules provided by this target.\n";
   fiStream << "provides\n";
-  std::set<std::string> const& provides = this->Internal->TargetProvides;
-  for(std::set<std::string>::const_iterator i = provides.begin();
+  std::set<cmStdString> const& provides = this->Internal->TargetProvides;
+  for(std::set<cmStdString>::const_iterator i = provides.begin();
       i != provides.end(); ++i)
     {
     fiStream << " " << *i << "\n";
@@ -275,7 +275,7 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends,
     cmGeneratedFileStream fcStream(fcName.c_str());
     fcStream << "# Remove fortran modules provided by this target.\n";
     fcStream << "FILE(REMOVE";
-    for(std::set<std::string>::const_iterator i = provides.begin();
+    for(std::set<cmStdString>::const_iterator i = provides.begin();
         i != provides.end(); ++i)
       {
       std::string mod_upper = mod_dir;
@@ -319,14 +319,14 @@ void cmDependsFortran::LocateModules()
       infoI != objInfo.end(); ++infoI)
     {
     cmDependsFortranSourceInfo const& info = infoI->second;
-    for(std::set<std::string>::const_iterator i = info.Provides.begin();
+    for(std::set<cmStdString>::const_iterator i = info.Provides.begin();
         i != info.Provides.end(); ++i)
       {
       // Include this module in the set provided by this target.
       this->Internal->TargetProvides.insert(*i);
       }
 
-    for(std::set<std::string>::const_iterator i = info.Requires.begin();
+    for(std::set<cmStdString>::const_iterator i = info.Requires.begin();
         i != info.Requires.end(); ++i)
       {
       // Include this module in the set required by this target.
@@ -368,8 +368,8 @@ void cmDependsFortran::LocateModules()
 void cmDependsFortran::MatchLocalModules()
 {
   const char* stampDir = this->TargetDirectory.c_str();
-  std::set<std::string> const& provides = this->Internal->TargetProvides;
-  for(std::set<std::string>::const_iterator i = provides.begin();
+  std::set<cmStdString> const& provides = this->Internal->TargetProvides;
+  for(std::set<cmStdString>::const_iterator i = provides.begin();
       i != provides.end(); ++i)
     {
     this->ConsiderModule(i->c_str(), stampDir);
@@ -445,7 +445,7 @@ cmDependsFortran
   // Write the include dependencies to the output stream.
   internalDepends << obj << std::endl;
   internalDepends << " " << src << std::endl;
-  for(std::set<std::string>::const_iterator i = info.Includes.begin();
+  for(std::set<cmStdString>::const_iterator i = info.Includes.begin();
       i != info.Includes.end(); ++i)
     {
     makeDepends << obj << ": " <<
@@ -458,11 +458,11 @@ cmDependsFortran
   makeDepends << std::endl;
 
   // Write module requirements to the output stream.
-  for(std::set<std::string>::const_iterator i = info.Requires.begin();
+  for(std::set<cmStdString>::const_iterator i = info.Requires.begin();
       i != info.Requires.end(); ++i)
     {
     // Require only modules not provided in the same source.
-    if(std::set<std::string>::const_iterator(info.Provides.find(*i)) !=
+    if(std::set<cmStdString>::const_iterator(info.Provides.find(*i)) !=
        info.Provides.end())
       {
       continue;
@@ -519,7 +519,7 @@ cmDependsFortran
     }
 
   // Write provided modules to the output stream.
-  for(std::set<std::string>::const_iterator i = info.Provides.begin();
+  for(std::set<cmStdString>::const_iterator i = info.Provides.begin();
       i != info.Provides.end(); ++i)
     {
     std::string proxy = stamp_dir;
@@ -538,7 +538,7 @@ cmDependsFortran
     // Create a target to copy the module after the object file
     // changes.
     makeDepends << obj << ".provides.build:\n";
-    for(std::set<std::string>::const_iterator i = info.Provides.begin();
+    for(std::set<cmStdString>::const_iterator i = info.Provides.begin();
         i != info.Provides.end(); ++i)
       {
       // Include this module in the set provided by this target.
diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx
index e23e4b7..c30d4bd 100644
--- a/Source/cmDependsJavaParserHelper.cxx
+++ b/Source/cmDependsJavaParserHelper.cxx
@@ -36,10 +36,10 @@ cmDependsJavaParserHelper::~cmDependsJavaParserHelper()
 }
 
 void cmDependsJavaParserHelper::CurrentClass
-::AddFileNamesForPrinting(std::vector<std::string> *files,
+::AddFileNamesForPrinting(std::vector<cmStdString> *files,
                           const char* prefix, const char* sep)
 {
-  std::string rname = "";
+  cmStdString rname = "";
   if ( prefix )
     {
     rname += prefix;
@@ -76,7 +76,7 @@ void cmDependsJavaParserHelper::AddClassFound(const char* sclass)
     {
     return;
     }
-  std::vector<std::string>::iterator it;
+  std::vector<cmStdString>::iterator it;
   for ( it = this->ClassesFound.begin();
     it != this->ClassesFound.end();
     it ++ )
@@ -91,7 +91,7 @@ void cmDependsJavaParserHelper::AddClassFound(const char* sclass)
 
 void cmDependsJavaParserHelper::AddPackagesImport(const char* sclass)
 {
-  std::vector<std::string>::iterator it;
+  std::vector<cmStdString>::iterator it;
   for ( it = this->PackagesImport.begin();
     it != this->PackagesImport.end();
     it ++ )
@@ -256,8 +256,8 @@ void cmDependsJavaParserHelper::PrintClasses()
     std::cerr << "Error when parsing. No classes on class stack" << std::endl;
     abort();
     }
-  std::vector<std::string> files = this->GetFilesProduced();
-  std::vector<std::string>::iterator sit;
+  std::vector<cmStdString> files = this->GetFilesProduced();
+  std::vector<cmStdString>::iterator sit;
   for ( sit = files.begin();
     sit != files.end();
     ++ sit )
@@ -266,9 +266,9 @@ void cmDependsJavaParserHelper::PrintClasses()
     }
 }
 
-std::vector<std::string> cmDependsJavaParserHelper::GetFilesProduced()
+std::vector<cmStdString> cmDependsJavaParserHelper::GetFilesProduced()
 {
-  std::vector<std::string> files;
+  std::vector<cmStdString> files;
   CurrentClass* toplevel = &(*(this->ClassStack.begin()));
   std::vector<CurrentClass>::iterator it;
   for ( it = toplevel->NestedClasses->begin();
@@ -313,7 +313,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
     std::cout << "Imports packages:";
     if ( this->PackagesImport.size() > 0 )
       {
-      std::vector<std::string>::iterator it;
+      std::vector<cmStdString>::iterator it;
       for ( it = this->PackagesImport.begin();
         it != this->PackagesImport.end();
         ++ it )
@@ -325,7 +325,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
     std::cout << "Depends on:";
     if ( this->ClassesFound.size() > 0 )
       {
-      std::vector<std::string>::iterator it;
+      std::vector<cmStdString>::iterator it;
       for ( it = this->ClassesFound.begin();
         it != this->ClassesFound.end();
         ++ it )
@@ -419,8 +419,8 @@ int cmDependsJavaParserHelper::ParseFile(const char* file)
     return 0;
     }
 
-  std::string fullfile = "";
-  std::string line;
+  cmStdString fullfile = "";
+  cmStdString line;
   while ( cmSystemTools::GetLineFromStream(ifs, line) )
     {
     fullfile += line + "\n";
diff --git a/Source/cmDependsJavaParserHelper.h b/Source/cmDependsJavaParserHelper.h
index 5542018..9807a04 100644
--- a/Source/cmDependsJavaParserHelper.h
+++ b/Source/cmDependsJavaParserHelper.h
@@ -59,15 +59,15 @@ public:
   const char* GetCurrentCombine() { return this->CurrentCombine.c_str(); }
   void UpdateCombine(const char* str1, const char* str2);
 
-  std::vector<std::string>& GetClassesFound() { return this->ClassesFound; }
+  std::vector<cmStdString>& GetClassesFound() { return this->ClassesFound; }
 
-  std::vector<std::string> GetFilesProduced();
+  std::vector<cmStdString> GetFilesProduced();
 
 private:
   class CurrentClass
   {
   public:
-    std::string Name;
+    cmStdString Name;
     std::vector<CurrentClass>* NestedClasses;
     CurrentClass()
       {
@@ -93,16 +93,16 @@ private:
       {
         (*this) = c;
       }
-    void AddFileNamesForPrinting(std::vector<std::string> *files,
+    void AddFileNamesForPrinting(std::vector<cmStdString> *files,
                                  const char* prefix, const char* sep);
   };
-  std::string CurrentPackage;
-  std::string::size_type InputBufferPos;
-  std::string InputBuffer;
+  cmStdString CurrentPackage;
+  cmStdString::size_type InputBufferPos;
+  cmStdString InputBuffer;
   std::vector<char> OutputBuffer;
-  std::vector<std::string> ClassesFound;
-  std::vector<std::string> PackagesImport;
-  std::string CurrentCombine;
+  std::vector<cmStdString> ClassesFound;
+  std::vector<cmStdString> PackagesImport;
+  cmStdString CurrentCombine;
 
   std::vector<CurrentClass> ClassStack;
 
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 96b5f04..9c27fc1 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -477,9 +477,9 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv,
 }
 
 //----------------------------------------------------------------------------
-void cmDocumentation::SetName(const std::string& name)
+void cmDocumentation::SetName(const char* name)
 {
-  this->NameString = name;
+  this->NameString = name?name:"";
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index 56a4151..d5a7dd5 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -56,7 +56,7 @@ public:
   void SetShowGenerators(bool showGen) { this->ShowGenerators = showGen; }
 
   /** Set the program name for standard document generation.  */
-  void SetName(const std::string& name);
+  void SetName(const char* name);
 
   /** Set a section of the documentation. Typical sections include Name,
       Usage, Description, Options */
diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx
index 944a000..6a0ab7b 100644
--- a/Source/cmDynamicLoader.cxx
+++ b/Source/cmDynamicLoader.cxx
@@ -23,7 +23,7 @@ public:
   static cmDynamicLoaderCache* GetInstance();
 
 private:
-  std::map<std::string, cmsys::DynamicLoader::LibraryHandle> CacheMap;
+  std::map<cmStdString, cmsys::DynamicLoader::LibraryHandle> CacheMap;
   static cmDynamicLoaderCache* Instance;
 };
 
@@ -47,7 +47,7 @@ void cmDynamicLoaderCache::CacheFile(const char* path,
 bool cmDynamicLoaderCache::GetCacheFile(const char* path,
   cmsys::DynamicLoader::LibraryHandle& p)
 {
-  std::map<std::string, cmsys::DynamicLoader::LibraryHandle>::iterator it
+  std::map<cmStdString, cmsys::DynamicLoader::LibraryHandle>::iterator it
     = this->CacheMap.find(path);
   if ( it != this->CacheMap.end() )
     {
@@ -59,7 +59,7 @@ bool cmDynamicLoaderCache::GetCacheFile(const char* path,
 
 bool cmDynamicLoaderCache::FlushCache(const char* path)
 {
-  std::map<std::string, cmsys::DynamicLoader::LibraryHandle>::iterator it
+  std::map<cmStdString, cmsys::DynamicLoader::LibraryHandle>::iterator it
     = this->CacheMap.find(path);
   bool ret = false;
   if ( it != this->CacheMap.end() )
@@ -73,7 +73,7 @@ bool cmDynamicLoaderCache::FlushCache(const char* path)
 
 void cmDynamicLoaderCache::FlushCache()
 {
-  for ( std::map<std::string,
+  for ( std::map<cmStdString,
     cmsys::DynamicLoader::LibraryHandle>::iterator it
     = this->CacheMap.begin();
         it != this->CacheMap.end(); it++ )
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index f991f45..308956a 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -118,9 +118,8 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
 void
 cmExportBuildFileGenerator
 ::GenerateImportTargetsConfig(std::ostream& os,
-                              const std::string& config,
-                              std::string const& suffix,
-                              std::vector<std::string> &missingTargets)
+                              const char* config, std::string const& suffix,
+                            std::vector<std::string> &missingTargets)
 {
   for(std::vector<cmTarget*>::const_iterator
         tei = this->Exports.begin();
@@ -167,8 +166,7 @@ void cmExportBuildFileGenerator::SetExportSet(cmExportSet *exportSet)
 //----------------------------------------------------------------------------
 void
 cmExportBuildFileGenerator
-::SetImportLocationProperty(const std::string& config,
-                            std::string const& suffix,
+::SetImportLocationProperty(const char* config, std::string const& suffix,
                             cmTarget* target, ImportPropertyMap& properties)
 {
   // Get the makefile in which to lookup target information.
diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h
index c1bdb5b..cea2099 100644
--- a/Source/cmExportBuildFileGenerator.h
+++ b/Source/cmExportBuildFileGenerator.h
@@ -52,7 +52,7 @@ protected:
   // Implement virtual methods from the superclass.
   virtual bool GenerateMainFile(std::ostream& os);
   virtual void GenerateImportTargetsConfig(std::ostream& os,
-                                           const std::string& config,
+                                           const char* config,
                                            std::string const& suffix,
                             std::vector<std::string> &missingTargets);
   virtual void HandleMissingTarget(std::string& link_libs,
@@ -66,7 +66,7 @@ protected:
                                   int occurrences);
 
   /** Fill in properties indicating built file locations.  */
-  void SetImportLocationProperty(const std::string& config,
+  void SetImportLocationProperty(const char* config,
                                  std::string const& suffix,
                                  cmTarget* target,
                                  ImportPropertyMap& properties);
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index bda8dda..db56aaf 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -168,7 +168,7 @@ bool cmExportCommand
         return false;
         }
 
-      if(cmTarget* target = gg->FindTarget(currentTarget->c_str()))
+      if(cmTarget* target = gg->FindTarget(0, currentTarget->c_str()))
         {
         if(target->GetType() == cmTarget::OBJECT_LIBRARY)
           {
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 3c3c6df..4a161ee 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -35,7 +35,7 @@ cmExportFileGenerator::cmExportFileGenerator()
 }
 
 //----------------------------------------------------------------------------
-void cmExportFileGenerator::AddConfiguration(const std::string& config)
+void cmExportFileGenerator::AddConfiguration(const char* config)
 {
   this->Configurations.push_back(config);
 }
@@ -117,12 +117,12 @@ bool cmExportFileGenerator::GenerateImportFile()
 
 //----------------------------------------------------------------------------
 void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
-                                    const std::string& config,
+                                    const char* config,
                                     std::vector<std::string> &missingTargets)
 {
   // Construct the property configuration suffix.
   std::string suffix = "_";
-  if(!config.empty())
+  if(config && *config)
     {
     suffix += cmSystemTools::UpperCase(config);
     }
@@ -136,8 +136,7 @@ void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
 }
 
 //----------------------------------------------------------------------------
-void cmExportFileGenerator::PopulateInterfaceProperty(
-                                              const std::string& propName,
+void cmExportFileGenerator::PopulateInterfaceProperty(const char *propName,
                                               cmTarget *target,
                                               ImportPropertyMap &properties)
 {
@@ -149,9 +148,8 @@ void cmExportFileGenerator::PopulateInterfaceProperty(
 }
 
 //----------------------------------------------------------------------------
-void cmExportFileGenerator::PopulateInterfaceProperty(
-                      const std::string& propName,
-                      const std::string& outputName,
+void cmExportFileGenerator::PopulateInterfaceProperty(const char *propName,
+                      const char *outputName,
                       cmTarget *target,
                       cmGeneratorExpression::PreprocessContext preprocessRule,
                       ImportPropertyMap &properties,
@@ -345,7 +343,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
                                             true);
   this->ReplaceInstallPrefix(dirs);
   cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(dirs);
-  std::string exportDirs = cge->Evaluate(target->GetMakefile(), "",
+  std::string exportDirs = cge->Evaluate(target->GetMakefile(), 0,
                                          false, target);
 
   if (cge->GetHadContextSensitiveCondition())
@@ -393,8 +391,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
 }
 
 //----------------------------------------------------------------------------
-void cmExportFileGenerator::PopulateInterfaceProperty(
-                      const std::string& propName,
+void cmExportFileGenerator::PopulateInterfaceProperty(const char *propName,
                       cmTarget *target,
                       cmGeneratorExpression::PreprocessContext preprocessRule,
                       ImportPropertyMap &properties,
@@ -406,7 +403,7 @@ void cmExportFileGenerator::PopulateInterfaceProperty(
 
 
 //----------------------------------------------------------------------------
-void getPropertyContents(cmTarget const* tgt, const std::string& prop,
+void getPropertyContents(cmTarget const* tgt, const char *prop,
          std::set<std::string> &ifaceProperties)
 {
   const char *p = tgt->GetProperty(prop);
@@ -426,7 +423,7 @@ void getPropertyContents(cmTarget const* tgt, const std::string& prop,
 //----------------------------------------------------------------------------
 void getCompatibleInterfaceProperties(cmTarget *target,
                                       std::set<std::string> &ifaceProperties,
-                                      const std::string& config)
+                                      const char *config)
 {
   cmComputeLinkInformation *info = target->GetLinkInformation(config);
 
@@ -490,7 +487,7 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
 
   if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
     {
-    getCompatibleInterfaceProperties(target, ifaceProperties, "");
+    getCompatibleInterfaceProperties(target, ifaceProperties, 0);
 
     std::vector<std::string> configNames;
     target->GetMakefile()->GetConfigurations(configNames);
@@ -687,7 +684,7 @@ cmExportFileGenerator::ReplaceInstallPrefix(std::string &)
 //----------------------------------------------------------------------------
 void
 cmExportFileGenerator
-::SetImportLinkInterface(const std::string& config, std::string const& suffix,
+::SetImportLinkInterface(const char* config, std::string const& suffix,
                     cmGeneratorExpression::PreprocessContext preprocessRule,
                     cmTarget* target, ImportPropertyMap& properties,
                     std::vector<std::string>& missingTargets)
@@ -762,8 +759,7 @@ cmExportFileGenerator
 //----------------------------------------------------------------------------
 void
 cmExportFileGenerator
-::SetImportDetailProperties(const std::string& config,
-                            std::string const& suffix,
+::SetImportDetailProperties(const char* config, std::string const& suffix,
                             cmTarget* target, ImportPropertyMap& properties,
                             std::vector<std::string>& missingTargets
                            )
@@ -829,7 +825,7 @@ void
 cmExportFileGenerator
 ::SetImportLinkProperty(std::string const& suffix,
                         cmTarget* target,
-                        const std::string& propName,
+                        const char* propName,
                         std::vector<std::string> const& entries,
                         ImportPropertyMap& properties,
                         std::vector<std::string>& missingTargets
@@ -865,11 +861,11 @@ cmExportFileGenerator
 
 //----------------------------------------------------------------------------
 void cmExportFileGenerator::GenerateImportHeaderCode(std::ostream& os,
-                                                    const std::string& config)
+                                                     const char* config)
 {
   os << "#----------------------------------------------------------------\n"
      << "# Generated CMake target import file";
-  if(!config.empty())
+  if(config)
     {
     os << " for configuration \"" << config << "\".\n";
     }
@@ -1000,7 +996,7 @@ cmExportFileGenerator
 //----------------------------------------------------------------------------
 void
 cmExportFileGenerator
-::GenerateImportPropertyCode(std::ostream& os, const std::string& config,
+::GenerateImportPropertyCode(std::ostream& os, const char* config,
                              cmTarget const* target,
                              ImportPropertyMap const& properties)
 {
@@ -1014,7 +1010,7 @@ cmExportFileGenerator
      << config << "\"\n";
   os << "set_property(TARGET " << targetName
      << " APPEND PROPERTY IMPORTED_CONFIGURATIONS ";
-  if(!config.empty())
+  if(config && *config)
     {
     os << cmSystemTools::UpperCase(config);
     }
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index cf91c69..57ab378 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -56,27 +56,26 @@ public:
   void SetExportOld(bool exportOld) { this->ExportOld = exportOld; }
 
   /** Add a configuration to be exported.  */
-  void AddConfiguration(const std::string& config);
+  void AddConfiguration(const char* config);
 
   /** Actually generate the export file.  Returns whether there was an
       error.  */
   bool GenerateImportFile();
 protected:
 
-  typedef std::map<std::string, std::string> ImportPropertyMap;
+  typedef std::map<cmStdString, cmStdString> ImportPropertyMap;
 
   // Generate per-configuration target information to the given output
   // stream.
-  void GenerateImportConfig(std::ostream& os, const std::string& config,
+  void GenerateImportConfig(std::ostream& os, const char* config,
                             std::vector<std::string> &missingTargets);
 
   // Methods to implement export file code generation.
-  void GenerateImportHeaderCode(std::ostream& os,
-                                const std::string& config = "");
+  void GenerateImportHeaderCode(std::ostream& os, const char* config = 0);
   void GenerateImportFooterCode(std::ostream& os);
   void GenerateImportVersionCode(std::ostream& os);
   void GenerateImportTargetCode(std::ostream& os, cmTarget const* target);
-  void GenerateImportPropertyCode(std::ostream& os, const std::string& config,
+  void GenerateImportPropertyCode(std::ostream& os, const char* config,
                                   cmTarget const* target,
                                   ImportPropertyMap const& properties);
   void GenerateImportedFileChecksCode(std::ostream& os, cmTarget* target,
@@ -91,12 +90,12 @@ protected:
 
   // Collect properties with detailed information about targets beyond
   // their location on disk.
-  void SetImportDetailProperties(const std::string& config,
+  void SetImportDetailProperties(const char* config,
                                  std::string const& suffix, cmTarget* target,
                                  ImportPropertyMap& properties,
                                  std::vector<std::string>& missingTargets);
   void SetImportLinkProperty(std::string const& suffix,
-                             cmTarget* target, const std::string& propName,
+                             cmTarget* target, const char* propName,
                              std::vector<std::string> const& entries,
                              ImportPropertyMap& properties,
                              std::vector<std::string>& missingTargets);
@@ -106,7 +105,7 @@ protected:
 
   /** Each subclass knows where the target files are located.  */
   virtual void GenerateImportTargetsConfig(std::ostream& os,
-                                           const std::string& config,
+                                           const char* config,
                                            std::string const& suffix,
                             std::vector<std::string> &missingTargets) = 0;
 
@@ -117,7 +116,7 @@ protected:
                                    cmMakefile* mf,
                                    cmTarget* depender,
                                    cmTarget* dependee) = 0;
-  void PopulateInterfaceProperty(const std::string&,
+  void PopulateInterfaceProperty(const char *,
                                  cmTarget *target,
                                  cmGeneratorExpression::PreprocessContext,
                                  ImportPropertyMap &properties,
@@ -126,7 +125,7 @@ protected:
                                  cmGeneratorExpression::PreprocessContext,
                                  ImportPropertyMap &properties,
                                  std::vector<std::string> &missingTargets);
-  void PopulateInterfaceProperty(const std::string& propName, cmTarget *target,
+  void PopulateInterfaceProperty(const char *propName, cmTarget *target,
                                  ImportPropertyMap &properties);
   void PopulateCompatibleInterfaceProperties(cmTarget *target,
                                  ImportPropertyMap &properties);
@@ -138,8 +137,7 @@ protected:
                       ImportPropertyMap &properties,
                       std::vector<std::string> &missingTargets);
 
-  void SetImportLinkInterface(const std::string& config,
-                    std::string const& suffix,
+  void SetImportLinkInterface(const char* config, std::string const& suffix,
                     cmGeneratorExpression::PreprocessContext preprocessRule,
                     cmTarget* target, ImportPropertyMap& properties,
                     std::vector<std::string>& missingTargets);
@@ -176,7 +174,7 @@ protected:
   std::set<cmTarget*> ExportedTargets;
 
 private:
-  void PopulateInterfaceProperty(const std::string&, const std::string&,
+  void PopulateInterfaceProperty(const char *, const char *,
                                  cmTarget *target,
                                  cmGeneratorExpression::PreprocessContext,
                                  ImportPropertyMap &properties,
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 5e7d5e4..b579963 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -240,8 +240,7 @@ cmExportInstallFileGenerator::ReplaceInstallPrefix(std::string &input)
 
 //----------------------------------------------------------------------------
 bool
-cmExportInstallFileGenerator::GenerateImportFileConfig(
-                                    const std::string& config,
+cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config,
                                     std::vector<std::string> &missingTargets)
 {
   // Skip configurations not enabled for this export.
@@ -255,7 +254,7 @@ cmExportInstallFileGenerator::GenerateImportFileConfig(
   fileName += "/";
   fileName += this->FileBase;
   fileName += "-";
-  if(!config.empty())
+  if(config && *config)
     {
     fileName += cmSystemTools::LowerCase(config);
     }
@@ -297,8 +296,7 @@ cmExportInstallFileGenerator::GenerateImportFileConfig(
 void
 cmExportInstallFileGenerator
 ::GenerateImportTargetsConfig(std::ostream& os,
-                              const std::string& config,
-                              std::string const& suffix,
+                              const char* config, std::string const& suffix,
                               std::vector<std::string> &missingTargets)
 {
   // Add each target in the set to the export.
@@ -357,8 +355,7 @@ cmExportInstallFileGenerator
 //----------------------------------------------------------------------------
 void
 cmExportInstallFileGenerator
-::SetImportLocationProperty(const std::string& config,
-                            std::string const& suffix,
+::SetImportLocationProperty(const char* config, std::string const& suffix,
                             cmInstallTargetGenerator* itgen,
                             ImportPropertyMap& properties,
                             std::set<std::string>& importedLocations
diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h
index b851ad5..7c634a4 100644
--- a/Source/cmExportInstallFileGenerator.h
+++ b/Source/cmExportInstallFileGenerator.h
@@ -41,7 +41,7 @@ public:
   /** Get the per-config file generated for each configuraiton.  This
       maps from the configuration name to the file temporary location
       for installation.  */
-  std::map<std::string, std::string> const& GetConfigImportFiles()
+  std::map<cmStdString, cmStdString> const& GetConfigImportFiles()
     { return this->ConfigImportFiles; }
 
   /** Compute the globbing expression used to load per-config import
@@ -52,7 +52,7 @@ protected:
   // Implement virtual methods from the superclass.
   virtual bool GenerateMainFile(std::ostream& os);
   virtual void GenerateImportTargetsConfig(std::ostream& os,
-                                           const std::string& config,
+                                           const char* config,
                                            std::string const& suffix,
                             std::vector<std::string> &missingTargets);
   virtual void HandleMissingTarget(std::string& link_libs,
@@ -72,11 +72,11 @@ protected:
 
 
   /** Generate a per-configuration file for the targets.  */
-  bool GenerateImportFileConfig(const std::string& config,
+  bool GenerateImportFileConfig(const char* config,
                             std::vector<std::string> &missingTargets);
 
   /** Fill in properties indicating installed file locations.  */
-  void SetImportLocationProperty(const std::string& config,
+  void SetImportLocationProperty(const char* config,
                                  std::string const& suffix,
                                  cmInstallTargetGenerator* itgen,
                                  ImportPropertyMap& properties,
@@ -92,7 +92,7 @@ protected:
   std::string ImportPrefix;
 
   // The import file generated for each configuration.
-  std::map<std::string, std::string> ConfigImportFiles;
+  std::map<cmStdString, cmStdString> ConfigImportFiles;
 };
 
 #endif
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx
index b04b937..5d6f094 100644
--- a/Source/cmExportLibraryDependenciesCommand.cxx
+++ b/Source/cmExportLibraryDependenciesCommand.cxx
@@ -83,9 +83,9 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
   cmake* cm = this->Makefile->GetCMakeInstance();
   cmGlobalGenerator* global = cm->GetGlobalGenerator();
   const std::vector<cmLocalGenerator *>& locals = global->GetLocalGenerators();
-  std::map<std::string, std::string> libDepsOld;
-  std::map<std::string, std::string> libDepsNew;
-  std::map<std::string, std::string> libTypes;
+  std::map<cmStdString, cmStdString> libDepsOld;
+  std::map<cmStdString, cmStdString> libDepsNew;
+  std::map<cmStdString, cmStdString> libTypes;
   for(std::vector<cmLocalGenerator *>::const_iterator i = locals.begin();
       i != locals.end(); ++i)
     {
@@ -138,7 +138,7 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
             break;
           }
         std::string lib = li->first;
-        if(cmTarget* libtgt = global->FindTarget(lib.c_str()))
+        if(cmTarget* libtgt = global->FindTarget(0, lib.c_str()))
           {
           // Handle simple output name changes.  This command is
           // deprecated so we do not support full target name
@@ -175,7 +175,7 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
   fout << "# Generated by CMake " <<  cmVersion::GetCMakeVersion() << "\n\n";
   fout << "if(" << vertest << ")\n";
   fout << "  # Information for CMake 2.6 and above.\n";
-  for(std::map<std::string, std::string>::const_iterator
+  for(std::map<cmStdString, cmStdString>::const_iterator
         i = libDepsNew.begin();
       i != libDepsNew.end(); ++i)
     {
@@ -186,7 +186,7 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
     }
   fout << "else()\n";
   fout << "  # Information for CMake 2.4 and lower.\n";
-  for(std::map<std::string, std::string>::const_iterator
+  for(std::map<cmStdString, cmStdString>::const_iterator
         i = libDepsOld.begin();
       i != libDepsOld.end(); ++i)
     {
@@ -195,7 +195,7 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
       fout << "  set(\"" << i->first << "\" \"" << i->second << "\")\n";
       }
     }
-  for(std::map<std::string, std::string>::const_iterator i = libTypes.begin();
+  for(std::map<cmStdString, cmStdString>::const_iterator i = libTypes.begin();
       i != libTypes.end(); ++i)
     {
     if(i->second != "general")
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index fe8c8ec..a8a91d6 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -46,9 +46,8 @@ bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
   return true;
 }
 
-std::string cmExportTryCompileFileGenerator::FindTargets(
-                                          const std::string& propName,
-                                          cmTarget const* tgt,
+std::string cmExportTryCompileFileGenerator::FindTargets(const char *propName,
+                                                cmTarget const* tgt,
                                           std::set<cmTarget const*> &emitted)
 {
   const char *prop = tgt->GetProperty(propName);
diff --git a/Source/cmExportTryCompileFileGenerator.h b/Source/cmExportTryCompileFileGenerator.h
index ec70d81..71ac0dd 100644
--- a/Source/cmExportTryCompileFileGenerator.h
+++ b/Source/cmExportTryCompileFileGenerator.h
@@ -23,14 +23,14 @@ public:
   /** Set the list of targets to export.  */
   void SetExports(const std::vector<cmTarget const*> &exports)
     { this->Exports = exports; }
-  void SetConfig(const std::string& config) { this->Config = config; }
+  void SetConfig(const char *config) { this->Config = config; }
 protected:
 
   // Implement virtual methods from the superclass.
   virtual bool GenerateMainFile(std::ostream& os);
 
   virtual void GenerateImportTargetsConfig(std::ostream&,
-                                           const std::string&,
+                                           const char*,
                                            std::string const&,
                             std::vector<std::string>&) {}
   virtual void HandleMissingTarget(std::string&,
@@ -46,12 +46,12 @@ protected:
   std::string InstallNameDir(cmTarget* target,
                              const std::string& config);
 private:
-  std::string FindTargets(const std::string& prop, cmTarget const* tgt,
+  std::string FindTargets(const char *prop, cmTarget const* tgt,
                    std::set<cmTarget const*> &emitted);
 
 
   std::vector<cmTarget const*> Exports;
-  std::string Config;
+  const char *Config;
 };
 
 #endif
diff --git a/Source/cmExprParserHelper.h b/Source/cmExprParserHelper.h
index 8d6b2cd..4b76b33 100644
--- a/Source/cmExprParserHelper.h
+++ b/Source/cmExprParserHelper.h
@@ -49,8 +49,8 @@ public:
   const char* GetError() { return this->ErrorString.c_str(); }
 
 private:
-  std::string::size_type InputBufferPos;
-  std::string InputBuffer;
+  cmStdString::size_type InputBufferPos;
+  cmStdString InputBuffer;
   std::vector<char> OutputBuffer;
   int CurrentLine;
   int Verbose;
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 9bc3ccb..548c88b 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -61,7 +61,7 @@ cmExtraCodeBlocksGenerator::cmExtraCodeBlocksGenerator()
 void cmExtraCodeBlocksGenerator::Generate()
 {
   // for each sub project in the project create a codeblocks project
-  for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator
+  for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
        it = this->GlobalGenerator->GetProjectMap().begin();
       it!= this->GlobalGenerator->GetProjectMap().end();
       ++it)
@@ -243,7 +243,7 @@ void cmExtraCodeBlocksGenerator
   Tree tree;
 
   // build tree of virtual folders
-  for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator
+  for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
           it = this->GlobalGenerator->GetProjectMap().begin();
          it != this->GlobalGenerator->GetProjectMap().end();
          ++it)
@@ -413,7 +413,7 @@ void cmExtraCodeBlocksGenerator
             bool isCFile = false;
             if ((*si)->GetLanguage() && (*(*si)->GetLanguage() == 'C'))
               {
-              for(std::set<std::string>::const_iterator
+              for(std::vector<std::string>::const_iterator
                   ext = mf->GetSourceExtensions().begin();
                   ext !=  mf->GetSourceExtensions().end();
                   ++ext)
@@ -459,7 +459,7 @@ void cmExtraCodeBlocksGenerator
     headerBasename+=cmSystemTools::GetFilenameWithoutExtension(sit->first);
 
     // check if there's a matching header around
-    for(std::set<std::string>::const_iterator
+    for(std::vector<std::string>::const_iterator
         ext = mf->GetHeaderExtensions().begin();
         ext !=  mf->GetHeaderExtensions().end();
         ++ext)
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index d882c29..ff84fb7 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -60,7 +60,7 @@ void cmExtraCodeLiteGenerator::Generate()
 
   // loop projects and locate the root project.
   // and extract the information for creating the worspace
-  for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator
+  for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
        it = this->GlobalGenerator->GetProjectMap().begin();
        it!= this->GlobalGenerator->GetProjectMap().end();
        ++it)
@@ -85,7 +85,7 @@ void cmExtraCodeLiteGenerator::Generate()
     }
 
   // for each sub project in the workspace create a codelite project
-  for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator
+  for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
        it = this->GlobalGenerator->GetProjectMap().begin();
        it!= this->GlobalGenerator->GetProjectMap().end();
        ++it)
@@ -222,7 +222,7 @@ void cmExtraCodeLiteGenerator
             bool isCFile = false;
             if ((*si)->GetLanguage() && (*(*si)->GetLanguage() == 'C'))
               {
-              for(std::set<std::string>::const_iterator
+              for(std::vector<std::string>::const_iterator
                   ext = mf->GetSourceExtensions().begin();
                   ext !=  mf->GetSourceExtensions().end();
                   ++ext)
@@ -268,7 +268,7 @@ void cmExtraCodeLiteGenerator
     headerBasename+=cmSystemTools::GetFilenameWithoutExtension(sit->first);
 
     // check if there's a matching header around
-    for(std::set<std::string>::const_iterator
+    for(std::vector<std::string>::const_iterator
         ext = mf->GetHeaderExtensions().begin();
         ext !=  mf->GetHeaderExtensions().end();
         ++ext)
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 38a2470..74ba9a6 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -624,7 +624,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
   this->AppendLinkedResource(fout, "[Subprojects]",
                              "virtual:/virtual", VirtualFolder);
 
-  for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator
+  for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
        it = this->GlobalGenerator->GetProjectMap().begin();
        it != this->GlobalGenerator->GetProjectMap().end();
        ++it)
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index fc7296b..604bfcc 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -64,7 +64,7 @@ cmExtraSublimeTextGenerator::cmExtraSublimeTextGenerator()
 void cmExtraSublimeTextGenerator::Generate()
 {
   // for each sub project in the project create a sublime text 2 project
-  for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator
+  for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
        it = this->GlobalGenerator->GetProjectMap().begin();
       it!= this->GlobalGenerator->GetProjectMap().end();
       ++it)
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx
index 5727470..02f10c0 100644
--- a/Source/cmFileTimeComparison.cxx
+++ b/Source/cmFileTimeComparison.cxx
@@ -43,13 +43,13 @@ private:
   class HashString
     {
   public:
-    size_t operator()(const std::string& s) const
+    size_t operator()(const cmStdString& s) const
       {
       return h(s.c_str());
       }
     cmsys::hash<const char*> h;
     };
-  typedef cmsys::hash_map<std::string,
+  typedef cmsys::hash_map<cmStdString,
                           cmFileTimeComparison_Type, HashString> FileStatsMap;
   FileStatsMap Files;
 #endif
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index 86fd54b..ae15ee7 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -268,7 +268,7 @@ void cmFindBase::AddPrefixPaths(std::vector<std::string> const& in_paths,
 }
 
 //----------------------------------------------------------------------------
-void cmFindBase::AddCMakePrefixPath(const std::string& variable)
+void cmFindBase::AddCMakePrefixPath(const char* variable)
 {
   // Get a path from a CMake variable.
   if(const char* varPath = this->Makefile->GetDefinition(variable))
@@ -280,11 +280,11 @@ void cmFindBase::AddCMakePrefixPath(const std::string& variable)
 }
 
 //----------------------------------------------------------------------------
-void cmFindBase::AddEnvPrefixPath(const std::string& variable)
+void cmFindBase::AddEnvPrefixPath(const char* variable)
 {
   // Get a path from the environment.
   std::vector<std::string> tmp;
-  cmSystemTools::GetPath(tmp, variable.c_str());
+  cmSystemTools::GetPath(tmp, variable);
   this->AddPrefixPaths(tmp, EnvPath);
 }
 
diff --git a/Source/cmFindBase.h b/Source/cmFindBase.h
index 42d9bc1..0562b1b 100644
--- a/Source/cmFindBase.h
+++ b/Source/cmFindBase.h
@@ -42,14 +42,14 @@ protected:
   bool CheckForVariableInCache();
 
   // use by command during find
-  std::string VariableDocumentation;
-  std::string VariableName;
+  cmStdString VariableDocumentation;
+  cmStdString VariableName;
   std::vector<std::string> Names;
   bool NamesPerDir;
   bool NamesPerDirAllowed;
 
   // CMAKE_*_PATH CMAKE_SYSTEM_*_PATH FRAMEWORK|LIBRARY|INCLUDE|PROGRAM
-  std::string EnvironmentPath; // LIB,INCLUDE
+  cmStdString EnvironmentPath; // LIB,INCLUDE
 
   bool AlreadyInCache;
   bool AlreadyInCacheWithoutMetaInfo;
@@ -63,8 +63,8 @@ private:
   void AddUserGuessPath();
 
   // Helpers.
-  void AddCMakePrefixPath(const std::string& variable);
-  void AddEnvPrefixPath(const std::string& variable);
+  void AddCMakePrefixPath(const char* variable);
+  void AddEnvPrefixPath(const char* variable);
   void AddPrefixPaths(std::vector<std::string> const& in_paths,
                       PathType pathType);
 };
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index bd75e10..e8c8da3 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -374,7 +374,7 @@ void cmFindCommon::AddUserPath(std::string const& p,
 }
 
 //----------------------------------------------------------------------------
-void cmFindCommon::AddCMakePath(const std::string& variable)
+void cmFindCommon::AddCMakePath(const char* variable)
 {
   // Get a path from a CMake variable.
   if(const char* varPath = this->Makefile->GetDefinition(variable))
diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h
index 5a905cd..6109a9f 100644
--- a/Source/cmFindCommon.h
+++ b/Source/cmFindCommon.h
@@ -56,14 +56,14 @@ protected:
   /** Compute the current default bundle/framework search policy.  */
   void SelectDefaultMacMode();
 
-  std::string CMakePathName;
+  cmStdString CMakePathName;
   RootPathMode FindRootPathMode;
 
   bool CheckCommonArgument(std::string const& arg);
   void AddPathSuffix(std::string const& arg);
   void AddUserPath(std::string const& p,
                    std::vector<std::string>& paths);
-  void AddCMakePath(const std::string& variable);
+  void AddCMakePath(const char* variable);
   void AddEnvPath(const char* variable);
   void AddPathsInternal(std::vector<std::string> const& in_paths,
                         PathType pathType);
@@ -81,7 +81,7 @@ protected:
   std::vector<std::string> UserPaths;
   std::vector<std::string> UserHints;
   std::vector<std::string> SearchPaths;
-  std::set<std::string> SearchPathsEmitted;
+  std::set<cmStdString> SearchPathsEmitted;
 
   bool SearchFrameworkFirst;
   bool SearchFrameworkOnly;
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 9345d15..de52df7 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -368,8 +368,8 @@ bool cmFindLibraryHelper::CheckDirectoryForName(std::string const& path,
   // Search for a file matching the library name regex.
   std::string dir = path;
   cmSystemTools::ConvertToUnixSlashes(dir);
-  std::set<std::string> const& files = this->GG->GetDirectoryContent(dir);
-  for(std::set<std::string>::const_iterator fi = files.begin();
+  std::set<cmStdString> const& files = this->GG->GetDirectoryContent(dir);
+  for(std::set<cmStdString>::const_iterator fi = files.begin();
       fi != files.end(); ++fi)
     {
     std::string const& origName = *fi;
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 7a4e7f4..73eba51 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -535,8 +535,7 @@ void cmFindPackageCommand::SetModuleVariables(const std::string& components)
 }
 
 //----------------------------------------------------------------------------
-void cmFindPackageCommand::AddFindDefinition(const std::string& var,
-                                             const char* val)
+void cmFindPackageCommand::AddFindDefinition(const char* var, const char* val)
 {
   if(const char* old = this->Makefile->GetDefinition(var))
     {
@@ -553,7 +552,7 @@ void cmFindPackageCommand::AddFindDefinition(const std::string& var,
 //----------------------------------------------------------------------------
 void cmFindPackageCommand::RestoreFindDefinitions()
 {
-  for(std::map<std::string, OriginalDef>::iterator
+  for(std::map<cmStdString, OriginalDef>::iterator
         i = this->OriginalDefs.begin(); i != this->OriginalDefs.end(); ++i)
     {
     OriginalDef const& od = i->second;
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h
index 72c1e3c..0d80e48 100644
--- a/Source/cmFindPackageCommand.h
+++ b/Source/cmFindPackageCommand.h
@@ -57,7 +57,7 @@ private:
   void AppendToFoundProperty(bool found);
   void SetModuleVariables(const std::string& components);
   bool FindModule(bool& found);
-  void AddFindDefinition(const std::string& var, const char* val);
+  void AddFindDefinition(const char* var, const char* val);
   void RestoreFindDefinitions();
   bool HandlePackageMode();
   bool FindConfig();
@@ -96,19 +96,19 @@ private:
   friend class cmFindPackageFileList;
 
   struct OriginalDef { bool exists; std::string value; };
-  std::map<std::string, OriginalDef> OriginalDefs;
+  std::map<cmStdString, OriginalDef> OriginalDefs;
 
-  std::string Name;
-  std::string Variable;
-  std::string Version;
+  cmStdString Name;
+  cmStdString Variable;
+  cmStdString Version;
   unsigned int VersionMajor;
   unsigned int VersionMinor;
   unsigned int VersionPatch;
   unsigned int VersionTweak;
   unsigned int VersionCount;
   bool VersionExact;
-  std::string FileFound;
-  std::string VersionFound;
+  cmStdString FileFound;
+  cmStdString VersionFound;
   unsigned int VersionFoundMajor;
   unsigned int VersionFoundMinor;
   unsigned int VersionFoundPatch;
diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx
index caaf1d3..8459995 100644
--- a/Source/cmFindPathCommand.cxx
+++ b/Source/cmFindPathCommand.cxx
@@ -89,9 +89,9 @@ std::string
 cmFindPathCommand::FindHeaderInFramework(std::string const& file,
                                          std::string const& dir)
 {
-  std::string fileName = file;
-  std::string frameWorkName;
-  std::string::size_type pos = fileName.find("/");
+  cmStdString fileName = file;
+  cmStdString frameWorkName;
+  cmStdString::size_type pos = fileName.find("/");
   // if there is a / in the name try to find the header as a framework
   // For example bar/foo.h would look for:
   // bar.framework/Headers/foo.h
@@ -128,7 +128,7 @@ cmFindPathCommand::FindHeaderInFramework(std::string const& file,
     }
   // if it is not found yet or not a framework header, then do a glob search
   // for all frameworks in the directory: dir/*.framework/Headers/<file>
-  std::string glob = dir;
+  cmStdString glob = dir;
   glob += "*.framework/Headers/";
   glob += file;
   cmsys::Glob globIt;
@@ -136,7 +136,7 @@ cmFindPathCommand::FindHeaderInFramework(std::string const& file,
   std::vector<std::string> files = globIt.GetFiles();
   if(files.size())
     {
-    std::string fheader = cmSystemTools::CollapseFullPath(files[0].c_str());
+    cmStdString fheader = cmSystemTools::CollapseFullPath(files[0].c_str());
     if(this->IncludeFileInPath)
       {
       return fheader;
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx
index 78ad4b2..34efc15 100644
--- a/Source/cmGeneratedFileStream.cxx
+++ b/Source/cmGeneratedFileStream.cxx
@@ -249,7 +249,12 @@ int cmGeneratedFileStreamBase::RenameFile(const char* oldname,
 }
 
 //----------------------------------------------------------------------------
-void cmGeneratedFileStream::SetName(const std::string& fname)
+void cmGeneratedFileStream::SetName(const char* fname)
 {
+  if ( !fname )
+    {
+    this->Name = "";
+    return;
+    }
   this->Name = fname;
 }
diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h
index 7adee7b..99f3b47 100644
--- a/Source/cmGeneratedFileStream.h
+++ b/Source/cmGeneratedFileStream.h
@@ -140,7 +140,7 @@ public:
    * Set name of the file that will hold the actual output. This method allows
    * the output file to be changed during the use of cmGeneratedFileStream.
    */
-  void SetName(const std::string& fname);
+  void SetName(const char* fname);
 
 private:
   cmGeneratedFileStream(cmGeneratedFileStream const&); // not implemented
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 68bee32..2e66d78 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -33,17 +33,17 @@ cmGeneratorExpression::cmGeneratorExpression(
 cmsys::auto_ptr<cmCompiledGeneratorExpression>
 cmGeneratorExpression::Parse(std::string const& input)
 {
-  return cmsys::auto_ptr<cmCompiledGeneratorExpression>(
-                                      new cmCompiledGeneratorExpression(
-                                        this->Backtrace,
-                                        input));
+  return this->Parse(input.c_str());
 }
 
 //----------------------------------------------------------------------------
 cmsys::auto_ptr<cmCompiledGeneratorExpression>
 cmGeneratorExpression::Parse(const char* input)
 {
-  return this->Parse(std::string(input ? input : ""));
+  return cmsys::auto_ptr<cmCompiledGeneratorExpression>(
+                                      new cmCompiledGeneratorExpression(
+                                        this->Backtrace,
+                                        input));
 }
 
 cmGeneratorExpression::~cmGeneratorExpression()
@@ -52,7 +52,7 @@ cmGeneratorExpression::~cmGeneratorExpression()
 
 //----------------------------------------------------------------------------
 const char *cmCompiledGeneratorExpression::Evaluate(
-  cmMakefile* mf, const std::string& config, bool quiet,
+  cmMakefile* mf, const char* config, bool quiet,
   cmTarget const* headTarget,
   cmGeneratorExpressionDAGChecker *dagChecker) const
 {
@@ -66,7 +66,7 @@ const char *cmCompiledGeneratorExpression::Evaluate(
 
 //----------------------------------------------------------------------------
 const char *cmCompiledGeneratorExpression::Evaluate(
-  cmMakefile* mf, const std::string& config, bool quiet,
+  cmMakefile* mf, const char* config, bool quiet,
   cmTarget const* headTarget,
   cmTarget const* currentTarget,
   cmGeneratorExpressionDAGChecker *dagChecker) const
@@ -97,7 +97,7 @@ const char *cmCompiledGeneratorExpression::Evaluate(
     {
     this->Output += (*it)->Evaluate(&context, dagChecker);
 
-    for(std::set<std::string>::const_iterator
+    for(std::set<cmStdString>::const_iterator
           p = context.SeenTargetProperties.begin();
           p != context.SeenTargetProperties.end(); ++p)
       {
@@ -122,13 +122,13 @@ const char *cmCompiledGeneratorExpression::Evaluate(
 
 cmCompiledGeneratorExpression::cmCompiledGeneratorExpression(
               cmListFileBacktrace const& backtrace,
-              const std::string& input)
-  : Backtrace(backtrace), Input(input),
+              const char *input)
+  : Backtrace(backtrace), Input(input ? input : ""),
     HadContextSensitiveCondition(false)
 {
   cmGeneratorExpressionLexer l;
   std::vector<cmGeneratorExpressionToken> tokens =
-                                              l.Tokenize(this->Input);
+                                              l.Tokenize(this->Input.c_str());
   this->NeedsEvaluation = l.GetSawGeneratorExpression();
 
   if (this->NeedsEvaluation)
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 5b97e8b..4992e93 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -78,12 +78,12 @@ private:
 class cmCompiledGeneratorExpression
 {
 public:
-  const char* Evaluate(cmMakefile* mf, const std::string& config,
+  const char* Evaluate(cmMakefile* mf, const char* config,
                        bool quiet = false,
                        cmTarget const* headTarget = 0,
                        cmTarget const* currentTarget = 0,
                        cmGeneratorExpressionDAGChecker *dagChecker = 0) const;
-  const char* Evaluate(cmMakefile* mf, const std::string& config,
+  const char* Evaluate(cmMakefile* mf, const char* config,
                        bool quiet,
                        cmTarget const* headTarget,
                        cmGeneratorExpressionDAGChecker *dagChecker) const;
@@ -92,7 +92,7 @@ public:
   std::set<cmTarget*> const& GetTargets() const
     { return this->DependTargets; }
 
-  std::set<std::string> const& GetSeenTargetProperties() const
+  std::set<cmStdString> const& GetSeenTargetProperties() const
     { return this->SeenTargetProperties; }
 
   std::set<cmTarget const*> const& GetAllTargetsSeen() const
@@ -100,7 +100,7 @@ public:
 
   ~cmCompiledGeneratorExpression();
 
-  std::string const& GetInput() const
+  std::string GetInput() const
   {
     return this->Input;
   }
@@ -116,7 +116,7 @@ public:
 
 private:
   cmCompiledGeneratorExpression(cmListFileBacktrace const& backtrace,
-              const std::string& input);
+              const char *input);
 
   friend class cmGeneratorExpression;
 
@@ -130,7 +130,7 @@ private:
 
   mutable std::set<cmTarget*> DependTargets;
   mutable std::set<cmTarget const*> AllTargetsSeen;
-  mutable std::set<std::string> SeenTargetProperties;
+  mutable std::set<cmStdString> SeenTargetProperties;
   mutable std::string Output;
   mutable bool HadContextSensitiveCondition;
 };
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 04f36b4..e7e1d34 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -42,12 +42,12 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
      )
 #undef TEST_TRANSITIVE_PROPERTY_METHOD
     {
-    std::map<std::string, std::set<std::string> >::const_iterator it
+    std::map<cmStdString, std::set<cmStdString> >::const_iterator it
                                                     = top->Seen.find(target);
     if (it != top->Seen.end())
       {
-      const std::set<std::string> &propSet = it->second;
-      const std::set<std::string>::const_iterator i = propSet.find(property);
+      const std::set<cmStdString> &propSet = it->second;
+      const std::set<cmStdString>::const_iterator i = propSet.find(property);
       if (i != propSet.end())
         {
         this->CheckResult = ALREADY_SEEN;
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 6cbbd2a..b6effa1 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -77,7 +77,7 @@ private:
   const cmGeneratorExpressionDAGChecker * const Parent;
   const std::string Target;
   const std::string Property;
-  std::map<std::string, std::set<std::string> > Seen;
+  std::map<cmStdString, std::set<cmStdString> > Seen;
   const GeneratorExpressionContent * const Content;
   const cmListFileBacktrace Backtrace;
   Result CheckResult;
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index 90ce27c..bf85870 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -33,7 +33,7 @@ cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile(
 }
 
 //----------------------------------------------------------------------------
-void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
+void cmGeneratorExpressionEvaluationFile::Generate(const char *config,
               cmCompiledGeneratorExpression* inputExpression,
               std::map<std::string, std::string> &outputFiles)
 {
@@ -135,7 +135,7 @@ void cmGeneratorExpressionEvaluationFile::Generate()
 
   if (allConfigs.empty())
     {
-    this->Generate("", inputExpression.get(), outputFiles);
+    this->Generate(0, inputExpression.get(), outputFiles);
     }
   else
     {
diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h
index f939916..20ee5cb 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.h
+++ b/Source/cmGeneratorExpressionEvaluationFile.h
@@ -32,7 +32,7 @@ public:
   std::vector<std::string> GetFiles() const { return this->Files; }
 
 private:
-  void Generate(const std::string& config,
+  void Generate(const char *config,
               cmCompiledGeneratorExpression* inputExpression,
               std::map<std::string, std::string> &outputFiles);
 
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 4bf35c9..7036992 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -689,7 +689,7 @@ static const struct ConfigurationNode : public cmGeneratorExpressionNode
                        cmGeneratorExpressionDAGChecker *) const
   {
     context->HadContextSensitiveCondition = true;
-    return context->Config;
+    return context->Config ? context->Config : "";
   }
 } configurationNode;
 
@@ -718,13 +718,13 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
       return std::string();
       }
     context->HadContextSensitiveCondition = true;
-    if (context->Config.empty())
+    if (!context->Config)
       {
       return parameters.front().empty() ? "1" : "0";
       }
 
     if (cmsysString_strcasecmp(parameters.begin()->c_str(),
-                               context->Config.c_str()) == 0)
+                                  context->Config) == 0)
       {
       return "1";
       }
@@ -800,7 +800,7 @@ static const char* targetPropertyTransitiveWhitelist[] = {
 
 #undef TRANSITIVE_PROPERTY_NAME
 
-std::string getLinkedTargetsContent(const std::vector<cmTarget*> &targets,
+std::string getLinkedTargetsContent(const std::vector<std::string> &libraries,
                                   cmTarget const* target,
                                   cmTarget const* headTarget,
                                   cmGeneratorExpressionContext *context,
@@ -811,21 +811,23 @@ std::string getLinkedTargetsContent(const std::vector<cmTarget*> &targets,
 
   std::string sep;
   std::string depString;
-  for (std::vector<cmTarget*>::const_iterator
-      it = targets.begin();
-      it != targets.end(); ++it)
+  for (std::vector<std::string>::const_iterator
+      it = libraries.begin();
+      it != libraries.end(); ++it)
     {
-    if (*it == target)
+    if (*it == target->GetName())
       {
       // Broken code can have a target in its own link interface.
       // Don't follow such link interface entries so as not to create a
       // self-referencing loop.
       continue;
       }
-    depString +=
-      sep + "$<TARGET_PROPERTY:" +
-        (*it)->GetName() + "," + interfacePropertyName + ">";
-    sep = ";";
+    if (context->Makefile->FindTargetToUse(*it))
+      {
+      depString +=
+        sep + "$<TARGET_PROPERTY:" + *it + "," + interfacePropertyName + ">";
+      sep = ";";
+      }
     }
   cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(depString);
   std::string linkedTargetsContent = cge->Evaluate(context->Makefile,
@@ -841,27 +843,6 @@ std::string getLinkedTargetsContent(const std::vector<cmTarget*> &targets,
   return linkedTargetsContent;
 }
 
-std::string getLinkedTargetsContent(const std::vector<std::string> &libraries,
-                                  cmTarget const* target,
-                                  cmTarget const* headTarget,
-                                  cmGeneratorExpressionContext *context,
-                                  cmGeneratorExpressionDAGChecker *dagChecker,
-                                  const std::string &interfacePropertyName)
-{
-  std::vector<cmTarget*> tgts;
-  for (std::vector<std::string>::const_iterator
-      it = libraries.begin();
-      it != libraries.end(); ++it)
-    {
-    if (cmTarget *tgt = context->Makefile->FindTargetToUse(*it))
-      {
-      tgts.push_back(tgt);
-      }
-    }
-  return getLinkedTargetsContent(tgts, target, headTarget, context,
-                                 dagChecker, interfacePropertyName);
-}
-
 //----------------------------------------------------------------------------
 static const struct TargetPropertyNode : public cmGeneratorExpressionNode
 {
@@ -1084,13 +1065,13 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
                      cmStrCmp(propertyName)) != transEnd)
       {
 
-      std::vector<cmTarget*> tgts;
-      target->GetTransitivePropertyTargets(context->Config,
-                                                 headTarget, tgts);
-      if (!tgts.empty())
+      std::vector<std::string> libs;
+      target->GetTransitivePropertyLinkLibraries(context->Config,
+                                                 headTarget, libs);
+      if (!libs.empty())
         {
         linkedTargetsContent =
-                  getLinkedTargetsContent(tgts, target,
+                  getLinkedTargetsContent(libs, target,
                                           headTarget,
                                           context, &dagChecker,
                                           interfacePropertyName);
@@ -1099,9 +1080,9 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
     else if (std::find_if(transBegin, transEnd,
                           cmStrCmp(interfacePropertyName)) != transEnd)
       {
-      const cmTarget::LinkImplementation *impl
-          = target->GetLinkImplementationLibraries(context->Config,
-                                                   headTarget);
+      const cmTarget::LinkImplementation *impl = target->GetLinkImplementation(
+                                                    context->Config,
+                                                    headTarget);
       if(impl)
         {
         linkedTargetsContent =
@@ -1555,58 +1536,89 @@ TargetFilesystemArtifact<false, true, true, false> targetSoNameFileDirNode;
 static const
 cmGeneratorExpressionNode* GetNode(const std::string &identifier)
 {
-  typedef std::map<std::string, const cmGeneratorExpressionNode*> NodeMap;
-  static NodeMap nodeMap;
-  if (nodeMap.empty())
-    {
-    nodeMap["0"] = &zeroNode;
-    nodeMap["1"] = &oneNode;
-    nodeMap["AND"] = &andNode;
-    nodeMap["OR"] = &orNode;
-    nodeMap["NOT"] = ¬Node;
-    nodeMap["C_COMPILER_ID"] = &cCompilerIdNode;
-    nodeMap["CXX_COMPILER_ID"] = &cxxCompilerIdNode;
-    nodeMap["VERSION_GREATER"] = &versionGreaterNode;
-    nodeMap["VERSION_LESS"] = &versionLessNode;
-    nodeMap["VERSION_EQUAL"] = &versionEqualNode;
-    nodeMap["C_COMPILER_VERSION"] = &cCompilerVersionNode;
-    nodeMap["CXX_COMPILER_VERSION"] = &cxxCompilerVersionNode;
-    nodeMap["PLATFORM_ID"] = &platformIdNode;
-    nodeMap["CONFIGURATION"] = &configurationNode;
-    nodeMap["CONFIG"] = &configurationTestNode;
-    nodeMap["TARGET_FILE"] = &targetFileNode;
-    nodeMap["TARGET_LINKER_FILE"] = &targetLinkerFileNode;
-    nodeMap["TARGET_SONAME_FILE"] = &targetSoNameFileNode;
-    nodeMap["TARGET_FILE_NAME"] = &targetFileNameNode;
-    nodeMap["TARGET_LINKER_FILE_NAME"] = &targetLinkerFileNameNode;
-    nodeMap["TARGET_SONAME_FILE_NAME"] = &targetSoNameFileNameNode;
-    nodeMap["TARGET_FILE_DIR"] = &targetFileDirNode;
-    nodeMap["TARGET_LINKER_FILE_DIR"] = &targetLinkerFileDirNode;
-    nodeMap["TARGET_SONAME_FILE_DIR"] = &targetSoNameFileDirNode;
-    nodeMap["STREQUAL"] = &strEqualNode;
-    nodeMap["EQUAL"] = &equalNode;
-    nodeMap["LOWER_CASE"] = &lowerCaseNode;
-    nodeMap["UPPER_CASE"] = &upperCaseNode;
-    nodeMap["MAKE_C_IDENTIFIER"] = &makeCIdentifierNode;
-    nodeMap["BOOL"] = &boolNode;
-    nodeMap["ANGLE-R"] = &angle_rNode;
-    nodeMap["COMMA"] = &commaNode;
-    nodeMap["SEMICOLON"] = &semicolonNode;
-    nodeMap["TARGET_PROPERTY"] = &targetPropertyNode;
-    nodeMap["TARGET_NAME"] = &targetNameNode;
-    nodeMap["TARGET_POLICY"] = &targetPolicyNode;
-    nodeMap["BUILD_INTERFACE"] = &buildInterfaceNode;
-    nodeMap["INSTALL_INTERFACE"] = &installInterfaceNode;
-    nodeMap["INSTALL_PREFIX"] = &installPrefixNode;
-    nodeMap["JOIN"] = &joinNode;
-    nodeMap["LINK_ONLY"] = &linkOnlyNode;
-    }
-  NodeMap::const_iterator i = nodeMap.find(identifier);
-  if (i == nodeMap.end())
-    {
-    return 0;
-    }
-  return i->second;
+  if (identifier == "0")
+    return &zeroNode;
+  else if (identifier == "1")
+    return &oneNode;
+  else if (identifier == "AND")
+    return &andNode;
+  else if (identifier == "OR")
+    return &orNode;
+  else if (identifier == "NOT")
+    return ¬Node;
+  else if (identifier == "C_COMPILER_ID")
+    return &cCompilerIdNode;
+  else if (identifier == "CXX_COMPILER_ID")
+    return &cxxCompilerIdNode;
+  else if (identifier == "VERSION_GREATER")
+    return &versionGreaterNode;
+  else if (identifier == "VERSION_LESS")
+    return &versionLessNode;
+  else if (identifier == "VERSION_EQUAL")
+    return &versionEqualNode;
+  else if (identifier == "C_COMPILER_VERSION")
+    return &cCompilerVersionNode;
+  else if (identifier == "CXX_COMPILER_VERSION")
+    return &cxxCompilerVersionNode;
+  else if (identifier == "PLATFORM_ID")
+    return &platformIdNode;
+  else if (identifier == "CONFIGURATION")
+    return &configurationNode;
+  else if (identifier == "CONFIG")
+    return &configurationTestNode;
+  else if (identifier == "TARGET_FILE")
+    return &targetFileNode;
+  else if (identifier == "TARGET_LINKER_FILE")
+    return &targetLinkerFileNode;
+  else if (identifier == "TARGET_SONAME_FILE")
+    return &targetSoNameFileNode;
+  else if (identifier == "TARGET_FILE_NAME")
+    return &targetFileNameNode;
+  else if (identifier == "TARGET_LINKER_FILE_NAME")
+    return &targetLinkerFileNameNode;
+  else if (identifier == "TARGET_SONAME_FILE_NAME")
+    return &targetSoNameFileNameNode;
+  else if (identifier == "TARGET_FILE_DIR")
+    return &targetFileDirNode;
+  else if (identifier == "TARGET_LINKER_FILE_DIR")
+    return &targetLinkerFileDirNode;
+  else if (identifier == "TARGET_SONAME_FILE_DIR")
+    return &targetSoNameFileDirNode;
+  else if (identifier == "STREQUAL")
+    return &strEqualNode;
+  else if (identifier == "EQUAL")
+    return &equalNode;
+  else if (identifier == "LOWER_CASE")
+    return &lowerCaseNode;
+  else if (identifier == "UPPER_CASE")
+    return &upperCaseNode;
+  else if (identifier == "MAKE_C_IDENTIFIER")
+    return &makeCIdentifierNode;
+  else if (identifier == "BOOL")
+    return &boolNode;
+  else if (identifier == "ANGLE-R")
+    return &angle_rNode;
+  else if (identifier == "COMMA")
+    return &commaNode;
+  else if (identifier == "SEMICOLON")
+    return &semicolonNode;
+  else if (identifier == "TARGET_PROPERTY")
+    return &targetPropertyNode;
+  else if (identifier == "TARGET_NAME")
+    return &targetNameNode;
+  else if (identifier == "TARGET_POLICY")
+    return &targetPolicyNode;
+  else if (identifier == "BUILD_INTERFACE")
+    return &buildInterfaceNode;
+  else if (identifier == "INSTALL_INTERFACE")
+    return &installInterfaceNode;
+  else if (identifier == "INSTALL_PREFIX")
+    return &installPrefixNode;
+  else if (identifier == "JOIN")
+    return &joinNode;
+  else if (identifier == "LINK_ONLY")
+    return &linkOnlyNode;
+  return 0;
 
 }
 
diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h
index a7099cb..49e52df 100644
--- a/Source/cmGeneratorExpressionEvaluator.h
+++ b/Source/cmGeneratorExpressionEvaluator.h
@@ -25,9 +25,9 @@ struct cmGeneratorExpressionContext
   cmListFileBacktrace Backtrace;
   std::set<cmTarget*> DependTargets;
   std::set<cmTarget const*> AllTargets;
-  std::set<std::string> SeenTargetProperties;
+  std::set<cmStdString> SeenTargetProperties;
   cmMakefile *Makefile;
-  std::string Config;
+  const char *Config;
   cmTarget const* HeadTarget; // The target whose property is being evaluated.
   cmTarget const* CurrentTarget; // The dependent of HeadTarget which appears
                                  // directly or indirectly in the property.
diff --git a/Source/cmGeneratorExpressionLexer.cxx b/Source/cmGeneratorExpressionLexer.cxx
index ddce282..cd71ec0 100644
--- a/Source/cmGeneratorExpressionLexer.cxx
+++ b/Source/cmGeneratorExpressionLexer.cxx
@@ -32,11 +32,13 @@ static void InsertText(const char *upto, const char *c,
 
 //----------------------------------------------------------------------------
 std::vector<cmGeneratorExpressionToken>
-cmGeneratorExpressionLexer::Tokenize(const std::string& input)
+cmGeneratorExpressionLexer::Tokenize(const char *input)
 {
   std::vector<cmGeneratorExpressionToken> result;
+  if (!input)
+    return result;
 
-  const char *c = input.c_str();
+  const char *c = input;
   const char *upto = c;
 
   for ( ; *c; ++c)
diff --git a/Source/cmGeneratorExpressionLexer.h b/Source/cmGeneratorExpressionLexer.h
index 1e2e8c2..83d661d 100644
--- a/Source/cmGeneratorExpressionLexer.h
+++ b/Source/cmGeneratorExpressionLexer.h
@@ -43,7 +43,7 @@ class cmGeneratorExpressionLexer
 public:
   cmGeneratorExpressionLexer();
 
-  std::vector<cmGeneratorExpressionToken> Tokenize(const std::string& input);
+  std::vector<cmGeneratorExpressionToken> Tokenize(const char *input);
 
   bool GetSawGeneratorExpression() const
   {
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 5af5c3d..175bb0e 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -24,207 +24,8 @@
 
 #include "assert.h"
 
-
 //----------------------------------------------------------------------------
-bool FindSourceFile(cmSourceFile *sf, cmTarget *tgt)
-{
-  std::string e;
-  if((sf)->GetFullPath(&e).empty())
-    {
-    if(!e.empty())
-      {
-      cmake* cm = tgt->GetMakefile()->GetCMakeInstance();
-      cm->IssueMessage(cmake::FATAL_ERROR, e,
-                       tgt->GetBacktrace());
-      }
-    return false;
-    }
-  return true;
-}
-
-//----------------------------------------------------------------------------
-void reportBadObjLib(std::vector<cmSourceFile*> const& badObjLib,
-                     cmTarget *target, cmake *cm)
-{
-  if(!badObjLib.empty())
-    {
-    cmOStringStream e;
-    e << "OBJECT library \"" << target->GetName() << "\" contains:\n";
-    for(std::vector<cmSourceFile*>::const_iterator i = badObjLib.begin();
-        i != badObjLib.end(); ++i)
-      {
-      e << "  " << (*i)->GetLocation().GetName() << "\n";
-      }
-    e << "but may contain only headers and sources that compile.";
-    cm->IssueMessage(cmake::FATAL_ERROR, e.str(),
-                     target->GetBacktrace());
-    }
-}
-
-struct ObjectSourcesTag {};
-struct CustomCommandsTag {};
-struct ExtraSourcesTag {};
-struct HeaderSourcesTag {};
-struct ExternalObjectsTag {};
-struct IDLSourcesTag {};
-struct ResxTag {};
-struct ModuleDefinitionFileTag {};
-
-template<typename, typename>
-struct IsSameTag
-{
-  enum {
-    Result = false
-  };
-};
-
-template<typename Tag>
-struct IsSameTag<Tag, Tag>
-{
-  enum {
-    Result = true
-  };
-};
-
-template<bool, typename T>
-void doAccept(T&, cmSourceFile*)
-{
-}
-
-template<>
-void doAccept<true,
-              std::vector<cmSourceFile*> >(std::vector<cmSourceFile*>& files,
-                                           cmSourceFile* f)
-{
-  files.push_back(f);
-}
-
-template<>
-void doAccept<true,
-              cmGeneratorTarget::ResxData>(cmGeneratorTarget::ResxData& data,
-                                            cmSourceFile* f)
-{
-  // Build and save the name of the corresponding .h file
-  // This relationship will be used later when building the project files.
-  // Both names would have been auto generated from Visual Studio
-  // where the user supplied the file name and Visual Studio
-  // appended the suffix.
-  std::string resx = f->GetFullPath();
-  std::string hFileName = resx.substr(0, resx.find_last_of(".")) + ".h";
-  data.ExpectedResxHeaders.insert(hFileName);
-  data.ResxSources.push_back(f);
-}
-
-template<>
-void doAccept<true, std::string>(std::string& data, cmSourceFile* f)
-{
-  data = f->GetFullPath();
-}
-
-//----------------------------------------------------------------------------
-template<typename Tag, typename DataType = std::vector<cmSourceFile*> >
-struct TagVisitor
-{
-  DataType& Data;
-  std::vector<cmSourceFile*> BadObjLibFiles;
-  cmTarget *Target;
-  cmGlobalGenerator *GlobalGenerator;
-  cmsys::RegularExpression Header;
-  bool IsObjLib;
-
-  TagVisitor(cmTarget *target, DataType& data)
-    : Data(data), Target(target),
-    GlobalGenerator(target->GetMakefile()
-                          ->GetLocalGenerator()->GetGlobalGenerator()),
-    Header(CM_HEADER_REGEX),
-    IsObjLib(target->GetType() == cmTarget::OBJECT_LIBRARY)
-  {
-  }
-
-  ~TagVisitor()
-  {
-    reportBadObjLib(this->BadObjLibFiles, this->Target,
-                    this->GlobalGenerator->GetCMakeInstance());
-  }
-
-  void Accept(cmSourceFile *sf)
-  {
-    std::string ext = cmSystemTools::LowerCase(sf->GetExtension());
-    if(sf->GetCustomCommand())
-      {
-      doAccept<IsSameTag<Tag, CustomCommandsTag>::Result>(this->Data, sf);
-      }
-    else if(this->Target->GetType() == cmTarget::UTILITY)
-      {
-      doAccept<IsSameTag<Tag, ExtraSourcesTag>::Result>(this->Data, sf);
-      }
-    else if(sf->GetPropertyAsBool("HEADER_FILE_ONLY"))
-      {
-      doAccept<IsSameTag<Tag, HeaderSourcesTag>::Result>(this->Data, sf);
-      }
-    else if(sf->GetPropertyAsBool("EXTERNAL_OBJECT"))
-      {
-      doAccept<IsSameTag<Tag, ExternalObjectsTag>::Result>(this->Data, sf);
-      if(this->IsObjLib)
-        {
-        this->BadObjLibFiles.push_back(sf);
-        }
-      }
-    else if(sf->GetLanguage())
-      {
-      doAccept<IsSameTag<Tag, ObjectSourcesTag>::Result>(this->Data, sf);
-      }
-    else if(ext == "def")
-      {
-      doAccept<IsSameTag<Tag, ModuleDefinitionFileTag>::Result>(this->Data,
-                                                                sf);
-      if(this->IsObjLib)
-        {
-        this->BadObjLibFiles.push_back(sf);
-        }
-      }
-    else if(ext == "idl")
-      {
-      doAccept<IsSameTag<Tag, IDLSourcesTag>::Result>(this->Data, sf);
-      if(this->IsObjLib)
-        {
-        this->BadObjLibFiles.push_back(sf);
-        }
-      }
-    else if(ext == "resx")
-      {
-      doAccept<IsSameTag<Tag, ResxTag>::Result>(this->Data, sf);
-      }
-    else if(this->Header.find(sf->GetFullPath().c_str()))
-      {
-      doAccept<IsSameTag<Tag, HeaderSourcesTag>::Result>(this->Data, sf);
-      }
-    else if(this->GlobalGenerator->IgnoreFile(sf->GetExtension().c_str()))
-      {
-      doAccept<IsSameTag<Tag, ExtraSourcesTag>::Result>(this->Data, sf);
-      }
-    else
-      {
-      doAccept<IsSameTag<Tag, ExtraSourcesTag>::Result>(this->Data, sf);
-      if(this->IsObjLib && ext != "txt")
-        {
-        this->BadObjLibFiles.push_back(sf);
-        }
-      }
-  }
-};
-
-//----------------------------------------------------------------------------
-cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t),
-  SourceFileFlagsConstructed(false),
-  ObjectSourcesDone(false),
-  IDLSourcesDone(false),
-  ExtraSourcesDone(false),
-  HeaderSourcesDone(false),
-  CustomCommandsDone(false),
-  ExternalObjectsDone(false),
-  ResxDone(false),
-  ModuleDefinitionFileDone(false)
+cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t)
 {
   this->Makefile = this->Target->GetMakefile();
   this->LocalGenerator = this->Makefile->GetLocalGenerator();
@@ -244,7 +45,7 @@ const char *cmGeneratorTarget::GetName() const
 }
 
 //----------------------------------------------------------------------------
-const char *cmGeneratorTarget::GetProperty(const std::string& prop) const
+const char *cmGeneratorTarget::GetProperty(const char *prop) const
 {
   return this->Target->GetProperty(prop);
 }
@@ -261,13 +62,19 @@ cmGeneratorTarget::GetSourceDepends(cmSourceFile* sf) const
   return 0;
 }
 
-static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
-                                  const std::string& config,
-                                  cmTarget *headTarget,
+static void handleSystemIncludesDep(cmMakefile *mf, const std::string &name,
+                                  const char *config, cmTarget *headTarget,
                                   cmGeneratorExpressionDAGChecker *dagChecker,
                                   std::vector<std::string>& result,
                                   bool excludeImported)
 {
+  cmTarget* depTgt = mf->FindTargetToUse(name);
+
+  if (!depTgt)
+    {
+    return;
+    }
+
   cmListFileBacktrace lfbt;
 
   if (const char* dirs =
@@ -295,35 +102,11 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
     }
 }
 
-#define IMPLEMENT_VISIT_IMPL(DATA, DATATYPE) \
-if (!this->DATA ## Done) \
-  { \
-  std::vector<cmSourceFile*> sourceFiles; \
-  this->Target->GetSourceFiles(sourceFiles); \
-  TagVisitor<DATA ## Tag DATATYPE> visitor(this->Target, this->DATA); \
-  for(std::vector<cmSourceFile*>::const_iterator si = sourceFiles.begin(); \
-      si != sourceFiles.end(); ++si) \
-    { \
-    if (!FindSourceFile(*si, this->Target)) \
-      { \
-      break; \
-      } \
-    visitor.Accept(*si); \
-    } \
-  this->DATA ## Done = true; \
-  } \
-data = this->DATA;
-
-#define IMPLEMENT_VISIT(DATA) \
-  IMPLEMENT_VISIT_IMPL(DATA, ) \
-
-#define COMMA ,
-
 //----------------------------------------------------------------------------
 void
-cmGeneratorTarget::GetObjectSources(std::vector<cmSourceFile*> &data) const
+cmGeneratorTarget::GetObjectSources(std::vector<cmSourceFile*> &objs) const
 {
-  IMPLEMENT_VISIT(ObjectSources);
+  objs = this->ObjectSources;
 }
 
 //----------------------------------------------------------------------------
@@ -352,62 +135,58 @@ bool cmGeneratorTarget::HasExplicitObjectName(cmSourceFile const* file) const
 }
 
 //----------------------------------------------------------------------------
-void cmGeneratorTarget::GetIDLSources(std::vector<cmSourceFile*>& data) const
+void cmGeneratorTarget::GetResxSources(std::vector<cmSourceFile*>& srcs) const
 {
-  IMPLEMENT_VISIT(IDLSources);
+  srcs = this->ResxSources;
 }
 
 //----------------------------------------------------------------------------
-void
-cmGeneratorTarget::GetHeaderSources(std::vector<cmSourceFile*>& data) const
+void cmGeneratorTarget::GetIDLSources(std::vector<cmSourceFile*>& srcs) const
 {
-  IMPLEMENT_VISIT(HeaderSources);
+  srcs = this->IDLSources;
 }
 
 //----------------------------------------------------------------------------
-void cmGeneratorTarget::GetExtraSources(std::vector<cmSourceFile*>& data) const
+void
+cmGeneratorTarget::GetHeaderSources(std::vector<cmSourceFile*>& srcs) const
 {
-  IMPLEMENT_VISIT(ExtraSources);
+  srcs = this->HeaderSources;
 }
 
 //----------------------------------------------------------------------------
-void
-cmGeneratorTarget::GetCustomCommands(std::vector<cmSourceFile*>& data) const
+void cmGeneratorTarget::GetExtraSources(std::vector<cmSourceFile*>& srcs) const
 {
-  IMPLEMENT_VISIT(CustomCommands);
+  srcs = this->ExtraSources;
 }
 
 //----------------------------------------------------------------------------
 void
-cmGeneratorTarget::GetExternalObjects(std::vector<cmSourceFile*>& data) const
+cmGeneratorTarget::GetCustomCommands(std::vector<cmSourceFile*>& srcs) const
 {
-  IMPLEMENT_VISIT(ExternalObjects);
+  srcs = this->CustomCommands;
 }
 
 //----------------------------------------------------------------------------
 void
 cmGeneratorTarget::GetExpectedResxHeaders(std::set<std::string>& srcs) const
 {
-  ResxData data = this->Resx;
-  IMPLEMENT_VISIT_IMPL(Resx, COMMA cmGeneratorTarget::ResxData)
-  srcs = data.ExpectedResxHeaders;
+  srcs = this->ExpectedResxHeaders;
 }
 
 //----------------------------------------------------------------------------
-void cmGeneratorTarget::GetResxSources(std::vector<cmSourceFile*>& srcs) const
+void
+cmGeneratorTarget::GetExternalObjects(std::vector<cmSourceFile*>& srcs) const
 {
-  ResxData data = this->Resx;
-  IMPLEMENT_VISIT_IMPL(Resx, COMMA cmGeneratorTarget::ResxData)
-  srcs = data.ResxSources;
+  srcs = this->ExternalObjects;
 }
 
 //----------------------------------------------------------------------------
-bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
-                                              const std::string& config) const
+bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir,
+                                                 const char *config) const
 {
   assert(this->GetType() != cmTarget::INTERFACE_LIBRARY);
   std::string config_upper;
-  if(!config.empty())
+  if(config && *config)
     {
     config_upper = cmSystemTools::UpperCase(config);
     }
@@ -434,7 +213,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
                 = this->Target->GetPropertyAsBool("NO_SYSTEM_FROM_IMPORTED");
 
     std::vector<std::string> result;
-    for (std::set<std::string>::const_iterator
+    for (std::set<cmStdString>::const_iterator
         it = this->Target->GetSystemIncludeDirectories().begin();
         it != this->Target->GetSystemIncludeDirectories().end(); ++it)
       {
@@ -445,25 +224,26 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
                                           &dagChecker), result);
       }
 
-    std::set<cmTarget*> uniqueDeps;
+    std::set<cmStdString> uniqueDeps;
     for(std::vector<std::string>::const_iterator li = impl->Libraries.begin();
         li != impl->Libraries.end(); ++li)
       {
-      cmTarget* tgt = this->Makefile->FindTargetToUse(*li);
-      if (!tgt)
+      if (uniqueDeps.insert(*li).second)
         {
-        continue;
-        }
+        cmTarget* tgt = this->Makefile->FindTargetToUse(*li);
 
-      if (uniqueDeps.insert(tgt).second)
-        {
-        handleSystemIncludesDep(this->Makefile, tgt, config, this->Target,
+        if (!tgt)
+          {
+          continue;
+          }
+
+        handleSystemIncludesDep(this->Makefile, *li, config, this->Target,
                                 &dagChecker, result, excludeImported);
 
-        std::vector<cmTarget*> deps;
-        tgt->GetTransitivePropertyTargets(config, this->Target, deps);
+        std::vector<std::string> deps;
+        tgt->GetTransitivePropertyLinkLibraries(config, this->Target, deps);
 
-        for(std::vector<cmTarget*>::const_iterator di = deps.begin();
+        for(std::vector<std::string>::const_iterator di = deps.begin();
             di != deps.end(); ++di)
           {
           if (uniqueDeps.insert(*di).second)
@@ -474,7 +254,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
           }
         }
       }
-    std::set<std::string> unique;
+    std::set<cmStdString> unique;
     for(std::vector<std::string>::iterator li = result.begin();
         li != result.end(); ++li)
       {
@@ -482,7 +262,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
       unique.insert(*li);
       }
     result.clear();
-    for(std::set<std::string>::iterator li = unique.begin();
+    for(std::set<cmStdString>::iterator li = unique.begin();
         li != unique.end(); ++li)
       {
       result.push_back(*li);
@@ -498,7 +278,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
 }
 
 //----------------------------------------------------------------------------
-bool cmGeneratorTarget::GetPropertyAsBool(const std::string& prop) const
+bool cmGeneratorTarget::GetPropertyAsBool(const char *prop) const
 {
   return this->Target->GetPropertyAsBool(prop);
 }
@@ -510,6 +290,102 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files) const
 }
 
 //----------------------------------------------------------------------------
+void cmGeneratorTarget::ClassifySources()
+{
+  cmsys::RegularExpression header(CM_HEADER_REGEX);
+
+  cmTarget::TargetType targetType = this->Target->GetType();
+  bool isObjLib = targetType == cmTarget::OBJECT_LIBRARY;
+
+  std::vector<cmSourceFile*> badObjLib;
+  std::vector<cmSourceFile*> sources;
+  this->Target->GetSourceFiles(sources);
+  for(std::vector<cmSourceFile*>::const_iterator si = sources.begin();
+      si != sources.end(); ++si)
+    {
+    cmSourceFile* sf = *si;
+    std::string ext = cmSystemTools::LowerCase(sf->GetExtension());
+    if(sf->GetCustomCommand())
+      {
+      this->CustomCommands.push_back(sf);
+      }
+    else if(targetType == cmTarget::UTILITY)
+      {
+      this->ExtraSources.push_back(sf);
+      }
+    else if(sf->GetPropertyAsBool("HEADER_FILE_ONLY"))
+      {
+      this->HeaderSources.push_back(sf);
+      }
+    else if(sf->GetPropertyAsBool("EXTERNAL_OBJECT"))
+      {
+      this->ExternalObjects.push_back(sf);
+      if(isObjLib) { badObjLib.push_back(sf); }
+      }
+    else if(sf->GetLanguage())
+      {
+      this->ObjectSources.push_back(sf);
+      }
+    else if(ext == "def")
+      {
+      this->ModuleDefinitionFile = sf->GetFullPath();
+      if(isObjLib) { badObjLib.push_back(sf); }
+      }
+    else if(ext == "idl")
+      {
+      this->IDLSources.push_back(sf);
+      if(isObjLib) { badObjLib.push_back(sf); }
+      }
+    else if(ext == "resx")
+      {
+      // Build and save the name of the corresponding .h file
+      // This relationship will be used later when building the project files.
+      // Both names would have been auto generated from Visual Studio
+      // where the user supplied the file name and Visual Studio
+      // appended the suffix.
+      std::string resx = sf->GetFullPath();
+      std::string hFileName = resx.substr(0, resx.find_last_of(".")) + ".h";
+      this->ExpectedResxHeaders.insert(hFileName);
+      this->ResxSources.push_back(sf);
+      }
+    else if(header.find(sf->GetFullPath().c_str()))
+      {
+      this->HeaderSources.push_back(sf);
+      }
+    else if(this->GlobalGenerator->IgnoreFile(sf->GetExtension().c_str()))
+      {
+      // We only get here if a source file is not an external object
+      // and has an extension that is listed as an ignored file type.
+      // No message or diagnosis should be given.
+      this->ExtraSources.push_back(sf);
+      }
+    else
+      {
+      this->ExtraSources.push_back(sf);
+      if(isObjLib && ext != "txt")
+        {
+        badObjLib.push_back(sf);
+        }
+      }
+    }
+
+  if(!badObjLib.empty())
+    {
+    cmOStringStream e;
+    e << "OBJECT library \"" << this->Target->GetName() << "\" contains:\n";
+    for(std::vector<cmSourceFile*>::iterator i = badObjLib.begin();
+        i != badObjLib.end(); ++i)
+      {
+      e << "  " << (*i)->GetLocation().GetName() << "\n";
+      }
+    e << "but may contain only headers and sources that compile.";
+    this->GlobalGenerator->GetCMakeInstance()
+      ->IssueMessage(cmake::FATAL_ERROR, e.str(),
+                     this->Target->GetBacktrace());
+    }
+}
+
+//----------------------------------------------------------------------------
 void cmGeneratorTarget::LookupObjectLibraries()
 {
   std::vector<std::string> const& objLibs =
@@ -562,14 +438,6 @@ void cmGeneratorTarget::LookupObjectLibraries()
 }
 
 //----------------------------------------------------------------------------
-std::string cmGeneratorTarget::GetModuleDefinitionFile() const
-{
-  std::string data;
-  IMPLEMENT_VISIT_IMPL(ModuleDefinitionFile, COMMA std::string)
-  return data;
-}
-
-//----------------------------------------------------------------------------
 void
 cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs) const
 {
@@ -606,7 +474,7 @@ private:
   SourceEntry* CurrentEntry;
   std::queue<cmSourceFile*> SourceQueue;
   std::set<cmSourceFile*> SourcesQueued;
-  typedef std::map<std::string, cmSourceFile*> NameMapType;
+  typedef std::map<cmStdString, cmSourceFile*> NameMapType;
   NameMapType NameMap;
 
   void QueueSource(cmSourceFile* sf);
@@ -754,7 +622,7 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
         {
         // This is really only for compatibility so we do not need to
         // worry about configuration names and output names.
-        std::string tLocation = t->GetLocation("");
+        std::string tLocation = t->GetLocation(0);
         tLocation = cmSystemTools::GetFilenamePath(tLocation);
         std::string depLocation = cmSystemTools::GetFilenamePath(dep);
         depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str());
@@ -814,7 +682,7 @@ cmTargetTraceDependencies
       {
       const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge
                                                               = ge.Parse(*cli);
-      cge->Evaluate(this->Makefile, "", true);
+      cge->Evaluate(this->Makefile, 0, true);
       std::set<cmTarget*> geTargets = cge->GetTargets();
       for(std::set<cmTarget*>::const_iterator it = geTargets.begin();
           it != geTargets.end(); ++it)
@@ -875,11 +743,11 @@ void cmGeneratorTarget::TraceDependencies()
 }
 
 //----------------------------------------------------------------------------
-void cmGeneratorTarget::GetAppleArchs(const std::string& config,
+void cmGeneratorTarget::GetAppleArchs(const char* config,
                              std::vector<std::string>& archVec) const
 {
   const char* archs = 0;
-  if(!config.empty())
+  if(config && *config)
     {
     std::string defVarName = "OSX_ARCHITECTURES_";
     defVarName += cmSystemTools::UpperCase(config);
@@ -916,14 +784,13 @@ const char* cmGeneratorTarget::GetCreateRuleVariable() const
 
 //----------------------------------------------------------------------------
 std::vector<std::string>
-cmGeneratorTarget::GetIncludeDirectories(const std::string& config) const
+cmGeneratorTarget::GetIncludeDirectories(const char *config) const
 {
   return this->Target->GetIncludeDirectories(config);
 }
 
 //----------------------------------------------------------------------------
-void cmGeneratorTarget::GenerateTargetManifest(
-                                              const std::string& config) const
+void cmGeneratorTarget::GenerateTargetManifest(const char* config) const
 {
   if (this->Target->IsImported())
     {
@@ -966,35 +833,35 @@ void cmGeneratorTarget::GenerateTargetManifest(
     f = dir;
     f += "/";
     f += name;
-    gg->AddToManifest(config, f);
+    gg->AddToManifest(config? config:"", f);
     }
   if(!soName.empty())
     {
     f = dir;
     f += "/";
     f += soName;
-    gg->AddToManifest(config, f);
+    gg->AddToManifest(config? config:"", f);
     }
   if(!realName.empty())
     {
     f = dir;
     f += "/";
     f += realName;
-    gg->AddToManifest(config, f);
+    gg->AddToManifest(config? config:"", f);
     }
   if(!pdbName.empty())
     {
     f = dir;
     f += "/";
     f += pdbName;
-    gg->AddToManifest(config, f);
+    gg->AddToManifest(config? config:"", f);
     }
   if(!impName.empty())
     {
     f = this->Target->GetDirectory(config, true);
     f += "/";
     f += impName;
-    gg->AddToManifest(config, f);
+    gg->AddToManifest(config? config:"", f);
     }
 }
 
@@ -1009,97 +876,3 @@ bool cmStrictTargetComparison::operator()(cmTarget const* t1,
     }
   return nameResult < 0;
 }
-
-//----------------------------------------------------------------------------
-struct cmGeneratorTarget::SourceFileFlags
-cmGeneratorTarget::GetTargetSourceFileFlags(const cmSourceFile* sf) const
-{
-  struct SourceFileFlags flags;
-  this->ConstructSourceFileFlags();
-  std::map<cmSourceFile const*, SourceFileFlags>::iterator si =
-    this->SourceFlagsMap.find(sf);
-  if(si != this->SourceFlagsMap.end())
-    {
-    flags = si->second;
-    }
-  else
-    {
-    // Handle the MACOSX_PACKAGE_LOCATION property on source files that
-    // were not listed in one of the other lists.
-    if(const char* location = sf->GetProperty("MACOSX_PACKAGE_LOCATION"))
-      {
-      flags.MacFolder = location;
-      if(strcmp(location, "Resources") == 0)
-        {
-        flags.Type = cmGeneratorTarget::SourceFileTypeResource;
-        }
-      else
-        {
-        flags.Type = cmGeneratorTarget::SourceFileTypeMacContent;
-        }
-      }
-    }
-  return flags;
-}
-
-//----------------------------------------------------------------------------
-void cmGeneratorTarget::ConstructSourceFileFlags() const
-{
-  if(this->SourceFileFlagsConstructed)
-    {
-    return;
-    }
-  this->SourceFileFlagsConstructed = true;
-
-  // Process public headers to mark the source files.
-  if(const char* files = this->Target->GetProperty("PUBLIC_HEADER"))
-    {
-    std::vector<std::string> relFiles;
-    cmSystemTools::ExpandListArgument(files, relFiles);
-    for(std::vector<std::string>::iterator it = relFiles.begin();
-        it != relFiles.end(); ++it)
-      {
-      if(cmSourceFile* sf = this->Makefile->GetSource(it->c_str()))
-        {
-        SourceFileFlags& flags = this->SourceFlagsMap[sf];
-        flags.MacFolder = "Headers";
-        flags.Type = cmGeneratorTarget::SourceFileTypePublicHeader;
-        }
-      }
-    }
-
-  // Process private headers after public headers so that they take
-  // precedence if a file is listed in both.
-  if(const char* files = this->Target->GetProperty("PRIVATE_HEADER"))
-    {
-    std::vector<std::string> relFiles;
-    cmSystemTools::ExpandListArgument(files, relFiles);
-    for(std::vector<std::string>::iterator it = relFiles.begin();
-        it != relFiles.end(); ++it)
-      {
-      if(cmSourceFile* sf = this->Makefile->GetSource(it->c_str()))
-        {
-        SourceFileFlags& flags = this->SourceFlagsMap[sf];
-        flags.MacFolder = "PrivateHeaders";
-        flags.Type = cmGeneratorTarget::SourceFileTypePrivateHeader;
-        }
-      }
-    }
-
-  // Mark sources listed as resources.
-  if(const char* files = this->Target->GetProperty("RESOURCE"))
-    {
-    std::vector<std::string> relFiles;
-    cmSystemTools::ExpandListArgument(files, relFiles);
-    for(std::vector<std::string>::iterator it = relFiles.begin();
-        it != relFiles.end(); ++it)
-      {
-      if(cmSourceFile* sf = this->Makefile->GetSource(it->c_str()))
-        {
-        SourceFileFlags& flags = this->SourceFlagsMap[sf];
-        flags.MacFolder = "Resources";
-        flags.Type = cmGeneratorTarget::SourceFileTypeResource;
-        }
-      }
-    }
-}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 35067e9..a4caba1 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -28,8 +28,8 @@ public:
 
   int GetType() const;
   const char *GetName() const;
-  const char *GetProperty(const std::string& prop) const;
-  bool GetPropertyAsBool(const std::string& prop) const;
+  const char *GetProperty(const char *prop) const;
+  bool GetPropertyAsBool(const char *prop) const;
   void GetSourceFiles(std::vector<cmSourceFile*>& files) const;
 
   void GetObjectSources(std::vector<cmSourceFile*> &) const;
@@ -52,7 +52,7 @@ public:
   cmLocalGenerator* LocalGenerator;
   cmGlobalGenerator const* GlobalGenerator;
 
-  std::string GetModuleDefinitionFile() const;
+  std::string ModuleDefinitionFile;
 
   /** Full path with trailing slash to the top-level directory
       holding object files for this target.  Includes the build
@@ -61,7 +61,7 @@ public:
 
   void UseObjectLibraries(std::vector<std::string>& objs) const;
 
-  void GetAppleArchs(const std::string& config,
+  void GetAppleArchs(const char* config,
                      std::vector<std::string>& archVec) const;
 
   ///! Return the rule variable used to create this type of target,
@@ -69,14 +69,12 @@ public:
   const char* GetCreateRuleVariable() const;
 
   /** Get the include directories for this target.  */
-  std::vector<std::string> GetIncludeDirectories(
-      const std::string& config) const;
+  std::vector<std::string> GetIncludeDirectories(const char *config) const;
 
-  bool IsSystemIncludeDirectory(const std::string& dir,
-                                const std::string& config) const;
+  bool IsSystemIncludeDirectory(const char *dir, const char *config) const;
 
   /** Add the target output files to the global generator manifest.  */
-  void GenerateTargetManifest(const std::string& config) const;
+  void GenerateTargetManifest(const char* config) const;
 
   /**
    * Trace through the source files in this target and add al source files
@@ -84,72 +82,31 @@ public:
    */
   void TraceDependencies();
 
+  void ClassifySources();
   void LookupObjectLibraries();
 
   /** Get sources that must be built before the given source.  */
   std::vector<cmSourceFile*> const* GetSourceDepends(cmSourceFile* sf) const;
 
-  /**
-   * Flags for a given source file as used in this target. Typically assigned
-   * via SET_TARGET_PROPERTIES when the property is a list of source files.
-   */
-  enum SourceFileType
-  {
-    SourceFileTypeNormal,
-    SourceFileTypePrivateHeader, // is in "PRIVATE_HEADER" target property
-    SourceFileTypePublicHeader,  // is in "PUBLIC_HEADER" target property
-    SourceFileTypeResource,      // is in "RESOURCE" target property *or*
-                                 // has MACOSX_PACKAGE_LOCATION=="Resources"
-    SourceFileTypeMacContent     // has MACOSX_PACKAGE_LOCATION!="Resources"
-  };
-  struct SourceFileFlags
-  {
-    SourceFileFlags(): Type(SourceFileTypeNormal), MacFolder(0) {}
-    SourceFileFlags(SourceFileFlags const& r):
-      Type(r.Type), MacFolder(r.MacFolder) {}
-    SourceFileType Type;
-    const char* MacFolder; // location inside Mac content folders
-  };
-
-  struct SourceFileFlags
-  GetTargetSourceFileFlags(const cmSourceFile* sf) const;
-
-  struct ResxData {
-    mutable std::set<std::string> ExpectedResxHeaders;
-    mutable std::vector<cmSourceFile*> ResxSources;
-  };
 private:
   friend class cmTargetTraceDependencies;
   struct SourceEntry { std::vector<cmSourceFile*> Depends; };
   typedef std::map<cmSourceFile*, SourceEntry> SourceEntriesType;
   SourceEntriesType SourceEntries;
-  mutable std::string ModuleDefinitionFile;
-
-  mutable ResxData Resx;
-
-  mutable bool SourceFileFlagsConstructed;
-  mutable bool ObjectSourcesDone;
-  mutable bool IDLSourcesDone;
-  mutable bool ExtraSourcesDone;
-  mutable bool HeaderSourcesDone;
-  mutable bool CustomCommandsDone;
-  mutable bool ExternalObjectsDone;
-  mutable bool ResxDone;
-  mutable bool ModuleDefinitionFileDone;
-  mutable std::vector<cmSourceFile*> CustomCommands;
-  mutable std::vector<cmSourceFile*> ExtraSources;
-  mutable std::vector<cmSourceFile*> HeaderSources;
-  mutable std::vector<cmSourceFile*> ExternalObjects;
-  mutable std::vector<cmSourceFile*> IDLSources;
+
+  std::vector<cmSourceFile*> CustomCommands;
+  std::vector<cmSourceFile*> ExtraSources;
+  std::vector<cmSourceFile*> HeaderSources;
+  std::vector<cmSourceFile*> ExternalObjects;
+  std::vector<cmSourceFile*> IDLSources;
+  std::vector<cmSourceFile*> ResxSources;
   std::map<cmSourceFile const*, std::string> Objects;
   std::set<cmSourceFile const*> ExplicitObjectName;
-  mutable std::vector<cmSourceFile*> ObjectSources;
+  std::set<std::string> ExpectedResxHeaders;
+  std::vector<cmSourceFile*> ObjectSources;
   std::vector<cmTarget*> ObjectLibraries;
   mutable std::map<std::string, std::vector<std::string> > SystemIncludesCache;
 
-  void ConstructSourceFileFlags() const;
-  mutable std::map<cmSourceFile const*, SourceFileFlags> SourceFlagsMap;
-
   cmGeneratorTarget(cmGeneratorTarget const&);
   void operator=(cmGeneratorTarget const&);
 };
diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx
index 5aaf1c6..e7ad91a 100644
--- a/Source/cmGetCMakePropertyCommand.cxx
+++ b/Source/cmGetCMakePropertyCommand.cxx
@@ -49,10 +49,10 @@ bool cmGetCMakePropertyCommand
     }
   else if ( args[1] == "COMPONENTS" )
     {
-    const std::set<std::string>* components
+    const std::set<cmStdString>* components
       = this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
         ->GetInstallComponents();
-    std::set<std::string>::const_iterator compIt;
+    std::set<cmStdString>::const_iterator compIt;
     output = "";
     for (compIt = components->begin(); compIt != components->end(); ++compIt)
       {
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 5633590..4f3328d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -432,8 +432,8 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
     fpath += "/CMakeSystem.cmake";
     mf->ReadListFile(0,fpath.c_str());
     }
-  std::map<std::string, bool> needTestLanguage;
-  std::map<std::string, bool> needSetLanguageEnabledMaps;
+  std::map<cmStdString, bool> needTestLanguage;
+  std::map<cmStdString, bool> needSetLanguageEnabledMaps;
   // foreach language
   // load the CMakeDetermine(LANG)Compiler.cmake file to find
   // the compiler
@@ -722,7 +722,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
 
 //----------------------------------------------------------------------------
 void cmGlobalGenerator::PrintCompilerAdvice(std::ostream& os,
-                                            std::string const& lang,
+                                            std::string lang,
                                             const char* envVar) const
 {
   // Subclasses override this method if they do not support this advice.
@@ -744,7 +744,7 @@ void cmGlobalGenerator::PrintCompilerAdvice(std::ostream& os,
 
 //----------------------------------------------------------------------------
 void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf,
-                                                std::string const& lang) const
+                                                     std::string lang) const
 {
   std::string compilerIdVar = "CMAKE_" + lang + "_COMPILER_ID";
   const char* compilerId = mf->GetDefinition(compilerIdVar.c_str());
@@ -822,7 +822,7 @@ cmGlobalGenerator::GetLanguageOutputExtension(cmSourceFile const& source) const
 {
   if(const char* lang = source.GetLanguage())
     {
-    std::map<std::string, std::string>::const_iterator it =
+    std::map<cmStdString, cmStdString>::const_iterator it =
                                   this->LanguageToOutputExtension.find(lang);
 
     if(it != this->LanguageToOutputExtension.end())
@@ -856,7 +856,7 @@ const char* cmGlobalGenerator::GetLanguageFromExtension(const char* ext) const
     {
     ++ext;
     }
-  std::map<std::string, std::string>::const_iterator it
+  std::map<cmStdString, cmStdString>::const_iterator it
                                         = this->ExtensionToLanguage.find(ext);
   if(it != this->ExtensionToLanguage.end())
     {
@@ -1007,7 +1007,7 @@ bool cmGlobalGenerator::IsDependedOn(const char* project,
                                      cmTarget const* targetIn)
 {
   // Get all local gens for this project
-  std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator it =
+  std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator it =
                                               this->ProjectMap.find(project);
   if (it == this->ProjectMap.end())
     {
@@ -1148,6 +1148,12 @@ void cmGlobalGenerator::Generate()
     return;
     }
 
+  // Check that all targets are valid.
+  if(!this->CheckTargets())
+    {
+    return;
+    }
+
   this->FinalizeTargetCompileInfo();
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
@@ -1300,6 +1306,35 @@ bool cmGlobalGenerator::ComputeTargetDepends()
 }
 
 //----------------------------------------------------------------------------
+bool cmGlobalGenerator::CheckTargets()
+{
+  // Make sure all targets can find their source files.
+  for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
+    {
+    cmTargets& targets =
+      this->LocalGenerators[i]->GetMakefile()->GetTargets();
+    for(cmTargets::iterator ti = targets.begin();
+        ti != targets.end(); ++ti)
+      {
+      cmTarget& target = ti->second;
+      if(target.GetType() == cmTarget::EXECUTABLE ||
+         target.GetType() == cmTarget::STATIC_LIBRARY ||
+         target.GetType() == cmTarget::SHARED_LIBRARY ||
+         target.GetType() == cmTarget::MODULE_LIBRARY ||
+         target.GetType() == cmTarget::OBJECT_LIBRARY ||
+         target.GetType() == cmTarget::UTILITY)
+        {
+        if(!target.FindSourceFiles())
+          {
+          return false;
+          }
+        }
+      }
+    }
+  return true;
+}
+
+//----------------------------------------------------------------------------
 void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
 {
 #ifdef CMAKE_BUILD_WITH_CMAKE
@@ -1439,6 +1474,7 @@ void cmGlobalGenerator::ComputeGeneratorTargetObjects()
         continue;
         }
       cmGeneratorTarget* gt = ti->second;
+      gt->ClassifySources();
       gt->LookupObjectLibraries();
       this->ComputeTargetObjects(gt);
       }
@@ -1512,8 +1548,8 @@ void cmGlobalGenerator::ComputeTargetObjects(cmGeneratorTarget*) const
 
 void cmGlobalGenerator::CheckLocalGenerators()
 {
-  std::map<std::string, std::string> notFoundMap;
-//  std::set<std::string> notFoundMap;
+  std::map<cmStdString, cmStdString> notFoundMap;
+//  std::set<cmStdString> notFoundMap;
   // after it is all done do a ConfigureFinalPass
   cmCacheManager* manager = 0;
   for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
@@ -1593,7 +1629,7 @@ void cmGlobalGenerator::CheckLocalGenerators()
   if(notFoundMap.size())
     {
     std::string notFoundVars;
-    for(std::map<std::string, std::string>::const_iterator
+    for(std::map<cmStdString, cmStdString>::const_iterator
         ii = notFoundMap.begin();
         ii != notFoundMap.end();
         ++ii)
@@ -1951,7 +1987,7 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
 void
 cmGlobalGenerator::GetEnabledLanguages(std::vector<std::string>& lang) const
 {
-  for(std::map<std::string, bool>::const_iterator i =
+  for(std::map<cmStdString, bool>::const_iterator i =
         this->LanguageEnabled.begin(); i != this->LanguageEnabled.end(); ++i)
     {
     lang.push_back(i->first);
@@ -1960,7 +1996,7 @@ cmGlobalGenerator::GetEnabledLanguages(std::vector<std::string>& lang) const
 
 int cmGlobalGenerator::GetLinkerPreference(const char* lang) const
 {
-  std::map<std::string, int>::const_iterator it =
+  std::map<cmStdString, int>::const_iterator it =
                                    this->LanguageToLinkerPreference.find(lang);
   if (it != this->LanguageToLinkerPreference.end())
     {
@@ -2037,7 +2073,7 @@ void cmGlobalGenerator::FillLocalGeneratorToTargetMap()
 
 ///! Find a local generator by its startdirectory
 cmLocalGenerator*
-cmGlobalGenerator::FindLocalGenerator(const std::string& start_dir) const
+cmGlobalGenerator::FindLocalGenerator(const char* start_dir) const
 {
   for(std::vector<cmLocalGenerator*>::const_iterator it =
       this->LocalGenerators.begin(); it != this->LocalGenerators.end(); ++it)
@@ -2052,41 +2088,60 @@ cmGlobalGenerator::FindLocalGenerator(const std::string& start_dir) const
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::AddAlias(const std::string& name, cmTarget *tgt)
+void cmGlobalGenerator::AddAlias(const char *name, cmTarget *tgt)
 {
   this->AliasTargets[name] = tgt;
 }
 
 //----------------------------------------------------------------------------
-bool cmGlobalGenerator::IsAlias(const std::string& name) const
+bool cmGlobalGenerator::IsAlias(const char *name) const
 {
   return this->AliasTargets.find(name) != this->AliasTargets.end();
 }
 
 //----------------------------------------------------------------------------
 cmTarget*
-cmGlobalGenerator::FindTarget(const std::string& name,
+cmGlobalGenerator::FindTarget(const char* project, const char* name,
                               bool excludeAliases) const
 {
-  if (!excludeAliases)
+  // if project specific
+  if(project)
     {
-    std::map<std::string, cmTarget*>::const_iterator ai
-                                            = this->AliasTargets.find(name);
-    if (ai != this->AliasTargets.end())
+    std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
+      gens = this->ProjectMap.find(project);
+    for(unsigned int i = 0; i < gens->second.size(); ++i)
       {
-      return ai->second;
+      cmTarget* ret = (gens->second)[i]->GetMakefile()->FindTarget(name,
+                                                            excludeAliases);
+      if(ret)
+        {
+        return ret;
+        }
       }
     }
-  std::map<std::string,cmTarget *>::const_iterator i =
-    this->TotalTargets.find ( name );
-  if ( i != this->TotalTargets.end() )
-    {
-    return i->second;
-    }
-  i = this->ImportedTargets.find(name);
-  if ( i != this->ImportedTargets.end() )
+  // if all projects/directories
+  else
     {
-    return i->second;
+    if (!excludeAliases)
+      {
+      std::map<cmStdString, cmTarget*>::const_iterator ai
+                                              = this->AliasTargets.find(name);
+      if (ai != this->AliasTargets.end())
+        {
+        return ai->second;
+        }
+      }
+    std::map<cmStdString,cmTarget *>::const_iterator i =
+      this->TotalTargets.find ( name );
+    if ( i != this->TotalTargets.end() )
+      {
+      return i->second;
+      }
+    i = this->ImportedTargets.find(name);
+    if ( i != this->ImportedTargets.end() )
+      {
+      return i->second;
+      }
     }
   return 0;
 }
@@ -2100,7 +2155,7 @@ cmGlobalGenerator::NameResolvesToFramework(const std::string& libname) const
     return true;
     }
 
-  if(cmTarget* tgt = this->FindTarget(libname.c_str()))
+  if(cmTarget* tgt = this->FindTarget(0, libname.c_str()))
     {
     if(tgt->IsFrameworkOnApple())
        {
@@ -2289,7 +2344,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
     {
     if(!cmakeCfgIntDir || !*cmakeCfgIntDir || cmakeCfgIntDir[0] == '.')
       {
-      std::set<std::string>* componentsSet = &this->InstallComponents;
+      std::set<cmStdString>* componentsSet = &this->InstallComponents;
       cpackCommandLines.erase(cpackCommandLines.begin(),
         cpackCommandLines.end());
       depends.erase(depends.begin(), depends.end());
@@ -2297,7 +2352,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
       if ( componentsSet->size() > 0 )
         {
         ostr << "Available install components are:";
-        std::set<std::string>::iterator it;
+        std::set<cmStdString>::iterator it;
         for (
           it = componentsSet->begin();
           it != componentsSet->end();
@@ -2458,7 +2513,7 @@ void cmGlobalGenerator::EnableMinGWLanguage(cmMakefile *mf)
 
 //----------------------------------------------------------------------------
 cmTarget cmGlobalGenerator::CreateGlobalTarget(
-  const std::string& name, const char* message,
+  const char* name, const char* message,
   const cmCustomCommandLines* commandLines,
   std::vector<std::string> depends,
   const char* workingDirectory)
@@ -2511,7 +2566,7 @@ cmGlobalGenerator::GenerateRuleFile(std::string const& output) const
 std::string cmGlobalGenerator::GetSharedLibFlagsForLanguage(
                                                   std::string const& l) const
 {
-  std::map<std::string, std::string>::const_iterator it =
+  std::map<cmStdString, cmStdString>::const_iterator it =
                               this->LanguageToOriginalSharedLibFlags.find(l);
   if(it != this->LanguageToOriginalSharedLibFlags.end())
     {
@@ -2521,8 +2576,7 @@ std::string cmGlobalGenerator::GetSharedLibFlagsForLanguage(
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::AppendDirectoryForConfig(const char*,
-                                                 const std::string&,
+void cmGlobalGenerator::AppendDirectoryForConfig(const char*, const char*,
                                                  const char*, std::string&)
 {
   // Subclasses that support multiple configurations should implement
@@ -2673,7 +2727,7 @@ void cmGlobalGenerator::AddTargetDepends(cmTarget const* target,
 
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::AddToManifest(const std::string& config,
+void cmGlobalGenerator::AddToManifest(const char* config,
                                       std::string const& f)
 {
   // Add to the main manifest for this configuration.
@@ -2686,7 +2740,7 @@ void cmGlobalGenerator::AddToManifest(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
-std::set<std::string> const&
+std::set<cmStdString> const&
 cmGlobalGenerator::GetDirectoryContent(std::string const& dir, bool needDisk)
 {
   DirectoryContent& dc = this->DirectoryContentMap[dir];
@@ -2792,7 +2846,7 @@ void cmGlobalGenerator::CheckRuleHashes(std::string const& pfile,
     fname = line.substr(33, line.npos);
 
     // Look for a hash for this file's rule.
-    std::map<std::string, RuleHash>::const_iterator rhi =
+    std::map<cmStdString, RuleHash>::const_iterator rhi =
       this->RuleHashes.find(fname);
     if(rhi != this->RuleHashes.end())
       {
@@ -2837,7 +2891,7 @@ void cmGlobalGenerator::WriteRuleHashes(std::string const& pfile)
     {
     cmGeneratedFileStream fout(pfile.c_str());
     fout << "# Hashes of file build rules.\n";
-    for(std::map<std::string, RuleHash>::const_iterator
+    for(std::map<cmStdString, RuleHash>::const_iterator
           rhi = this->RuleHashes.begin(); rhi != this->RuleHashes.end(); ++rhi)
       {
       fout.write(rhi->second.Data, 32);
@@ -2858,7 +2912,7 @@ void cmGlobalGenerator::WriteSummary()
   cmGeneratedFileStream fout(fname.c_str());
 
   // Generate summary information files for each target.
-  for(std::map<std::string,cmTarget *>::const_iterator ti =
+  for(std::map<cmStdString,cmTarget *>::const_iterator ti =
         this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti)
     {
     if ((ti->second)->GetType() == cmTarget::INTERFACE_LIBRARY)
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 7e752c2..753eebf 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -166,13 +166,13 @@ public:
 
   void AddInstallComponent(const char* component);
 
-  const std::set<std::string>* GetInstallComponents() const
+  const std::set<cmStdString>* GetInstallComponents() const
     { return &this->InstallComponents; }
 
   cmExportSetMap& GetExportSets() {return this->ExportSets;}
 
   /** Add a file to the manifest of generated targets for a configuration.  */
-  void AddToManifest(const std::string& config, std::string const& f);
+  void AddToManifest(const char* config, std::string const& f);
 
   void EnableInstallTarget();
 
@@ -210,11 +210,11 @@ public:
   virtual void FindMakeProgram(cmMakefile*);
 
   ///! Find a target by name by searching the local generators.
-  cmTarget* FindTarget(const std::string& name,
+  cmTarget* FindTarget(const char* project, const char* name,
                        bool excludeAliases = false) const;
 
-  void AddAlias(const std::string& name, cmTarget *tgt);
-  bool IsAlias(const std::string& name) const;
+  void AddAlias(const char *name, cmTarget *tgt);
+  bool IsAlias(const char *name) const;
 
   /** Determine if a name resolves to a framework on disk or a built target
       that is a framework. */
@@ -224,13 +224,13 @@ public:
       target in the project */
   bool IsDependedOn(const char* project, cmTarget const* target);
   ///! Find a local generator by its startdirectory
-  cmLocalGenerator* FindLocalGenerator(const std::string& start_dir) const;
+  cmLocalGenerator* FindLocalGenerator(const char* start_dir) const;
 
   /** Append the subdirectory for the given configuration.  If anything is
       appended the given prefix and suffix will be appended around it, which
       is useful for leading or trailing slashes.  */
   virtual void AppendDirectoryForConfig(const char* prefix,
-                                        const std::string& config,
+                                        const char* config,
                                         const char* suffix,
                                         std::string& dir);
 
@@ -243,7 +243,7 @@ public:
       from disk at most once and cached.  During the generation step
       the content will include the target files to be built even if
       they do not yet exist.  */
-  std::set<std::string> const& GetDirectoryContent(std::string const& dir,
+  std::set<cmStdString> const& GetDirectoryContent(std::string const& dir,
                                                    bool needDisk = true);
 
   void AddTarget(cmTarget* t);
@@ -275,7 +275,7 @@ public:
   /** Get per-target generator information.  */
   cmGeneratorTarget* GetGeneratorTarget(cmTarget const*) const;
 
-  const std::map<std::string, std::vector<cmLocalGenerator*> >& GetProjectMap()
+  const std::map<cmStdString, std::vector<cmLocalGenerator*> >& GetProjectMap()
                                                const {return this->ProjectMap;}
 
   // track files replaced during a Generate
@@ -286,7 +286,7 @@ public:
                    std::string const& content);
 
   /** Return whether the given binary directory is unused.  */
-  bool BinaryDirectoryIsNew(const std::string& dir)
+  bool BinaryDirectoryIsNew(const char* dir)
     {
     return this->BinaryDirectories.insert(dir).second;
     }
@@ -340,6 +340,7 @@ protected:
 
   virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const;
 
+  bool CheckTargets();
   typedef std::vector<std::pair<cmQtAutoGenerators,
                                 cmTarget const*> > AutogensType;
   void CreateQtAutoGeneratorsTargets(AutogensType& autogens);
@@ -355,7 +356,7 @@ protected:
   bool IsExcluded(cmLocalGenerator* root, cmTarget const& target) const;
   void FillLocalGeneratorToTargetMap();
   void CreateDefaultGlobalTargets(cmTargets* targets);
-  cmTarget CreateGlobalTarget(const std::string& name, const char* message,
+  cmTarget CreateGlobalTarget(const char* name, const char* message,
     const cmCustomCommandLines* commandLines,
     std::vector<std::string> depends, const char* workingDir);
 
@@ -363,18 +364,18 @@ protected:
   bool UseLinkScript;
   bool ForceUnixPaths;
   bool ToolSupportsColor;
-  std::string FindMakeProgramFile;
-  std::string ConfiguredFilesPath;
+  cmStdString FindMakeProgramFile;
+  cmStdString ConfiguredFilesPath;
   cmake *CMakeInstance;
   std::vector<cmLocalGenerator *> LocalGenerators;
   cmLocalGenerator* CurrentLocalGenerator;
   // map from project name to vector of local generators in that project
-  std::map<std::string, std::vector<cmLocalGenerator*> > ProjectMap;
+  std::map<cmStdString, std::vector<cmLocalGenerator*> > ProjectMap;
   std::map<cmLocalGenerator*, std::set<cmTarget const*> >
                                                     LocalGeneratorToTargetMap;
 
   // Set of named installation components requested by the project.
-  std::set<std::string> InstallComponents;
+  std::set<cmStdString> InstallComponents;
   bool InstallTargetEnabled;
   // Sets of named target exports
   cmExportSetMap ExportSets;
@@ -386,9 +387,9 @@ protected:
   cmTargetManifest TargetManifest;
 
   // All targets in the entire project.
-  std::map<std::string,cmTarget *> TotalTargets;
-  std::map<std::string,cmTarget *> AliasTargets;
-  std::map<std::string,cmTarget *> ImportedTargets;
+  std::map<cmStdString,cmTarget *> TotalTargets;
+  std::map<cmStdString,cmTarget *> AliasTargets;
+  std::map<cmStdString,cmTarget *> ImportedTargets;
   std::vector<cmGeneratorExpressionEvaluationFile*> EvaluationFiles;
 
   virtual const char* GetPredefinedTargetsFolder();
@@ -400,18 +401,18 @@ private:
   float FirstTimeProgress;
   // If you add a new map here, make sure it is copied
   // in EnableLanguagesFromGenerator
-  std::map<std::string, bool> IgnoreExtensions;
-  std::map<std::string, bool> LanguageEnabled;
-  std::set<std::string> LanguagesReady; // Ready for try_compile
-  std::map<std::string, std::string> OutputExtensions;
-  std::map<std::string, std::string> LanguageToOutputExtension;
-  std::map<std::string, std::string> ExtensionToLanguage;
-  std::map<std::string, int> LanguageToLinkerPreference;
-  std::map<std::string, std::string> LanguageToOriginalSharedLibFlags;
+  std::map<cmStdString, bool> IgnoreExtensions;
+  std::map<cmStdString, bool> LanguageEnabled;
+  std::set<cmStdString> LanguagesReady; // Ready for try_compile
+  std::map<cmStdString, cmStdString> OutputExtensions;
+  std::map<cmStdString, cmStdString> LanguageToOutputExtension;
+  std::map<cmStdString, cmStdString> ExtensionToLanguage;
+  std::map<cmStdString, int> LanguageToLinkerPreference;
+  std::map<cmStdString, cmStdString> LanguageToOriginalSharedLibFlags;
 
   // Record hashes for rules and outputs.
   struct RuleHash { char Data[32]; };
-  std::map<std::string, RuleHash> RuleHashes;
+  std::map<cmStdString, RuleHash> RuleHashes;
   void CheckRuleHashes();
   void CheckRuleHashes(std::string const& pfile, std::string const& home);
   void WriteRuleHashes(std::string const& pfile);
@@ -420,10 +421,9 @@ private:
   void WriteSummary(cmTarget* target);
   void FinalizeTargetCompileInfo();
 
-  virtual void PrintCompilerAdvice(std::ostream& os, std::string const& lang,
+  virtual void PrintCompilerAdvice(std::ostream& os, std::string lang,
                                    const char* envVar) const;
-  void CheckCompilerIdCompatibility(cmMakefile* mf,
-                                    std::string const& lang) const;
+  void CheckCompilerIdCompatibility(cmMakefile* mf, std::string lang) const;
 
   cmExternalMakefileProjectGenerator* ExtraGenerator;
 
@@ -447,18 +447,18 @@ private:
   virtual const char* GetBuildIgnoreErrorsFlag() const { return 0; }
 
   // Cache directory content and target files to be built.
-  struct DirectoryContent: public std::set<std::string>
+  struct DirectoryContent: public std::set<cmStdString>
   {
-    typedef std::set<std::string> derived;
+    typedef std::set<cmStdString> derived;
     bool LoadedFromDisk;
     DirectoryContent(): LoadedFromDisk(false) {}
     DirectoryContent(DirectoryContent const& dc):
       derived(dc), LoadedFromDisk(dc.LoadedFromDisk) {}
   };
-  std::map<std::string, DirectoryContent> DirectoryContentMap;
+  std::map<cmStdString, DirectoryContent> DirectoryContentMap;
 
   // Set of binary directories on disk.
-  std::set<std::string> BinaryDirectories;
+  std::set<cmStdString> BinaryDirectories;
 
   // track targets to issue CMP0042 warning for.
   std::set<std::string> CMP0042WarnTargets;
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index b0fccb5..ed0e15b 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -44,7 +44,7 @@ void cmGlobalKdevelopGenerator::Generate()
 {
   // for each sub project in the project create
   // a kdevelop project
-  for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator
+  for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
        it = this->GlobalGenerator->GetProjectMap().begin();
       it!= this->GlobalGenerator->GetProjectMap().end();
       ++it)
@@ -76,7 +76,7 @@ void cmGlobalKdevelopGenerator::Generate()
         {
         if (ti->second.GetType()==cmTarget::EXECUTABLE)
           {
-          executable = ti->second.GetLocation("");
+          executable = ti->second.GetLocation(0);
           break;
           }
         }
@@ -103,7 +103,7 @@ bool cmGlobalKdevelopGenerator
   std::string projectDir = projectDirIn + "/";
   std::string filename = outputDir+ "/" + projectname +".kdevelop.filelist";
 
-  std::set<std::string> files;
+  std::set<cmStdString> files;
   std::string tmp;
 
   for (std::vector<cmLocalGenerator*>::const_iterator it=lgs.begin();
@@ -158,7 +158,7 @@ bool cmGlobalKdevelopGenerator
           files.insert(tmp);
 
           // check if there's a matching header around
-          for(std::set<std::string>::const_iterator
+          for(std::vector<std::string>::const_iterator
                 ext = makefile->GetHeaderExtensions().begin();
               ext !=  makefile->GetHeaderExtensions().end(); ++ext)
             {
@@ -217,7 +217,7 @@ bool cmGlobalKdevelopGenerator
     }
 
   fileToOpen="";
-  for (std::set<std::string>::const_iterator it=files.begin();
+  for (std::set<cmStdString>::const_iterator it=files.begin();
        it!=files.end(); it++)
     {
     // get the full path to the file
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 691b580..731bc00 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -886,7 +886,7 @@ cmGlobalNinjaGenerator
   if (target->GetType() == cmTarget::GLOBAL_TARGET) {
     // Global targets only depend on other utilities, which may not appear in
     // the TargetDepends set (e.g. "all").
-    std::set<std::string> const& utils = target->GetUtilities();
+    std::set<cmStdString> const& utils = target->GetUtilities();
     std::copy(utils.begin(), utils.end(), std::back_inserter(outputs));
   } else {
     cmTargetDependSet const& targetDeps =
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 3592a47..0b37a07 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -624,7 +624,7 @@ void cmGlobalUnixMakefileGenerator3
 void
 cmGlobalUnixMakefileGenerator3
 ::WriteConvenienceRules(std::ostream& ruleFileStream,
-                        std::set<std::string> &emitted)
+                        std::set<cmStdString> &emitted)
 {
   std::vector<std::string> depends;
   std::vector<std::string> commands;
@@ -1051,7 +1051,7 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
   lg->AppendEcho(commands,"... depend");
 
   // Keep track of targets already listed.
-  std::set<std::string> emittedTargets;
+  std::set<cmStdString> emittedTargets;
 
   // for each local generator
   unsigned int i;
@@ -1086,8 +1086,8 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
         }
       }
     }
-  std::vector<std::string> const& localHelp = lg->GetLocalHelp();
-  for(std::vector<std::string>::const_iterator o = localHelp.begin();
+  std::vector<cmStdString> const& localHelp = lg->GetLocalHelp();
+  for(std::vector<cmStdString>::const_iterator o = localHelp.begin();
       o != localHelp.end(); ++o)
     {
     path = "... ";
@@ -1104,9 +1104,9 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
 bool cmGlobalUnixMakefileGenerator3
 ::NeedRequiresStep(cmTarget const& target)
 {
-  std::set<std::string> languages;
+  std::set<cmStdString> languages;
   target.GetLanguages(languages);
-  for(std::set<std::string>::const_iterator l = languages.begin();
+  for(std::set<cmStdString>::const_iterator l = languages.begin();
       l != languages.end(); ++l)
     {
     std::string var = "CMAKE_NEEDS_REQUIRES_STEP_";
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 3974b5d..9173751 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -96,7 +96,7 @@ public:
 
   // write the top level target rules
   void WriteConvenienceRules(std::ostream& ruleFileStream,
-                             std::set<std::string> &emitted);
+                             std::set<cmStdString> &emitted);
 
   /** Get the command to use for a target that has no rule.  This is
       used for multiple output dependencies and for cmake_force.  */
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index e297c48..6c458c3 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -259,7 +259,7 @@ void cmGlobalVisualStudio6Generator
 // output the DSW file
 void cmGlobalVisualStudio6Generator::OutputDSWFile()
 {
-  std::map<std::string, std::vector<cmLocalGenerator*> >::iterator it;
+  std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
   for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
     {
     this->OutputDSWFile(it->second[0], it->second);
@@ -317,7 +317,7 @@ void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout,
 void cmGlobalVisualStudio6Generator::WriteExternalProject(std::ostream& fout,
                                const char* name,
                                const char* location,
-                               const std::set<std::string>& dependencies)
+                               const std::set<cmStdString>& dependencies)
 {
  fout << "#########################################################"
     "######################\n\n";
@@ -328,7 +328,7 @@ void cmGlobalVisualStudio6Generator::WriteExternalProject(std::ostream& fout,
   fout << "{{{\n";
 
 
-  std::set<std::string>::const_iterator i, end;
+  std::set<cmStdString>::const_iterator i, end;
   // write dependencies.
   i = dependencies.begin();
   end = dependencies.end();
@@ -418,11 +418,11 @@ void cmGlobalVisualStudio6Generator
 void
 cmGlobalVisualStudio6Generator
 ::AppendDirectoryForConfig(const char* prefix,
-                           const std::string& config,
+                           const char* config,
                            const char* suffix,
                            std::string& dir)
 {
-  if(!config.empty())
+  if(config)
     {
     dir += prefix;
     dir += config;
diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h
index 44207af..5521410 100644
--- a/Source/cmGlobalVisualStudio6Generator.h
+++ b/Source/cmGlobalVisualStudio6Generator.h
@@ -82,7 +82,7 @@ public:
 
   /** Append the subdirectory for the given configuration.  */
   virtual void AppendDirectoryForConfig(const char* prefix,
-                                        const std::string& config,
+                                        const char* config,
                                         const char* suffix,
                                         std::string& dir);
 
@@ -102,7 +102,7 @@ private:
                     const char* name, const char* path, cmTarget const& t);
   void WriteExternalProject(std::ostream& fout,
                             const char* name, const char* path,
-                            const std::set<std::string>& dependencies);
+                            const std::set<cmStdString>& dependencies);
   void WriteDSWFooter(std::ostream& fout);
   virtual std::string WriteUtilityDepend(cmTarget const* target);
   std::string MSDevCommand;
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 08bcc5b..22e4f08 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -155,7 +155,7 @@ cmGlobalVisualStudio71Generator
 // the libraries it uses are also done here
 void
 cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
-                                              const std::string& dspname,
+                                              const char* dspname,
                                               const char* dir,
                                               cmTarget const& t)
 {
@@ -208,7 +208,7 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
 void
 cmGlobalVisualStudio71Generator
 ::WriteProjectDepends(std::ostream& fout,
-                      const std::string&,
+                      const char*,
                       const char*, cmTarget const& target)
 {
   VSDependSet const& depends = this->VSTargetDepends[&target];
@@ -234,10 +234,10 @@ cmGlobalVisualStudio71Generator
 // executables to the libraries it uses are also done here
 void cmGlobalVisualStudio71Generator
 ::WriteExternalProject(std::ostream& fout,
-                       const std::string& name,
+                       const char* name,
                        const char* location,
                        const char* typeGuid,
-                       const std::set<std::string>& depends)
+                       const std::set<cmStdString>& depends)
 {
   fout << "Project(\"{"
        << (typeGuid ? typeGuid : this->ExternalProjectType(location))
@@ -252,7 +252,7 @@ void cmGlobalVisualStudio71Generator
   if(!depends.empty())
     {
     fout << "\tProjectSection(ProjectDependencies) = postProject\n";
-    std::set<std::string>::const_iterator it;
+    std::set<cmStdString>::const_iterator it;
     for(it = depends.begin(); it != depends.end(); ++it)
       {
       if(it->size() > 0)
@@ -277,7 +277,7 @@ void cmGlobalVisualStudio71Generator
 // executables to the libraries it uses are also done here
 void cmGlobalVisualStudio71Generator
 ::WriteProjectConfigurations(
-  std::ostream& fout, const std::string& name, cmTarget::TargetType,
+  std::ostream& fout, const char* name, cmTarget::TargetType,
   const std::set<std::string>& configsPartOfDefaultBuild,
   const char* platformMapping)
 {
diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h
index 23afc22..04e3a55 100644
--- a/Source/cmGlobalVisualStudio71Generator.h
+++ b/Source/cmGlobalVisualStudio71Generator.h
@@ -72,7 +72,7 @@ protected:
                                     const char* name,
                                     const char* path,
                                     const char* typeGuid,
-                                    const std::set<std::string>& depends);
+                                    const std::set<cmStdString>& depends);
   virtual void WriteSLNHeader(std::ostream& fout);
 
   std::string ProjectConfigurationSectionName;
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index c12dae6..bb63289 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -352,7 +352,7 @@ void cmGlobalVisualStudio7Generator
 // output the SLN file
 void cmGlobalVisualStudio7Generator::OutputSLNFile()
 {
-  std::map<std::string, std::vector<cmLocalGenerator*> >::iterator it;
+  std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
   for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
     {
     this->OutputSLNFile(it->second[0], it->second);
@@ -653,7 +653,7 @@ cmGlobalVisualStudio7Generator::ConvertToSolutionPath(const char* path)
 // Note, that dependencies from executables to
 // the libraries it uses are also done here
 void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout,
-                               const std::string& dspname,
+                               const char* dspname,
                                const char* dir, cmTarget const& target)
 {
    // check to see if this is a fortran build
@@ -693,7 +693,7 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout,
 void
 cmGlobalVisualStudio7Generator
 ::WriteProjectDepends(std::ostream& fout,
-                      const std::string& dspname,
+                      const char* dspname,
                       const char*, cmTarget const& target)
 {
   int depcount = 0;
@@ -729,7 +729,7 @@ cmGlobalVisualStudio7Generator
 // executables to the libraries it uses are also done here
 void cmGlobalVisualStudio7Generator
 ::WriteProjectConfigurations(
-  std::ostream& fout, const std::string& name, cmTarget::TargetType,
+  std::ostream& fout, const char* name, cmTarget::TargetType,
   const std::set<std::string>& configsPartOfDefaultBuild,
   const char* platformMapping)
 {
@@ -757,10 +757,10 @@ void cmGlobalVisualStudio7Generator
 // Note, that dependencies from executables to
 // the libraries it uses are also done here
 void cmGlobalVisualStudio7Generator::WriteExternalProject(std::ostream& fout,
-                               const std::string& name,
+                               const char* name,
                                const char* location,
                                const char* typeGuid,
-                               const std::set<std::string>&)
+                               const std::set<cmStdString>&)
 {
   std::string d = cmSystemTools::ConvertToOutputPath(location);
   fout << "Project("
@@ -907,7 +907,7 @@ cmGlobalVisualStudio7Generator::WriteUtilityDepend(cmTarget const* target)
   return pname;
 }
 
-std::string cmGlobalVisualStudio7Generator::GetGUID(const std::string& name)
+std::string cmGlobalVisualStudio7Generator::GetGUID(const char* name)
 {
   std::string guidStoreName = name;
   guidStoreName += "_GUID_CMAKE";
@@ -961,11 +961,11 @@ void cmGlobalVisualStudio7Generator
 void
 cmGlobalVisualStudio7Generator
 ::AppendDirectoryForConfig(const char* prefix,
-                           const std::string& config,
+                           const char* config,
                            const char* suffix,
                            std::string& dir)
 {
-  if(!config.empty())
+  if(config)
     {
     dir += prefix;
     dir += config;
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index ca05352..f69bd84 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -90,11 +90,11 @@ public:
 
   ///! Create a GUID or get an existing one.
   void CreateGUID(const char* name);
-  std::string GetGUID(const std::string& name);
+  std::string GetGUID(const char* name);
 
   /** Append the subdirectory for the given configuration.  */
   virtual void AppendDirectoryForConfig(const char* prefix,
-                                        const std::string& config,
+                                        const char* config,
                                         const char* suffix,
                                         std::string& dir);
 
@@ -156,7 +156,7 @@ protected:
                                     const char* name,
                                     const char* path,
                                     const char* typeGuid,
-                                    const std::set<std::string>&
+                                    const std::set<cmStdString>&
                                     dependencies);
 
   std::string ConvertToSolutionPath(const char* path);
@@ -164,7 +164,7 @@ protected:
   std::set<std::string> IsPartOfDefaultBuild(const char* project,
                                              cmTarget const* target);
   std::vector<std::string> Configurations;
-  std::map<std::string, std::string> GUIDMap;
+  std::map<cmStdString, cmStdString> GUIDMap;
 
   virtual void WriteFolders(std::ostream& fout);
   virtual void WriteFoldersContent(std::ostream& fout);
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 1ba6fd5..12c240b 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -338,7 +338,7 @@ void cmGlobalVisualStudio8Generator::Generate()
   if(this->AddCheckTarget())
     {
     // All targets depend on the build-system check target.
-    for(std::map<std::string,cmTarget *>::const_iterator
+    for(std::map<cmStdString,cmTarget *>::const_iterator
           ti = this->TotalTargets.begin();
         ti != this->TotalTargets.end(); ++ti)
       {
@@ -372,7 +372,7 @@ cmGlobalVisualStudio8Generator
 void
 cmGlobalVisualStudio8Generator
 ::WriteProjectConfigurations(
-  std::ostream& fout, const std::string& name, cmTarget::TargetType type,
+  std::ostream& fout, const char* name, cmTarget::TargetType type,
   const std::set<std::string>& configsPartOfDefaultBuild,
   const char* platformMapping)
 {
@@ -436,11 +436,11 @@ bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies(
   cmTarget& target)
 {
   // Look for utility dependencies that magically link.
-  for(std::set<std::string>::const_iterator ui =
+  for(std::set<cmStdString>::const_iterator ui =
         target.GetUtilities().begin();
       ui != target.GetUtilities().end(); ++ui)
     {
-    if(cmTarget* depTarget = this->FindTarget(ui->c_str()))
+    if(cmTarget* depTarget = this->FindTarget(0, ui->c_str()))
       {
       if(depTarget->GetType() != cmTarget::INTERFACE_LIBRARY
           && depTarget->GetProperty("EXTERNAL_MSPROJECT"))
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 86b3caa..0c5f35b 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -53,7 +53,7 @@ void cmGlobalVisualStudioGenerator::Generate()
   const char* no_working_dir = 0;
   std::vector<std::string> no_depends;
   cmCustomCommandLines no_commands;
-  std::map<std::string, std::vector<cmLocalGenerator*> >::iterator it;
+  std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
   for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
     {
     std::vector<cmLocalGenerator*>& gen = it->second;
@@ -128,7 +128,7 @@ cmGlobalVisualStudioGenerator
 
   // Count the number of object files with each name.  Note that
   // windows file names are not case sensitive.
-  std::map<std::string, int> counts;
+  std::map<cmStdString, int> counts;
   std::vector<cmSourceFile*> objectSources;
   gt->GetObjectSources(objectSources);
   for(std::vector<cmSourceFile*>::const_iterator
@@ -380,7 +380,7 @@ bool cmGlobalVisualStudioGenerator::ComputeTargetDepends()
     {
     return false;
     }
-  std::map<std::string, std::vector<cmLocalGenerator*> >::iterator it;
+  std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
   for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
     {
     std::vector<cmLocalGenerator*>& gen = it->second;
@@ -852,7 +852,7 @@ bool
 cmGlobalVisualStudioGenerator::TargetIsFortranOnly(cmTarget const& target)
 {
   // check to see if this is a fortran build
-  std::set<std::string> languages;
+  std::set<cmStdString> languages;
   target.GetLanguages(languages);
   if(languages.size() == 1)
     {
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index b8b91d5..9186d65 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -99,7 +99,7 @@ protected:
   virtual void AddPlatformDefinitions(cmMakefile* mf);
 
   virtual bool ComputeTargetDepends();
-  class VSDependSet: public std::set<std::string> {};
+  class VSDependSet: public std::set<cmStdString> {};
   class VSDependMap: public std::map<cmTarget const*, VSDependSet> {};
   VSDependMap VSTargetDepends;
   void ComputeVSTargetDepends(cmTarget&);
@@ -108,7 +108,7 @@ protected:
   std::string GetUtilityForTarget(cmTarget& target, const char*);
   virtual std::string WriteUtilityDepend(cmTarget const*) = 0;
   std::string GetUtilityDepend(cmTarget const* target);
-  typedef std::map<cmTarget const*, std::string> UtilityDependsMap;
+  typedef std::map<cmTarget const*, cmStdString> UtilityDependsMap;
   UtilityDependsMap UtilityDepends;
   const char* AdditionalPlatformDefinition;
 
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 42c1da4..484b28f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -336,7 +336,7 @@ cmLocalGenerator *cmGlobalXCodeGenerator::CreateLocalGenerator()
 //----------------------------------------------------------------------------
 void cmGlobalXCodeGenerator::Generate()
 {
-  std::map<std::string, std::vector<cmLocalGenerator*> >::iterator it;
+  std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
   // make sure extra targets are added before calling
   // the parent generate which will call trace depends
   for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
@@ -569,7 +569,7 @@ void cmGlobalXCodeGenerator::addObject(cmXCodeObject *obj)
 {
   if(obj->GetType() == cmXCodeObject::OBJECT)
     {
-    std::string id = obj->GetId();
+    cmStdString id = obj->GetId();
 
     // If this is a duplicate id, it's an error:
     //
@@ -613,7 +613,7 @@ cmGlobalXCodeGenerator::CreateObject(cmXCodeObject::Type type)
 
 //----------------------------------------------------------------------------
 cmXCodeObject*
-cmGlobalXCodeGenerator::CreateString(const std::string& s)
+cmGlobalXCodeGenerator::CreateString(const char* s)
 {
   cmXCodeObject* obj = this->CreateObject(cmXCodeObject::STRING);
   obj->SetString(s);
@@ -630,17 +630,17 @@ cmXCodeObject* cmGlobalXCodeGenerator
 }
 
 //----------------------------------------------------------------------------
-std::string
+cmStdString
 GetGroupMapKeyFromPath(cmTarget& cmtarget, const std::string& fullpath)
 {
-  std::string key(cmtarget.GetName());
+  cmStdString key(cmtarget.GetName());
   key += "-";
   key += fullpath;
   return key;
 }
 
 //----------------------------------------------------------------------------
-std::string
+cmStdString
 GetGroupMapKey(cmTarget& cmtarget, cmSourceFile* sf)
 {
   return GetGroupMapKeyFromPath(cmtarget, sf->GetFullPath());
@@ -713,23 +713,22 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
 
   // Is this a resource file in this target? Add it to the resources group...
   //
-  cmGeneratorTarget::SourceFileFlags tsFlags =
-            this->GetGeneratorTarget(&cmtarget)->GetTargetSourceFileFlags(sf);
-  bool isResource = tsFlags.Type == cmGeneratorTarget::SourceFileTypeResource;
+  cmTarget::SourceFileFlags tsFlags = cmtarget.GetTargetSourceFileFlags(sf);
+  bool isResource = (tsFlags.Type == cmTarget::SourceFileTypeResource);
 
   // Is this a "private" or "public" framework header file?
   // Set the ATTRIBUTES attribute appropriately...
   //
   if(cmtarget.IsFrameworkOnApple())
     {
-    if(tsFlags.Type == cmGeneratorTarget::SourceFileTypePrivateHeader)
+    if(tsFlags.Type == cmTarget::SourceFileTypePrivateHeader)
       {
       cmXCodeObject* attrs = this->CreateObject(cmXCodeObject::OBJECT_LIST);
       attrs->AddObject(this->CreateString("Private"));
       settings->AddAttribute("ATTRIBUTES", attrs);
       isResource = true;
       }
-    else if(tsFlags.Type == cmGeneratorTarget::SourceFileTypePublicHeader)
+    else if(tsFlags.Type == cmTarget::SourceFileTypePublicHeader)
       {
       cmXCodeObject* attrs = this->CreateObject(cmXCodeObject::OBJECT_LIST);
       attrs->AddObject(this->CreateString("Public"));
@@ -847,7 +846,7 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
     fileRef->SetComment(fname.c_str());
     this->FileRefs[fname] = fileRef;
     }
-  std::string key = GetGroupMapKeyFromPath(cmtarget, fullpath);
+  cmStdString key = GetGroupMapKeyFromPath(cmtarget, fullpath);
   cmXCodeObject* group = this->GroupMap[key];
   cmXCodeObject* children = group->GetObject("children");
   if (!children->HasObject(fileRef))
@@ -974,7 +973,6 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
   for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++)
     {
     cmTarget& cmtarget = l->second;
-    cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
 
     // make sure ALL_BUILD, INSTALL, etc are only done once
     if(this->SpecialTargetEmitted(l->first.c_str()))
@@ -1013,8 +1011,8 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
       cmXCodeObject* filetype =
         fr->GetObject()->GetObject("explicitFileType");
 
-      cmGeneratorTarget::SourceFileFlags tsFlags =
-        gtgt->GetTargetSourceFileFlags(*i);
+      cmTarget::SourceFileFlags tsFlags =
+        cmtarget.GetTargetSourceFileFlags(*i);
 
       if(filetype &&
          strcmp(filetype->GetString(), "compiled.mach-o.objfile") == 0)
@@ -1022,12 +1020,12 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
         externalObjFiles.push_back(xsf);
         }
       else if(this->IsHeaderFile(*i) ||
-        (tsFlags.Type == cmGeneratorTarget::SourceFileTypePrivateHeader) ||
-        (tsFlags.Type == cmGeneratorTarget::SourceFileTypePublicHeader))
+        (tsFlags.Type == cmTarget::SourceFileTypePrivateHeader) ||
+        (tsFlags.Type == cmTarget::SourceFileTypePublicHeader))
         {
         headerFiles.push_back(xsf);
         }
-      else if(tsFlags.Type == cmGeneratorTarget::SourceFileTypeResource)
+      else if(tsFlags.Type == cmTarget::SourceFileTypeResource)
         {
         resourceFiles.push_back(xsf);
         }
@@ -1050,7 +1048,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
       // the externalObjFiles above, except each one is not a cmSourceFile
       // within the target.)
       std::vector<std::string> objs;
-      gtgt->UseObjectLibraries(objs);
+      this->GetGeneratorTarget(&cmtarget)->UseObjectLibraries(objs);
       for(std::vector<std::string>::const_iterator
             oi = objs.begin(); oi != objs.end(); ++oi)
         {
@@ -1134,15 +1132,15 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
     std::vector<cmXCodeObject*> contentBuildPhases;
     if (isFrameworkTarget || isBundleTarget || isCFBundleTarget)
       {
-      typedef std::map<std::string, std::vector<cmSourceFile*> >
+      typedef std::map<cmStdString, std::vector<cmSourceFile*> >
         mapOfVectorOfSourceFiles;
       mapOfVectorOfSourceFiles bundleFiles;
       for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
           i != classes.end(); ++i)
         {
-        cmGeneratorTarget::SourceFileFlags tsFlags =
-          gtgt->GetTargetSourceFileFlags(*i);
-        if(tsFlags.Type == cmGeneratorTarget::SourceFileTypeMacContent)
+        cmTarget::SourceFileFlags tsFlags =
+          cmtarget.GetTargetSourceFileFlags(*i);
+        if(tsFlags.Type == cmTarget::SourceFileTypeMacContent)
           {
           bundleFiles[tsFlags.MacFolder].push_back(*i);
           }
@@ -1223,7 +1221,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
 void cmGlobalXCodeGenerator::ForceLinkerLanguages()
 {
   // This makes sure all targets link using the proper language.
-  for(std::map<std::string, cmTarget*>::const_iterator
+  for(std::map<cmStdString, cmTarget*>::const_iterator
         ti = this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti)
     {
     this->ForceLinkerLanguage(*ti->second);
@@ -1278,9 +1276,10 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
 //----------------------------------------------------------------------------
 bool cmGlobalXCodeGenerator::IsHeaderFile(cmSourceFile* sf)
 {
-  const std::set<std::string>& hdrExts =
+  const std::vector<std::string>& hdrExts =
     this->CurrentMakefile->GetHeaderExtensions();
-  return (hdrExts.count(sf->GetExtension() > 0);
+  return (std::find(hdrExts.begin(), hdrExts.end(), sf->GetExtension()) !=
+          hdrExts.end());
 }
 
 //----------------------------------------------------------------------------
@@ -1483,7 +1482,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
 
   // collect multiple outputs of custom commands into a set
   // which will be used for every configuration
-  std::map<std::string, std::string> multipleOutputPairs;
+  std::map<cmStdString, cmStdString> multipleOutputPairs;
   for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
       i != commands.end(); ++i)
     {
@@ -1553,9 +1552,9 @@ void  cmGlobalXCodeGenerator
                             cmTarget& target,
                             std::vector<cmCustomCommand>
                             const & commands,
-                            const std::string& configName,
-                            const std::map<std::string,
-                            std::string>& multipleOutputPairs
+                            const char* configName,
+                            const std::map<cmStdString,
+                            cmStdString>& multipleOutputPairs
                            )
 {
   std::string makefileName=makefileBasename;
@@ -1577,7 +1576,7 @@ void  cmGlobalXCodeGenerator
 
   // have all depend on all outputs
   makefileStream << "all: ";
-  std::map<const cmCustomCommand*, std::string> tname;
+  std::map<const cmCustomCommand*, cmStdString> tname;
   int count = 0;
   for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
       i != commands.end(); ++i)
@@ -1675,7 +1674,7 @@ void  cmGlobalXCodeGenerator
     makefileStream <<
         "\n# Dependencies of multiple outputs to their primary outputs \n";
 
-    for(std::map<std::string, std::string>::const_iterator o =
+    for(std::map<cmStdString, cmStdString>::const_iterator o =
         multipleOutputPairs.begin(); o != multipleOutputPairs.end(); ++o)
       {
       makefileStream << o->first << ": " << o->second << "\n";
@@ -1684,7 +1683,7 @@ void  cmGlobalXCodeGenerator
     makefileStream <<
         "\n"
         "cmake_check_multiple_outputs:\n";
-    for(std::map<std::string, std::string>::const_iterator o =
+    for(std::map<cmStdString, cmStdString>::const_iterator o =
         multipleOutputPairs.begin(); o != multipleOutputPairs.end(); ++o)
       {
       makefileStream << "\t at if [ ! -f "
@@ -1696,8 +1695,8 @@ void  cmGlobalXCodeGenerator
 
 //----------------------------------------------------------------------------
 void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
-                                                cmXCodeObject* buildSettings,
-                                                const std::string& configName)
+                                                 cmXCodeObject* buildSettings,
+                                                 const char* configName)
 {
   if(target.GetType() == cmTarget::INTERFACE_LIBRARY)
     {
@@ -1810,7 +1809,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
       this->CurrentLocalGenerator->
         AppendFlags(extraLinkOptions, targetLinkFlags);
       }
-    if(!configName.empty())
+    if(configName && *configName)
       {
       std::string linkFlagsVar = "LINK_FLAGS_";
       linkFlagsVar += cmSystemTools::UpperCase(configName);
@@ -2094,7 +2093,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
   std::vector<std::string> includes;
   this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt,
                                                      "C", configName);
-  std::set<std::string> emitted;
+  std::set<cmStdString> emitted;
   emitted.insert("/System/Library/Frameworks");
   for(std::vector<std::string>::iterator i = includes.begin();
       i != includes.end(); ++i)
@@ -2363,18 +2362,18 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     {
     if(i->first.find("XCODE_ATTRIBUTE_") == 0)
       {
-      std::string attribute = i->first.substr(16);
+      cmStdString attribute = i->first.substr(16);
       // Handle [variant=<config>] condition explicitly here.
-      std::string::size_type beginVariant =
+      cmStdString::size_type beginVariant =
         attribute.find("[variant=");
-      if (beginVariant != std::string::npos)
+      if (beginVariant != cmStdString::npos)
         {
-        std::string::size_type endVariant =
+        cmStdString::size_type endVariant =
           attribute.find("]", beginVariant+9);
-        if (endVariant != std::string::npos)
+        if (endVariant != cmStdString::npos)
           {
           // Compare the variant to the configuration.
-          std::string variant =
+          cmStdString variant =
             attribute.substr(beginVariant+9, endVariant-beginVariant-9);
           if (variant == configName)
             {
@@ -2975,7 +2974,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
           mf->FindSourceGroup(source.c_str(), sourceGroups);
         cmXCodeObject* pbxgroup =
           this->CreateOrGetPBXGroup(cmtarget, sourceGroup);
-        std::string key = GetGroupMapKey(cmtarget, sf);
+        cmStdString key = GetGroupMapKey(cmtarget, sf);
         this->GroupMap[key] = pbxgroup;
         }
 
@@ -2990,7 +2989,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
           mf->FindSourceGroup(source.c_str(), sourceGroups);
         cmXCodeObject* pbxgroup =
           this->CreateOrGetPBXGroup(cmtarget, sourceGroup);
-        std::string key = GetGroupMapKeyFromPath(cmtarget, source);
+        cmStdString key = GetGroupMapKeyFromPath(cmtarget, source);
         this->GroupMap[key] = pbxgroup;
         }
       }
@@ -2998,7 +2997,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
 }
 
 cmXCodeObject *cmGlobalXCodeGenerator
-::CreatePBXGroup(cmXCodeObject *parent, std::string name)
+::CreatePBXGroup(cmXCodeObject *parent, cmStdString name)
 {
   cmXCodeObject* parentChildren = NULL;
   if(parent)
@@ -3022,8 +3021,8 @@ cmXCodeObject *cmGlobalXCodeGenerator
 cmXCodeObject* cmGlobalXCodeGenerator
 ::CreateOrGetPBXGroup(cmTarget& cmtarget, cmSourceGroup* sg)
 {
-  std::string s;
-  std::string target;
+  cmStdString s;
+  cmStdString target;
   const char *targetFolder= cmtarget.GetProperty("FOLDER");
   if(targetFolder) {
     target = targetFolder;
@@ -3032,7 +3031,7 @@ cmXCodeObject* cmGlobalXCodeGenerator
   target += cmtarget.GetName();
   s = target + "/";
   s += sg->GetFullName();
-  std::map<std::string, cmXCodeObject* >::iterator it =
+  std::map<cmStdString, cmXCodeObject* >::iterator it =
     this->GroupNameMap.find(s);
   if(it != this->GroupNameMap.end())
     {
@@ -3049,7 +3048,7 @@ cmXCodeObject* cmGlobalXCodeGenerator
     {
     std::vector<std::string> tgt_folders =
       cmSystemTools::tokenize(target, "/");
-    std::string curr_tgt_folder;
+    cmStdString curr_tgt_folder;
     for(std::vector<std::string>::size_type i = 0; i < tgt_folders.size();i++)
       {
       if (i != 0)
@@ -3076,7 +3075,7 @@ cmXCodeObject* cmGlobalXCodeGenerator
   // If it's the default source group (empty name) then put the source file
   // directly in the tgroup...
   //
-  if (std::string(sg->GetFullName()) == "")
+  if (cmStdString(sg->GetFullName()) == "")
     {
     this->GroupNameMap[s] = tgroup;
     return tgroup;
@@ -3087,12 +3086,12 @@ cmXCodeObject* cmGlobalXCodeGenerator
     {
     std::vector<std::string> folders =
       cmSystemTools::tokenize(sg->GetFullName(), "\\");
-    std::string curr_folder = target;
+    cmStdString curr_folder = target;
     curr_folder += "/";
     for(std::vector<std::string>::size_type i = 0; i < folders.size();i++)
       {
       curr_folder += folders[i];
-      std::map<std::string, cmXCodeObject* >::iterator i_folder =
+      std::map<cmStdString, cmXCodeObject* >::iterator i_folder =
         this->GroupNameMap.find(curr_folder);
       //Create new folder
       if(i_folder == this->GroupNameMap.end())
@@ -3472,14 +3471,14 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
   makefileStream
     << "# For each target create a dummy rule "
     "so the target does not have to exist\n";
-  std::set<std::string> emitted;
+  std::set<cmStdString> emitted;
   for(std::vector<cmXCodeObject*>::iterator i = targets.begin();
       i != targets.end(); ++i)
     {
     cmXCodeObject* target = *i;
-    std::map<std::string, cmXCodeObject::StringVec> const& deplibs =
+    std::map<cmStdString, cmXCodeObject::StringVec> const& deplibs =
       target->GetDependLibraries();
-    for(std::map<std::string, cmXCodeObject::StringVec>::const_iterator ci
+    for(std::map<cmStdString, cmXCodeObject::StringVec>::const_iterator ci
           = deplibs.begin(); ci != deplibs.end(); ++ci)
       {
       for(cmXCodeObject::StringVec::const_iterator d = ci->second.begin();
@@ -3535,12 +3534,12 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
         std::string trel = this->ConvertToRelativeForMake(tfull.c_str());
 
         // Add this target to the post-build phases of its dependencies.
-        std::map<std::string, cmXCodeObject::StringVec>::const_iterator
+        std::map<cmStdString, cmXCodeObject::StringVec>::const_iterator
           y = target->GetDependTargets().find(*ct);
         if(y != target->GetDependTargets().end())
           {
-          std::vector<std::string> const& deptgts = y->second;
-          for(std::vector<std::string>::const_iterator d = deptgts.begin();
+          std::vector<cmStdString> const& deptgts = y->second;
+          for(std::vector<cmStdString>::const_iterator d = deptgts.begin();
               d != deptgts.end(); ++d)
             {
             makefileStream << this->PostBuildMakeTarget(*d, *ct) << ": "
@@ -3552,12 +3551,12 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
         makefileStream << trel << ":";
 
         // List dependencies if any exist.
-        std::map<std::string, cmXCodeObject::StringVec>::const_iterator
+        std::map<cmStdString, cmXCodeObject::StringVec>::const_iterator
           x = target->GetDependLibraries().find(*ct);
         if(x != target->GetDependLibraries().end())
           {
-          std::vector<std::string> const& deplibs = x->second;
-          for(std::vector<std::string>::const_iterator d = deplibs.begin();
+          std::vector<cmStdString> const& deplibs = x->second;
+          for(std::vector<cmStdString>::const_iterator d = deplibs.begin();
               d != deplibs.end(); ++d)
             {
             makefileStream << "\\\n\t" <<
@@ -3783,7 +3782,7 @@ std::string cmGlobalXCodeGenerator::XCodeEscapePath(const char* p)
 void
 cmGlobalXCodeGenerator
 ::AppendDirectoryForConfig(const char* prefix,
-                           const std::string& config,
+                           const char* config,
                            const char* suffix,
                            std::string& dir)
 {
@@ -3965,7 +3964,7 @@ cmGlobalXCodeGenerator
   // names since Xcode names them uniquely automatically with a numeric suffix
   // to avoid exact duplicate file names. Note that Mac file names are not
   // typically case sensitive, hence the LowerCase.
-  std::map<std::string, int> counts;
+  std::map<cmStdString, int> counts;
   std::vector<cmSourceFile*> objectSources;
   gt->GetObjectSources(objectSources);
   for(std::vector<cmSourceFile*>::const_iterator
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index ab02049..c9d20c2 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -73,7 +73,7 @@ public:
 
   /** Append the subdirectory for the given configuration.  */
   virtual void AppendDirectoryForConfig(const char* prefix,
-                                        const std::string& config,
+                                        const char* config,
                                         const char* suffix,
                                         std::string& dir);
 
@@ -95,7 +95,7 @@ private:
   cmXCodeObject* CreateOrGetPBXGroup(cmTarget& cmtarget,
                                      cmSourceGroup* sg);
   cmXCodeObject* CreatePBXGroup(cmXCodeObject *parent,
-                                std::string name);
+                                cmStdString name);
   void CreateGroups(cmLocalGenerator* root,
                     std::vector<cmLocalGenerator*>&
                     generators);
@@ -124,7 +124,7 @@ private:
                                  cmTarget& target,
                                  std::vector<cmCustomCommand> const & commands,
                                  const char* configName,
-                                 const std::map<std::string, std::string>&
+                                 const std::map<cmStdString, cmStdString>&
                                      multipleOutputPairs
                                 );
 
@@ -211,7 +211,7 @@ protected:
 
   unsigned int XcodeVersion;
   std::string VersionString;
-  std::set<std::string> XCodeObjectIDs;
+  std::set<cmStdString> XCodeObjectIDs;
   std::vector<cmXCodeObject*> XCodeObjects;
   cmXCodeObject* RootObject;
 private:
@@ -235,14 +235,14 @@ private:
   std::string CurrentReRunCMakeMakefile;
   std::string CurrentXCodeHackMakefile;
   std::string CurrentProject;
-  std::set<std::string> TargetDoneSet;
+  std::set<cmStdString> TargetDoneSet;
   std::vector<std::string> CurrentOutputDirectoryComponents;
   std::vector<std::string> ProjectSourceDirectoryComponents;
   std::vector<std::string> ProjectOutputDirectoryComponents;
-  std::map<std::string, cmXCodeObject* > GroupMap;
-  std::map<std::string, cmXCodeObject* > GroupNameMap;
-  std::map<std::string, cmXCodeObject* > TargetGroup;
-  std::map<std::string, cmXCodeObject* > FileRefs;
+  std::map<cmStdString, cmXCodeObject* > GroupMap;
+  std::map<cmStdString, cmXCodeObject* > GroupNameMap;
+  std::map<cmStdString, cmXCodeObject* > TargetGroup;
+  std::map<cmStdString, cmXCodeObject* > FileRefs;
   std::vector<std::string> Architectures;
   std::string PlatformToolset;
 };
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index 7623003..db964a9 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -121,7 +121,7 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
   __set_bool_if_set(this->GeneratePerTarget, "GRAPHVIZ_GENERATE_PER_TARGET");
   __set_bool_if_set(this->GenerateDependers, "GRAPHVIZ_GENERATE_DEPENDERS");
 
-  std::string ignoreTargetsRegexes;
+  cmStdString ignoreTargetsRegexes;
   __set_if_set(ignoreTargetsRegexes, "GRAPHVIZ_IGNORE_TARGETS");
 
   this->TargetsToIgnoreRegex.clear();
@@ -135,7 +135,7 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
         itvIt != ignoreTargetsRegExVector.end();
         ++ itvIt )
       {
-      std::string currentRegexString(*itvIt);
+      cmStdString currentRegexString(*itvIt);
       cmsys::RegularExpression currentRegex;
       if (!currentRegex.compile(currentRegexString.c_str()))
         {
@@ -160,7 +160,7 @@ void cmGraphVizWriter::WriteTargetDependersFiles(const char* fileName)
 
   this->CollectTargetsAndLibs();
 
-  for(std::map<std::string, const cmTarget*>::const_iterator ptrIt =
+  for(std::map<cmStdString, const cmTarget*>::const_iterator ptrIt =
                                                       this->TargetPtrs.begin();
       ptrIt != this->TargetPtrs.end();
       ++ptrIt)
@@ -211,7 +211,7 @@ void cmGraphVizWriter::WritePerTargetFiles(const char* fileName)
 
   this->CollectTargetsAndLibs();
 
-  for(std::map<std::string, const cmTarget*>::const_iterator ptrIt =
+  for(std::map<cmStdString, const cmTarget*>::const_iterator ptrIt =
                                                       this->TargetPtrs.begin();
       ptrIt != this->TargetPtrs.end();
       ++ptrIt)
@@ -265,7 +265,7 @@ void cmGraphVizWriter::WriteGlobalFile(const char* fileName)
   std::set<std::string> insertedConnections;
   std::set<std::string> insertedNodes;
 
-  for(std::map<std::string, const cmTarget*>::const_iterator ptrIt =
+  for(std::map<cmStdString, const cmTarget*>::const_iterator ptrIt =
                                                       this->TargetPtrs.begin();
       ptrIt != this->TargetPtrs.end();
       ++ptrIt)
@@ -305,7 +305,7 @@ void cmGraphVizWriter::WriteConnections(const char* targetName,
                                     std::set<std::string>& insertedConnections,
                                     cmGeneratedFileStream& str) const
 {
-  std::map<std::string, const cmTarget* >::const_iterator targetPtrIt =
+  std::map<cmStdString, const cmTarget* >::const_iterator targetPtrIt =
                                              this->TargetPtrs.find(targetName);
 
   if (targetPtrIt == this->TargetPtrs.end())  // not found at all
@@ -331,7 +331,7 @@ void cmGraphVizWriter::WriteConnections(const char* targetName,
        ++ llit )
     {
     const char* libName = llit->first.c_str();
-    std::map<std::string, std::string>::const_iterator libNameIt =
+    std::map<cmStdString, cmStdString>::const_iterator libNameIt =
                                           this->TargetNamesNodes.find(libName);
 
     // can happen e.g. if GRAPHVIZ_TARGET_IGNORE_REGEX is used
@@ -364,7 +364,7 @@ void cmGraphVizWriter::WriteDependerConnections(const char* targetName,
                                     std::set<std::string>& insertedConnections,
                                     cmGeneratedFileStream& str) const
 {
-  std::map<std::string, const cmTarget* >::const_iterator targetPtrIt =
+  std::map<cmStdString, const cmTarget* >::const_iterator targetPtrIt =
                                              this->TargetPtrs.find(targetName);
 
   if (targetPtrIt == this->TargetPtrs.end())  // not found at all
@@ -383,7 +383,7 @@ void cmGraphVizWriter::WriteDependerConnections(const char* targetName,
   std::string myNodeName = this->TargetNamesNodes.find(targetName)->second;
 
   // now search who links against me
-  for(std::map<std::string, const cmTarget*>::const_iterator dependerIt =
+  for(std::map<cmStdString, const cmTarget*>::const_iterator dependerIt =
                                                       this->TargetPtrs.begin();
       dependerIt != this->TargetPtrs.end();
       ++dependerIt)
@@ -411,7 +411,7 @@ void cmGraphVizWriter::WriteDependerConnections(const char* targetName,
       if (libName == targetName)
         {
         // So this target links against targetName.
-        std::map<std::string, std::string>::const_iterator dependerNodeNameIt =
+        std::map<cmStdString, cmStdString>::const_iterator dependerNodeNameIt =
                                 this->TargetNamesNodes.find(dependerIt->first);
 
         if(dependerNodeNameIt != this->TargetNamesNodes.end())
@@ -452,7 +452,7 @@ void cmGraphVizWriter::WriteNode(const char* targetName,
   if (insertedNodes.find(targetName) == insertedNodes.end())
   {
     insertedNodes.insert(targetName);
-    std::map<std::string, std::string>::const_iterator nameIt =
+    std::map<cmStdString, cmStdString>::const_iterator nameIt =
                                        this->TargetNamesNodes.find(targetName);
 
     str << "    \"" << nameIt->second.c_str() << "\" [ label=\""
@@ -540,7 +540,7 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt)
           continue;
           }
 
-        std::map<std::string, const cmTarget*>::const_iterator tarIt =
+        std::map<cmStdString, const cmTarget*>::const_iterator tarIt =
                                                 this->TargetPtrs.find(libName);
         if ( tarIt == this->TargetPtrs.end() )
           {
diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h
index 405914c..17b97f8 100644
--- a/Source/cmGraphVizWriter.h
+++ b/Source/cmGraphVizWriter.h
@@ -64,10 +64,10 @@ protected:
 
   bool GenerateForTargetType(cmTarget::TargetType targetType) const;
 
-  std::string GraphType;
-  std::string GraphName;
-  std::string GraphHeader;
-  std::string GraphNodePrefix;
+  cmStdString GraphType;
+  cmStdString GraphName;
+  cmStdString GraphHeader;
+  cmStdString GraphNodePrefix;
 
   bool GenerateForExecutables;
   bool GenerateForStaticLibs;
@@ -81,9 +81,9 @@ protected:
 
   const std::vector<cmLocalGenerator*>& LocalGenerators;
 
-  std::map<std::string, const cmTarget*> TargetPtrs;
+  std::map<cmStdString, const cmTarget*> TargetPtrs;
   // maps from the actual target names to node names in dot:
-  std::map<std::string, std::string> TargetNamesNodes;
+  std::map<cmStdString, cmStdString> TargetNamesNodes;
 
   bool HaveTargetsAndLibs;
 };
diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx
index e03223f..34a9c7c 100644
--- a/Source/cmIDEOptions.cxx
+++ b/Source/cmIDEOptions.cxx
@@ -108,7 +108,7 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table,
           {
           const char *new_value = flag+1+n;
 
-          std::map<std::string,std::string>::iterator itr;
+          std::map<cmStdString,cmStdString>::iterator itr;
           itr = this->FlagMap.find(entry->IDEName);
           if(itr != this->FlagMap.end())
             {
@@ -186,7 +186,7 @@ void cmIDEOptions::RemoveFlag(const char* flag)
 //----------------------------------------------------------------------------
 const char* cmIDEOptions::GetFlag(const char* flag)
 {
-  std::map<std::string, std::string>::iterator i = this->FlagMap.find(flag);
+  std::map<cmStdString, cmStdString>::iterator i = this->FlagMap.find(flag);
   if(i != this->FlagMap.end())
     {
     return i->second.c_str();
diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h
index 691893f..e78af3e 100644
--- a/Source/cmIDEOptions.h
+++ b/Source/cmIDEOptions.h
@@ -40,13 +40,13 @@ protected:
   // Then parse the command line flags specified in CMAKE_CXX_FLAGS
   // and CMAKE_C_FLAGS
   // and overwrite or add new values to this map
-  std::map<std::string, std::string> FlagMap;
+  std::map<cmStdString, cmStdString> FlagMap;
 
   // Preprocessor definitions.
   std::vector<std::string> Defines;
 
   // Unrecognized flags that get no special handling.
-  std::string FlagString;
+  cmStdString FlagString;
 
   bool DoingDefine;
   bool AllowDefine;
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index df5508e..e20fe02 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -38,7 +38,7 @@ bool cmIncludeDirectoryCommand
 
   std::vector<std::string> beforeIncludes;
   std::vector<std::string> afterIncludes;
-  std::set<std::string> systemIncludes;
+  std::set<cmStdString> systemIncludes;
 
   for(; i != args.end(); ++i)
     {
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 1e4bdea..6f2dd65 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -95,7 +95,7 @@ bool cmInstallCommand::InitialPass(std::vector<std::string> const& args,
     }
 
   // Unknown mode.
-  std::string e = "called with unknown mode ";
+  cmStdString e = "called with unknown mode ";
   e += args[0];
   this->SetError(e.c_str());
   return false;
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index d2737a1..1287ea6 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -142,7 +142,7 @@ void cmInstallExportGenerator::GenerateScript(std::ostream& os)
   this->EFGen->SetExportOld(this->ExportOld);
   if(this->ConfigurationTypes->empty())
     {
-    if(!this->ConfigurationName.empty())
+    if(this->ConfigurationName && *this->ConfigurationName)
       {
       this->EFGen->AddConfiguration(this->ConfigurationName);
       }
@@ -177,7 +177,7 @@ cmInstallExportGenerator::GenerateScriptConfigs(std::ostream& os,
   // Now create a configuration-specific install rule for the import
   // file of each configuration.
   std::vector<std::string> files;
-  for(std::map<std::string, std::string>::const_iterator
+  for(std::map<cmStdString, cmStdString>::const_iterator
         i = this->EFGen->GetConfigImportFiles().begin();
       i != this->EFGen->GetConfigImportFiles().end(); ++i)
     {
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx
index 0fad9d6..d105a0c 100644
--- a/Source/cmInstallGenerator.cxx
+++ b/Source/cmInstallGenerator.cxx
@@ -163,7 +163,7 @@ void cmInstallGenerator::GenerateScript(std::ostream& os)
 }
 
 //----------------------------------------------------------------------------
-bool cmInstallGenerator::InstallsForConfig(const std::string& config)
+bool cmInstallGenerator::InstallsForConfig(const char* config)
 {
   return this->GeneratesForConfig(config);
 }
diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h
index c72e9e9..c89ab8a 100644
--- a/Source/cmInstallGenerator.h
+++ b/Source/cmInstallGenerator.h
@@ -48,7 +48,7 @@ public:
   std::string GetInstallDestination() const;
 
   /** Test if this generator installs something for a given configuration.  */
-  bool InstallsForConfig(const std::string& config);
+  bool InstallsForConfig(const char*);
 
 protected:
   virtual void GenerateScript(std::ostream& os);
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index ec2b518..7a39f45 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -59,8 +59,8 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os)
 
 //----------------------------------------------------------------------------
 void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
-                                                    const std::string& config,
-                                                    Indent const& indent)
+                                                       const char* config,
+                                                       Indent const& indent)
 {
   // Compute the build tree directory from which to copy the target.
   std::string fromDirConfig;
@@ -319,7 +319,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
 
 //----------------------------------------------------------------------------
 std::string
-cmInstallTargetGenerator::GetInstallFilename(const std::string& config) const
+cmInstallTargetGenerator::GetInstallFilename(const char* config) const
 {
   NameType nameType = this->ImportLibrary? NameImplib : NameNormal;
   return
@@ -330,7 +330,7 @@ cmInstallTargetGenerator::GetInstallFilename(const std::string& config) const
 //----------------------------------------------------------------------------
 std::string
 cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target,
-                                             const std::string& config,
+                                             const char* config,
                                              NameType nameType)
 {
   std::string fname;
@@ -405,7 +405,7 @@ cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target,
 //----------------------------------------------------------------------------
 void
 cmInstallTargetGenerator
-::AddTweak(std::ostream& os, Indent const& indent, const std::string& config,
+::AddTweak(std::ostream& os, Indent const& indent, const char* config,
            std::string const& file, TweakMethod tweak)
 {
   cmOStringStream tw;
@@ -423,7 +423,7 @@ cmInstallTargetGenerator
 //----------------------------------------------------------------------------
 void
 cmInstallTargetGenerator
-::AddTweak(std::ostream& os, Indent const& indent, const std::string& config,
+::AddTweak(std::ostream& os, Indent const& indent, const char* config,
            std::vector<std::string> const& files, TweakMethod tweak)
 {
   if(files.size() == 1)
@@ -470,7 +470,7 @@ std::string cmInstallTargetGenerator::GetDestDirPath(std::string const& file)
 //----------------------------------------------------------------------------
 void cmInstallTargetGenerator::PreReplacementTweaks(std::ostream& os,
                                                     Indent const& indent,
-                                                    const std::string& config,
+                                                    const char* config,
                                                     std::string const& file)
 {
   this->AddRPathCheckRule(os, indent, config, file);
@@ -478,9 +478,9 @@ void cmInstallTargetGenerator::PreReplacementTweaks(std::ostream& os,
 
 //----------------------------------------------------------------------------
 void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os,
-                                                    Indent const& indent,
-                                                    const std::string& config,
-                                                    std::string const& file)
+                                                     Indent const& indent,
+                                                     const char* config,
+                                                     std::string const& file)
 {
   this->AddInstallNamePatchRule(os, indent, config, file);
   this->AddChrpathPatchRule(os, indent, config, file);
@@ -492,8 +492,7 @@ void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os,
 void
 cmInstallTargetGenerator
 ::AddInstallNamePatchRule(std::ostream& os, Indent const& indent,
-                          const std::string& config,
-                          std::string const& toDestDirPath)
+                          const char* config, std::string const& toDestDirPath)
 {
   if(this->ImportLibrary ||
      !(this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
@@ -514,7 +513,7 @@ cmInstallTargetGenerator
 
   // Build a map of build-tree install_name to install-tree install_name for
   // shared libraries linked to this target.
-  std::map<std::string, std::string> install_name_remap;
+  std::map<cmStdString, cmStdString> install_name_remap;
   if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config))
     {
     std::set<cmTarget const*> const& sharedLibs
@@ -591,7 +590,7 @@ cmInstallTargetGenerator
       {
       os << "\n" << indent << "  -id \"" << new_id << "\"";
       }
-    for(std::map<std::string, std::string>::const_iterator
+    for(std::map<cmStdString, cmStdString>::const_iterator
           i = install_name_remap.begin();
         i != install_name_remap.end(); ++i)
       {
@@ -606,8 +605,7 @@ cmInstallTargetGenerator
 void
 cmInstallTargetGenerator
 ::AddRPathCheckRule(std::ostream& os, Indent const& indent,
-                    const std::string& config,
-                    std::string const& toDestDirPath)
+                    const char* config, std::string const& toDestDirPath)
 {
   // Skip the chrpath if the target does not need it.
   if(this->ImportLibrary || !this->Target->IsChrpathUsed(config))
@@ -644,8 +642,7 @@ cmInstallTargetGenerator
 void
 cmInstallTargetGenerator
 ::AddChrpathPatchRule(std::ostream& os, Indent const& indent,
-                      const std::string& config,
-                      std::string const& toDestDirPath)
+                      const char* config, std::string const& toDestDirPath)
 {
   // Skip the chrpath if the target does not need it.
   if(this->ImportLibrary || !this->Target->IsChrpathUsed(config))
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h
index 0f21da7..18c3957 100644
--- a/Source/cmInstallTargetGenerator.h
+++ b/Source/cmInstallTargetGenerator.h
@@ -43,7 +43,7 @@ public:
   void SetNamelinkMode(NamelinkModeType mode) { this->NamelinkMode = mode; }
   NamelinkModeType GetNamelinkMode() const { return this->NamelinkMode; }
 
-  std::string GetInstallFilename(const std::string& config) const;
+  std::string GetInstallFilename(const char* config) const;
 
   enum NameType
   {
@@ -54,7 +54,7 @@ public:
   };
 
   static std::string GetInstallFilename(cmTarget const* target,
-                                        const std::string& config,
+                                        const char* config,
                                         NameType nameType = NameNormal);
 
   cmTarget* GetTarget() const { return this->Target; }
@@ -63,33 +63,30 @@ public:
 protected:
   virtual void GenerateScript(std::ostream& os);
   virtual void GenerateScriptForConfig(std::ostream& os,
-                                       const std::string& config,
+                                       const char* config,
                                        Indent const& indent);
   typedef void (cmInstallTargetGenerator::*TweakMethod)(
-    std::ostream&, Indent const&, const std::string&, std::string const&
+    std::ostream&, Indent const&, const char*, std::string const&
     );
   void AddTweak(std::ostream& os, Indent const& indent,
-                const std::string& config, std::string const& file,
+                const char* config, std::string const& file,
                 TweakMethod tweak);
   void AddTweak(std::ostream& os, Indent const& indent,
-                const std::string& config,
-                std::vector<std::string> const& files,
+                const char* config, std::vector<std::string> const& files,
                 TweakMethod tweak);
   std::string GetDestDirPath(std::string const& file);
   void PreReplacementTweaks(std::ostream& os, Indent const& indent,
-                            const std::string& config,
-                            std::string const& file);
+                            const char* config, std::string const& file);
   void PostReplacementTweaks(std::ostream& os, Indent const& indent,
-                             const std::string& config,
-                             std::string const& file);
+                             const char* config, std::string const& file);
   void AddInstallNamePatchRule(std::ostream& os, Indent const& indent,
-                               const std::string& config,
+                               const char* config,
                                const std::string& toDestDirPath);
   void AddChrpathPatchRule(std::ostream& os, Indent const& indent,
-                           const std::string& config,
+                           const char* config,
                            std::string const& toDestDirPath);
   void AddRPathCheckRule(std::ostream& os, Indent const& indent,
-                         const std::string& config,
+                         const char* config,
                          std::string const& toDestDirPath);
 
   void AddStripRule(std::ostream& os, Indent const& indent,
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 20e760a..df64695 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -74,9 +74,12 @@ bool cmListCommand
 }
 
 //----------------------------------------------------------------------------
-bool cmListCommand::GetListString(std::string& listString,
-                                  const std::string& var)
+bool cmListCommand::GetListString(std::string& listString, const char* var)
 {
+  if ( !var )
+    {
+    return false;
+    }
   // get the old value
   const char* cacheValue
     = this->Makefile->GetDefinition(var);
@@ -89,8 +92,7 @@ bool cmListCommand::GetListString(std::string& listString,
 }
 
 //----------------------------------------------------------------------------
-bool cmListCommand::GetList(std::vector<std::string>& list,
-                            const std::string& var)
+bool cmListCommand::GetList(std::vector<std::string>& list, const char* var)
 {
   std::string listString;
   if ( !this->GetListString(listString, var) )
diff --git a/Source/cmListCommand.h b/Source/cmListCommand.h
index b79ff0d..0cb5da2 100644
--- a/Source/cmListCommand.h
+++ b/Source/cmListCommand.h
@@ -60,8 +60,8 @@ protected:
   bool HandleReverseCommand(std::vector<std::string> const& args);
 
 
-  bool GetList(std::vector<std::string>& list, const std::string& var);
-  bool GetListString(std::string& listString, const std::string& var);
+  bool GetList(std::vector<std::string>& list, const char* var);
+  bool GetListString(std::string& listString, const char* var);
 };
 
 
diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx
index 806d821..dfd98fa 100644
--- a/Source/cmLoadCacheCommand.cxx
+++ b/Source/cmLoadCacheCommand.cxx
@@ -33,7 +33,7 @@ bool cmLoadCacheCommand
   // and they can not be overridden.
   bool excludeFiles=false;
   unsigned int i;
-  std::set<std::string> excludes;
+  std::set<cmStdString> excludes;
 
   for(i=0; i<args.size(); i++)
     {
@@ -55,7 +55,7 @@ bool cmLoadCacheCommand
   // If this set is empty, no internal cache entries are
   // brought in.
   bool includeFiles=false;
-  std::set<std::string> includes;
+  std::set<cmStdString> includes;
 
   for(i=0; i<args.size(); i++)
     {
diff --git a/Source/cmLoadCacheCommand.h b/Source/cmLoadCacheCommand.h
index ff8625f..c8f7236 100644
--- a/Source/cmLoadCacheCommand.h
+++ b/Source/cmLoadCacheCommand.h
@@ -45,7 +45,7 @@ public:
   cmTypeMacro(cmLoadCacheCommand, cmCommand);
 protected:
 
-  std::set<std::string> VariablesToRead;
+  std::set<cmStdString> VariablesToRead;
   std::string Prefix;
 
   bool ReadWithPrefix(std::vector<std::string> const& args);
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index bfe377c..aca195c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -557,7 +557,7 @@ void cmLocalGenerator::GenerateTargetManifest()
       }
     if(configNames.empty())
       {
-      target.GenerateTargetManifest("");
+      target.GenerateTargetManifest(0);
       }
     else
       {
@@ -617,8 +617,8 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
 
     // Parse the string to get the custom command line.
     cmCustomCommandLine commandLine;
-    std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str());
-    for(std::vector<std::string>::iterator a = cmd.begin();
+    std::vector<cmStdString> cmd = cmSystemTools::ParseArguments(i->c_str());
+    for(std::vector<cmStdString>::iterator a = cmd.begin();
         a != cmd.end(); ++a)
       {
       commandLine.push_back(*a);
@@ -656,7 +656,7 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
 void cmLocalGenerator::AddBuildTargetRule(const char* llang,
                                           cmGeneratorTarget& target)
 {
-  std::string objs;
+  cmStdString objs;
   std::vector<std::string> objVector;
   // Add all the sources outputs to the depends of the target
   std::vector<cmSourceFile*> classes;
@@ -712,8 +712,8 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang,
   vars.LinkFlags = linkFlags.c_str();
 
   std::string langFlags;
-  this->AddLanguageFlags(langFlags, llang, "");
-  this->AddArchitectureFlags(langFlags, &target, llang, "");
+  this->AddLanguageFlags(langFlags, llang, 0);
+  this->AddArchitectureFlags(langFlags, &target, llang, 0);
   vars.LanguageCompileFlags = langFlags.c_str();
 
   cmCustomCommandLines commandLines;
@@ -728,8 +728,8 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang,
     this->ExpandRuleVariables(*i, vars);
     // Parse the string to get the custom command line.
     cmCustomCommandLine commandLine;
-    std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str());
-    for(std::vector<std::string>::iterator a = cmd.begin();
+    std::vector<cmStdString> cmd = cmSystemTools::ParseArguments(i->c_str());
+    for(std::vector<cmStdString>::iterator a = cmd.begin();
         a != cmd.end(); ++a)
       {
       commandLine.push_back(*a);
@@ -758,7 +758,7 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang,
 
 
 void cmLocalGenerator
-::CreateCustomTargetsAndCommands(std::set<std::string> const& lang)
+::CreateCustomTargetsAndCommands(std::set<cmStdString> const& lang)
 {
   cmGeneratorTargetsType tgts = this->Makefile->GetGeneratorTargets();
   for(cmGeneratorTargetsType::iterator l = tgts.begin();
@@ -1194,7 +1194,7 @@ cmLocalGenerator::ExpandRuleVariables(std::string& s,
 
 //----------------------------------------------------------------------------
 const char* cmLocalGenerator::GetRuleLauncher(cmTarget* target,
-                                              const std::string& prop)
+                                              const char* prop)
 {
   if(target)
     {
@@ -1208,7 +1208,7 @@ const char* cmLocalGenerator::GetRuleLauncher(cmTarget* target,
 
 //----------------------------------------------------------------------------
 void cmLocalGenerator::InsertRuleLauncher(std::string& s, cmTarget* target,
-                                          const std::string& prop)
+                                          const char* prop)
 {
   if(const char* val = this->GetRuleLauncher(target, prop))
     {
@@ -1220,17 +1220,17 @@ void cmLocalGenerator::InsertRuleLauncher(std::string& s, cmTarget* target,
 
 //----------------------------------------------------------------------------
 std::string
-cmLocalGenerator::ConvertToOutputForExistingCommon(const std::string& remote,
+cmLocalGenerator::ConvertToOutputForExistingCommon(const char* remote,
                                                    std::string const& result)
 {
   // If this is a windows shell, the result has a space, and the path
   // already exists, we can use a short-path to reference it without a
   // space.
   if(this->WindowsShell && result.find(' ') != result.npos &&
-     cmSystemTools::FileExists(remote.c_str()))
+     cmSystemTools::FileExists(remote))
     {
     std::string tmp;
-    if(cmSystemTools::GetShortPath(remote.c_str(), tmp))
+    if(cmSystemTools::GetShortPath(remote, tmp))
       {
       return this->Convert(tmp.c_str(), NONE, SHELL, true);
       }
@@ -1242,7 +1242,7 @@ cmLocalGenerator::ConvertToOutputForExistingCommon(const std::string& remote,
 
 //----------------------------------------------------------------------------
 std::string
-cmLocalGenerator::ConvertToOutputForExisting(const std::string& remote,
+cmLocalGenerator::ConvertToOutputForExisting(const char* remote,
                                              RelativeRoot local)
 {
   // Perform standard conversion.
@@ -1255,7 +1255,7 @@ cmLocalGenerator::ConvertToOutputForExisting(const std::string& remote,
 //----------------------------------------------------------------------------
 std::string
 cmLocalGenerator::ConvertToOutputForExisting(RelativeRoot remote,
-                                             const std::string& local)
+                                             const char* local)
 {
   // Perform standard conversion.
   std::string result = this->Convert(remote, local, SHELL, true);
@@ -1277,7 +1277,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
                                      const std::vector<std::string> &includes,
                                      cmGeneratorTarget* target,
                                      const char* lang, bool forResponseFile,
-                                     const std::string& config)
+                                     const char *config)
 {
   if(!lang)
     {
@@ -1328,7 +1328,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
     this->Makefile->GetDefinition(fwSearchFlagVar.c_str());
 
   bool flagUsed = false;
-  std::set<std::string> emitted;
+  std::set<cmStdString> emitted;
 #ifdef __APPLE__
   emitted.insert("/System/Library/Frameworks");
 #endif
@@ -1355,7 +1355,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
     if(!flagUsed || repeatFlag)
       {
       if(sysIncludeFlag && target &&
-         target->IsSystemIncludeDirectory(*i, config))
+         target->IsSystemIncludeDirectory(i->c_str(), config))
         {
         includeFlags << sysIncludeFlag;
         }
@@ -1398,7 +1398,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
 //----------------------------------------------------------------------------
 void cmLocalGenerator::AddCompileDefinitions(std::set<std::string>& defines,
                                              cmTarget const* target,
-                                             const std::string& config)
+                                             const char* config)
 {
   std::vector<std::string> targetDefines;
   target->GetCompileDefinitions(targetDefines,
@@ -1409,7 +1409,7 @@ void cmLocalGenerator::AddCompileDefinitions(std::set<std::string>& defines,
 //----------------------------------------------------------------------------
 void cmLocalGenerator::AddCompileOptions(
   std::string& flags, cmTarget* target,
-  const char* lang, const std::string& config
+  const char* lang, const char* config
   )
 {
   std::string langFlagRegexVar = std::string("CMAKE_")+lang+"_FLAG_REGEX";
@@ -1458,7 +1458,7 @@ void cmLocalGenerator::AddCompileOptions(
 void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
                                              cmGeneratorTarget* target,
                                              const char* lang,
-                                             const std::string& config,
+                                             const char *config,
                                              bool stripImplicitInclDirs
                                             )
 {
@@ -1481,7 +1481,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
     }
 
   // Do not repeat an include path.
-  std::set<std::string> emitted;
+  std::set<cmStdString> emitted;
 
   // Store the automatic include paths.
   if(includeBinaryDir)
@@ -1691,7 +1691,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
            target->Target->GetName());
         return;
         }
-      this->AddLanguageFlags(flags, linkLanguage, buildType);
+      this->AddLanguageFlags(flags, linkLanguage, buildType.c_str());
       this->OutputLinkLibraries(linkLibs, frameworkPath, linkPath,
                                 *target, false);
       if(cmSystemTools::IsOn
@@ -1932,7 +1932,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
 void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
                                             cmGeneratorTarget* target,
                                             const char *lang,
-                                            const std::string& config)
+                                            const char* config)
 {
   // Only add Mac OS X specific flags on Darwin platforms (OSX and iphone):
   if(!this->Makefile->IsOn("APPLE"))
@@ -1989,7 +1989,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
 //----------------------------------------------------------------------------
 void cmLocalGenerator::AddLanguageFlags(std::string& flags,
                                         const char* lang,
-                                        const std::string& config)
+                                        const char* config)
 {
   // Add language-specific flags.
   std::string flagsVar = "CMAKE_";
@@ -1999,8 +1999,8 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
 }
 
 //----------------------------------------------------------------------------
-bool cmLocalGenerator::GetRealDependency(const std::string& inName,
-                                         const std::string& config,
+bool cmLocalGenerator::GetRealDependency(const char* inName,
+                                         const char* config,
                                          std::string& dep)
 {
   // Older CMake code may specify the dependency using the target
@@ -2027,7 +2027,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
     {
     // make sure it is not just a coincidence that the target name
     // found is part of the inName
-    if(cmSystemTools::FileIsFullPath(inName.c_str()))
+    if(cmSystemTools::FileIsFullPath(inName))
       {
       std::string tLocation;
       if(target->GetType() >= cmTarget::EXECUTABLE &&
@@ -2075,7 +2075,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
     }
 
   // The name was not that of a CMake target.  It must name a file.
-  if(cmSystemTools::FileIsFullPath(inName.c_str()))
+  if(cmSystemTools::FileIsFullPath(inName))
     {
     // This is a full path.  Return it as given.
     dep = inName;
@@ -2197,7 +2197,7 @@ void cmLocalGenerator
 //----------------------------------------------------------------------------
 void cmLocalGenerator::AddCMP0018Flags(std::string &flags, cmTarget* target,
                                        std::string const& lang,
-                                       const std::string& config)
+                                       const char *config)
 {
   int targetType = target->GetType();
 
@@ -2312,14 +2312,14 @@ void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags,
 
 //----------------------------------------------------------------------------
 void cmLocalGenerator::AddConfigVariableFlags(std::string& flags,
-                                              const std::string& var,
-                                              const std::string& config)
+                                              const char* var,
+                                              const char* config)
 {
   // Add the flags from the variable itself.
   std::string flagsVar = var;
   this->AppendFlags(flags, this->Makefile->GetDefinition(flagsVar.c_str()));
   // Add the flags from the build-type specific variable.
-  if(!config.empty())
+  if(config && *config)
     {
     flagsVar += "_";
     flagsVar += cmSystemTools::UpperCase(config);
@@ -2344,7 +2344,7 @@ void cmLocalGenerator::AppendFlags(std::string& flags,
 
 //----------------------------------------------------------------------------
 void cmLocalGenerator::AppendFlagEscape(std::string& flags,
-                                        const std::string& rawFlag)
+                                        const char* rawFlag)
 {
   this->AppendFlags(flags, this->EscapeForShell(rawFlag).c_str());
 }
@@ -2499,8 +2499,7 @@ cmLocalGenerator::ConstructComment(const cmCustomCommand& cc,
 
 //----------------------------------------------------------------------------
 std::string
-cmLocalGenerator::ConvertToOptionallyRelativeOutputPath(
-                                                    const std::string& remote)
+cmLocalGenerator::ConvertToOptionallyRelativeOutputPath(const char* remote)
 {
   return this->Convert(remote, START_OUTPUT, SHELL, true);
 }
@@ -2520,7 +2519,7 @@ const char* cmLocalGenerator::GetRelativeRootPath(RelativeRoot relroot)
 }
 
 //----------------------------------------------------------------------------
-std::string cmLocalGenerator::Convert(const std::string& source,
+std::string cmLocalGenerator::Convert(const char* source,
                                       RelativeRoot relative,
                                       OutputFormat output,
                                       bool optional)
@@ -2572,7 +2571,7 @@ std::string cmLocalGenerator::Convert(const std::string& source,
 }
 
 //----------------------------------------------------------------------------
-std::string cmLocalGenerator::ConvertToOutputFormat(const std::string& source,
+std::string cmLocalGenerator::ConvertToOutputFormat(const char* source,
                                                     OutputFormat output)
 {
   std::string result = source;
@@ -2614,7 +2613,7 @@ std::string cmLocalGenerator::ConvertToOutputFormat(const std::string& source,
 
 //----------------------------------------------------------------------------
 std::string cmLocalGenerator::Convert(RelativeRoot remote,
-                                      const std::string& local,
+                                      const char* local,
                                       OutputFormat output,
                                       bool optional)
 {
@@ -2623,10 +2622,10 @@ std::string cmLocalGenerator::Convert(RelativeRoot remote,
   // The relative root must have a path (i.e. not FULL or NONE)
   assert(remotePath != 0);
 
-  if(!local.empty() && (!optional || this->UseRelativePaths))
+  if(local && (!optional || this->UseRelativePaths))
     {
     std::vector<std::string> components;
-    cmSystemTools::SplitPath(local.c_str(), components);
+    cmSystemTools::SplitPath(local, components);
     std::string result = this->ConvertToRelativePath(components, remotePath);
     return this->ConvertToOutputFormat(result.c_str(), output);
     }
@@ -2709,8 +2708,7 @@ static bool cmLocalGeneratorNotAbove(const char* a, const char* b)
 //----------------------------------------------------------------------------
 std::string
 cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
-                                        const std::string& in_remote,
-                                        bool force)
+                                        const char* in_remote, bool force)
 {
   // The path should never be quoted.
   assert(in_remote[0] != '\"');
@@ -2719,7 +2717,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
   assert(local.size() > 0 && !(local[local.size()-1] == ""));
 
   // If the path is already relative then just return the path.
-  if(!cmSystemTools::FileIsFullPath(in_remote.c_str()))
+  if(!cmSystemTools::FileIsFullPath(in_remote))
     {
     return in_remote;
     }
@@ -2738,11 +2736,11 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
     std::string local_path = cmSystemTools::JoinPath(local);
     if(!((cmLocalGeneratorNotAbove(local_path.c_str(),
                                    this->RelativePathTopBinary.c_str()) &&
-          cmLocalGeneratorNotAbove(in_remote.c_str(),
+          cmLocalGeneratorNotAbove(in_remote,
                                    this->RelativePathTopBinary.c_str())) ||
          (cmLocalGeneratorNotAbove(local_path.c_str(),
                                    this->RelativePathTopSource.c_str()) &&
-          cmLocalGeneratorNotAbove(in_remote.c_str(),
+          cmLocalGeneratorNotAbove(in_remote,
                                    this->RelativePathTopSource.c_str()))))
       {
       return in_remote;
@@ -2752,7 +2750,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
   // Identify the longest shared path component between the remote
   // path and the local path.
   std::vector<std::string> remote;
-  cmSystemTools::SplitPath(in_remote.c_str(), remote);
+  cmSystemTools::SplitPath(in_remote, remote);
   unsigned int common=0;
   while(common < remote.size() &&
         common < local.size() &&
@@ -2970,11 +2968,11 @@ bool cmLocalGeneratorCheckObjectName(std::string& objName,
 //----------------------------------------------------------------------------
 std::string&
 cmLocalGenerator
-::CreateSafeUniqueObjectFileName(const std::string& sin,
+::CreateSafeUniqueObjectFileName(const char* sin,
                                  std::string const& dir_max)
 {
   // Look for an existing mapped name for this object file.
-  std::map<std::string,std::string>::iterator it =
+  std::map<cmStdString,cmStdString>::iterator it =
     this->UniqueObjectNamesMap.find(sin);
 
   // If no entry exists create one.
@@ -3057,7 +3055,7 @@ cmLocalGenerator
 #endif
 
     // Insert the newly mapped object file name.
-    std::map<std::string, std::string>::value_type e(sin, ssin);
+    std::map<cmStdString, cmStdString>::value_type e(sin, ssin);
     it = this->UniqueObjectNamesMap.insert(e).first;
     }
 
@@ -3172,7 +3170,7 @@ cmLocalGenerator
 }
 
 //----------------------------------------------------------------------------
-std::string cmLocalGenerator::EscapeForShellOldStyle(const std::string& str)
+std::string cmLocalGenerator::EscapeForShellOldStyle(const char* str)
 {
   std::string result;
 #if defined(_WIN32) && !defined(__CYGWIN__)
@@ -3188,7 +3186,7 @@ std::string cmLocalGenerator::EscapeForShellOldStyle(const std::string& str)
     }
   return str;
 #else
-  for(const char* ch = str.c_str(); *ch != '\0'; ++ch)
+  for(const char* ch = str; *ch != '\0'; ++ch)
     {
     if(*ch == ' ')
       {
@@ -3201,30 +3199,28 @@ std::string cmLocalGenerator::EscapeForShellOldStyle(const std::string& str)
 }
 
 //----------------------------------------------------------------------------
-static bool cmLocalGeneratorIsShellOperator(const std::string& str)
-{
-  static std::set<std::string> shellOperators;
-  if(shellOperators.empty())
+static bool cmLocalGeneratorIsShellOperator(const char* str)
+{
+  if(strcmp(str, "<") == 0 ||
+     strcmp(str, ">") == 0 ||
+     strcmp(str, "<<") == 0 ||
+     strcmp(str, ">>") == 0 ||
+     strcmp(str, "|") == 0 ||
+     strcmp(str, "||") == 0 ||
+     strcmp(str, "&&") == 0 ||
+     strcmp(str, "&>") == 0 ||
+     strcmp(str, "1>") == 0 ||
+     strcmp(str, "2>") == 0 ||
+     strcmp(str, "2>&1") == 0 ||
+     strcmp(str, "1>&2") == 0)
     {
-    shellOperators.insert("<");
-    shellOperators.insert(">");
-    shellOperators.insert("<<");
-    shellOperators.insert(">>");
-    shellOperators.insert("|");
-    shellOperators.insert("||");
-    shellOperators.insert("&&");
-    shellOperators.insert("&>");
-    shellOperators.insert("1>");
-    shellOperators.insert("2>");
-    shellOperators.insert("2>&1");
-    shellOperators.insert("1>&2");
+    return true;
     }
-  return shellOperators.count(str) > 0;
+  return false;
 }
 
 //----------------------------------------------------------------------------
-std::string cmLocalGenerator::EscapeForShell(const std::string& str,
-                                             bool makeVars,
+std::string cmLocalGenerator::EscapeForShell(const char* str, bool makeVars,
                                              bool forEcho)
 {
   // Do not escape shell operators.
@@ -3266,28 +3262,28 @@ std::string cmLocalGenerator::EscapeForShell(const std::string& str,
 
   // Compute the buffer size needed.
   int size = (this->WindowsShell ?
-              cmsysSystem_Shell_GetArgumentSizeForWindows(str.c_str(), flags) :
-              cmsysSystem_Shell_GetArgumentSizeForUnix(str.c_str(), flags));
+              cmsysSystem_Shell_GetArgumentSizeForWindows(str, flags) :
+              cmsysSystem_Shell_GetArgumentSizeForUnix(str, flags));
 
   // Compute the shell argument itself.
   std::vector<char> arg(size);
   if(this->WindowsShell)
     {
-    cmsysSystem_Shell_GetArgumentForWindows(str.c_str(), &arg[0], flags);
+    cmsysSystem_Shell_GetArgumentForWindows(str, &arg[0], flags);
     }
   else
     {
-    cmsysSystem_Shell_GetArgumentForUnix(str.c_str(), &arg[0], flags);
+    cmsysSystem_Shell_GetArgumentForUnix(str, &arg[0], flags);
     }
   return std::string(&arg[0]);
 }
 
 //----------------------------------------------------------------------------
-std::string cmLocalGenerator::EscapeForCMake(const std::string& str)
+std::string cmLocalGenerator::EscapeForCMake(const char* str)
 {
   // Always double-quote the argument to take care of most escapes.
   std::string result = "\"";
-  for(const char* c = str.c_str(); *c; ++c)
+  for(const char* c = str; *c; ++c)
     {
     if(*c == '"')
       {
@@ -3450,12 +3446,11 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
 }
 
 //----------------------------------------------------------------------------
-static void cmLGInfoProp(cmMakefile* mf, cmTarget* target,
-    const std::string& prop)
+static void cmLGInfoProp(cmMakefile* mf, cmTarget* target, const char* prop)
 {
   if(const char* val = target->GetProperty(prop))
     {
-    mf->AddDefinition(prop.c_str(), val);
+    mf->AddDefinition(prop, val);
     }
 }
 
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 7fb84cd..9764813 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -106,12 +106,11 @@ public:
    */
   enum RelativeRoot { NONE, FULL, HOME, START, HOME_OUTPUT, START_OUTPUT };
   enum OutputFormat { UNCHANGED, MAKEFILE, SHELL, RESPONSE };
-  std::string ConvertToOutputFormat(const std::string& source,
-                                    OutputFormat output);
-  std::string Convert(const std::string& remote, RelativeRoot local,
+  std::string ConvertToOutputFormat(const char* source, OutputFormat output);
+  std::string Convert(const char* remote, RelativeRoot local,
                       OutputFormat output = UNCHANGED,
                       bool optional = false);
-  std::string Convert(RelativeRoot remote, const std::string& local,
+  std::string Convert(RelativeRoot remote, const char* local,
                       OutputFormat output = UNCHANGED,
                       bool optional = false);
 
@@ -126,7 +125,7 @@ public:
    * remote path must use forward slashes and not already be escaped
    * or quoted.
    */
-  std::string ConvertToOptionallyRelativeOutputPath(const std::string& remote);
+  std::string ConvertToOptionallyRelativeOutputPath(const char* remote);
 
   ///! set/get the parent generator
   cmLocalGenerator* GetParent(){return this->Parent;}
@@ -138,25 +137,24 @@ public:
 
 
   void AddArchitectureFlags(std::string& flags, cmGeneratorTarget* target,
-                            const char *lang, const std::string& config);
+                            const char *lang, const char* config);
 
   void AddLanguageFlags(std::string& flags, const char* lang,
-                        const std::string& config);
+                        const char* config);
   void AddCMP0018Flags(std::string &flags, cmTarget* target,
-                       std::string const& lang, const std::string& config);
+                       std::string const& lang, const char *config);
   void AddVisibilityPresetFlags(std::string &flags, cmTarget* target,
                                 const char *lang);
-  void AddConfigVariableFlags(std::string& flags, const std::string& var,
-                              const std::string& config);
+  void AddConfigVariableFlags(std::string& flags, const char* var,
+                              const char* config);
   ///! Append flags to a string.
   virtual void AppendFlags(std::string& flags, const char* newFlags);
-  virtual void AppendFlagEscape(std::string& flags,
-                                const std::string& rawFlag);
+  virtual void AppendFlagEscape(std::string& flags, const char* rawFlag);
   ///! Get the include flags for the current makefile and language
   std::string GetIncludeFlags(const std::vector<std::string> &includes,
                               cmGeneratorTarget* target,
                               const char* lang, bool forResponseFile = false,
-                              const std::string& config = "");
+                              const char *config = 0);
 
   /**
    * Encode a list of preprocessor definitions for the compiler
@@ -195,17 +193,17 @@ public:
    *   the source directory of this generator.  This should only be
    *   used for dependencies of custom commands.
    */
-  bool GetRealDependency(const std::string& name, const std::string& config,
+  bool GetRealDependency(const char* name, const char* config,
                          std::string& dep);
 
   ///! for existing files convert to output path and short path if spaces
-  std::string ConvertToOutputForExisting(const std::string& remote,
+  std::string ConvertToOutputForExisting(const char* remote,
                                          RelativeRoot local = START_OUTPUT);
 
   /** For existing path identified by RelativeRoot convert to output
       path and short path if spaces.  */
   std::string ConvertToOutputForExisting(RelativeRoot remote,
-                                         const std::string& local = "");
+                                         const char* local = 0);
 
   virtual std::string ConvertToIncludeReference(std::string const& path);
 
@@ -222,14 +220,13 @@ public:
   /** Get the include flags for the current makefile and language.  */
   void GetIncludeDirectories(std::vector<std::string>& dirs,
                              cmGeneratorTarget* target,
-                             const char* lang = "C",
-                             const std::string& config = "",
+                             const char* lang = "C", const char *config = 0,
                              bool stripImplicitInclDirs = true);
   void AddCompileOptions(std::string& flags, cmTarget* target,
-                         const char* lang, const std::string& config);
+                         const char* lang, const char* config);
   void AddCompileDefinitions(std::set<std::string>& defines,
                              cmTarget const* target,
-                             const std::string& config);
+                             const char* config);
 
   /** Compute the language used to compile the given source file.  */
   const char* GetSourceFileLanguage(const cmSourceFile& source);
@@ -281,14 +278,14 @@ public:
       system to replace make variable references.  Optionally adjust
       escapes for the special case of passing to the native echo
       command.  */
-  std::string EscapeForShell(const std::string& str, bool makeVars = false,
+  std::string EscapeForShell(const char* str, bool makeVars = false,
                              bool forEcho = false);
 
   /** Backwards-compatibility version of EscapeForShell.  */
-  std::string EscapeForShellOldStyle(const std::string& str);
+  std::string EscapeForShellOldStyle(const char* str);
 
   /** Escape the given string as an argument in a CMake script.  */
-  static std::string EscapeForCMake(const std::string& str);
+  static std::string EscapeForCMake(const char* str);
 
   enum FortranFormat
     {
@@ -306,8 +303,7 @@ public:
    * or quoted.
    */
   std::string ConvertToRelativePath(const std::vector<std::string>& local,
-                                    const std::string& remote,
-                                    bool force=false);
+                                    const char* remote, bool force=false);
 
   /**
    * Get the relative path from the generator output directory to a
@@ -381,9 +377,9 @@ protected:
   std::string ExpandRuleVariable(std::string const& variable,
                                  const RuleVariables& replaceValues);
 
-  const char* GetRuleLauncher(cmTarget* target, const std::string& prop);
+  const char* GetRuleLauncher(cmTarget* target, const char* prop);
   void InsertRuleLauncher(std::string& s, cmTarget* target,
-                          const std::string& prop);
+                          const char* prop);
 
 
   /** Convert a target to a utility target for unsupported
@@ -399,14 +395,14 @@ protected:
   // generator directly.  Any targets containing files that are not
   // of the types listed will be compiled as custom commands and added
   // to a custom target.
-  void CreateCustomTargetsAndCommands(std::set<std::string> const&);
+  void CreateCustomTargetsAndCommands(std::set<cmStdString> const&);
 
   // Handle old-style install rules stored in the targets.
   void GenerateTargetInstallRules(
     std::ostream& os, const char* config,
     std::vector<std::string> const& configurationTypes);
 
-  std::string& CreateSafeUniqueObjectFileName(const std::string& sin,
+  std::string& CreateSafeUniqueObjectFileName(const char* sin,
                                               std::string const& dir_max);
   void ComputeObjectMaxPath();
 
@@ -435,9 +431,9 @@ protected:
   std::vector<std::string> StartOutputDirectoryComponents;
   cmLocalGenerator* Parent;
   std::vector<cmLocalGenerator*> Children;
-  std::map<std::string, std::string> UniqueObjectNamesMap;
+  std::map<cmStdString, cmStdString> UniqueObjectNamesMap;
   std::string::size_type ObjectPathMax;
-  std::set<std::string> ObjectMaxPathViolations;
+  std::set<cmStdString> ObjectMaxPathViolations;
   bool WindowsShell;
   bool WindowsVSIDE;
   bool WatcomWMake;
@@ -467,7 +463,7 @@ protected:
   cmIML_INT_uint64_t BackwardsCompatibility;
   bool BackwardsCompatibilityFinal;
 private:
-  std::string ConvertToOutputForExistingCommon(const std::string& remote,
+  std::string ConvertToOutputForExistingCommon(const char* remote,
                                                std::string const& result);
 
   void AddSharedFlags(std::string& flags, const char* lang, bool shared);
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index 1c20f8c..ea854c6 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -55,8 +55,8 @@ public:
   const cmake* GetCMakeInstance() const;
   cmake* GetCMakeInstance();
 
-  std::string const& GetConfigName() const
-  { return this->ConfigName; }
+  const char* GetConfigName() const
+  { return this->ConfigName.c_str(); }
 
   /// @return whether we are processing the top CMakeLists.txt file.
   bool isRootMakefile() const;
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 2222641..93722d1 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -190,7 +190,7 @@ void cmLocalUnixMakefileGenerator3::AddLocalObjectFile(
 void cmLocalUnixMakefileGenerator3::GetIndividualFileTargets
                                             (std::vector<std::string>& targets)
 {
-  for (std::map<std::string, LocalObjectInfo>::iterator lo =
+  for (std::map<cmStdString, LocalObjectInfo>::iterator lo =
          this->LocalObjectFiles.begin();
        lo != this->LocalObjectFiles.end(); ++lo)
     {
@@ -235,7 +235,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
 
   // only write local targets unless at the top Keep track of targets already
   // listed.
-  std::set<std::string> emittedTargets;
+  std::set<cmStdString> emittedTargets;
   if (this->Parent)
     {
     // write our targets, and while doing it collect up the object
@@ -256,7 +256,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
 
   // now write out the object rules
   // for each object file name
-  for (std::map<std::string, LocalObjectInfo>::iterator lo =
+  for (std::map<cmStdString, LocalObjectInfo>::iterator lo =
          this->LocalObjectFiles.begin();
        lo != this->LocalObjectFiles.end(); ++lo)
     {
@@ -371,7 +371,7 @@ cmLocalUnixMakefileGenerator3
 //----------------------------------------------------------------------------
 void cmLocalUnixMakefileGenerator3
 ::WriteLocalMakefileTargets(std::ostream& ruleFileStream,
-                            std::set<std::string> &emitted)
+                            std::set<cmStdString> &emitted)
 {
   std::vector<std::string> depends;
   std::vector<std::string> commands;
@@ -1196,12 +1196,12 @@ cmLocalUnixMakefileGenerator3
   if(!filename)
     {
     // Get the set of source languages in the target.
-    std::set<std::string> languages;
+    std::set<cmStdString> languages;
     target.GetLanguages(languages);
     fout << "\n"
          << "# Per-language clean rules from dependency scanning.\n"
          << "foreach(lang";
-    for(std::set<std::string>::const_iterator l = languages.begin();
+    for(std::set<cmStdString>::const_iterator l = languages.begin();
         l != languages.end(); ++l)
       {
       fout << " " << *l;
@@ -1317,7 +1317,7 @@ cmLocalUnixMakefileGenerator3
 
   // see if the variable has been defined before and return
   // the modified version of the variable
-  std::map<std::string, std::string>::iterator i =
+  std::map<cmStdString, cmStdString>::iterator i =
     this->MakeVariableMap.find(unmodified);
   if(i != this->MakeVariableMap.end())
     {
@@ -1721,7 +1721,7 @@ void cmLocalUnixMakefileGenerator3
         {
         text = "Running external command ...";
         }
-      std::set<std::string>::const_iterator dit;
+      std::set<cmStdString>::const_iterator dit;
       for ( dit = glIt->second.GetUtilities().begin();
          dit != glIt->second.GetUtilities().end();
         ++ dit )
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 57df11e..703369e 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -210,11 +210,11 @@ public:
   // File pairs for implicit dependency scanning.  The key of the map
   // is the depender and the value is the explicit dependee.
   struct ImplicitDependFileMap:
-    public std::map<std::string, cmDepends::DependencyVector> {};
+    public std::map<cmStdString, cmDepends::DependencyVector> {};
   struct ImplicitDependLanguageMap:
-    public std::map<std::string, ImplicitDependFileMap> {};
+    public std::map<cmStdString, ImplicitDependFileMap> {};
   struct ImplicitDependTargetMap:
-    public std::map<std::string, ImplicitDependLanguageMap> {};
+    public std::map<cmStdString, ImplicitDependLanguageMap> {};
   ImplicitDependLanguageMap const& GetImplicitDepends(cmTarget const& tgt);
 
   void AddImplicitDepends(cmTarget const& tgt, const char* lang,
@@ -230,7 +230,7 @@ public:
                           std::string objNoTargetDir,
                           bool hasSourceExtension);
 
-  std::vector<std::string> const& GetLocalHelp() { return this->LocalHelp; }
+  std::vector<cmStdString> const& GetLocalHelp() { return this->LocalHelp; }
 
   /** Get whether to create rules to generate preprocessed and
       assembly sources.  This could be converted to a variable lookup
@@ -255,7 +255,7 @@ protected:
 
   // write the target rules for the local Makefile into the stream
   void WriteLocalMakefileTargets(std::ostream& ruleFileStream,
-                                 std::set<std::string> &emitted);
+                                 std::set<cmStdString> &emitted);
 
   // this method Writes the Directory information files
   void WriteDirectoryInformationFile();
@@ -369,16 +369,16 @@ private:
     LocalObjectInfo():HasSourceExtension(false), HasPreprocessRule(false),
                       HasAssembleRule(false) {}
   };
-  std::map<std::string, LocalObjectInfo> LocalObjectFiles;
+  std::map<cmStdString, LocalObjectInfo> LocalObjectFiles;
   void WriteObjectConvenienceRule(std::ostream& ruleFileStream,
                                   const char* comment, const char* output,
                                   LocalObjectInfo const& info);
 
-  std::vector<std::string> LocalHelp;
+  std::vector<cmStdString> LocalHelp;
 
   /* does the work for each target */
-  std::map<std::string, std::string> MakeVariableMap;
-  std::map<std::string, std::string> ShortMakeVariableMap;
+  std::map<cmStdString, cmStdString> MakeVariableMap;
+  std::map<cmStdString, cmStdString> ShortMakeVariableMap;
 };
 
 #endif
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index fa091b1..a5e8294 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -38,7 +38,7 @@ class cmLocalVisualStudio6Generator::EventWriter
 {
 public:
   EventWriter(cmLocalVisualStudio6Generator* lg,
-              const std::string& config, std::string& code):
+              const char* config, std::string& code):
     LG(lg), Config(config), Code(code), First(true) {}
   void Start(const char* event)
     {
@@ -72,7 +72,7 @@ public:
     }
 private:
   cmLocalVisualStudio6Generator* LG;
-  std::string Config;
+  const char* Config;
   std::string& Code;
   bool First;
   std::string Event;
@@ -80,7 +80,7 @@ private:
 
 void cmLocalVisualStudio6Generator::AddHelperCommands()
 {
-  std::set<std::string> lang;
+  std::set<cmStdString> lang;
   lang.insert("C");
   lang.insert("CXX");
   this->CreateCustomTargetsAndCommands(lang);
@@ -429,7 +429,7 @@ void cmLocalVisualStudio6Generator
       }
 
     // Add per-source and per-configuration preprocessor definitions.
-    std::map<std::string, std::string> cdmap;
+    std::map<cmStdString, cmStdString> cdmap;
 
       {
       std::set<std::string> targetCompileDefinitions;
@@ -529,7 +529,7 @@ void cmLocalVisualStudio6Generator
             {
             fout << "\n# ADD CPP " << compileFlags << "\n\n";
             }
-          std::map<std::string, std::string>::iterator cdi =
+          std::map<cmStdString, cmStdString>::iterator cdi =
             cdmap.find(cmSystemTools::UpperCase(config));
           if(cdi != cdmap.end() && !cdi->second.empty())
             {
@@ -788,7 +788,7 @@ void cmLocalVisualStudio6Generator::SetBuildType(BuildType b,
 //----------------------------------------------------------------------------
 cmsys::auto_ptr<cmCustomCommand>
 cmLocalVisualStudio6Generator::MaybeCreateOutputDir(cmTarget& target,
-                                                    const std::string& config)
+                                                    const char* config)
 {
   cmsys::auto_ptr<cmCustomCommand> pcc;
 
@@ -816,8 +816,8 @@ cmLocalVisualStudio6Generator::MaybeCreateOutputDir(cmTarget& target,
 // look for custom rules on a target and collect them together
 std::string
 cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target,
-                                                const std::string& configName,
-                                                const char * /* libName */)
+                                                 const char* configName,
+                                                 const char * /* libName */)
 {
   if (target.GetType() >= cmTarget::UTILITY )
     {
@@ -866,7 +866,7 @@ inline std::string removeQuotes(const std::string& s)
 
 std::string
 cmLocalVisualStudio6Generator::GetTargetIncludeOptions(cmTarget &target,
-                                                  const std::string& config)
+                                                       const char *config)
 {
   std::string includeOptions;
 
@@ -1102,7 +1102,7 @@ void cmLocalVisualStudio6Generator
       // Compute the proper name to use to link this library.
       std::string lib;
       std::string libDebug;
-      cmTarget* tgt = this->GlobalGenerator->FindTarget(j->first.c_str());
+      cmTarget* tgt = this->GlobalGenerator->FindTarget(0, j->first.c_str());
       if(tgt)
         {
         lib = cmSystemTools::GetFilenameWithoutExtension
@@ -1707,7 +1707,7 @@ void cmLocalVisualStudio6Generator
       flagsRelWithDebInfo = this->Makefile->GetSafeDefinition(flagVar.c_str());
       flagsRelWithDebInfo += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\" ";
 
-      this->AddCompileOptions(flags, &target, linkLanguage, "");
+      this->AddCompileOptions(flags, &target, linkLanguage, 0);
       this->AddCompileOptions(flagsDebug, &target, linkLanguage, "Debug");
       this->AddCompileOptions(flagsRelease, &target, linkLanguage, "Release");
       this->AddCompileOptions(flagsMinSizeRel, &target, linkLanguage,
@@ -1733,7 +1733,7 @@ void cmLocalVisualStudio6Generator
     std::set<std::string> minsizeDefinesSet;
     std::set<std::string> debugrelDefinesSet;
 
-    this->AddCompileDefinitions(definesSet, &target, "");
+    this->AddCompileDefinitions(definesSet, &target, 0);
     this->AddCompileDefinitions(debugDefinesSet, &target, "DEBUG");
     this->AddCompileDefinitions(releaseDefinesSet, &target, "RELEASE");
     this->AddCompileDefinitions(minsizeDefinesSet, &target, "MINSIZEREL");
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 5536b08..212b06b 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -59,7 +59,7 @@ cmLocalVisualStudio7Generator::~cmLocalVisualStudio7Generator()
 
 void cmLocalVisualStudio7Generator::AddHelperCommands()
 {
-  std::set<std::string> lang;
+  std::set<cmStdString> lang;
   lang.insert("C");
   lang.insert("CXX");
   lang.insert("RC");
@@ -228,7 +228,7 @@ void cmLocalVisualStudio7Generator::WriteStampFiles()
 
 //----------------------------------------------------------------------------
 void cmLocalVisualStudio7Generator
-::CreateSingleVCProj(const std::string& lname, cmTarget &target)
+::CreateSingleVCProj(const char *lname, cmTarget &target)
 {
   this->FortranProject =
     static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator)
@@ -245,7 +245,7 @@ void cmLocalVisualStudio7Generator
     }
 
   // add to the list of projects
-  std::string const& pname = lname;
+  std::string pname = lname;
   target.SetProperty("GENERATOR_FILE_NAME",lname);
   // create the dsp.cmake file
   std::string fname;
@@ -334,8 +334,8 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
 }
 
 void cmLocalVisualStudio7Generator::WriteConfigurations(std::ostream& fout,
-                                                    const std::string& libName,
-                                                    cmTarget &target)
+                                                        const char *libName,
+                                                        cmTarget &target)
 {
   std::vector<std::string> *configs =
     static_cast<cmGlobalVisualStudio7Generator *>
@@ -637,9 +637,9 @@ private:
 
 //----------------------------------------------------------------------------
 void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
-                                                const std::string& configName,
-                                                const char *libName,
-                                                cmTarget &target)
+                                                       const char* configName,
+                                                       const char *libName,
+                                                       cmTarget &target)
 {
   const char* mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG");
   if(!mfcFlag)
@@ -745,7 +745,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
                         table,
                         this->ExtraFlagTable);
   targetOptions.FixExceptionHandlingDefault();
-  std::string asmLocation = configName + "/";
+  std::string asmLocation = std::string(configName) + "/";
   targetOptions.AddFlag("AssemblerListingLocation", asmLocation.c_str());
   targetOptions.Parse(flags.c_str());
   targetOptions.Parse(defineFlags.c_str());
@@ -1457,7 +1457,7 @@ public:
                                       cmTarget& target,
                                       cmSourceFile const& sf,
                                       std::vector<std::string>* configs);
-  std::map<std::string, cmLVS7GFileConfig> FileConfigMap;
+  std::map<cmStdString, cmLVS7GFileConfig> FileConfigMap;
 };
 
 cmLocalVisualStudio7GeneratorFCInfo
@@ -1702,7 +1702,7 @@ bool cmLocalVisualStudio7Generator
             aCompilerTool = "VFCustomBuildTool";
             }
           }
-        for(std::map<std::string, cmLVS7GFileConfig>::const_iterator
+        for(std::map<cmStdString, cmLVS7GFileConfig>::const_iterator
               fci = fcinfo.FileConfigMap.begin();
             fci != fcinfo.FileConfigMap.end(); ++fci)
           {
@@ -1893,7 +1893,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjEndGroup(std::ostream& fout)
 // look for custom rules on a target and collect them together
 void cmLocalVisualStudio7Generator
 ::OutputTargetRules(std::ostream& fout,
-                    const std::string& configName,
+                    const char* configName,
                     cmTarget &target,
                     const char * /*libName*/)
 {
@@ -1955,7 +1955,7 @@ void cmLocalVisualStudio7Generator::WriteProjectSCC(std::ostream& fout,
 void
 cmLocalVisualStudio7Generator
 ::WriteProjectStartFortran(std::ostream& fout,
-                           const std::string& libName,
+                           const char *libName,
                            cmTarget & target)
 {
 
@@ -2015,7 +2015,7 @@ cmLocalVisualStudio7Generator
 
 void
 cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
-                                                 const std::string& libName,
+                                                 const char *libName,
                                                  cmTarget & target,
                                                  std::vector<cmSourceGroup> &)
 {
@@ -2038,7 +2038,7 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
   const char* projLabel = target.GetProperty("PROJECT_LABEL");
   if(!projLabel)
     {
-    projLabel = libName.c_str();
+    projLabel = libName;
     }
   const char* keyword = target.GetProperty("VS_KEYWORD");
   if(!keyword)
@@ -2090,7 +2090,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjFooter(std::ostream& fout,
        << "</VisualStudioProject>\n";
 }
 
-std::string cmLocalVisualStudio7GeneratorEscapeForXML(const std::string& s)
+std::string cmLocalVisualStudio7GeneratorEscapeForXML(const char* s)
 {
   std::string ret = s;
   cmSystemTools::ReplaceString(ret, "&", "&");
@@ -2101,7 +2101,7 @@ std::string cmLocalVisualStudio7GeneratorEscapeForXML(const std::string& s)
   return ret;
 }
 
-std::string cmLocalVisualStudio7Generator::EscapeForXML(const std::string& s)
+std::string cmLocalVisualStudio7Generator::EscapeForXML(const char* s)
 {
   return cmLocalVisualStudio7GeneratorEscapeForXML(s);
 }
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 2e2279f..92e4d3c 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -66,7 +66,7 @@ public:
                                         const char* path);
   virtual void AddCMakeListsRules();
 protected:
-  void CreateSingleVCProj(const std::string& lname, cmTarget &tgt);
+  void CreateSingleVCProj(const char *lname, cmTarget &tgt);
 private:
   typedef cmVisualStudioGeneratorOptions Options;
   typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo;
@@ -84,7 +84,7 @@ private:
   void WriteConfiguration(std::ostream& fout,
                           const char* configName,
                           const char* libName, cmTarget &tgt);
-  std::string EscapeForXML(const std::string& s);
+  std::string EscapeForXML(const char* s);
   std::string ConvertToXMLOutputPath(const char* path);
   std::string ConvertToXMLOutputPathSingle(const char* path);
   void OutputTargetRules(std::ostream& fout, const char* configName,
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index d5e9dd9..ef2bb1d 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -80,7 +80,7 @@ const char* cmLocalVisualStudioGenerator::GetReportErrorLabel() const
 std::string
 cmLocalVisualStudioGenerator
 ::ConstructScript(cmCustomCommand const& cc,
-                  const std::string& configName,
+                  const char* configName,
                   const char* newline_text)
 {
   bool useLocal = this->CustomCommandUseLocal();
diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx
index 5857aef..a9a27b9 100644
--- a/Source/cmLocalXCodeGenerator.cxx
+++ b/Source/cmLocalXCodeGenerator.cxx
@@ -37,7 +37,7 @@ cmLocalXCodeGenerator::GetTargetDirectory(cmTarget const&) const
 
 //----------------------------------------------------------------------------
 void cmLocalXCodeGenerator::AppendFlagEscape(std::string& flags,
-                                             const std::string& rawFlag)
+                                             const char* rawFlag)
 {
   cmGlobalXCodeGenerator* gg =
     static_cast<cmGlobalXCodeGenerator*>(this->GlobalGenerator);
@@ -54,7 +54,7 @@ void cmLocalXCodeGenerator::Generate()
       iter != targets.end(); ++iter)
     {
     cmTarget* t = &iter->second;
-    t->HasMacOSXRpathInstallNameDir("");
+    t->HasMacOSXRpathInstallNameDir(NULL);
     }
 }
 
@@ -68,6 +68,6 @@ void cmLocalXCodeGenerator::GenerateInstallRules()
       iter != targets.end(); ++iter)
     {
     cmTarget* t = &iter->second;
-    t->HasMacOSXRpathInstallNameDir("");
+    t->HasMacOSXRpathInstallNameDir(NULL);
     }
 }
diff --git a/Source/cmLocalXCodeGenerator.h b/Source/cmLocalXCodeGenerator.h
index 3bfe3a3..edd2f5b 100644
--- a/Source/cmLocalXCodeGenerator.h
+++ b/Source/cmLocalXCodeGenerator.h
@@ -28,8 +28,7 @@ public:
 
   virtual ~cmLocalXCodeGenerator();
   virtual std::string GetTargetDirectory(cmTarget const& target) const;
-  virtual void AppendFlagEscape(std::string& flags,
-                                const std::string& rawFlag);
+  virtual void AppendFlagEscape(std::string& flags, const char* rawFlag);
   virtual void Generate();
   virtual void GenerateInstallRules();
 private:
diff --git a/Source/cmMakeDepend.cxx b/Source/cmMakeDepend.cxx
index 03ad37c..615e6f2 100644
--- a/Source/cmMakeDepend.cxx
+++ b/Source/cmMakeDepend.cxx
@@ -359,7 +359,7 @@ std::string cmMakeDepend::FullPath(const char* fname, const char *extraPath)
 }
 
 // Add a directory to the search path
-void cmMakeDepend::AddSearchPath(const std::string& path)
+void cmMakeDepend::AddSearchPath(const char* path)
 {
   this->IncludeDirectories.push_back(path);
 }
diff --git a/Source/cmMakeDepend.h b/Source/cmMakeDepend.h
index 2c9d515..b6e3928 100644
--- a/Source/cmMakeDepend.h
+++ b/Source/cmMakeDepend.h
@@ -94,7 +94,7 @@ public:
   /**
    * Add a directory to the search path for include files.
    */
-  virtual void AddSearchPath(const std::string&);
+  virtual void AddSearchPath(const char*);
 
   /**
    * Generate dependencies for the file given.  Returns a pointer to
@@ -138,10 +138,10 @@ protected:
   cmsys::RegularExpression IncludeFileRegularExpression;
   cmsys::RegularExpression ComplainFileRegularExpression;
   std::vector<std::string> IncludeDirectories;
-  typedef std::map<std::string, std::string> FileToPathMapType;
-  typedef std::map<std::string, FileToPathMapType>
+  typedef std::map<cmStdString, cmStdString> FileToPathMapType;
+  typedef std::map<cmStdString, FileToPathMapType>
   DirectoryToFileToPathMapType;
-  typedef std::map<std::string, cmDependInformation*>
+  typedef std::map<cmStdString, cmDependInformation*>
   DependInformationMapType;
   DependInformationMapType DependInformationMap;
   DirectoryToFileToPathMapType DirectoryToFileToPathMap;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 4019a87..f248c57 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -45,8 +45,8 @@ class cmMakefile::Internals
 {
 public:
   std::stack<cmDefinitions, std::list<cmDefinitions> > VarStack;
-  std::stack<std::set<std::string> > VarInitStack;
-  std::stack<std::set<std::string> > VarUsageStack;
+  std::stack<std::set<cmStdString> > VarInitStack;
+  std::stack<std::set<cmStdString> > VarUsageStack;
   bool IsSourceFileTryCompile;
 };
 
@@ -54,7 +54,7 @@ public:
 cmMakefile::cmMakefile(): Internal(new Internals)
 {
   const cmDefinitions& defs = cmDefinitions();
-  const std::set<std::string> globalKeys = defs.LocalKeys();
+  const std::set<cmStdString> globalKeys = defs.LocalKeys();
   this->Internal->VarStack.push(defs);
   this->Internal->VarInitStack.push(globalKeys);
   this->Internal->VarUsageStack.push(globalKeys);
@@ -74,25 +74,25 @@ cmMakefile::cmMakefile(): Internal(new Internals)
   // these are used to find files when the extension
   // is not given
   // The "c" extension MUST precede the "C" extension.
-  this->SourceFileExtensions.insert( "c" );
-  this->SourceFileExtensions.insert( "C" );
-
-  this->SourceFileExtensions.insert( "c++" );
-  this->SourceFileExtensions.insert( "cc" );
-  this->SourceFileExtensions.insert( "cpp" );
-  this->SourceFileExtensions.insert( "cxx" );
-  this->SourceFileExtensions.insert( "m" );
-  this->SourceFileExtensions.insert( "M" );
-  this->SourceFileExtensions.insert( "mm" );
-
-  this->HeaderFileExtensions.insert( "h" );
-  this->HeaderFileExtensions.insert( "hh" );
-  this->HeaderFileExtensions.insert( "h++" );
-  this->HeaderFileExtensions.insert( "hm" );
-  this->HeaderFileExtensions.insert( "hpp" );
-  this->HeaderFileExtensions.insert( "hxx" );
-  this->HeaderFileExtensions.insert( "in" );
-  this->HeaderFileExtensions.insert( "txx" );
+  this->SourceFileExtensions.push_back( "c" );
+  this->SourceFileExtensions.push_back( "C" );
+
+  this->SourceFileExtensions.push_back( "c++" );
+  this->SourceFileExtensions.push_back( "cc" );
+  this->SourceFileExtensions.push_back( "cpp" );
+  this->SourceFileExtensions.push_back( "cxx" );
+  this->SourceFileExtensions.push_back( "m" );
+  this->SourceFileExtensions.push_back( "M" );
+  this->SourceFileExtensions.push_back( "mm" );
+
+  this->HeaderFileExtensions.push_back( "h" );
+  this->HeaderFileExtensions.push_back( "hh" );
+  this->HeaderFileExtensions.push_back( "h++" );
+  this->HeaderFileExtensions.push_back( "hm" );
+  this->HeaderFileExtensions.push_back( "hpp" );
+  this->HeaderFileExtensions.push_back( "hxx" );
+  this->HeaderFileExtensions.push_back( "in" );
+  this->HeaderFileExtensions.push_back( "txx" );
 
   this->DefineFlags = " ";
   this->LocalGenerator = 0;
@@ -203,7 +203,7 @@ cmMakefile::~cmMakefile()
     {
     delete *i;
     }
-  for(std::map<std::string, cmTest*>::iterator i = this->Tests.begin();
+  for(std::map<cmStdString, cmTest*>::iterator i = this->Tests.begin();
       i != this->Tests.end(); ++i)
     {
     delete i->second;
@@ -247,10 +247,10 @@ void cmMakefile::PrintStringVector(const char* s,
 
 void cmMakefile
 ::PrintStringVector(const char* s,
-                    const std::vector<std::pair<std::string, bool> >& v) const
+                    const std::vector<std::pair<cmStdString, bool> >& v) const
 {
   std::cout << s << ": ( \n";
-  for(std::vector<std::pair<std::string, bool> >::const_iterator i
+  for(std::vector<std::pair<cmStdString, bool> >::const_iterator i
         = v.begin(); i != v.end(); ++i)
     {
     std::cout << i->first.c_str() << " " << i->second;
@@ -1102,7 +1102,7 @@ cmMakefile::UpdateOutputToSourceMap(std::string const& output,
 
 //----------------------------------------------------------------------------
 cmSourceFile*
-cmMakefile::AddCustomCommandToOutput(const std::string& output,
+cmMakefile::AddCustomCommandToOutput(const char* output,
                                      const std::vector<std::string>& depends,
                                      const char* main_dependency,
                                      const cmCustomCommandLines& commandLines,
@@ -1187,7 +1187,7 @@ cmMakefile::AddCustomCommandOldStyle(const char* target,
 }
 
 //----------------------------------------------------------------------------
-void cmMakefile::AddUtilityCommand(const std::string& utilityName,
+void cmMakefile::AddUtilityCommand(const char* utilityName,
                                    bool excludeFromAll,
                                    const std::vector<std::string>& depends,
                                    const char* workingDirectory,
@@ -1226,7 +1226,7 @@ void cmMakefile::AddUtilityCommand(const std::string& utilityName,
 
 //----------------------------------------------------------------------------
 cmTarget*
-cmMakefile::AddUtilityCommand(const std::string& utilityName,
+cmMakefile::AddUtilityCommand(const char* utilityName,
                               bool excludeFromAll,
                               const char* workingDirectory,
                               const std::vector<std::string>& depends,
@@ -1453,7 +1453,7 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
   return true;
 }
 
-void cmMakefile::AddLinkLibrary(const std::string& lib,
+void cmMakefile::AddLinkLibrary(const char* lib,
                                 cmTarget::LinkLibraryType llt)
 {
   cmTarget::LibraryID tmp;
@@ -1462,15 +1462,15 @@ void cmMakefile::AddLinkLibrary(const std::string& lib,
   this->LinkLibraries.push_back(tmp);
 }
 
-void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
-                                         const std::string& lib,
+void cmMakefile::AddLinkLibraryForTarget(const char *target,
+                                         const char* lib,
                                          cmTarget::LinkLibraryType llt)
 {
   cmTargets::iterator i = this->Targets.find(target);
   if ( i != this->Targets.end())
     {
     cmTarget* tgt =
-      this->GetCMakeInstance()->GetGlobalGenerator()->FindTarget(lib);
+      this->GetCMakeInstance()->GetGlobalGenerator()->FindTarget(0,lib);
     if(tgt)
       {
       // if it is not a static or shared library then you can not link to it
@@ -1500,8 +1500,8 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
     }
 }
 
-void cmMakefile::AddLinkDirectoryForTarget(const std::string& target,
-                                           const std::string& d)
+void cmMakefile::AddLinkDirectoryForTarget(const char *target,
+                                           const char* d)
 {
   cmTargets::iterator i = this->Targets.find(target);
   if ( i != this->Targets.end())
@@ -1520,37 +1520,46 @@ void cmMakefile::AddLinkDirectoryForTarget(const std::string& target,
     {
     cmSystemTools::Error
       ("Attempt to add link directories to non-existent target: ",
-       target.c_str(), " for directory ", d.c_str());
+       target, " for directory ", d);
     }
 }
 
-void cmMakefile::AddLinkLibrary(const std::string& lib)
+void cmMakefile::AddLinkLibrary(const char* lib)
 {
   this->AddLinkLibrary(lib,cmTarget::GENERAL);
 }
 
-void cmMakefile::AddLinkDirectory(const std::string& dir)
+void cmMakefile::AddLinkDirectory(const char* dir)
 {
   // Don't add a link directory that is already present.  Yes, this
   // linear search results in n^2 behavior, but n won't be getting
   // much bigger than 20.  We cannot use a set because of order
   // dependency of the link search path.
 
-  if(dir.empty())
+  if(!dir)
     {
     return;
     }
-  std::string newdir = dir;
   // remove trailing slashes
-  if(*dir.rbegin() == '/')
+  if(dir[strlen(dir)-1] == '/')
     {
-    newdir = dir.substr(0, dir.size()-1);
+    std::string newdir = dir;
+    newdir = newdir.substr(0, newdir.size()-1);
+    if(std::find(this->LinkDirectories.begin(),
+                 this->LinkDirectories.end(),
+                 newdir.c_str()) == this->LinkDirectories.end())
+      {
+      this->LinkDirectories.push_back(newdir);
+      }
     }
-  if(std::find(this->LinkDirectories.begin(),
-               this->LinkDirectories.end(), newdir)
-      == this->LinkDirectories.end())
+  else
     {
-    this->LinkDirectories.push_back(dir);
+    if(std::find(this->LinkDirectories.begin(),
+                 this->LinkDirectories.end(), dir)
+       == this->LinkDirectories.end())
+      {
+      this->LinkDirectories.push_back(dir);
+      }
     }
 }
 
@@ -1647,7 +1656,7 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2)
     }
 }
 
-void cmMakefile::AddSubDirectory(const std::string& sub,
+void cmMakefile::AddSubDirectory(const char* sub,
                                  bool excludeFromAll, bool preorder)
 {
   // the source path must be made full if it isn't already
@@ -1674,8 +1683,7 @@ void cmMakefile::AddSubDirectory(const std::string& sub,
 }
 
 
-void cmMakefile::AddSubDirectory(const std::string& srcPath,
-                                 const std::string& binPath,
+void cmMakefile::AddSubDirectory(const char* srcPath, const char *binPath,
                                  bool excludeFromAll, bool preorder,
                                  bool immediate)
 {
@@ -1745,9 +1753,9 @@ void cmMakefile::AddIncludeDirectories(const std::vector<std::string> &incs,
 
 //----------------------------------------------------------------------------
 void
-cmMakefile::AddSystemIncludeDirectories(const std::set<std::string> &incs)
+cmMakefile::AddSystemIncludeDirectories(const std::set<cmStdString> &incs)
 {
-  for(std::set<std::string>::const_iterator li = incs.begin();
+  for(std::set<cmStdString>::const_iterator li = incs.begin();
       li != incs.end(); ++li)
     {
     this->SystemIncludeDirectories.insert(*li);
@@ -1761,7 +1769,7 @@ cmMakefile::AddSystemIncludeDirectories(const std::set<std::string> &incs)
     }
 }
 
-void cmMakefile::AddDefinition(const std::string& name, const char* value)
+void cmMakefile::AddDefinition(const char* name, const char* value)
 {
   if (!value )
     {
@@ -1790,14 +1798,14 @@ void cmMakefile::AddDefinition(const std::string& name, const char* value)
 }
 
 
-void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
+void cmMakefile::AddCacheDefinition(const char* name, const char* value,
                                     const char* doc,
                                     cmCacheManager::CacheEntryType type,
                                     bool force)
 {
   const char* val = value;
   cmCacheManager::CacheIterator it =
-    this->GetCacheManager()->GetCacheIterator(name.c_str());
+    this->GetCacheManager()->GetCacheIterator(name);
   if(!it.IsAtEnd() && (it.GetType() == cmCacheManager::UNINITIALIZED) &&
      it.Initialized())
     {
@@ -1837,7 +1845,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
 }
 
 
-void cmMakefile::AddDefinition(const std::string& name, bool value)
+void cmMakefile::AddDefinition(const char* name, bool value)
 {
   this->Internal->VarStack.top().Set(name, value? "ON" : "OFF");
   if (this->Internal->VarUsageStack.size() &&
@@ -1864,20 +1872,20 @@ void cmMakefile::CheckForUnusedVariables() const
     return;
     }
   const cmDefinitions& defs = this->Internal->VarStack.top();
-  const std::set<std::string>& locals = defs.LocalKeys();
-  std::set<std::string>::const_iterator it = locals.begin();
+  const std::set<cmStdString>& locals = defs.LocalKeys();
+  std::set<cmStdString>::const_iterator it = locals.begin();
   for (; it != locals.end(); ++it)
     {
     this->CheckForUnused("out of scope", it->c_str());
     }
 }
 
-void cmMakefile::MarkVariableAsUsed(const std::string& var)
+void cmMakefile::MarkVariableAsUsed(const char* var)
 {
   this->Internal->VarUsageStack.top().insert(var);
 }
 
-bool cmMakefile::VariableInitialized(const std::string& var) const
+bool cmMakefile::VariableInitialized(const char* var) const
 {
   if(this->Internal->VarInitStack.top().find(var) !=
       this->Internal->VarInitStack.top().end())
@@ -1887,7 +1895,7 @@ bool cmMakefile::VariableInitialized(const std::string& var) const
   return false;
 }
 
-bool cmMakefile::VariableUsed(const std::string& var) const
+bool cmMakefile::VariableUsed(const char* var) const
 {
   if(this->Internal->VarUsageStack.top().find(var) !=
       this->Internal->VarUsageStack.top().end())
@@ -1897,12 +1905,11 @@ bool cmMakefile::VariableUsed(const std::string& var) const
   return false;
 }
 
-void cmMakefile::CheckForUnused(const char* reason,
-                                const std::string& name) const
+void cmMakefile::CheckForUnused(const char* reason, const char* name) const
 {
   if (this->WarnUnused && !this->VariableUsed(name))
     {
-    std::string path;
+    cmStdString path;
     cmListFileBacktrace bt;
     if (this->CallStack.size())
       {
@@ -1936,7 +1943,7 @@ void cmMakefile::CheckForUnused(const char* reason,
     }
 }
 
-void cmMakefile::RemoveDefinition(const std::string& name)
+void cmMakefile::RemoveDefinition(const char* name)
 {
   this->Internal->VarStack.top().Set(name, 0);
   if (this->Internal->VarUsageStack.size() &&
@@ -1956,7 +1963,7 @@ void cmMakefile::RemoveDefinition(const std::string& name)
 #endif
 }
 
-void cmMakefile::RemoveCacheDefinition(const std::string& name)
+void cmMakefile::RemoveCacheDefinition(const char* name)
 {
   this->GetCacheManager()->RemoveCacheEntry(name);
 }
@@ -1988,7 +1995,7 @@ void cmMakefile::AddGlobalLinkInformation(const char* name, cmTarget& target)
 }
 
 
-void cmMakefile::AddAlias(const std::string& lname, cmTarget *tgt)
+void cmMakefile::AddAlias(const char* lname, cmTarget *tgt)
 {
   this->AliasTargets[lname] = tgt;
   this->LocalGenerator->GetGlobalGenerator()->AddAlias(lname, tgt);
@@ -2040,7 +2047,7 @@ cmTarget* cmMakefile::AddExecutable(const char *exeName,
 
 //----------------------------------------------------------------------------
 cmTarget*
-cmMakefile::AddNewTarget(cmTarget::TargetType type, const std::string& name)
+cmMakefile::AddNewTarget(cmTarget::TargetType type, const char* name)
 {
   cmTargets::iterator it =
     this->Targets.insert(cmTargets::value_type(name, cmTarget())).first;
@@ -2052,8 +2059,9 @@ cmMakefile::AddNewTarget(cmTarget::TargetType type, const std::string& name)
 }
 
 cmSourceFile*
-cmMakefile::LinearGetSourceFileWithOutput(const std::string& name) const
+cmMakefile::LinearGetSourceFileWithOutput(const char *cname) const
 {
+  std::string name = cname;
   std::string out;
 
   // look through all the source files that have custom commands
@@ -2087,14 +2095,15 @@ cmMakefile::LinearGetSourceFileWithOutput(const std::string& name) const
   return 0;
 }
 
-cmSourceFile *cmMakefile::GetSourceFileWithOutput(
-                                                const std::string& name) const
+cmSourceFile *cmMakefile::GetSourceFileWithOutput(const char *cname) const
 {
+  std::string name = cname;
+
   // If the queried path is not absolute we use the backward compatible
   // linear-time search for an output with a matching suffix.
-  if(!cmSystemTools::FileIsFullPath(name.c_str()))
+  if(!cmSystemTools::FileIsFullPath(cname))
     {
-    return LinearGetSourceFileWithOutput(name.c_str());
+    return LinearGetSourceFileWithOutput(cname);
     }
   // Otherwise we use an efficient lookup map.
   OutputToSourceMap::const_iterator o = this->OutputToSource.find(name);
@@ -2139,12 +2148,15 @@ cmMakefile::GetSourceGroup(const std::vector<std::string>&name) const
   return sg;
 }
 
-void cmMakefile::AddSourceGroup(const std::string& name,
+ void cmMakefile::AddSourceGroup(const char* name,
                                  const char* regex)
 {
-  std::vector<std::string> nameVector;
-  nameVector.push_back(name);
-  AddSourceGroup(nameVector, regex);
+  if (name)
+    {
+    std::vector<std::string> nameVector;
+    nameVector.push_back(name);
+    AddSourceGroup(nameVector, regex);
+    }
 }
 
 void cmMakefile::AddSourceGroup(const std::vector<std::string>& name,
@@ -2317,13 +2329,13 @@ void cmMakefile::ExpandVariablesCMP0019()
     }
 }
 
-bool cmMakefile::IsOn(const std::string& name) const
+bool cmMakefile::IsOn(const char* name) const
 {
   const char* value = this->GetDefinition(name);
   return cmSystemTools::IsOn(value);
 }
 
-bool cmMakefile::IsSet(const std::string& name) const
+bool cmMakefile::IsSet(const char* name) const
 {
   const char* value = this->GetDefinition(name);
   if ( !value )
@@ -2394,7 +2406,7 @@ bool cmMakefile::CanIWriteThisFile(const char* fileName) const
   return true;
 }
 
-const char* cmMakefile::GetRequiredDefinition(const std::string& name) const
+const char* cmMakefile::GetRequiredDefinition(const char* name) const
 {
   const char* ret = this->GetDefinition(name);
   if(!ret)
@@ -2402,13 +2414,13 @@ const char* cmMakefile::GetRequiredDefinition(const std::string& name) const
     cmSystemTools::Error("Error required internal CMake variable not "
                          "set, cmake may be not be built correctly.\n",
                          "Missing variable is:\n",
-                         name.c_str());
+                         name);
     return "";
     }
   return ret;
 }
 
-bool cmMakefile::IsDefinitionSet(const std::string& name) const
+bool cmMakefile::IsDefinitionSet(const char* name) const
 {
   const char* def = this->Internal->VarStack.top().Get(name);
   this->Internal->VarUsageStack.top().insert(name);
@@ -2430,7 +2442,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const
   return def?true:false;
 }
 
-const char* cmMakefile::GetDefinition(const std::string& name) const
+const char* cmMakefile::GetDefinition(const char* name) const
 {
   if (this->WarnUnused)
     {
@@ -2471,7 +2483,7 @@ const char* cmMakefile::GetDefinition(const std::string& name) const
   return def;
 }
 
-const char* cmMakefile::GetSafeDefinition(const std::string& def) const
+const char* cmMakefile::GetSafeDefinition(const char* def) const
 {
   const char* ret = this->GetDefinition(def);
   if(!ret)
@@ -2484,7 +2496,7 @@ const char* cmMakefile::GetSafeDefinition(const std::string& def) const
 std::vector<std::string> cmMakefile
 ::GetDefinitions(int cacheonly /* = 0 */) const
 {
-  std::set<std::string> definitions;
+  std::set<cmStdString> definitions;
   if ( !cacheonly )
     {
     definitions = this->Internal->VarStack.top().ClosureKeys();
@@ -2498,7 +2510,7 @@ std::vector<std::string> cmMakefile
 
   std::vector<std::string> res;
 
-  std::set<std::string>::iterator fit;
+  std::set<cmStdString>::iterator fit;
   for ( fit = definitions.begin(); fit != definitions.end(); fit ++ )
     {
     res.push_back(*fit);
@@ -2953,7 +2965,7 @@ cmMakefile::LexicalPushPop::~LexicalPushPop()
   this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
 }
 
-void cmMakefile::SetHomeDirectory(const std::string& dir)
+void cmMakefile::SetHomeDirectory(const char* dir)
 {
   this->cmHomeDirectory = dir;
   cmSystemTools::ConvertToUnixSlashes(this->cmHomeDirectory);
@@ -2964,7 +2976,7 @@ void cmMakefile::SetHomeDirectory(const std::string& dir)
     }
 }
 
-void cmMakefile::SetHomeOutputDirectory(const std::string& lib)
+void cmMakefile::SetHomeOutputDirectory(const char* lib)
 {
   this->HomeOutputDirectory = lib;
   cmSystemTools::ConvertToUnixSlashes(this->HomeOutputDirectory);
@@ -2998,9 +3010,9 @@ void cmMakefile::SetArgcArgv(const std::vector<std::string>& args)
 }
 
 //----------------------------------------------------------------------------
-cmSourceFile* cmMakefile::GetSource(const std::string& sourceName) const
+cmSourceFile* cmMakefile::GetSource(const char* sourceName) const
 {
-  cmSourceFileLocation sfl(this, sourceName.c_str());
+  cmSourceFileLocation sfl(this, sourceName);
   for(std::vector<cmSourceFile*>::const_iterator
         sfi = this->SourceFiles.begin();
       sfi != this->SourceFiles.end(); ++sfi)
@@ -3015,7 +3027,7 @@ cmSourceFile* cmMakefile::GetSource(const std::string& sourceName) const
 }
 
 //----------------------------------------------------------------------------
-cmSourceFile* cmMakefile::GetOrCreateSource(const std::string& sourceName,
+cmSourceFile* cmMakefile::GetOrCreateSource(const char* sourceName,
                                             bool generated)
 {
   if(cmSourceFile* esf = this->GetSource(sourceName))
@@ -3024,7 +3036,7 @@ cmSourceFile* cmMakefile::GetOrCreateSource(const std::string& sourceName,
     }
   else
     {
-    cmSourceFile* sf = new cmSourceFile(this, sourceName.c_str());
+    cmSourceFile* sf = new cmSourceFile(this, sourceName);
     if(generated)
       {
       sf->SetProperty("GENERATED", "1");
@@ -3535,9 +3547,17 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
   return res;
 }
 
-void cmMakefile::SetProperty(const std::string& prop, const char* value)
+void cmMakefile::SetProperty(const char* prop, const char* value)
 {
-  if ( prop == "LINK_DIRECTORIES" )
+  if (!prop)
+    {
+    return;
+    }
+
+  // handle special props
+  std::string propname = prop;
+
+  if ( propname == "LINK_DIRECTORIES" )
     {
     std::vector<std::string> varArgsExpanded;
     if(value)
@@ -3547,7 +3567,7 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value)
     this->SetLinkDirectories(varArgsExpanded);
     return;
     }
-  if (prop == "INCLUDE_DIRECTORIES")
+  if (propname == "INCLUDE_DIRECTORIES")
     {
     this->IncludeDirectoriesEntries.clear();
       if (!value)
@@ -3560,7 +3580,7 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value)
                                         cmValueWithOrigin(value, lfbt));
     return;
     }
-  if (prop == "COMPILE_OPTIONS")
+  if (propname == "COMPILE_OPTIONS")
     {
     this->CompileOptionsEntries.clear();
       if (!value)
@@ -3572,7 +3592,7 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value)
     this->CompileOptionsEntries.push_back(cmValueWithOrigin(value, lfbt));
     return;
     }
-  if (prop == "COMPILE_DEFINITIONS")
+  if (propname == "COMPILE_DEFINITIONS")
     {
     this->CompileDefinitionsEntries.clear();
     if (!value)
@@ -3586,13 +3606,13 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value)
     return;
     }
 
-  if ( prop == "INCLUDE_REGULAR_EXPRESSION" )
+  if ( propname == "INCLUDE_REGULAR_EXPRESSION" )
     {
     this->SetIncludeRegularExpression(value);
     return;
     }
 
-  if ( prop == "ADDITIONAL_MAKE_CLEAN_FILES" )
+  if ( propname == "ADDITIONAL_MAKE_CLEAN_FILES" )
     {
     // This property is not inherrited
     if ( strcmp(this->GetCurrentDirectory(),
@@ -3605,11 +3625,18 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value)
   this->Properties.SetProperty(prop,value,cmProperty::DIRECTORY);
 }
 
-void cmMakefile::AppendProperty(const std::string& prop,
-                                const char* value,
+void cmMakefile::AppendProperty(const char* prop, const char* value,
                                 bool asString)
 {
-  if (prop == "INCLUDE_DIRECTORIES")
+  if (!prop)
+    {
+    return;
+    }
+
+  // handle special props
+  std::string propname = prop;
+
+  if (propname == "INCLUDE_DIRECTORIES")
     {
     cmListFileBacktrace lfbt;
     this->GetBacktrace(lfbt);
@@ -3617,7 +3644,7 @@ void cmMakefile::AppendProperty(const std::string& prop,
                                         cmValueWithOrigin(value, lfbt));
     return;
     }
-  if (prop == "COMPILE_OPTIONS")
+  if (propname == "COMPILE_OPTIONS")
     {
     cmListFileBacktrace lfbt;
     this->GetBacktrace(lfbt);
@@ -3625,7 +3652,7 @@ void cmMakefile::AppendProperty(const std::string& prop,
                                         cmValueWithOrigin(value, lfbt));
     return;
     }
-  if (prop == "COMPILE_DEFINITIONS")
+  if (propname == "COMPILE_DEFINITIONS")
     {
     cmListFileBacktrace lfbt;
     this->GetBacktrace(lfbt);
@@ -3633,7 +3660,7 @@ void cmMakefile::AppendProperty(const std::string& prop,
                                         cmValueWithOrigin(value, lfbt));
     return;
     }
-  if ( prop == "LINK_DIRECTORIES" )
+  if ( propname == "LINK_DIRECTORIES" )
     {
     std::vector<std::string> varArgsExpanded;
     cmSystemTools::ExpandListArgument(value, varArgsExpanded);
@@ -3648,18 +3675,32 @@ void cmMakefile::AppendProperty(const std::string& prop,
   this->Properties.AppendProperty(prop,value,cmProperty::DIRECTORY,asString);
 }
 
-const char *cmMakefile::GetProperty(const std::string& prop) const
+const char *cmMakefile::GetPropertyOrDefinition(const char* prop) const
+{
+  const char *ret = this->GetProperty(prop, cmProperty::DIRECTORY);
+  if (!ret)
+    {
+    ret = this->GetDefinition(prop);
+    }
+  return ret;
+}
+
+const char *cmMakefile::GetProperty(const char* prop) const
 {
   return this->GetProperty(prop, cmProperty::DIRECTORY);
 }
 
-const char *cmMakefile::GetProperty(const std::string& prop,
+const char *cmMakefile::GetProperty(const char* prop,
                                     cmProperty::ScopeType scope) const
 {
+  if(!prop)
+    {
+    return 0;
+    }
   // watch for specific properties
   static std::string output;
   output = "";
-  if (prop == "PARENT_DIRECTORY")
+  if (!strcmp("PARENT_DIRECTORY",prop))
     {
     if(cmLocalGenerator* plg = this->LocalGenerator->GetParent())
       {
@@ -3667,14 +3708,14 @@ const char *cmMakefile::GetProperty(const std::string& prop,
       }
     return output.c_str();
     }
-  else if (prop == "INCLUDE_REGULAR_EXPRESSION" )
+  else if (!strcmp("INCLUDE_REGULAR_EXPRESSION",prop) )
     {
     output = this->GetIncludeRegularExpression();
     return output.c_str();
     }
-  else if (prop == "LISTFILE_STACK")
+  else if (!strcmp("LISTFILE_STACK",prop))
     {
-    for (std::deque<std::string>::const_iterator
+    for (std::deque<cmStdString>::const_iterator
         i = this->ListFileStack.begin();
         i != this->ListFileStack.end(); ++i)
       {
@@ -3686,10 +3727,10 @@ const char *cmMakefile::GetProperty(const std::string& prop,
       }
     return output.c_str();
     }
-  else if (prop == "VARIABLES" || prop == "CACHE_VARIABLES")
+  else if (!strcmp("VARIABLES",prop) || !strcmp("CACHE_VARIABLES",prop))
     {
     int cacheonly = 0;
-    if ( prop == "CACHE_VARIABLES" )
+    if ( !strcmp("CACHE_VARIABLES",prop) )
       {
       cacheonly = 1;
       }
@@ -3704,17 +3745,17 @@ const char *cmMakefile::GetProperty(const std::string& prop,
       }
     return output.c_str();
     }
-  else if (prop == "MACROS")
+  else if (!strcmp("MACROS",prop))
     {
     this->GetListOfMacros(output);
     return output.c_str();
     }
-  else if (prop == "DEFINITIONS")
+  else if (!strcmp("DEFINITIONS",prop))
     {
     output += this->DefineFlagsOrig;
     return output.c_str();
     }
-  else if (prop == "LINK_DIRECTORIES")
+  else if (!strcmp("LINK_DIRECTORIES",prop))
     {
     cmOStringStream str;
     for (std::vector<std::string>::const_iterator
@@ -3731,7 +3772,7 @@ const char *cmMakefile::GetProperty(const std::string& prop,
     output = str.str();
     return output.c_str();
     }
-  else if (prop == "INCLUDE_DIRECTORIES")
+  else if (!strcmp("INCLUDE_DIRECTORIES",prop))
     {
     std::string sep;
     for (std::vector<cmValueWithOrigin>::const_iterator
@@ -3745,7 +3786,7 @@ const char *cmMakefile::GetProperty(const std::string& prop,
       }
     return output.c_str();
     }
-  else if (prop == "COMPILE_OPTIONS")
+  else if (!strcmp("COMPILE_OPTIONS",prop))
     {
     std::string sep;
     for (std::vector<cmValueWithOrigin>::const_iterator
@@ -3759,7 +3800,7 @@ const char *cmMakefile::GetProperty(const std::string& prop,
       }
     return output.c_str();
     }
-  else if (prop == "COMPILE_DEFINITIONS")
+  else if (!strcmp("COMPILE_DEFINITIONS",prop))
     {
     std::string sep;
     for (std::vector<cmValueWithOrigin>::const_iterator
@@ -3790,18 +3831,17 @@ const char *cmMakefile::GetProperty(const std::string& prop,
   return retVal;
 }
 
-bool cmMakefile::GetPropertyAsBool(const std::string& prop) const
+bool cmMakefile::GetPropertyAsBool(const char* prop) const
 {
   return cmSystemTools::IsOn(this->GetProperty(prop));
 }
 
 //----------------------------------------------------------------------------
-const char* cmMakefile::GetFeature(const std::string& feature,
-                                   const std::string& config)
+const char* cmMakefile::GetFeature(const char* feature, const char* config)
 {
   // TODO: Define accumulation policy for features (prepend, append, replace).
   // Currently we always replace.
-  if(!config.empty())
+  if(config && *config)
     {
     std::string featureConfig = feature;
     featureConfig += "_";
@@ -3844,27 +3884,34 @@ cmTarget* cmMakefile::FindTarget(const std::string& name,
 }
 
 //----------------------------------------------------------------------------
-cmTest* cmMakefile::CreateTest(const std::string& testName)
+cmTest* cmMakefile::CreateTest(const char* testName)
 {
+  if ( !testName )
+    {
+    return 0;
+    }
   cmTest* test = this->GetTest(testName);
   if ( test )
     {
     return test;
     }
   test = new cmTest(this);
-  test->SetName(testName.c_str());
+  test->SetName(testName);
   this->Tests[testName] = test;
   return test;
 }
 
 //----------------------------------------------------------------------------
-cmTest* cmMakefile::GetTest(const std::string& testName) const
+cmTest* cmMakefile::GetTest(const char* testName) const
 {
-  std::map<std::string, cmTest*>::const_iterator
-    mi = this->Tests.find(testName);
-  if(mi != this->Tests.end())
+  if(testName)
     {
-    return mi->second;
+    std::map<cmStdString, cmTest*>::const_iterator
+      mi = this->Tests.find(testName);
+    if(mi != this->Tests.end())
+      {
+      return mi->second;
+      }
     }
   return 0;
 }
@@ -3899,7 +3946,7 @@ std::string cmMakefile::GetListFileStack() const
   size_t depth = this->ListFileStack.size();
   if (depth > 0)
     {
-    std::deque<std::string>::const_iterator it = this->ListFileStack.end();
+    std::deque<cmStdString>::const_iterator it = this->ListFileStack.end();
     do
       {
       if (depth != this->ListFileStack.size())
@@ -3922,8 +3969,8 @@ std::string cmMakefile::GetListFileStack() const
 void cmMakefile::PushScope()
 {
   cmDefinitions* parent = &this->Internal->VarStack.top();
-  const std::set<std::string>& init = this->Internal->VarInitStack.top();
-  const std::set<std::string>& usage = this->Internal->VarUsageStack.top();
+  const std::set<cmStdString>& init = this->Internal->VarInitStack.top();
+  const std::set<cmStdString>& usage = this->Internal->VarUsageStack.top();
   this->Internal->VarStack.push(cmDefinitions(parent));
   this->Internal->VarInitStack.push(init);
   this->Internal->VarUsageStack.push(usage);
@@ -3932,12 +3979,12 @@ void cmMakefile::PushScope()
 void cmMakefile::PopScope()
 {
   cmDefinitions* current = &this->Internal->VarStack.top();
-  std::set<std::string> init = this->Internal->VarInitStack.top();
-  std::set<std::string> usage = this->Internal->VarUsageStack.top();
-  const std::set<std::string>& locals = current->LocalKeys();
+  std::set<cmStdString> init = this->Internal->VarInitStack.top();
+  std::set<cmStdString> usage = this->Internal->VarUsageStack.top();
+  const std::set<cmStdString>& locals = current->LocalKeys();
   // Remove initialization and usage information for variables in the local
   // scope.
-  std::set<std::string>::const_iterator it = locals.begin();
+  std::set<cmStdString>::const_iterator it = locals.begin();
   for (; it != locals.end(); ++it)
     {
     init.erase(*it);
@@ -3966,9 +4013,9 @@ void cmMakefile::PopScope()
     }
 }
 
-void cmMakefile::RaiseScope(const std::string& var, const char *varDef)
+void cmMakefile::RaiseScope(const char *var, const char *varDef)
 {
-  if (var.empty())
+  if (!var || !strlen(var))
     {
     return;
     }
@@ -3977,10 +4024,10 @@ void cmMakefile::RaiseScope(const std::string& var, const char *varDef)
   if(cmDefinitions* up = cur.GetParent())
     {
     // First localize the definition in the current scope.
-    cur.Get(var.c_str());
+    cur.Get(var);
 
     // Now update the definition in the parent scope.
-    up->Set(var.c_str(), varDef);
+    up->Set(var, varDef);
     }
   else if(cmLocalGenerator* plg = this->LocalGenerator->GetParent())
     {
@@ -3990,11 +4037,11 @@ void cmMakefile::RaiseScope(const std::string& var, const char *varDef)
     cmMakefile* parent = plg->GetMakefile();
     if (varDef)
       {
-      parent->AddDefinition(var.c_str(), varDef);
+      parent->AddDefinition(var, varDef);
       }
     else
       {
-      parent->RemoveDefinition(var.c_str());
+      parent->RemoveDefinition(var);
       }
     }
   else
@@ -4022,8 +4069,7 @@ void cmMakefile::DefineProperties(cmake *cm)
 
 //----------------------------------------------------------------------------
 cmTarget*
-cmMakefile::AddImportedTarget(const std::string& name,
-                              cmTarget::TargetType type,
+cmMakefile::AddImportedTarget(const char* name, cmTarget::TargetType type,
                               bool global)
 {
   // Create the target.
@@ -4050,7 +4096,7 @@ cmTarget* cmMakefile::FindTargetToUse(const std::string& name,
 {
   // Look for an imported target.  These take priority because they
   // are more local in scope and do not have to be globally unique.
-  std::map<std::string, cmTarget*>::const_iterator
+  std::map<cmStdString, cmTarget*>::const_iterator
     imported = this->ImportedTargets.find(name);
   if(imported != this->ImportedTargets.end())
     {
@@ -4064,7 +4110,8 @@ cmTarget* cmMakefile::FindTargetToUse(const std::string& name,
     }
 
   // Look for a target built in this project.
-  return this->LocalGenerator->GetGlobalGenerator()->FindTarget(name.c_str(),
+  return this->LocalGenerator->GetGlobalGenerator()->FindTarget(0,
+                                                              name.c_str(),
                                                               excludeAliases);
 }
 
@@ -4079,7 +4126,7 @@ bool cmMakefile::IsAlias(const std::string& name) const
 
 //----------------------------------------------------------------------------
 cmGeneratorTarget*
-cmMakefile::FindGeneratorTargetToUse(const std::string& name) const
+cmMakefile::FindGeneratorTargetToUse(const char* name) const
 {
   if (cmTarget *t = this->FindTargetToUse(name))
     {
@@ -4181,8 +4228,8 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
 }
 
 //----------------------------------------------------------------------------
-bool cmMakefile::EnforceUniqueDir(const std::string& srcPath,
-                                  const std::string& binPath) const
+bool cmMakefile::EnforceUniqueDir(const char* srcPath,
+                                  const char* binPath) const
 {
   // Make sure the binary directory is unique.
   cmGlobalGenerator* gg = this->LocalGenerator->GetGlobalGenerator();
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 82a5521..45f3b9f 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -69,11 +69,11 @@ public:
   /* Check for unused variables in this scope */
   void CheckForUnusedVariables() const;
   /* Mark a variable as used */
-  void MarkVariableAsUsed(const std::string& var);
+  void MarkVariableAsUsed(const char* var);
   /* return true if a variable has been initialized */
-  bool VariableInitialized(const std::string& ) const;
+  bool VariableInitialized(const char* ) const;
   /* return true if a variable has been used */
-  bool VariableUsed(const std::string& ) const;
+  bool VariableUsed(const char* ) const;
   /** Return whether compatibility features needed for a version of
       the cache or lower should be enabled.  */
   bool NeedCacheCompatibility(int major, int minor) const;
@@ -183,7 +183,7 @@ public:
     bool replace = false,
     bool escapeOldStyle = true);
   cmSourceFile* AddCustomCommandToOutput(
-    const std::string& output,
+    const char* output,
     const std::vector<std::string>& depends,
     const char* main_dependency,
     const cmCustomCommandLines& commandLines,
@@ -205,11 +205,10 @@ public:
   void AddCompileOption(const char* option);
 
   /** Create a new imported target with the name and type given.  */
-  cmTarget* AddImportedTarget(const std::string& name,
-                              cmTarget::TargetType type,
+  cmTarget* AddImportedTarget(const char* name, cmTarget::TargetType type,
                               bool global);
 
-  cmTarget* AddNewTarget(cmTarget::TargetType type, const std::string& name);
+  cmTarget* AddNewTarget(cmTarget::TargetType type, const char* name);
 
   /**
    * Add an executable to the build.
@@ -222,7 +221,7 @@ public:
    * Add a utility to the build.  A utiltity target is a command that
    * is run every time the target is built.
    */
-  void AddUtilityCommand(const std::string& utilityName, bool excludeFromAll,
+  void AddUtilityCommand(const char* utilityName, bool excludeFromAll,
                          const std::vector<std::string>& depends,
                          const char* workingDirectory,
                          const char* command,
@@ -230,8 +229,7 @@ public:
                          const char* arg2=0,
                          const char* arg3=0,
                          const char* arg4=0);
-  cmTarget* AddUtilityCommand(const std::string& utilityName,
-                              bool excludeFromAll,
+  cmTarget* AddUtilityCommand(const char* utilityName, bool excludeFromAll,
                               const char* workingDirectory,
                               const std::vector<std::string>& depends,
                               const cmCustomCommandLines& commandLines,
@@ -241,16 +239,16 @@ public:
   /**
    * Add a link library to the build.
    */
-  void AddLinkLibrary(const std::string&);
-  void AddLinkLibrary(const std::string&, cmTarget::LinkLibraryType type);
-  void AddLinkLibraryForTarget(const std::string& tgt, const std::string&,
+  void AddLinkLibrary(const char*);
+  void AddLinkLibrary(const char*, cmTarget::LinkLibraryType type);
+  void AddLinkLibraryForTarget(const char *tgt, const char*,
                                cmTarget::LinkLibraryType type);
-  void AddLinkDirectoryForTarget(const std::string& tgt, const std::string& d);
+  void AddLinkDirectoryForTarget(const char *tgt, const char* d);
 
   /**
    * Add a link directory to the build.
    */
-  void AddLinkDirectory(const std::string&);
+  void AddLinkDirectory(const char*);
 
   const std::vector<std::string>& GetLinkDirectories() const
     {
@@ -264,10 +262,9 @@ public:
   /**
    * Add a subdirectory to the build.
    */
-  void AddSubDirectory(const std::string&, bool excludeFromAll=false,
+  void AddSubDirectory(const char*, bool excludeFromAll=false,
                        bool preorder = false);
-  void AddSubDirectory(const std::string& fullSrcDir,
-                       const std::string& fullBinDir,
+  void AddSubDirectory(const char* fullSrcDir,const char *fullBinDir,
                        bool excludeFromAll, bool preorder,
                        bool immediate);
 
@@ -286,9 +283,9 @@ public:
    * Add a variable definition to the build. This variable
    * can be used in CMake to refer to lists, directories, etc.
    */
-  void AddDefinition(const std::string& name, const char* value);
+  void AddDefinition(const char* name, const char* value);
   ///! Add a definition to this makefile and the global cmake cache.
-  void AddCacheDefinition(const std::string& name, const char* value,
+  void AddCacheDefinition(const char* name, const char* value,
                           const char* doc,
                           cmCacheManager::CacheEntryType type,
                           bool force = false);
@@ -296,15 +293,15 @@ public:
   /**
    * Add bool variable definition to the build.
    */
-  void AddDefinition(const std::string& name, bool);
+  void AddDefinition(const char* name, bool);
 
   /**
    * Remove a variable definition from the build.  This is not valid
    * for cache entries, and will only affect the current makefile.
    */
-  void RemoveDefinition(const std::string& name);
+  void RemoveDefinition(const char* name);
   ///! Remove a definition from the cache.
-  void RemoveCacheDefinition(const std::string& name);
+  void RemoveCacheDefinition(const char* name);
 
   /**
    * Specify the name of the project for this build.
@@ -329,13 +326,13 @@ public:
   cmTarget* AddLibrary(const char *libname, cmTarget::TargetType type,
                   const std::vector<std::string> &srcs,
                   bool excludeFromAll = false);
-  void AddAlias(const std::string& libname, cmTarget *tgt);
+  void AddAlias(const char *libname, cmTarget *tgt);
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
   /**
    * Add a root source group for consideration when adding a new source.
    */
-  void AddSourceGroup(const std::string& name, const char* regex=0);
+  void AddSourceGroup(const char* name, const char* regex=0);
 
   /**
    * Add a source group for consideration when adding a new source.
@@ -402,12 +399,12 @@ public:
    * CMakeLists files by recursing up the tree starting at the StartDirectory
    * and going up until it reaches the HomeDirectory.
    */
-  void SetHomeDirectory(const std::string& dir);
+  void SetHomeDirectory(const char* dir);
   const char* GetHomeDirectory() const
     {
       return this->cmHomeDirectory.c_str();
     }
-  void SetHomeOutputDirectory(const std::string& lib);
+  void SetHomeOutputDirectory(const char* lib);
   const char* GetHomeOutputDirectory() const
     {
       return this->HomeOutputDirectory.c_str();
@@ -432,7 +429,7 @@ public:
    * recursing up the tree starting at the StartDirectory and going up until
    * it reaches the HomeDirectory.
    */
-  void SetStartDirectory(const std::string& dir)
+  void SetStartDirectory(const char* dir)
     {
       this->cmStartDirectory = dir;
       cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
@@ -445,7 +442,7 @@ public:
     {
       return this->cmStartDirectory.c_str();
     }
-  void SetStartOutputDirectory(const std::string& lib)
+  void SetStartOutputDirectory(const char* lib)
     {
       this->StartOutputDirectory = lib;
       cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
@@ -497,7 +494,7 @@ public:
    * Set a regular expression that include files that are not found
    * must match in order to be considered a problem.
    */
-  void SetComplainRegularExpression(const std::string& regex)
+  void SetComplainRegularExpression(const char* regex)
     {
       this->ComplainFileRegularExpression = regex;
     }
@@ -537,12 +534,12 @@ public:
   cmTarget* FindTargetToUse(const std::string& name,
                             bool excludeAliases = false) const;
   bool IsAlias(const std::string& name) const;
-  cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const;
+  cmGeneratorTarget* FindGeneratorTargetToUse(const char* name) const;
 
   /**
    * Mark include directories as system directories.
    */
-  void AddSystemIncludeDirectories(const std::set<std::string> &incs);
+  void AddSystemIncludeDirectories(const std::set<cmStdString> &incs);
 
   /** Expand out any arguements in the vector that have ; separated
    *  strings into multiple arguements.  A new vector is created
@@ -558,14 +555,14 @@ public:
   /** Get a cmSourceFile pointer for a given source name, if the name is
    *  not found, then a null pointer is returned.
    */
-  cmSourceFile* GetSource(const std::string& sourceName) const;
+  cmSourceFile* GetSource(const char* sourceName) const;
 
   /** Get a cmSourceFile pointer for a given source name, if the name is
    *  not found, then create the source file and return it. generated
    * indicates if it is a generated file, this is used in determining
    * how to create the source file instance e.g. name
    */
-  cmSourceFile* GetOrCreateSource(const std::string& sourceName,
+  cmSourceFile* GetOrCreateSource(const char* sourceName,
                                   bool generated = false);
 
   /**
@@ -579,9 +576,9 @@ public:
    * Return a list of extensions associated with source and header
    * files
    */
-  const std::set<std::string>& GetSourceExtensions() const
+  const std::vector<std::string>& GetSourceExtensions() const
     {return this->SourceFileExtensions;}
-  const std::set<std::string>& GetHeaderExtensions() const
+  const std::vector<std::string>& GetHeaderExtensions() const
     {return this->HeaderFileExtensions;}
   //@}
 
@@ -590,10 +587,10 @@ public:
    * If the variable is not found in this makefile instance, the
    * cache is then queried.
    */
-  const char* GetDefinition(const std::string&) const;
-  const char* GetSafeDefinition(const std::string&) const;
-  const char* GetRequiredDefinition(const std::string& name) const;
-  bool IsDefinitionSet(const std::string&) const;
+  const char* GetDefinition(const char*) const;
+  const char* GetSafeDefinition(const char*) const;
+  const char* GetRequiredDefinition(const char* name) const;
+  bool IsDefinitionSet(const char*) const;
   /**
    * Get the list of all variables in the current space. If argument
    * cacheonly is specified and is greater than 0, then only cache
@@ -604,8 +601,8 @@ public:
   /** Test a boolean cache entry to see if it is true or false,
    *  returns false if no entry defined.
    */
-  bool IsOn(const std::string& name) const;
-  bool IsSet(const std::string& name) const;
+  bool IsOn(const char* name) const;
+  bool IsSet(const char* name) const;
 
   /** Return whether the target platform is 64-bit.  */
   bool PlatformIs64Bit() const;
@@ -776,7 +773,7 @@ public:
    * Is there a source file that has the provided source file as an output?
    * if so then return it
    */
-  cmSourceFile *GetSourceFileWithOutput(const std::string& outName) const;
+  cmSourceFile *GetSourceFileWithOutput(const char *outName) const;
 
   /**
    * Add a macro to the list of macros. The arguments should be name of the
@@ -785,12 +782,12 @@ public:
   void AddMacro(const char* name, const char* signature);
 
   ///! Add a new cmTest to the list of tests for this makefile.
-  cmTest* CreateTest(const std::string& testName);
+  cmTest* CreateTest(const char* testName);
 
   /** Get a cmTest pointer for a given test name, if the name is
    *  not found, then a null pointer is returned.
    */
-  cmTest* GetTest(const std::string& testName) const;
+  cmTest* GetTest(const char* testName) const;
 
   /**
    * Get a list of macros as a ; separated string
@@ -803,16 +800,14 @@ public:
   std::string GetModulesFile(const char* name) const;
 
   ///! Set/Get a property of this directory
-  void SetProperty(const std::string& prop, const char *value);
-  void AppendProperty(const std::string& prop, const char *value,
-                      bool asString=false);
-  const char *GetProperty(const std::string& prop) const;
-  const char *GetProperty(const std::string& prop,
-                          cmProperty::ScopeType scope) const;
-  bool GetPropertyAsBool(const std::string& prop) const;
+  void SetProperty(const char *prop, const char *value);
+  void AppendProperty(const char *prop, const char *value,bool asString=false);
+  const char *GetProperty(const char *prop) const;
+  const char *GetPropertyOrDefinition(const char *prop) const;
+  const char *GetProperty(const char *prop, cmProperty::ScopeType scope) const;
+  bool GetPropertyAsBool(const char *prop) const;
 
-  const char* GetFeature(const std::string& feature,
-                         const std::string& config);
+  const char* GetFeature(const char* feature, const char* config);
 
   // Get the properties
   cmPropertyMap &GetProperties() { return this->Properties; };
@@ -840,7 +835,7 @@ public:
   // push and pop variable scopes
   void PushScope();
   void PopScope();
-  void RaiseScope(const std::string& var, const char *value);
+  void RaiseScope(const char *var, const char *value);
 
   /** Helper class to push and pop scopes automatically.  */
   class ScopePushPop
@@ -877,7 +872,7 @@ public:
   void AddQtUiFileWithOptions(cmSourceFile *sf);
   std::vector<cmSourceFile*> GetQtUiFilesWithOptions() const;
 
-  std::set<std::string> const & GetSystemIncludeDirectories() const
+  std::set<cmStdString> const & GetSystemIncludeDirectories() const
     { return this->SystemIncludeDirectories; }
 
 protected:
@@ -885,7 +880,7 @@ protected:
   void AddGlobalLinkInformation(const char* name, cmTarget& target);
 
   // Check for a an unused variable
-  void CheckForUnused(const char* reason, const std::string& name) const;
+  void CheckForUnused(const char* reason, const char* name) const;
 
   std::string Prefix;
   std::vector<std::string> AuxSourceDirectories; //
@@ -905,14 +900,14 @@ protected:
   std::vector<cmSourceFile*> SourceFiles;
 
   // Tests
-  std::map<std::string, cmTest*> Tests;
+  std::map<cmStdString, cmTest*> Tests;
 
   // The link-library paths.  Order matters, use std::vector (not std::set).
   std::vector<std::string> LinkDirectories;
 
   // The set of include directories that are marked as system include
   // directories.
-  std::set<std::string> SystemIncludeDirectories;
+  std::set<cmStdString> SystemIncludeDirectories;
 
   std::vector<std::string> ListFiles; // list of command files loaded
   std::vector<std::string> OutputFiles; // list of command files loaded
@@ -925,8 +920,8 @@ protected:
 
   std::string IncludeFileRegularExpression;
   std::string ComplainFileRegularExpression;
-  std::set<std::string> SourceFileExtensions;
-  std::set<std::string> HeaderFileExtensions;
+  std::vector<std::string> SourceFileExtensions;
+  std::vector<std::string> HeaderFileExtensions;
   std::string DefineFlags;
 
   std::vector<cmValueWithOrigin> IncludeDirectoriesEntries;
@@ -952,13 +947,12 @@ private:
 
   bool ParseDefineFlag(std::string const& definition, bool remove);
 
-  bool EnforceUniqueDir(const std::string& srcPath,
-                        const std::string& binPath) const;
+  bool EnforceUniqueDir(const char* srcPath, const char* binPath) const;
 
   friend class cmMakeDepend;    // make depend needs direct access
                                 // to the Sources array
   void PrintStringVector(const char* s, const
-                         std::vector<std::pair<std::string, bool> >& v) const;
+                         std::vector<std::pair<cmStdString, bool> >& v) const;
   void PrintStringVector(const char* s,
                          const std::vector<std::string>& v) const;
 
@@ -969,10 +963,10 @@ private:
   void PushFunctionBlockerBarrier();
   void PopFunctionBlockerBarrier(bool reportError = true);
 
-  typedef std::map<std::string, std::string> StringStringMap;
+  typedef std::map<cmStdString, cmStdString> StringStringMap;
   StringStringMap MacrosMap;
 
-  std::map<std::string, bool> SubDirectoryOrder;
+  std::map<cmStdString, bool> SubDirectoryOrder;
 
   mutable cmsys::RegularExpression cmDefineRegex;
   mutable cmsys::RegularExpression cmDefine01Regex;
@@ -988,7 +982,7 @@ private:
   bool CheckSystemVars;
 
   // stack of list files being read
-  std::deque<std::string> ListFileStack;
+  std::deque<cmStdString> ListFileStack;
 
   // stack of commands being invoked.
   struct CallStackEntry
@@ -1001,7 +995,7 @@ private:
   friend class cmMakefileCall;
 
   std::vector<cmTarget*> ImportedTargetsOwned;
-  std::map<std::string, cmTarget*> ImportedTargets;
+  std::map<cmStdString, cmTarget*> ImportedTargets;
 
   // Internal policy stack management.
   void PushPolicy(bool weak = false,
@@ -1035,12 +1029,12 @@ private:
 
   bool GeneratingBuildSystem;
   /**
-   * Old version of GetSourceFileWithOutput(const std::string&) kept for
+   * Old version of GetSourceFileWithOutput(const char*) kept for
    * backward-compatibility. It implements a linear search and support
    * relative file paths. It is used as a fall back by
-   * GetSourceFileWithOutput(const std::string&).
+   * GetSourceFileWithOutput(const char*).
    */
-  cmSourceFile *LinearGetSourceFileWithOutput(const std::string& cname) const;
+  cmSourceFile *LinearGetSourceFileWithOutput(const char *cname) const;
 
   // A map for fast output to input look up.
 #if defined(CMAKE_BUILD_WITH_CMAKE)
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 9d4bb7a..d6a0cd4 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -237,7 +237,7 @@ void cmMakefileLibraryTargetGenerator::WriteFrameworkRules(bool relink)
 
 //----------------------------------------------------------------------------
 void cmMakefileLibraryTargetGenerator::WriteLibraryRules
-(const std::string& linkRuleVar, const std::string& extraFlags, bool relink)
+(const char* linkRuleVar, const char* extraFlags, bool relink)
 {
   // TODO: Merge the methods that call this method to avoid
   // code duplication.
@@ -261,7 +261,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
 
   // Create set of linking flags.
   std::string linkFlags;
-  this->LocalGenerator->AppendFlags(linkFlags, extraFlags.c_str());
+  this->LocalGenerator->AppendFlags(linkFlags, extraFlags);
 
   // Add OSX version flags, if any.
   if(this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
diff --git a/Source/cmMakefileLibraryTargetGenerator.h b/Source/cmMakefileLibraryTargetGenerator.h
index 4873516..1487b56 100644
--- a/Source/cmMakefileLibraryTargetGenerator.h
+++ b/Source/cmMakefileLibraryTargetGenerator.h
@@ -30,8 +30,7 @@ protected:
   void WriteStaticLibraryRules();
   void WriteSharedLibraryRules(bool relink);
   void WriteModuleLibraryRules(bool relink);
-  void WriteLibraryRules(const std::string& linkRule,
-                         const std::string& extraFlags,
+  void WriteLibraryRules(const char *linkRule, const char *extraFlags,
                          bool relink);
   // MacOSX Framework support methods
   void WriteFrameworkRules(bool relink);
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index e9b59ed..c3ca85d 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -342,21 +342,21 @@ std::string cmMakefileTargetGenerator::GetDefines(const std::string &l)
 void cmMakefileTargetGenerator::WriteTargetLanguageFlags()
 {
   // write language flags for target
-  std::set<std::string> languages;
+  std::set<cmStdString> languages;
   this->Target->GetLanguages(languages);
   // put the compiler in the rules.make file so that if it changes
   // things rebuild
-  for(std::set<std::string>::const_iterator l = languages.begin();
+  for(std::set<cmStdString>::const_iterator l = languages.begin();
       l != languages.end(); ++l)
     {
-    std::string compiler = "CMAKE_";
+    cmStdString compiler = "CMAKE_";
     compiler += *l;
     compiler += "_COMPILER";
     *this->FlagFileStream << "# compile " << l->c_str() << " with " <<
       this->Makefile->GetSafeDefinition(compiler.c_str()) << "\n";
     }
 
-  for(std::set<std::string>::const_iterator l = languages.begin();
+  for(std::set<cmStdString>::const_iterator l = languages.begin();
       l != languages.end(); ++l)
     {
     *this->FlagFileStream << *l << "_FLAGS = " << this->GetFlags(*l) << "\n\n";
@@ -1514,7 +1514,7 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(const char* main_output,
       }
 
     // Make sure the extra files are built.
-    for(std::set<std::string>::const_iterator i = this->ExtraFiles.begin();
+    for(std::set<cmStdString>::const_iterator i = this->ExtraFiles.begin();
         i != this->ExtraFiles.end(); ++i)
       {
       depends.push_back(*i);
@@ -1544,7 +1544,7 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags(std::string const& l)
     return std::string();
     }
 
- std::set<std::string> emitted;
+ std::set<cmStdString> emitted;
 #ifdef __APPLE__  /* don't insert this when crosscompiling e.g. to iphone */
   emitted.insert("/System/Library/Frameworks");
 #endif
@@ -1650,10 +1650,9 @@ void cmMakefileTargetGenerator
   this->AppendTargetDepends(depends);
 
   // Add a dependency on the link definitions file, if any.
-  std::string def = this->GeneratorTarget->GetModuleDefinitionFile();
-  if(!def.empty())
+  if(!this->GeneratorTarget->ModuleDefinitionFile.empty())
     {
-    depends.push_back(def);
+    depends.push_back(this->GeneratorTarget->ModuleDefinitionFile);
     }
 
   // Add user-specified dependencies.
@@ -1665,8 +1664,7 @@ void cmMakefileTargetGenerator
 }
 
 //----------------------------------------------------------------------------
-std::string cmMakefileTargetGenerator::GetLinkRule(
-                                              const std::string& linkRuleVar)
+std::string cmMakefileTargetGenerator::GetLinkRule(const char* linkRuleVar)
 {
   std::string linkRule = this->Makefile->GetRequiredDefinition(linkRuleVar);
   if(this->Target->HasImplibGNUtoMS())
@@ -2021,8 +2019,7 @@ void cmMakefileTargetGenerator::AddFortranFlags(std::string& flags)
 //----------------------------------------------------------------------------
 void cmMakefileTargetGenerator::AddModuleDefinitionFlag(std::string& flags)
 {
-  std::string def = this->GeneratorTarget->GetModuleDefinitionFile();
-  if(def.empty())
+  if(this->GeneratorTarget->ModuleDefinitionFile.empty())
     {
     return;
     }
@@ -2038,18 +2035,19 @@ void cmMakefileTargetGenerator::AddModuleDefinitionFlag(std::string& flags)
   // Append the flag and value.  Use ConvertToLinkReference to help
   // vs6's "cl -link" pass it to the linker.
   std::string flag = defFileFlag;
-  flag += (this->LocalGenerator->ConvertToLinkReference(def.c_str()));
+  flag += (this->LocalGenerator->ConvertToLinkReference(
+             this->GeneratorTarget->ModuleDefinitionFile.c_str()));
   this->LocalGenerator->AppendFlags(flags, flag.c_str());
 }
 
 //----------------------------------------------------------------------------
-const char* cmMakefileTargetGenerator::GetFeature(const std::string& feature)
+const char* cmMakefileTargetGenerator::GetFeature(const char* feature)
 {
   return this->Target->GetFeature(feature, this->ConfigName);
 }
 
 //----------------------------------------------------------------------------
-bool cmMakefileTargetGenerator::GetFeatureAsBool(const std::string& feature)
+bool cmMakefileTargetGenerator::GetFeatureAsBool(const char* feature)
 {
   return cmSystemTools::IsOn(this->GetFeature(feature));
 }
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index 2a752ec..4f8fafa 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -138,7 +138,7 @@ protected:
   void AppendLinkDepends(std::vector<std::string>& depends);
 
   // Lookup the link rule for this target.
-  std::string GetLinkRule(const std::string& linkRuleVar);
+  std::string GetLinkRule(const char* linkRuleVar);
 
   /** In order to support parallel builds for custom commands with
       multiple outputs the outputs are given a serial order, and only
@@ -178,7 +178,7 @@ protected:
   cmLocalUnixMakefileGenerator3 *LocalGenerator;
   cmGlobalUnixMakefileGenerator3 *GlobalGenerator;
   cmMakefile *Makefile;
-  std::string ConfigName;
+  const char *ConfigName;
 
   enum CustomCommandDriveType { OnBuild, OnDepends, OnUtility };
   CustomCommandDriveType CustomCommandDriver;
@@ -203,7 +203,7 @@ protected:
   std::string FlagFileNameFull;
   cmGeneratedFileStream *FlagFileStream;
   class StringList: public std::vector<std::string> {};
-  std::map<std::string, StringList> FlagFileDepends;
+  std::map<cmStdString, StringList> FlagFileDepends;
 
   // the stream for the info file
   std::string InfoFileNameFull;
@@ -217,12 +217,12 @@ protected:
   std::vector<std::string> ExternalObjects;
 
   // Set of object file names that will be built in this directory.
-  std::set<std::string> ObjectFiles;
+  std::set<cmStdString> ObjectFiles;
 
   // Set of extra output files to be driven by the build.
-  std::set<std::string> ExtraFiles;
+  std::set<cmStdString> ExtraFiles;
 
-  typedef std::map<std::string, std::string> MultipleOutputPairsType;
+  typedef std::map<cmStdString, cmStdString> MultipleOutputPairsType;
   MultipleOutputPairsType MultipleOutputPairs;
 
   // Target name info.
@@ -233,11 +233,11 @@ protected:
   std::string TargetNamePDB;
 
   // Mac OS X content info.
-  std::set<std::string> MacContentFolders;
+  std::set<cmStdString> MacContentFolders;
   cmOSXBundleGenerator* OSXBundleGenerator;
   MacOSXContentGeneratorType* MacOSXContentGenerator;
 
-  typedef std::map<std::string, std::string> ByLanguageMap;
+  typedef std::map<cmStdString, cmStdString> ByLanguageMap;
   std::string GetFlags(const std::string &l);
   ByLanguageMap FlagsByLanguage;
   std::string GetDefines(const std::string &l);
@@ -258,13 +258,13 @@ protected:
   void AddFeatureFlags(std::string& flags, const char* lang);
 
   // Feature query methods.
-  const char* GetFeature(const std::string& feature);
-  bool GetFeatureAsBool(const std::string& feature);
+  const char* GetFeature(const char* feature);
+  bool GetFeatureAsBool(const char* feature);
 
   //==================================================================
   // Convenience routines that do nothing more than forward to
   // implementaitons
-  std::string Convert(const std::string& source,
+  std::string Convert(const char* source,
                       cmLocalGenerator::RelativeRoot relative,
                       cmLocalGenerator::OutputFormat output =
                       cmLocalGenerator::UNCHANGED,
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index f825d67..73ba815 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -109,9 +109,9 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules()
     << "\n\n";
 #endif
 
-  std::set<std::string> languages;
+  std::set<cmStdString> languages;
   this->GetTarget()->GetLanguages(languages);
-  for(std::set<std::string>::const_iterator l = languages.begin();
+  for(std::set<cmStdString>::const_iterator l = languages.begin();
       l != languages.end();
       ++l)
     this->WriteLanguageRules(*l);
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 5c7bfe2..900af8d 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -91,19 +91,19 @@ cmGlobalNinjaGenerator* cmNinjaTargetGenerator::GetGlobalGenerator() const
   return this->LocalGenerator->GetGlobalNinjaGenerator();
 }
 
-std::string const& cmNinjaTargetGenerator::GetConfigName() const
+const char* cmNinjaTargetGenerator::GetConfigName() const
 {
   return this->LocalGenerator->GetConfigName();
 }
 
 // TODO: Picked up from cmMakefileTargetGenerator.  Refactor it.
-const char* cmNinjaTargetGenerator::GetFeature(const std::string& feature)
+const char* cmNinjaTargetGenerator::GetFeature(const char* feature)
 {
   return this->Target->GetFeature(feature, this->GetConfigName());
 }
 
 // TODO: Picked up from cmMakefileTargetGenerator.  Refactor it.
-bool cmNinjaTargetGenerator::GetFeatureAsBool(const std::string& feature)
+bool cmNinjaTargetGenerator::GetFeatureAsBool(const char* feature)
 {
   return cmSystemTools::IsOn(this->GetFeature(feature));
 }
@@ -498,10 +498,10 @@ cmNinjaTargetGenerator
     {
     this->WriteObjectBuildStatement(*si);
     }
-  std::string def = this->GeneratorTarget->GetModuleDefinitionFile();
-  if(!def.empty())
+  if(!this->GeneratorTarget->ModuleDefinitionFile.empty())
     {
-    this->ModuleDefinitionFile = this->ConvertToNinjaPath(def.c_str());
+    this->ModuleDefinitionFile = this->ConvertToNinjaPath(
+      this->GeneratorTarget->ModuleDefinitionFile.c_str());
     }
 
   {
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index aad499a..43f2279 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -65,13 +65,13 @@ protected:
   cmMakefile* GetMakefile() const
   { return this->Makefile; }
 
-  std::string const& GetConfigName() const;
+  const char* GetConfigName() const;
 
   std::string LanguageCompilerRule(const std::string& lang) const
   { return lang + "_COMPILER"; }
 
-  const char* GetFeature(const std::string& feature);
-  bool GetFeatureAsBool(const std::string& feature);
+  const char* GetFeature(const char* feature);
+  bool GetFeatureAsBool(const char* feature);
   void AddFeatureFlags(std::string& flags, const char* lang);
 
   /**
@@ -140,7 +140,7 @@ protected:
   MacOSXContentGeneratorType* MacOSXContentGenerator;
   // Properly initialized by sub-classes.
   cmOSXBundleGenerator* OSXBundleGenerator;
-  std::set<std::string> MacContentFolders;
+  std::set<cmStdString> MacContentFolders;
 
   void addPoolNinjaVariable(const char* pool_property,
                             cmTarget* target,
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index fb41cef..9a340dc 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -19,9 +19,8 @@
 //----------------------------------------------------------------------------
 cmOSXBundleGenerator::
 cmOSXBundleGenerator(cmGeneratorTarget* target,
-                     const std::string& configName)
- : GT(target)
- , Target(target->Target)
+                     const char* configName)
+ : Target(target->Target)
  , Makefile(target->Target->GetMakefile())
  , LocalGenerator(Makefile->GetLocalGenerator())
  , ConfigName(configName)
@@ -35,7 +34,7 @@ cmOSXBundleGenerator(cmGeneratorTarget* target,
 //----------------------------------------------------------------------------
 bool cmOSXBundleGenerator::MustSkip()
 {
-  return !this->GT->Target->HaveWellDefinedOutputFiles();
+  return !this->Target->HaveWellDefinedOutputFiles();
 }
 
 //----------------------------------------------------------------------------
@@ -48,7 +47,7 @@ void cmOSXBundleGenerator::CreateAppBundle(const std::string& targetName,
   // Compute bundle directory names.
   std::string out = outpath;
   out += "/";
-  out += this->GT->Target->GetAppBundleDirectory(this->ConfigName, false);
+  out += this->Target->GetAppBundleDirectory(this->ConfigName, false);
   cmSystemTools::MakeDirectory(out.c_str());
   this->Makefile->AddCMakeOutputFile(out);
 
@@ -58,9 +57,9 @@ void cmOSXBundleGenerator::CreateAppBundle(const std::string& targetName,
   // to be set.
   std::string plist = outpath;
   plist += "/";
-  plist += this->GT->Target->GetAppBundleDirectory(this->ConfigName, true);
+  plist += this->Target->GetAppBundleDirectory(this->ConfigName, true);
   plist += "/Info.plist";
-  this->LocalGenerator->GenerateAppleInfoPList(this->GT->Target,
+  this->LocalGenerator->GenerateAppleInfoPList(this->Target,
                                                targetName.c_str(),
                                                plist.c_str());
   this->Makefile->AddCMakeOutputFile(plist);
@@ -78,20 +77,20 @@ void cmOSXBundleGenerator::CreateFramework(
 
   // Compute the location of the top-level foo.framework directory.
   std::string contentdir = outpath + "/" +
-    this->GT->Target->GetFrameworkDirectory(this->ConfigName, true);
+    this->Target->GetFrameworkDirectory(this->ConfigName, true);
   contentdir += "/";
 
   std::string newoutpath = outpath + "/" +
-    this->GT->Target->GetFrameworkDirectory(this->ConfigName, false);
+    this->Target->GetFrameworkDirectory(this->ConfigName, false);
 
-  std::string frameworkVersion = this->GT->Target->GetFrameworkVersion();
+  std::string frameworkVersion = this->Target->GetFrameworkVersion();
 
   // Configure the Info.plist file into the Resources directory.
   this->MacContentFolders->insert("Resources");
   std::string plist = newoutpath;
   plist += "/Resources/Info.plist";
   std::string name = cmSystemTools::GetFilenameName(targetName);
-  this->LocalGenerator->GenerateFrameworkInfoPList(this->GT->Target,
+  this->LocalGenerator->GenerateFrameworkInfoPList(this->Target,
                                                    name.c_str(),
                                                    plist.c_str());
 
@@ -173,16 +172,16 @@ void cmOSXBundleGenerator::CreateCFBundle(const std::string& targetName,
   // Compute bundle directory names.
   std::string out = root;
   out += "/";
-  out += this->GT->Target->GetCFBundleDirectory(this->ConfigName, false);
+  out += this->Target->GetCFBundleDirectory(this->ConfigName, false);
   cmSystemTools::MakeDirectory(out.c_str());
   this->Makefile->AddCMakeOutputFile(out);
 
   // Configure the Info.plist file.  Note that it needs the executable name
   // to be set.
   std::string plist =
-    this->GT->Target->GetCFBundleDirectory(this->ConfigName, true);
+    this->Target->GetCFBundleDirectory(this->ConfigName, true);
   plist += "/Info.plist";
-  this->LocalGenerator->GenerateAppleInfoPList(this->GT->Target,
+  this->LocalGenerator->GenerateAppleInfoPList(this->Target,
                                                targetName.c_str(),
                                                plist.c_str());
   this->Makefile->AddCMakeOutputFile(plist);
@@ -200,9 +199,9 @@ GenerateMacOSXContentStatements(std::vector<cmSourceFile*> const& sources,
   for(std::vector<cmSourceFile*>::const_iterator
         si = sources.begin(); si != sources.end(); ++si)
     {
-    cmGeneratorTarget::SourceFileFlags tsFlags =
-      this->GT->GetTargetSourceFileFlags(*si);
-    if(tsFlags.Type != cmGeneratorTarget::SourceFileTypeNormal)
+    cmTarget::SourceFileFlags tsFlags =
+      this->Target->GetTargetSourceFileFlags(*si);
+    if(tsFlags.Type != cmTarget::SourceFileTypeNormal)
       {
       (*generator)(**si, tsFlags.MacFolder);
       }
@@ -216,7 +215,7 @@ cmOSXBundleGenerator::InitMacOSXContentDirectory(const char* pkgloc)
   // Construct the full path to the content subdirectory.
 
   std::string macdir =
-    this->GT->Target->GetMacContentDirectory(this->ConfigName,
+    this->Target->GetMacContentDirectory(this->ConfigName,
                                          /*implib*/ false);
   macdir += "/";
   macdir += pkgloc;
diff --git a/Source/cmOSXBundleGenerator.h b/Source/cmOSXBundleGenerator.h
index a4bcf23..29b7611 100644
--- a/Source/cmOSXBundleGenerator.h
+++ b/Source/cmOSXBundleGenerator.h
@@ -27,7 +27,7 @@ class cmOSXBundleGenerator
 {
 public:
   cmOSXBundleGenerator(cmGeneratorTarget* target,
-                       const std::string& configName);
+                       const char* configName);
 
   // create an app bundle at a given root, and return
   // the directory within the bundle that contains the executable
@@ -52,19 +52,18 @@ public:
     MacOSXContentGeneratorType* generator);
   std::string InitMacOSXContentDirectory(const char* pkgloc);
 
-  void SetMacContentFolders(std::set<std::string>* macContentFolders)
+  void SetMacContentFolders(std::set<cmStdString>* macContentFolders)
   { this->MacContentFolders = macContentFolders; }
 
 private:
   bool MustSkip();
 
 private:
-  cmGeneratorTarget* GT;
   cmTarget* Target;
   cmMakefile* Makefile;
   cmLocalGenerator* LocalGenerator;
-  std::string ConfigName;
-  std::set<std::string>* MacContentFolders;
+  const char* ConfigName;
+  std::set<cmStdString>* MacContentFolders;
 };
 
 
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx
index 79677e3..86beb97 100644
--- a/Source/cmOrderDirectories.cxx
+++ b/Source/cmOrderDirectories.cxx
@@ -138,9 +138,9 @@ bool cmOrderDirectoriesConstraint::FileMayConflict(std::string const& dir,
     }
 
   // Check if the file will be built by cmake.
-  std::set<std::string> const& files =
+  std::set<cmStdString> const& files =
     (this->GlobalGenerator->GetDirectoryContent(dir, false));
-  std::set<std::string>::const_iterator fi = files.find(name);
+  std::set<cmStdString>::const_iterator fi = files.find(name);
   return fi != files.end();
 }
 
@@ -200,7 +200,7 @@ bool cmOrderDirectoriesConstraintSOName::FindConflict(std::string const& dir)
     {
     // We do not have the soname.  Look for files in the directory
     // that may conflict.
-    std::set<std::string> const& files =
+    std::set<cmStdString> const& files =
       (this->GlobalGenerator
        ->GetDirectoryContent(dir, true));
 
@@ -208,9 +208,9 @@ bool cmOrderDirectoriesConstraintSOName::FindConflict(std::string const& dir)
     // know the soname just look at all files that start with the
     // file name.  Usually the soname starts with the library name.
     std::string base = this->FileName;
-    std::set<std::string>::const_iterator first = files.lower_bound(base);
+    std::set<cmStdString>::const_iterator first = files.lower_bound(base);
     ++base[base.size()-1];
-    std::set<std::string>::const_iterator last = files.upper_bound(base);
+    std::set<cmStdString>::const_iterator last = files.upper_bound(base);
     if(first != last)
       {
       return true;
@@ -251,8 +251,8 @@ bool cmOrderDirectoriesConstraintLibrary::FindConflict(std::string const& dir)
   if(!this->OD->LinkExtensions.empty() &&
      this->OD->RemoveLibraryExtension.find(this->FileName))
     {
-    std::string lib = this->OD->RemoveLibraryExtension.match(1);
-    std::string ext = this->OD->RemoveLibraryExtension.match(2);
+    cmStdString lib = this->OD->RemoveLibraryExtension.match(1);
+    cmStdString ext = this->OD->RemoveLibraryExtension.match(2);
     for(std::vector<std::string>::iterator
           i = this->OD->LinkExtensions.begin();
         i != this->OD->LinkExtensions.end(); ++i)
@@ -407,7 +407,7 @@ cmOrderDirectories
 //----------------------------------------------------------------------------
 void
 cmOrderDirectories
-::SetImplicitDirectories(std::set<std::string> const& implicitDirs)
+::SetImplicitDirectories(std::set<cmStdString> const& implicitDirs)
 {
   this->ImplicitDirectories = implicitDirs;
 }
@@ -444,11 +444,11 @@ void cmOrderDirectories::CollectOriginalDirectories()
 int cmOrderDirectories::AddOriginalDirectory(std::string const& dir)
 {
   // Add the runtime directory with a unique index.
-  std::map<std::string, int>::iterator i =
+  std::map<cmStdString, int>::iterator i =
     this->DirectoryIndex.find(dir);
   if(i == this->DirectoryIndex.end())
     {
-    std::map<std::string, int>::value_type
+    std::map<cmStdString, int>::value_type
       entry(dir, static_cast<int>(this->OriginalDirectories.size()));
     i = this->DirectoryIndex.insert(entry).first;
     this->OriginalDirectories.push_back(dir);
diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h
index 07c85dd..76bf429 100644
--- a/Source/cmOrderDirectories.h
+++ b/Source/cmOrderDirectories.h
@@ -34,7 +34,7 @@ public:
   void AddLinkLibrary(std::string const& fullPath);
   void AddUserDirectories(std::vector<std::string> const& extra);
   void AddLanguageDirectories(std::vector<std::string> const& dirs);
-  void SetImplicitDirectories(std::set<std::string> const& implicitDirs);
+  void SetImplicitDirectories(std::set<cmStdString> const& implicitDirs);
   void SetLinkExtensionInfo(std::vector<std::string> const& linkExtensions,
                             std::string const& removeExtRegex);
 
@@ -54,11 +54,11 @@ private:
   std::vector<std::string> LanguageDirectories;
   cmsys::RegularExpression RemoveLibraryExtension;
   std::vector<std::string> LinkExtensions;
-  std::set<std::string> ImplicitDirectories;
-  std::set<std::string> EmmittedConstraintSOName;
-  std::set<std::string> EmmittedConstraintLibrary;
+  std::set<cmStdString> ImplicitDirectories;
+  std::set<cmStdString> EmmittedConstraintSOName;
+  std::set<cmStdString> EmmittedConstraintLibrary;
   std::vector<std::string> OriginalDirectories;
-  std::map<std::string, int> DirectoryIndex;
+  std::map<cmStdString, int> DirectoryIndex;
   std::vector<int> DirectoryVisited;
   void CollectOriginalDirectories();
   int AddOriginalDirectory(std::string const& dir);
diff --git a/Source/cmProperty.cxx b/Source/cmProperty.cxx
index 40976db..3b37cf3 100644
--- a/Source/cmProperty.cxx
+++ b/Source/cmProperty.cxx
@@ -12,15 +12,14 @@
 #include "cmProperty.h"
 #include "cmSystemTools.h"
 
-void cmProperty::Set(const std::string& name, const char *value)
+void cmProperty::Set(const char *name, const char *value)
 {
   this->Name = name;
   this->Value = value;
   this->ValueHasBeenSet = true;
 }
 
-void cmProperty::Append(const std::string& name, const char *value,
-                        bool asString)
+void cmProperty::Append(const char *name, const char *value, bool asString)
 {
   this->Name = name;
   if(!this->Value.empty() && *value && !asString)
diff --git a/Source/cmProperty.h b/Source/cmProperty.h
index 789be1d..bb75bb0 100644
--- a/Source/cmProperty.h
+++ b/Source/cmProperty.h
@@ -21,11 +21,10 @@ public:
                    TEST, VARIABLE, CACHED_VARIABLE };
 
   // set this property
-  void Set(const std::string& name, const char *value);
+  void Set(const char *name, const char *value);
 
   // append to this property
-  void Append(const std::string& name, const char *value,
-              bool asString = false);
+  void Append(const char *name, const char *value, bool asString = false);
 
   // get the value
   const char *GetValue() const;
diff --git a/Source/cmPropertyDefinition.cxx b/Source/cmPropertyDefinition.cxx
index 1af967c..abc57ce 100644
--- a/Source/cmPropertyDefinition.cxx
+++ b/Source/cmPropertyDefinition.cxx
@@ -13,7 +13,7 @@
 #include "cmSystemTools.h"
 
 void cmPropertyDefinition
-::DefineProperty(const std::string& name, cmProperty::ScopeType scope,
+::DefineProperty(const char *name, cmProperty::ScopeType scope,
                  const char *shortDescription,
                  const char *fullDescription,
                  bool chain)
diff --git a/Source/cmPropertyDefinition.h b/Source/cmPropertyDefinition.h
index 9ca8222..1b6a7a6 100644
--- a/Source/cmPropertyDefinition.h
+++ b/Source/cmPropertyDefinition.h
@@ -27,7 +27,7 @@ class cmPropertyDefinition
 {
 public:
   /// Define this property
-  void DefineProperty(const std::string& name, cmProperty::ScopeType scope,
+  void DefineProperty(const char *name, cmProperty::ScopeType scope,
                       const char *ShortDescription,
                       const char *FullDescription,
                       bool chained);
diff --git a/Source/cmPropertyDefinitionMap.cxx b/Source/cmPropertyDefinitionMap.cxx
index 3875318..db29504 100644
--- a/Source/cmPropertyDefinitionMap.cxx
+++ b/Source/cmPropertyDefinitionMap.cxx
@@ -14,11 +14,16 @@
 #include "cmDocumentationSection.h"
 
 void cmPropertyDefinitionMap
-::DefineProperty(const std::string& name, cmProperty::ScopeType scope,
+::DefineProperty(const char *name, cmProperty::ScopeType scope,
                  const char *ShortDescription,
                  const char *FullDescription,
                  bool chain)
 {
+  if (!name)
+    {
+    return;
+    }
+
   cmPropertyDefinitionMap::iterator it = this->find(name);
   cmPropertyDefinition *prop;
   if (it == this->end())
@@ -29,8 +34,13 @@ void cmPropertyDefinitionMap
     }
 }
 
-bool cmPropertyDefinitionMap::IsPropertyDefined(const std::string& name)
+bool cmPropertyDefinitionMap::IsPropertyDefined(const char *name)
 {
+  if (!name)
+    {
+    return false;
+    }
+
   cmPropertyDefinitionMap::iterator it = this->find(name);
   if (it == this->end())
     {
@@ -40,8 +50,13 @@ bool cmPropertyDefinitionMap::IsPropertyDefined(const std::string& name)
   return true;
 }
 
-bool cmPropertyDefinitionMap::IsPropertyChained(const std::string& name)
+bool cmPropertyDefinitionMap::IsPropertyChained(const char *name)
 {
+  if (!name)
+    {
+    return false;
+    }
+
   cmPropertyDefinitionMap::iterator it = this->find(name);
   if (it == this->end())
     {
diff --git a/Source/cmPropertyDefinitionMap.h b/Source/cmPropertyDefinitionMap.h
index 00c7328..736e243 100644
--- a/Source/cmPropertyDefinitionMap.h
+++ b/Source/cmPropertyDefinitionMap.h
@@ -17,20 +17,20 @@
 class cmDocumentationSection;
 
 class cmPropertyDefinitionMap :
-public std::map<std::string,cmPropertyDefinition>
+public std::map<cmStdString,cmPropertyDefinition>
 {
 public:
   // define the property
-  void DefineProperty(const std::string& name, cmProperty::ScopeType scope,
+  void DefineProperty(const char *name, cmProperty::ScopeType scope,
                       const char *ShortDescription,
                       const char *FullDescription,
                       bool chain);
 
   // has a named property been defined
-  bool IsPropertyDefined(const std::string& name);
+  bool IsPropertyDefined(const char *name);
 
   // is a named property set to chain
-  bool IsPropertyChained(const std::string& name);
+  bool IsPropertyChained(const char *name);
 };
 
 #endif
diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx
index e335b3b..e94e3e9 100644
--- a/Source/cmPropertyMap.cxx
+++ b/Source/cmPropertyMap.cxx
@@ -13,7 +13,7 @@
 #include "cmSystemTools.h"
 #include "cmake.h"
 
-cmProperty *cmPropertyMap::GetOrCreateProperty(const std::string& name)
+cmProperty *cmPropertyMap::GetOrCreateProperty(const char *name)
 {
   cmPropertyMap::iterator it = this->find(name);
   cmProperty *prop;
@@ -28,9 +28,13 @@ cmProperty *cmPropertyMap::GetOrCreateProperty(const std::string& name)
   return prop;
 }
 
-void cmPropertyMap::SetProperty(const std::string& name, const char *value,
+void cmPropertyMap::SetProperty(const char *name, const char *value,
                                 cmProperty::ScopeType scope)
 {
+  if (!name)
+    {
+    return;
+    }
   if(!value)
     {
     this->erase(name);
@@ -42,11 +46,11 @@ void cmPropertyMap::SetProperty(const std::string& name, const char *value,
   prop->Set(name,value);
 }
 
-void cmPropertyMap::AppendProperty(const std::string& name, const char* value,
+void cmPropertyMap::AppendProperty(const char* name, const char* value,
                                    cmProperty::ScopeType scope, bool asString)
 {
   // Skip if nothing to append.
-  if(!value || !*value)
+  if(!name || !value || !*value)
     {
     return;
     }
@@ -57,12 +61,12 @@ void cmPropertyMap::AppendProperty(const std::string& name, const char* value,
 }
 
 const char *cmPropertyMap
-::GetPropertyValue(const std::string& name,
+::GetPropertyValue(const char *name,
                    cmProperty::ScopeType scope,
                    bool &chain) const
 {
   chain = false;
-  if (name.empty())
+  if (!name)
     {
     return 0;
     }
diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h
index fa33848..0c3aad4 100644
--- a/Source/cmPropertyMap.h
+++ b/Source/cmPropertyMap.h
@@ -16,18 +16,18 @@
 
 class cmake;
 
-class cmPropertyMap : public std::map<std::string,cmProperty>
+class cmPropertyMap : public std::map<cmStdString,cmProperty>
 {
 public:
-  cmProperty *GetOrCreateProperty(const std::string& name);
+  cmProperty *GetOrCreateProperty(const char *name);
 
-  void SetProperty(const std::string& name, const char *value,
+  void SetProperty(const char *name, const char *value,
                    cmProperty::ScopeType scope);
 
-  void AppendProperty(const std::string& name, const char* value,
+  void AppendProperty(const char* name, const char* value,
                       cmProperty::ScopeType scope, bool asString=false);
 
-  const char *GetPropertyValue(const std::string& name,
+  const char *GetPropertyValue(const char *name,
                                cmProperty::ScopeType scope,
                                bool &chain) const;
 
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 657bfbe..dfb310e 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -62,10 +62,10 @@ static bool requiresMocing(const std::string& text, std::string &macroName)
 static std::string findMatchingHeader(const std::string& absPath,
                                       const std::string& mocSubDir,
                                       const std::string& basename,
-                              const std::set<std::string>& headerExtensions)
+                              const std::vector<std::string>& headerExtensions)
 {
   std::string header;
-  for(std::set<std::string>::const_iterator ext = headerExtensions.begin();
+  for(std::vector<std::string>::const_iterator ext = headerExtensions.begin();
       ext != headerExtensions.end();
       ++ext)
     {
@@ -105,7 +105,7 @@ static std::string extractSubDir(const std::string& absPath,
 
 static void copyTargetProperty(cmTarget* destinationTarget,
                                cmTarget* sourceTarget,
-                               const std::string& propertyName)
+                               const char* propertyName)
 {
   const char* propertyValue = sourceTarget->GetProperty(propertyName);
   if (propertyValue)
@@ -306,7 +306,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
 }
 
 static void GetCompileDefinitionsAndDirectories(cmTarget const* target,
-                                                const std::string& config,
+                                                const char * config,
                                                 std::string &incs,
                                                 std::string &defs)
 {
@@ -610,7 +610,7 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
                           autogenTargetName.c_str());
       return;
       }
-    makefile->AddDefinition("_qt_moc_executable", qt5Moc->GetLocation(""));
+    makefile->AddDefinition("_qt_moc_executable", qt5Moc->GetLocation(0));
     }
   else if (strcmp(qtVersion, "4") == 0)
     {
@@ -621,7 +621,7 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
                           autogenTargetName.c_str());
       return;
       }
-    makefile->AddDefinition("_qt_moc_executable", qt4Moc->GetLocation(""));
+    makefile->AddDefinition("_qt_moc_executable", qt4Moc->GetLocation(0));
     }
   else
     {
@@ -660,7 +660,7 @@ void cmQtAutoGenerators::MergeUicOptions(std::vector<std::string> &opts,
         ++o;
         }
       if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions),
-                  cmStrCmp(*it)) != cmArrayEnd(valueOptions))
+                  cmStrCmp(o)) != cmArrayEnd(valueOptions))
         {
         assert(existingIt + 1 != opts.end());
         *(existingIt + 1) = *(it + 1);
@@ -697,7 +697,7 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
 {
   cmMakefile *makefile = target->GetMakefile();
 
-  std::set<std::string> skipped;
+  std::set<cmStdString> skipped;
   std::vector<std::string> skipVec;
   cmSystemTools::ExpandListArgument(this->SkipUic.c_str(), skipVec);
 
@@ -782,7 +782,7 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
       }
     else
       {
-      makefile->AddDefinition("_qt_uic_executable", qt5Uic->GetLocation(""));
+      makefile->AddDefinition("_qt_uic_executable", qt5Uic->GetLocation(0));
       }
     }
   else if (strcmp(qtVersion, "4") == 0)
@@ -794,7 +794,7 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
                           targetName);
       return;
       }
-    makefile->AddDefinition("_qt_uic_executable", qt4Uic->GetLocation(""));
+    makefile->AddDefinition("_qt_uic_executable", qt4Uic->GetLocation(0));
     }
   else
     {
@@ -831,7 +831,7 @@ void cmQtAutoGenerators::MergeRccOptions(std::vector<std::string> &opts,
         ++o;
         }
       if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions),
-                  cmStrCmp(*it)) != cmArrayEnd(valueOptions))
+                  cmStrCmp(o)) != cmArrayEnd(valueOptions))
         {
         assert(existingIt + 1 != opts.end());
         *(existingIt + 1) = *(it + 1);
@@ -931,7 +931,7 @@ void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target)
                           targetName);
       return;
       }
-    makefile->AddDefinition("_qt_rcc_executable", qt5Rcc->GetLocation(""));
+    makefile->AddDefinition("_qt_rcc_executable", qt5Rcc->GetLocation(0));
     }
   else if (strcmp(qtVersion, "4") == 0)
     {
@@ -942,7 +942,7 @@ void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target)
                           targetName);
       return;
       }
-    makefile->AddDefinition("_qt_rcc_executable", qt4Rcc->GetLocation(""));
+    makefile->AddDefinition("_qt_rcc_executable", qt4Rcc->GetLocation(0));
     }
   else
     {
@@ -1280,7 +1280,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
   std::vector<std::string> sourceFiles;
   cmSystemTools::ExpandListArgument(this->Sources, sourceFiles);
 
-  const std::set<std::string>& headerExtensions =
+  const std::vector<std::string>& headerExtensions =
                                                makefile->GetHeaderExtensions();
 
   std::map<std::string, std::string> includedUis;
@@ -1435,7 +1435,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
 
 
 void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
-                              const std::set<std::string>& headerExtensions,
+                              const std::vector<std::string>& headerExtensions,
                               std::map<std::string, std::string>& includedMocs,
                               std::map<std::string, std::string> &includedUis)
 {
@@ -1623,7 +1623,7 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
 
 
 void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
-                              const std::set<std::string>& headerExtensions,
+                              const std::vector<std::string>& headerExtensions,
                               std::map<std::string, std::string>& includedMocs,
                               std::map<std::string, std::string>& includedUis)
 {
@@ -1802,7 +1802,7 @@ void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
 
 void
 cmQtAutoGenerators::SearchHeadersForCppFile(const std::string& absFilename,
-                              const std::set<std::string>& headerExtensions,
+                              const std::vector<std::string>& headerExtensions,
                               std::set<std::string>& absHeaders)
 {
   // search for header files and private header files we may need to moc:
@@ -1811,7 +1811,7 @@ cmQtAutoGenerators::SearchHeadersForCppFile(const std::string& absFilename,
   const std::string absPath = cmsys::SystemTools::GetFilenamePath(
                    cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/';
 
-  for(std::set<std::string>::const_iterator ext = headerExtensions.begin();
+  for(std::vector<std::string>::const_iterator ext = headerExtensions.begin();
       ext != headerExtensions.end();
       ++ext)
     {
@@ -1822,7 +1822,7 @@ cmQtAutoGenerators::SearchHeadersForCppFile(const std::string& absFilename,
       break;
       }
     }
-  for(std::set<std::string>::const_iterator ext = headerExtensions.begin();
+  for(std::vector<std::string>::const_iterator ext = headerExtensions.begin();
       ext != headerExtensions.end();
       ++ext)
     {
@@ -1895,7 +1895,7 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
                                            |cmsysTerminal_Color_ForegroundBold,
                                      msg.c_str(), true, this->ColorOutput);
 
-    std::vector<std::string> command;
+    std::vector<cmStdString> command;
     command.push_back(this->MocExecutable);
     for (std::list<std::string>::const_iterator it = this->MocIncludes.begin();
          it != this->MocIncludes.end();
@@ -1924,7 +1924,7 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
 
     if (this->Verbose)
       {
-      for(std::vector<std::string>::const_iterator cmdIt = command.begin();
+      for(std::vector<cmStdString>::const_iterator cmdIt = command.begin();
           cmdIt != command.end();
           ++cmdIt)
         {
@@ -1971,7 +1971,7 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& path,
                                           |cmsysTerminal_Color_ForegroundBold,
                                       msg.c_str(), true, this->ColorOutput);
 
-    std::vector<std::string> command;
+    std::vector<cmStdString> command;
     command.push_back(this->UicExecutable);
 
     std::vector<std::string> opts = this->UicTargetOptions;
@@ -1996,7 +1996,7 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& path,
 
     if (this->Verbose)
       {
-      for(std::vector<std::string>::const_iterator cmdIt = command.begin();
+      for(std::vector<cmStdString>::const_iterator cmdIt = command.begin();
           cmdIt != command.end();
           ++cmdIt)
         {
@@ -2034,7 +2034,7 @@ bool cmQtAutoGenerators::GenerateQrc()
       {
       continue;
       }
-    std::vector<std::string> command;
+    std::vector<cmStdString> command;
     command.push_back(this->RccExecutable);
 
     std::string basename = cmsys::SystemTools::
@@ -2068,7 +2068,7 @@ bool cmQtAutoGenerators::GenerateQrc()
 
       if (this->Verbose)
         {
-        for(std::vector<std::string>::const_iterator cmdIt = command.begin();
+        for(std::vector<cmStdString>::const_iterator cmdIt = command.begin();
             cmdIt != command.end();
             ++cmdIt)
           {
@@ -2092,7 +2092,7 @@ bool cmQtAutoGenerators::GenerateQrc()
   return true;
 }
 
-std::string cmQtAutoGenerators::Join(const std::set<std::string>& lst,
+std::string cmQtAutoGenerators::Join(const std::vector<std::string>& lst,
                               char separator)
 {
     if (lst.empty())
@@ -2101,7 +2101,7 @@ std::string cmQtAutoGenerators::Join(const std::set<std::string>& lst,
       }
 
     std::string result;
-    for (std::set<std::string>::const_iterator it = lst.begin();
+    for (std::vector<std::string>::const_iterator it = lst.begin();
          it != lst.end();
          ++it)
       {
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 5bdd437..2840fbf 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -51,15 +51,15 @@ private:
   bool GenerateUi(const std::string& path, const std::string& uiFileName);
   bool GenerateQrc();
   void ParseCppFile(const std::string& absFilename,
-                    const std::set<std::string>& headerExtensions,
+                    const std::vector<std::string>& headerExtensions,
                     std::map<std::string, std::string>& includedMocs,
                           std::map<std::string, std::string>& includedUis);
   void StrictParseCppFile(const std::string& absFilename,
-                          const std::set<std::string>& headerExtensions,
+                          const std::vector<std::string>& headerExtensions,
                           std::map<std::string, std::string>& includedMocs,
                           std::map<std::string, std::string>& includedUis);
   void SearchHeadersForCppFile(const std::string& absFilename,
-                              const std::set<std::string>& headerExtensions,
+                              const std::vector<std::string>& headerExtensions,
                               std::set<std::string>& absHeaders);
 
   void ParseHeaders(const std::set<std::string>& absHeaders,
@@ -76,7 +76,7 @@ private:
 
   void Init();
 
-  std::string Join(const std::set<std::string>& lst, char separator);
+  std::string Join(const std::vector<std::string>& lst, char separator);
   bool EndsWith(const std::string& str, const std::string& with);
   bool StartsWith(const std::string& str, const std::string& with);
 
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx
index 7ff12dd..11a9913 100644
--- a/Source/cmRST.cxx
+++ b/Source/cmRST.cxx
@@ -326,11 +326,11 @@ std::string cmRST::ReplaceSubstitutions(std::string const& line)
     std::string::size_type start = this->Substitution.start(2);
     std::string::size_type end = this->Substitution.end(2);
     std::string substitute = this->Substitution.match(3);
-    std::map<std::string, std::string>::iterator
+    std::map<cmStdString, cmStdString>::iterator
       replace = this->Replace.find(substitute);
     if(replace != this->Replace.end())
       {
-      std::pair<std::set<std::string>::iterator, bool> replaced =
+      std::pair<std::set<cmStdString>::iterator, bool> replaced =
         this->Replaced.insert(substitute);
       if(replaced.second)
         {
diff --git a/Source/cmRST.h b/Source/cmRST.h
index b9b2366..3356008 100644
--- a/Source/cmRST.h
+++ b/Source/cmRST.h
@@ -92,8 +92,8 @@ private:
 
   std::vector<std::string> MarkupLines;
   std::string DocDir;
-  std::map<std::string, std::string> Replace;
-  std::set<std::string> Replaced;
+  std::map<cmStdString, cmStdString> Replace;
+  std::set<cmStdString> Replaced;
   std::string ReplaceName;
 };
 
diff --git a/Source/cmScriptGenerator.cxx b/Source/cmScriptGenerator.cxx
index 7685d40..3b6a49b 100644
--- a/Source/cmScriptGenerator.cxx
+++ b/Source/cmScriptGenerator.cxx
@@ -15,11 +15,11 @@
 
 //----------------------------------------------------------------------------
 cmScriptGenerator
-::cmScriptGenerator(const std::string& config_var,
+::cmScriptGenerator(const char* config_var,
                     std::vector<std::string> const& configurations):
   RuntimeConfigVariable(config_var),
   Configurations(configurations),
-  ConfigurationName(""),
+  ConfigurationName(0),
   ConfigurationTypes(0),
   ActionsPerConfig(false)
 {
@@ -34,21 +34,21 @@ cmScriptGenerator
 //----------------------------------------------------------------------------
 void
 cmScriptGenerator
-::Generate(std::ostream& os, const std::string& config,
+::Generate(std::ostream& os, const char* config,
            std::vector<std::string> const& configurationTypes)
 {
   this->ConfigurationName = config;
   this->ConfigurationTypes = &configurationTypes;
   this->GenerateScript(os);
-  this->ConfigurationName = "";
+  this->ConfigurationName = 0;
   this->ConfigurationTypes = 0;
 }
 
 //----------------------------------------------------------------------------
-static void cmScriptGeneratorEncodeConfig(const std::string& config,
+static void cmScriptGeneratorEncodeConfig(const char* config,
                                           std::string& result)
 {
-  for(const char* c = config.c_str(); *c; ++c)
+  for(const char* c = config; *c; ++c)
     {
     if(*c >= 'a' && *c <= 'z')
       {
@@ -73,12 +73,12 @@ static void cmScriptGeneratorEncodeConfig(const std::string& config,
 
 //----------------------------------------------------------------------------
 std::string
-cmScriptGenerator::CreateConfigTest(const std::string& config)
+cmScriptGenerator::CreateConfigTest(const char* config)
 {
   std::string result = "\"${";
   result += this->RuntimeConfigVariable;
   result += "}\" MATCHES \"^(";
-  if(!config.empty())
+  if(config && *config)
     {
     cmScriptGeneratorEncodeConfig(config, result);
     }
@@ -142,15 +142,14 @@ void cmScriptGenerator::GenerateScriptActions(std::ostream& os,
 }
 
 //----------------------------------------------------------------------------
-void cmScriptGenerator::GenerateScriptForConfig(std::ostream&,
-                                                const std::string&,
+void cmScriptGenerator::GenerateScriptForConfig(std::ostream&, const char*,
                                                 Indent const&)
 {
   // No actions for this generator.
 }
 
 //----------------------------------------------------------------------------
-bool cmScriptGenerator::GeneratesForConfig(const std::string& config)
+bool cmScriptGenerator::GeneratesForConfig(const char* config)
 {
   // If this is not a configuration-specific rule then we install.
   if(this->Configurations.empty())
@@ -160,7 +159,7 @@ bool cmScriptGenerator::GeneratesForConfig(const std::string& config)
 
   // This is a configuration-specific rule.  Check if the config
   // matches this rule.
-  std::string config_upper = cmSystemTools::UpperCase(config);
+  std::string config_upper = cmSystemTools::UpperCase(config?config:"");
   for(std::vector<std::string>::const_iterator i =
         this->Configurations.begin();
       i != this->Configurations.end(); ++i)
diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h
index 9ab04f1..8b2ca33 100644
--- a/Source/cmScriptGenerator.h
+++ b/Source/cmScriptGenerator.h
@@ -47,11 +47,11 @@ inline std::ostream& operator<<(std::ostream& os,
 class cmScriptGenerator
 {
 public:
-  cmScriptGenerator(const std::string& config_var,
+  cmScriptGenerator(const char* config_var,
                     std::vector<std::string> const& configurations);
   virtual ~cmScriptGenerator();
 
-  void Generate(std::ostream& os, const std::string& config,
+  void Generate(std::ostream& os, const char* config,
                 std::vector<std::string> const& configurationTypes);
 
   const std::vector<std::string>& GetConfigurations() const
@@ -63,15 +63,15 @@ protected:
   virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent);
   virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
   virtual void GenerateScriptForConfig(std::ostream& os,
-                                       const std::string& config,
+                                       const char* config,
                                        Indent const& indent);
   virtual void GenerateScriptNoConfig(std::ostream&, Indent const&) {}
   virtual bool NeedsScriptNoConfig() const { return false; }
 
   // Test if this generator does something for a given configuration.
-  bool GeneratesForConfig(const std::string&);
+  bool GeneratesForConfig(const char*);
 
-  std::string CreateConfigTest(const std::string& config);
+  std::string CreateConfigTest(const char* config);
   std::string CreateConfigTest(std::vector<std::string> const& configs);
   std::string CreateComponentTest(const char* component);
 
@@ -80,7 +80,7 @@ protected:
   std::vector<std::string> const Configurations;
 
   // Information used during generation.
-  std::string ConfigurationName;
+  const char* ConfigurationName;
   std::vector<std::string> const* ConfigurationTypes;
 
   // True if the subclass needs to generate an explicit rule for each
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx
index 84c7610..1a6f1d6 100644
--- a/Source/cmSetPropertyCommand.cxx
+++ b/Source/cmSetPropertyCommand.cxx
@@ -203,7 +203,7 @@ bool cmSetPropertyCommand::HandleDirectoryMode()
     // Lookup the generator.
     if(cmLocalGenerator* lg =
        (this->Makefile->GetLocalGenerator()
-        ->GetGlobalGenerator()->FindLocalGenerator(dir)))
+        ->GetGlobalGenerator()->FindLocalGenerator(dir.c_str())))
       {
       // Use the makefile for the directory found.
       mf = lg->GetMakefile();
@@ -241,7 +241,7 @@ bool cmSetPropertyCommand::HandleDirectoryMode()
 //----------------------------------------------------------------------------
 bool cmSetPropertyCommand::HandleTargetMode()
 {
-  for(std::set<std::string>::const_iterator ni = this->Names.begin();
+  for(std::set<cmStdString>::const_iterator ni = this->Names.begin();
       ni != this->Names.end(); ++ni)
     {
     if (this->Makefile->IsAlias(*ni))
@@ -297,7 +297,7 @@ bool cmSetPropertyCommand::HandleTarget(cmTarget* target)
 //----------------------------------------------------------------------------
 bool cmSetPropertyCommand::HandleSourceMode()
 {
-  for(std::set<std::string>::const_iterator ni = this->Names.begin();
+  for(std::set<cmStdString>::const_iterator ni = this->Names.begin();
       ni != this->Names.end(); ++ni)
     {
     // Get the source file.
@@ -345,8 +345,8 @@ bool cmSetPropertyCommand::HandleSource(cmSourceFile* sf)
 bool cmSetPropertyCommand::HandleTestMode()
 {
   // Look for tests with all names given.
-  std::set<std::string>::iterator next;
-  for(std::set<std::string>::iterator ni = this->Names.begin();
+  std::set<cmStdString>::iterator next;
+  for(std::set<cmStdString>::iterator ni = this->Names.begin();
       ni != this->Names.end(); ni = next)
     {
     next = ni;
@@ -369,7 +369,7 @@ bool cmSetPropertyCommand::HandleTestMode()
     {
     cmOStringStream e;
     e << "given TEST names that do not exist:\n";
-    for(std::set<std::string>::const_iterator ni = this->Names.begin();
+    for(std::set<cmStdString>::const_iterator ni = this->Names.begin();
         ni != this->Names.end(); ++ni)
       {
       e << "  " << *ni << "\n";
@@ -440,7 +440,7 @@ bool cmSetPropertyCommand::HandleCacheMode()
     return false;
     }
 
-  for(std::set<std::string>::const_iterator ni = this->Names.begin();
+  for(std::set<cmStdString>::const_iterator ni = this->Names.begin();
       ni != this->Names.end(); ++ni)
     {
     // Get the source file.
diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h
index 5757d21..5470314 100644
--- a/Source/cmSetPropertyCommand.h
+++ b/Source/cmSetPropertyCommand.h
@@ -44,7 +44,7 @@ public:
   cmTypeMacro(cmSetPropertyCommand, cmCommand);
 
 private:
-  std::set<std::string> Names;
+  std::set<cmStdString> Names;
   std::string PropertyName;
   std::string PropertyValue;
   bool Remove;
diff --git a/Source/cmSetTestsPropertiesCommand.cxx b/Source/cmSetTestsPropertiesCommand.cxx
index c725d35..3d52cf2 100644
--- a/Source/cmSetTestsPropertiesCommand.cxx
+++ b/Source/cmSetTestsPropertiesCommand.cxx
@@ -91,7 +91,7 @@ bool cmSetTestsPropertiesCommand
 
 
 bool cmSetTestsPropertiesCommand
-::SetOneTest(const std::string& tname,
+::SetOneTest(const char *tname,
              std::vector<std::string> &propertyPairs,
              cmMakefile *mf, std::string &errors)
 {
diff --git a/Source/cmSetTestsPropertiesCommand.h b/Source/cmSetTestsPropertiesCommand.h
index 7f8d57d..9e85495 100644
--- a/Source/cmSetTestsPropertiesCommand.h
+++ b/Source/cmSetTestsPropertiesCommand.h
@@ -36,7 +36,7 @@ public:
 
   cmTypeMacro(cmSetTestsPropertiesCommand, cmCommand);
 
-  static bool SetOneTest(const std::string& tname,
+  static bool SetOneTest(const char *tname,
                          std::vector<std::string> &propertyPairs,
                          cmMakefile *mf,
                          std::string &errors);
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 5d6213c..23422a2 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -18,7 +18,7 @@
 #include "cmake.h"
 
 //----------------------------------------------------------------------------
-cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name):
+cmSourceFile::cmSourceFile(cmMakefile* mf, const char* name):
   Location(mf, name)
 {
   this->CustomCommand = 0;
@@ -153,8 +153,8 @@ bool cmSourceFile::FindFullPath(std::string* error)
     {
     tryDirs[0] = "";
     }
-  const std::set<std::string>& srcExts = mf->GetSourceExtensions();
-  const std::set<std::string>& hdrExts = mf->GetHeaderExtensions();
+  const std::vector<std::string>& srcExts = mf->GetSourceExtensions();
+  const std::vector<std::string>& hdrExts = mf->GetHeaderExtensions();
   for(const char* const* di = tryDirs; *di; ++di)
     {
     std::string tryPath = this->Location.GetDirectory();
@@ -164,11 +164,11 @@ bool cmSourceFile::FindFullPath(std::string* error)
       }
     tryPath += this->Location.GetName();
     tryPath = cmSystemTools::CollapseFullPath(tryPath.c_str(), *di);
-    if(this->TryFullPath(tryPath.c_str(), ""))
+    if(this->TryFullPath(tryPath.c_str(), 0))
       {
       return true;
       }
-    for(std::set<std::string>::const_iterator ei = srcExts.begin();
+    for(std::vector<std::string>::const_iterator ei = srcExts.begin();
         ei != srcExts.end(); ++ei)
       {
       if(this->TryFullPath(tryPath.c_str(), ei->c_str()))
@@ -176,7 +176,7 @@ bool cmSourceFile::FindFullPath(std::string* error)
         return true;
         }
       }
-    for(std::set<std::string>::const_iterator ei = hdrExts.begin();
+    for(std::vector<std::string>::const_iterator ei = hdrExts.begin();
         ei != hdrExts.end(); ++ei)
       {
       if(this->TryFullPath(tryPath.c_str(), ei->c_str()))
@@ -194,12 +194,12 @@ bool cmSourceFile::FindFullPath(std::string* error)
     }
   missing += this->Location.GetName();
   e << "Cannot find source file:\n  " << missing << "\nTried extensions";
-  for(std::set<std::string>::const_iterator ext = srcExts.begin();
+  for(std::vector<std::string>::const_iterator ext = srcExts.begin();
       ext != srcExts.end(); ++ext)
     {
     e << " ." << *ext;
     }
-  for(std::set<std::string>::const_iterator ext = hdrExts.begin();
+  for(std::vector<std::string>::const_iterator ext = hdrExts.begin();
       ext != hdrExts.end(); ++ext)
     {
     e << " ." << *ext;
@@ -217,11 +217,10 @@ bool cmSourceFile::FindFullPath(std::string* error)
 }
 
 //----------------------------------------------------------------------------
-bool cmSourceFile::TryFullPath(const std::string& path,
-                               const std::string& ext)
+bool cmSourceFile::TryFullPath(const char* tp, const char* ext)
 {
-  std::string tryPath = path;
-  if(!ext.empty())
+  std::string tryPath = tp;
+  if(ext && *ext)
     {
     tryPath += ".";
     tryPath += ext;
@@ -280,8 +279,13 @@ bool cmSourceFile::Matches(cmSourceFileLocation const& loc)
 }
 
 //----------------------------------------------------------------------------
-void cmSourceFile::SetProperty(const std::string& prop, const char* value)
+void cmSourceFile::SetProperty(const char* prop, const char* value)
 {
+  if (!prop)
+    {
+    return;
+    }
+
   this->Properties.SetProperty(prop, value, cmProperty::SOURCE_FILE);
 
   std::string ext =
@@ -289,7 +293,7 @@ void cmSourceFile::SetProperty(const std::string& prop, const char* value)
   if (ext == ".ui")
     {
     cmMakefile const* mf = this->Location.GetMakefile();
-    if (prop == "AUTOUIC_OPTIONS")
+    if (strcmp(prop, "AUTOUIC_OPTIONS") == 0)
       {
       const_cast<cmMakefile*>(mf)->AddQtUiFileWithOptions(this);
       }
@@ -297,15 +301,19 @@ void cmSourceFile::SetProperty(const std::string& prop, const char* value)
 }
 
 //----------------------------------------------------------------------------
-void cmSourceFile::AppendProperty(const std::string& prop, const char* value,
+void cmSourceFile::AppendProperty(const char* prop, const char* value,
                                   bool asString)
 {
+  if (!prop)
+    {
+    return;
+    }
   this->Properties.AppendProperty(prop, value, cmProperty::SOURCE_FILE,
                                   asString);
 }
 
 //----------------------------------------------------------------------------
-const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
+const char* cmSourceFile::GetPropertyForUser(const char *prop)
 {
   // This method is a consequence of design history and backwards
   // compatibility.  GetProperty is (and should be) a const method.
@@ -321,7 +329,7 @@ const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
   // cmSourceFileLocation class to commit to a particular full path to
   // the source file as late as possible.  If the users requests the
   // LOCATION property we must commit now.
-  if(prop == "LOCATION")
+  if(strcmp(prop, "LOCATION") == 0)
     {
     // Commit to a location.
     this->GetFullPath();
@@ -332,10 +340,10 @@ const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
 }
 
 //----------------------------------------------------------------------------
-const char* cmSourceFile::GetProperty(const std::string& prop) const
+const char* cmSourceFile::GetProperty(const char* prop) const
 {
   // Check for computed properties.
-  if(prop == "LOCATION")
+  if(strcmp(prop, "LOCATION") == 0)
     {
     if(this->FullPath.empty())
       {
@@ -360,7 +368,7 @@ const char* cmSourceFile::GetProperty(const std::string& prop) const
 }
 
 //----------------------------------------------------------------------------
-bool cmSourceFile::GetPropertyAsBool(const std::string& prop) const
+bool cmSourceFile::GetPropertyAsBool(const char* prop) const
 {
   return cmSystemTools::IsOn(this->GetProperty(prop));
 }
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index b362c98..4440b05 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -31,7 +31,7 @@ public:
    * Construct with the makefile storing the source and the initial
    * name referencing it.
    */
-  cmSourceFile(cmMakefile* mf, const std::string& name);
+  cmSourceFile(cmMakefile* mf, const char* name);
 
   ~cmSourceFile();
 
@@ -43,15 +43,14 @@ public:
   void SetCustomCommand(cmCustomCommand *cc);
 
   ///! Set/Get a property of this source file
-  void SetProperty(const std::string& prop, const char *value);
-  void AppendProperty(const std::string& prop,
-                      const char* value,bool asString=false);
-  const char *GetProperty(const std::string& prop) const;
-  bool GetPropertyAsBool(const std::string& prop) const;
+  void SetProperty(const char *prop, const char *value);
+  void AppendProperty(const char* prop, const char* value,bool asString=false);
+  const char *GetProperty(const char *prop) const;
+  bool GetPropertyAsBool(const char *prop) const;
 
   /** Implement getting a property when called from a CMake language
       command like get_property or get_source_file_property.  */
-  const char* GetPropertyForUser(const std::string& prop);
+  const char* GetPropertyForUser(const char *prop);
 
   /**
    * The full path to the file.  The non-const version of this method
@@ -107,7 +106,7 @@ private:
   bool FindFullPathFailed;
 
   bool FindFullPath(std::string* error);
-  bool TryFullPath(const std::string& path, const std::string& ext);
+  bool TryFullPath(const char* tryPath, const char* ext);
   void CheckExtension();
   void CheckLanguage(std::string const& ext);
 
diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx
index 5e6dfbf..5a8578b 100644
--- a/Source/cmSourceFileLocation.cxx
+++ b/Source/cmSourceFileLocation.cxx
@@ -18,10 +18,9 @@
 
 //----------------------------------------------------------------------------
 cmSourceFileLocation
-::cmSourceFileLocation(cmMakefile const* mf, const std::string& name)
-  : Makefile(mf)
+::cmSourceFileLocation(cmMakefile const* mf, const char* name): Makefile(mf)
 {
-  this->AmbiguousDirectory = !cmSystemTools::FileIsFullPath(name.c_str());
+  this->AmbiguousDirectory = !cmSystemTools::FileIsFullPath(name);
   this->AmbiguousExtension = true;
   this->Directory = cmSystemTools::GetFilenamePath(name);
   this->Name = cmSystemTools::GetFilenameName(name);
@@ -29,7 +28,7 @@ cmSourceFileLocation
 }
 
 //----------------------------------------------------------------------------
-void cmSourceFileLocation::Update(const std::string& name)
+void cmSourceFileLocation::Update(const char* name)
 {
   if(this->AmbiguousDirectory)
     {
@@ -81,7 +80,7 @@ void cmSourceFileLocation::DirectoryUseBinary()
 }
 
 //----------------------------------------------------------------------------
-void cmSourceFileLocation::UpdateExtension(const std::string& name)
+void cmSourceFileLocation::UpdateExtension(const char* name)
 {
   // Check the extension.
   std::string ext = cmSystemTools::GetFilenameLastExtension(name);
@@ -91,11 +90,11 @@ void cmSourceFileLocation::UpdateExtension(const std::string& name)
   cmGlobalGenerator* gg =
     this->Makefile->GetLocalGenerator()->GetGlobalGenerator();
   cmMakefile const* mf = this->Makefile;
-  const std::set<std::string>& srcExts = mf->GetSourceExtensions();
-  const std::set<std::string>& hdrExts = mf->GetHeaderExtensions();
+  const std::vector<std::string>& srcExts = mf->GetSourceExtensions();
+  const std::vector<std::string>& hdrExts = mf->GetHeaderExtensions();
   if(gg->GetLanguageFromExtension(ext.c_str()) ||
-     (srcExts.count(ext) > 0) ||
-     (hdrExts.count(ext) > 0))
+     std::find(srcExts.begin(), srcExts.end(), ext) != srcExts.end() ||
+     std::find(hdrExts.begin(), hdrExts.end(), ext) != hdrExts.end())
     {
     // This is a known extension.  Use the given filename with extension.
     this->Name = cmSystemTools::GetFilenameName(name);
@@ -137,10 +136,10 @@ void cmSourceFileLocation::UpdateExtension(const std::string& name)
 }
 
 //----------------------------------------------------------------------------
-void cmSourceFileLocation::UpdateDirectory(const std::string& name)
+void cmSourceFileLocation::UpdateDirectory(const char* name)
 {
   // If a full path was given we know the directory.
-  if(cmSystemTools::FileIsFullPath(name.c_str()))
+  if(cmSystemTools::FileIsFullPath(name))
     {
     this->Directory = cmSystemTools::GetFilenamePath(name);
     this->AmbiguousDirectory = false;
@@ -172,13 +171,13 @@ cmSourceFileLocation
   // disk.  One of these must match if loc refers to this source file.
   std::string ext = this->Name.substr(loc.Name.size()+1);
   cmMakefile const* mf = this->Makefile;
-  const std::set<std::string>& srcExts = mf->GetSourceExtensions();
-  if(srcExts.count(ext) > 0)
+  const std::vector<std::string>& srcExts = mf->GetSourceExtensions();
+  if(std::find(srcExts.begin(), srcExts.end(), ext) != srcExts.end())
     {
     return true;
     }
-  const std::set<std::string>& hdrExts = mf->GetHeaderExtensions();
-  if(hdrExts.count(ext) > 0)
+  const std::vector<std::string>& hdrExts = mf->GetHeaderExtensions();
+  if(std::find(hdrExts.begin(), hdrExts.end(), ext) != hdrExts.end())
     {
     return true;
     }
diff --git a/Source/cmSourceFileLocation.h b/Source/cmSourceFileLocation.h
index c83e8c0..c03eee7 100644
--- a/Source/cmSourceFileLocation.h
+++ b/Source/cmSourceFileLocation.h
@@ -33,7 +33,7 @@ public:
    * Construct for a source file created in a given cmMakefile
    * instance with an initial name.
    */
-  cmSourceFileLocation(cmMakefile const* mf, const std::string& name);
+  cmSourceFileLocation(cmMakefile const* mf, const char* name);
 
   /**
    * Return whether the givne source file location could refers to the
@@ -76,7 +76,7 @@ public:
    * final name (but could be).  Otherwise the returned name is the
    * final name.
    */
-  const std::string& GetName() const { return this->Name; }
+  const char* GetName() const { return this->Name.c_str(); }
 
   /**
    * Get the cmMakefile instance for which the source file was created.
@@ -93,9 +93,9 @@ private:
 
   // Update the location with additional knowledge.
   void Update(cmSourceFileLocation const& loc);
-  void Update(const std::string& name);
-  void UpdateExtension(const std::string& name);
-  void UpdateDirectory(const std::string& name);
+  void Update(const char* name);
+  void UpdateExtension(const char* name);
+  void UpdateDirectory(const char* name);
 };
 
 #endif
diff --git a/Source/cmSourceGroup.cxx b/Source/cmSourceGroup.cxx
index 8fed95e..d272b6c 100644
--- a/Source/cmSourceGroup.cxx
+++ b/Source/cmSourceGroup.cxx
@@ -73,7 +73,7 @@ void cmSourceGroup::SetGroupRegex(const char* regex)
 }
 
 //----------------------------------------------------------------------------
-void cmSourceGroup::AddGroupFile(const std::string& name)
+void cmSourceGroup::AddGroupFile(const char* name)
 {
   this->GroupFiles.insert(name);
 }
@@ -99,7 +99,7 @@ bool cmSourceGroup::MatchesRegex(const char* name)
 //----------------------------------------------------------------------------
 bool cmSourceGroup::MatchesFiles(const char* name)
 {
-  std::set<std::string>::const_iterator i = this->GroupFiles.find(name);
+  std::set<cmStdString>::const_iterator i = this->GroupFiles.find(name);
   if(i != this->GroupFiles.end())
     {
     return true;
diff --git a/Source/cmSourceGroup.h b/Source/cmSourceGroup.h
index e8cf519..3bbdef9 100644
--- a/Source/cmSourceGroup.h
+++ b/Source/cmSourceGroup.h
@@ -46,7 +46,7 @@ public:
   /**
    * Add a file name to the explicit list of files for this group.
    */
-  void AddGroupFile(const std::string& name);
+  void AddGroupFile(const char* name);
 
   /**
    * Add child to this sourcegroup
@@ -118,7 +118,7 @@ private:
   /**
    * Set of file names explicitly added to this group.
    */
-  std::set<std::string> GroupFiles;
+  std::set<cmStdString> GroupFiles;
 
   /**
    * Vector of all source files that have been assigned to
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index ed8efcc..b4ae657 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -241,7 +241,7 @@ inline bool operator==(std::string const& a, const char* b)
 // std::string is really basic_string<....lots of stuff....>
 // when combined with a map or set, the symbols can be > 2000 chars!
 #include <cmsys/String.hxx>
-//typedef cmsys::String std::string;
+typedef cmsys::String cmStdString;
 
 // Define cmOStringStream and cmIStringStream wrappers to hide
 // differences between std::stringstream and the old strstream.
@@ -449,16 +449,11 @@ bool cmHasLiteralSuffix(T str1, const char (&str2)[N])
 
 struct cmStrCmp {
   cmStrCmp(const char *test) : m_test(test) {}
-  cmStrCmp(const std::string &test) : m_test(test) {}
-
-  bool operator()(const std::string& input) const
-  {
-    return m_test == input;
-  }
+  cmStrCmp(std::string &test) : m_test(test.c_str()) {}
 
   bool operator()(const char * input) const
   {
-    return strcmp(input, m_test.c_str()) == 0;
+    return strcmp(input, m_test) == 0;
   }
 
   // For use with binary_search
@@ -468,7 +463,7 @@ struct cmStrCmp {
   }
 
 private:
-  const std::string m_test;
+  const char * const m_test;
 };
 
 #endif
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 22637ea..ff05975 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -179,11 +179,10 @@ void cmSystemTools::ExpandRegistryValues(std::string& source, KeyWOW64)
 }
 #endif
 
-std::string cmSystemTools::EscapeQuotes(const std::string& str)
+std::string cmSystemTools::EscapeQuotes(const char* str)
 {
-  std::string result;
-  result.reserve(str.size());
-  for(const char* ch = str.c_str(); *ch != '\0'; ++ch)
+  std::string result = "";
+  for(const char* ch = str; *ch != '\0'; ++ch)
     {
     if(*ch == '"')
       {
@@ -477,6 +476,13 @@ public:
       args.push_back(*arg);
       }
     }
+  void Store(std::vector<cmStdString>& args) const
+    {
+    for(char** arg = this->ArgV; arg && *arg; ++arg)
+      {
+      args.push_back(*arg);
+      }
+    }
 };
 
 //----------------------------------------------------------------------------
@@ -488,6 +494,15 @@ void cmSystemTools::ParseUnixCommandLine(const char* command,
   argv.Store(args);
 }
 
+//----------------------------------------------------------------------------
+void cmSystemTools::ParseUnixCommandLine(const char* command,
+                                         std::vector<cmStdString>& args)
+{
+  // Invoke the underlying parser.
+  cmSystemToolsArgV argv = cmsysSystem_Parse_CommandForUnix(command, 0);
+  argv.Store(args);
+}
+
 std::string cmSystemTools::EscapeWindowsShellArgument(const char* arg,
                                                       int shell_flags)
 {
@@ -507,9 +522,9 @@ std::string cmSystemTools::EscapeWindowsShellArgument(const char* arg,
   return result;
 }
 
-std::vector<std::string> cmSystemTools::ParseArguments(const char* command)
+std::vector<cmStdString> cmSystemTools::ParseArguments(const char* command)
 {
-  std::vector<std::string> args;
+  std::vector<cmStdString> args;
   std::string arg;
 
   bool win_path = false;
@@ -590,6 +605,22 @@ std::vector<std::string> cmSystemTools::ParseArguments(const char* command)
 }
 
 
+bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command,
+                                     std::string* output ,
+                                     int* retVal , const char* dir ,
+                                     OutputOption outputflag ,
+                                     double timeout )
+{
+  std::vector<std::string> cmd;
+  for(std::vector<cmStdString>::const_iterator i = command.begin();
+      i != command.end(); ++i)
+    {
+    cmd.push_back(*i);
+    }
+  return cmSystemTools::RunSingleCommand(cmd, output, retVal, dir,
+                                         outputflag, timeout);
+}
+
 bool cmSystemTools::RunSingleCommand(std::vector<std::string>const& command,
                                      std::string* output ,
                                      int* retVal , const char* dir ,
@@ -749,7 +780,7 @@ bool cmSystemTools::RunSingleCommand(
     outputflag = OUTPUT_NONE;
     }
 
-  std::vector<std::string> args = cmSystemTools::ParseArguments(command);
+  std::vector<cmStdString> args = cmSystemTools::ParseArguments(command);
 
   if(args.size() < 1)
     {
@@ -913,7 +944,7 @@ bool cmSystemTools::RenameFile(const char* oldname, const char* newname)
 #endif
 }
 
-bool cmSystemTools::ComputeFileMD5(const std::string& source, char* md5out)
+bool cmSystemTools::ComputeFileMD5(const char* source, char* md5out)
 {
 #if defined(CMAKE_BUILD_WITH_CMAKE)
   cmCryptoHashMD5 md5;
@@ -928,7 +959,7 @@ bool cmSystemTools::ComputeFileMD5(const std::string& source, char* md5out)
 #endif
 }
 
-std::string cmSystemTools::ComputeStringMD5(const std::string& input)
+std::string cmSystemTools::ComputeStringMD5(const char* input)
 {
 #if defined(CMAKE_BUILD_WITH_CMAKE)
   cmCryptoHashMD5 md5;
@@ -940,14 +971,13 @@ std::string cmSystemTools::ComputeStringMD5(const std::string& input)
 #endif
 }
 
-void cmSystemTools::Glob(const std::string& directory,
-                         const std::string& regexp,
+void cmSystemTools::Glob(const char *directory, const char *regexp,
                          std::vector<std::string>& files)
 {
   cmsys::Directory d;
-  cmsys::RegularExpression reg(regexp.c_str());
+  cmsys::RegularExpression reg(regexp);
 
-  if (d.Load(directory.c_str()))
+  if (d.Load(directory))
     {
     size_t numf;
         unsigned int i;
@@ -964,13 +994,14 @@ void cmSystemTools::Glob(const std::string& directory,
 }
 
 
-void cmSystemTools::GlobDirs(const std::string& path,
+void cmSystemTools::GlobDirs(const char *fullPath,
                              std::vector<std::string>& files)
 {
+  std::string path = fullPath;
   std::string::size_type pos = path.find("/*");
   if(pos == std::string::npos)
     {
-    files.push_back(path);
+    files.push_back(fullPath);
     return;
     }
   std::string startPath = path.substr(0, pos);
@@ -1097,8 +1128,8 @@ void cmSystemTools::ExpandListArgument(const std::string& arg,
     }
 }
 
-bool cmSystemTools::SimpleGlob(const std::string& glob,
-                               std::vector<std::string>& files,
+bool cmSystemTools::SimpleGlob(const cmStdString& glob,
+                               std::vector<cmStdString>& files,
                                int type /* = 0 */)
 {
   files.clear();
@@ -1216,7 +1247,7 @@ cmSystemTools::FileFormat cmSystemTools::GetFileFormat(const char* cext)
   return cmSystemTools::UNKNOWN_FILE_FORMAT;
 }
 
-bool cmSystemTools::Split(const char* s, std::vector<std::string>& l)
+bool cmSystemTools::Split(const char* s, std::vector<cmStdString>& l)
 {
   std::vector<std::string> temp;
   bool res = Superclass::Split(s, temp);
@@ -1428,7 +1459,7 @@ bool cmSystemTools::IsPathToFramework(const char* path)
 }
 
 bool cmSystemTools::CreateTar(const char* outFileName,
-                              const std::vector<std::string>& files,
+                              const std::vector<cmStdString>& files,
                               bool gzip, bool bzip2, bool verbose)
 {
 #if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -1448,7 +1479,7 @@ bool cmSystemTools::CreateTar(const char* outFileName,
                            cmArchiveWrite::CompressNone)),
                            cmArchiveWrite::TypeTAR);
   a.SetVerbose(verbose);
-  for(std::vector<std::string>::const_iterator i = files.begin();
+  for(std::vector<cmStdString>::const_iterator i = files.begin();
       i != files.end(); ++i)
     {
     std::string path = *i;
@@ -2300,7 +2331,7 @@ bool cmSystemTools::GuessLibrarySOName(std::string const& fullPath,
 bool cmSystemTools::GuessLibraryInstallName(std::string const& fullPath,
                                        std::string& soname)
 {
-  std::vector<std::string> cmds;
+  std::vector<cmStdString> cmds;
   cmds.push_back("otool");
   cmds.push_back("-D");
   cmds.push_back(fullPath.c_str());
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 27b4bce..4a5d298 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -47,7 +47,7 @@ public:
                                    KeyWOW64 view = KeyWOW64_Default);
 
   ///! Escape quotes in a string.
-  static std::string EscapeQuotes(const std::string& str);
+  static std::string EscapeQuotes(const char* str);
 
   /** Map help document name to file name.  */
   static std::string HelpFileName(std::string);
@@ -158,10 +158,9 @@ public:
   static std::string FileExistsInParentDirectories(const char* fname,
     const char* directory, const char* toplevel);
 
-  static void Glob(const std::string& directory, const std::string& regexp,
+  static void Glob(const char *directory, const char *regexp,
                    std::vector<std::string>& files);
-  static void GlobDirs(const std::string& fullPath,
-                       std::vector<std::string>& files);
+  static void GlobDirs(const char *fullPath, std::vector<std::string>& files);
 
   /**
    * Try to find a list of files that match the "simple" globbing
@@ -172,8 +171,8 @@ public:
    * want to find. 0 means all files, -1 means directories, 1 means
    * files only. This method returns true if search was succesfull.
    */
-  static bool SimpleGlob(const std::string& glob,
-                         std::vector<std::string>& files,
+  static bool SimpleGlob(const cmStdString& glob,
+                         std::vector<cmStdString>& files,
                          int type = 0);
 
   ///! Copy a file.
@@ -186,10 +185,10 @@ public:
   static bool RenameFile(const char* oldname, const char* newname);
 
   ///! Compute the md5sum of a file
-  static bool ComputeFileMD5(const std::string& source, char* md5out);
+  static bool ComputeFileMD5(const char* source, char* md5out);
 
   /** Compute the md5sum of a string.  */
-  static std::string ComputeStringMD5(const std::string& input);
+  static std::string ComputeStringMD5(const char* input);
 
   /**
    * Run a single executable command
@@ -234,13 +233,18 @@ public:
                                int* retVal = 0, const char* dir = 0,
                                OutputOption outputflag = OUTPUT_MERGE,
                                double timeout = 0.0);
+  static bool RunSingleCommand(std::vector<cmStdString> const& command,
+                               std::string* output = 0,
+                               int* retVal = 0, const char* dir = 0,
+                               OutputOption outputflag = OUTPUT_MERGE,
+                               double timeout = 0.0);
 
   static std::string PrintSingleCommand(std::vector<std::string> const&);
 
   /**
    * Parse arguments out of a single string command
    */
-  static std::vector<std::string> ParseArguments(const char* command);
+  static std::vector<cmStdString> ParseArguments(const char* command);
 
   /** Parse arguments out of a windows command line string.  */
   static void ParseWindowsCommandLine(const char* command,
@@ -249,6 +253,8 @@ public:
   /** Parse arguments out of a unix command line string.  */
   static void ParseUnixCommandLine(const char* command,
                                    std::vector<std::string>& args);
+  static void ParseUnixCommandLine(const char* command,
+                                   std::vector<cmStdString>& args);
 
   /** Compute an escaped version of the given argument for use in a
       windows shell.  See kwsys/System.h.in for details.  */
@@ -314,7 +320,7 @@ public:
 
   /** Split a string on its newlines into multiple lines.  Returns
       false only if the last line stored had no newline.  */
-  static bool Split(const char* s, std::vector<std::string>& l);
+  static bool Split(const char* s, std::vector<cmStdString>& l);
   static void SetForceUnixPaths(bool v)
     {
       s_ForceUnixPaths = v;
@@ -383,7 +389,7 @@ public:
   static bool ListTar(const char* outFileName,
                       bool gzip, bool verbose);
   static bool CreateTar(const char* outFileName,
-                        const std::vector<std::string>& files, bool gzip,
+                        const std::vector<cmStdString>& files, bool gzip,
                         bool bzip2, bool verbose);
   static bool ExtractTar(const char* inFileName, bool gzip,
                          bool verbose);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 2699920..db34bd8 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -83,12 +83,17 @@ public:
   cmTargetInternals()
     {
     this->PolicyWarnedCMP0022 = false;
+    this->SourceFileFlagsConstructed = false;
     }
   cmTargetInternals(cmTargetInternals const&)
     {
     this->PolicyWarnedCMP0022 = false;
+    this->SourceFileFlagsConstructed = false;
     }
   ~cmTargetInternals();
+  typedef cmTarget::SourceFileFlags SourceFileFlags;
+  mutable std::map<cmSourceFile const*, SourceFileFlags> SourceFlagsMap;
+  mutable bool SourceFileFlagsConstructed;
 
   // The backtrace when the target was created.
   cmListFileBacktrace Backtrace;
@@ -96,24 +101,15 @@ public:
   // Cache link interface computation from each configuration.
   struct OptionalLinkInterface: public cmTarget::LinkInterface
   {
-    OptionalLinkInterface():
-      Exists(false), Complete(false), ExplicitLibraries(0) {}
+    OptionalLinkInterface(): Exists(false) {}
     bool Exists;
-    bool Complete;
-    const char* ExplicitLibraries;
   };
-  void ComputeLinkInterface(cmTarget const* thisTarget,
-                            const std::string& config,
-                            OptionalLinkInterface& iface,
-                            cmTarget const* head,
-                            const char *explicitLibraries) const;
-
   typedef std::map<TargetConfigPair, OptionalLinkInterface>
                                                           LinkInterfaceMapType;
   LinkInterfaceMapType LinkInterfaceMap;
   bool PolicyWarnedCMP0022;
 
-  typedef std::map<std::string, cmTarget::OutputInfo> OutputInfoMapType;
+  typedef std::map<cmStdString, cmTarget::OutputInfo> OutputInfoMapType;
   OutputInfoMapType OutputInfoMap;
 
   typedef std::map<TargetConfigPair, cmTarget::ImportInfo>
@@ -226,7 +222,7 @@ void cmTarget::DefineProperties(cmake *cm)
      "", "", true);
 }
 
-void cmTarget::SetType(TargetType type, const std::string& name)
+void cmTarget::SetType(TargetType type, const char* name)
 {
   this->Name = name;
   // only add dependency information for library targets
@@ -346,10 +342,10 @@ void cmTarget::SetMakefile(cmMakefile* mf)
       {
       this->InsertInclude(*it);
       }
-    const std::set<std::string> parentSystemIncludes =
+    const std::set<cmStdString> parentSystemIncludes =
                                 this->Makefile->GetSystemIncludeDirectories();
 
-    for (std::set<std::string>::const_iterator it
+    for (std::set<cmStdString>::const_iterator it
           = parentSystemIncludes.begin();
           it != parentSystemIncludes.end(); ++it)
       {
@@ -405,7 +401,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::AddUtility(const std::string& u, cmMakefile *makefile)
+void cmTarget::AddUtility(const char *u, cmMakefile *makefile)
 {
   this->Utilities.insert(u);
   if(makefile)
@@ -415,10 +411,9 @@ void cmTarget::AddUtility(const std::string& u, cmMakefile *makefile)
 }
 
 //----------------------------------------------------------------------------
-cmListFileBacktrace const* cmTarget::GetUtilityBacktrace(
-    const std::string& u) const
+cmListFileBacktrace const* cmTarget::GetUtilityBacktrace(const char *u) const
 {
-  std::map<std::string, cmListFileBacktrace>::const_iterator i =
+  std::map<cmStdString, cmListFileBacktrace>::const_iterator i =
     this->UtilityBacktraces.find(u);
   if(i == this->UtilityBacktraces.end()) return 0;
 
@@ -532,6 +527,28 @@ bool cmTarget::IsBundleOnApple() const
 }
 
 //----------------------------------------------------------------------------
+bool cmTarget::FindSourceFiles()
+{
+  for(std::vector<cmSourceFile*>::const_iterator
+        si = this->SourceFiles.begin();
+      si != this->SourceFiles.end(); ++si)
+    {
+    std::string e;
+    if((*si)->GetFullPath(&e).empty())
+      {
+      if(!e.empty())
+        {
+        cmake* cm = this->Makefile->GetCMakeInstance();
+        cm->IssueMessage(cmake::FATAL_ERROR, e,
+                         this->GetBacktrace());
+        }
+      return false;
+      }
+    }
+  return true;
+}
+
+//----------------------------------------------------------------------------
 void cmTarget::GetSourceFiles(std::vector<cmSourceFile*> &files) const
 {
   assert(this->GetType() != INTERFACE_LIBRARY);
@@ -567,7 +584,7 @@ void cmTarget::AddSources(std::vector<std::string> const& srcs)
 }
 
 //----------------------------------------------------------------------------
-cmSourceFile* cmTarget::AddSource(const std::string& s)
+cmSourceFile* cmTarget::AddSource(const char* s)
 {
   std::string src = s;
 
@@ -631,6 +648,109 @@ void cmTarget::ProcessSourceExpression(std::string const& expr)
 }
 
 //----------------------------------------------------------------------------
+struct cmTarget::SourceFileFlags
+cmTarget::GetTargetSourceFileFlags(const cmSourceFile* sf) const
+{
+  struct SourceFileFlags flags;
+  this->ConstructSourceFileFlags();
+  std::map<cmSourceFile const*, SourceFileFlags>::iterator si =
+    this->Internal->SourceFlagsMap.find(sf);
+  if(si != this->Internal->SourceFlagsMap.end())
+    {
+    flags = si->second;
+    }
+  return flags;
+}
+
+//----------------------------------------------------------------------------
+void cmTarget::ConstructSourceFileFlags() const
+{
+  if(this->Internal->SourceFileFlagsConstructed)
+    {
+    return;
+    }
+  this->Internal->SourceFileFlagsConstructed = true;
+
+  // Process public headers to mark the source files.
+  if(const char* files = this->GetProperty("PUBLIC_HEADER"))
+    {
+    std::vector<std::string> relFiles;
+    cmSystemTools::ExpandListArgument(files, relFiles);
+    for(std::vector<std::string>::iterator it = relFiles.begin();
+        it != relFiles.end(); ++it)
+      {
+      if(cmSourceFile* sf = this->Makefile->GetSource(it->c_str()))
+        {
+        SourceFileFlags& flags = this->Internal->SourceFlagsMap[sf];
+        flags.MacFolder = "Headers";
+        flags.Type = cmTarget::SourceFileTypePublicHeader;
+        }
+      }
+    }
+
+  // Process private headers after public headers so that they take
+  // precedence if a file is listed in both.
+  if(const char* files = this->GetProperty("PRIVATE_HEADER"))
+    {
+    std::vector<std::string> relFiles;
+    cmSystemTools::ExpandListArgument(files, relFiles);
+    for(std::vector<std::string>::iterator it = relFiles.begin();
+        it != relFiles.end(); ++it)
+      {
+      if(cmSourceFile* sf = this->Makefile->GetSource(it->c_str()))
+        {
+        SourceFileFlags& flags = this->Internal->SourceFlagsMap[sf];
+        flags.MacFolder = "PrivateHeaders";
+        flags.Type = cmTarget::SourceFileTypePrivateHeader;
+        }
+      }
+    }
+
+  // Mark sources listed as resources.
+  if(const char* files = this->GetProperty("RESOURCE"))
+    {
+    std::vector<std::string> relFiles;
+    cmSystemTools::ExpandListArgument(files, relFiles);
+    for(std::vector<std::string>::iterator it = relFiles.begin();
+        it != relFiles.end(); ++it)
+      {
+      if(cmSourceFile* sf = this->Makefile->GetSource(it->c_str()))
+        {
+        SourceFileFlags& flags = this->Internal->SourceFlagsMap[sf];
+        flags.MacFolder = "Resources";
+        flags.Type = cmTarget::SourceFileTypeResource;
+        }
+      }
+    }
+
+  // Handle the MACOSX_PACKAGE_LOCATION property on source files that
+  // were not listed in one of the other lists.
+  std::vector<cmSourceFile*> sources;
+  this->GetSourceFiles(sources);
+  for(std::vector<cmSourceFile*>::const_iterator si = sources.begin();
+      si != sources.end(); ++si)
+    {
+    cmSourceFile* sf = *si;
+    if(const char* location = sf->GetProperty("MACOSX_PACKAGE_LOCATION"))
+      {
+      SourceFileFlags& flags = this->Internal->SourceFlagsMap[sf];
+      if(flags.Type == cmTarget::SourceFileTypeNormal)
+        {
+        flags.MacFolder = location;
+        if(strcmp(location, "Resources") == 0)
+          {
+          flags.Type = cmTarget::SourceFileTypeResource;
+          }
+        else
+          {
+          flags.Type = cmTarget::SourceFileTypeMacContent;
+          }
+        }
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
 void cmTarget::MergeLinkLibraries( cmMakefile& mf,
                                    const char *selfname,
                                    const LinkLibraryVectorType& libs )
@@ -650,7 +770,7 @@ void cmTarget::MergeLinkLibraries( cmMakefile& mf,
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::AddLinkDirectory(const std::string& d)
+void cmTarget::AddLinkDirectory(const char* d)
 {
   // Make sure we don't add unnecessary search directories.
   if(this->LinkDirectoriesEmmitted.insert(d).second)
@@ -666,11 +786,10 @@ const std::vector<std::string>& cmTarget::GetLinkDirectories() const
 }
 
 //----------------------------------------------------------------------------
-cmTarget::LinkLibraryType cmTarget::ComputeLinkType(
-                                      const std::string& config) const
+cmTarget::LinkLibraryType cmTarget::ComputeLinkType(const char* config) const
 {
   // No configuration is always optimized.
-  if(config.empty())
+  if(!(config && *config))
     {
     return cmTarget::OPTIMIZED;
     }
@@ -730,7 +849,7 @@ bool cmTarget::NameResolvesToFramework(const std::string& libname) const
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::GetDirectLinkLibraries(const std::string& config,
+void cmTarget::GetDirectLinkLibraries(const char *config,
                             std::vector<std::string> &libs,
                             cmTarget const* head) const
 {
@@ -751,8 +870,8 @@ void cmTarget::GetDirectLinkLibraries(const std::string& config,
                                         &dagChecker),
                                       libs);
 
-    std::set<std::string> seenProps = cge->GetSeenTargetProperties();
-    for (std::set<std::string>::const_iterator it = seenProps.begin();
+    std::set<cmStdString> seenProps = cge->GetSeenTargetProperties();
+    for (std::set<cmStdString>::const_iterator it = seenProps.begin();
         it != seenProps.end(); ++it)
       {
       if (!this->GetProperty(it->c_str()))
@@ -764,7 +883,7 @@ void cmTarget::GetDirectLinkLibraries(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::GetInterfaceLinkLibraries(const std::string& config,
+void cmTarget::GetInterfaceLinkLibraries(const char *config,
                                          std::vector<std::string> &libs,
                                          cmTarget const* head) const
 {
@@ -820,9 +939,9 @@ std::string cmTarget::GetDebugGeneratorExpressions(const std::string &value,
 }
 
 //----------------------------------------------------------------------------
-static std::string targetNameGenex(const std::string& lib)
+static std::string targetNameGenex(const char *lib)
 {
-  return "$<TARGET_NAME:" + lib + ">";
+  return std::string("$<TARGET_NAME:") + lib + ">";
 }
 
 //----------------------------------------------------------------------------
@@ -862,7 +981,7 @@ void cmTarget::GetTllSignatureTraces(cmOStringStream &s,
                         = (sig == cmTarget::KeywordTLLSignature ? "keyword"
                                                                 : "plain");
     s << "The uses of the " << sigString << " signature are here:\n";
-    std::set<std::string> emitted;
+    std::set<cmStdString> emitted;
     for(std::vector<cmListFileBacktrace>::const_iterator it = sigs.begin();
         it != sigs.end(); ++it)
       {
@@ -884,8 +1003,7 @@ void cmTarget::GetTllSignatureTraces(cmOStringStream &s,
 
 //----------------------------------------------------------------------------
 void cmTarget::AddLinkLibrary(cmMakefile& mf,
-                              const std::string& target,
-                              const std::string& lib,
+                              const char *target, const char* lib,
                               LinkLibraryType llt)
 {
   cmTarget *tgt = this->Makefile->FindTargetToUse(lib);
@@ -894,7 +1012,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
 
   const std::string libName = (isNonImportedTarget && llt != GENERAL)
                                                         ? targetNameGenex(lib)
-                                                        : lib;
+                                                        : std::string(lib);
   this->AppendProperty("LINK_LIBRARIES",
                        this->GetDebugGeneratorExpressions(libName,
                                                           llt).c_str());
@@ -902,7 +1020,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
 
   if (cmGeneratorExpression::Find(lib) != std::string::npos
       || (tgt && tgt->GetType() == INTERFACE_LIBRARY)
-      || (target == lib ))
+      || (strcmp( target, lib ) == 0))
     {
     return;
     }
@@ -956,9 +1074,9 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
 
 //----------------------------------------------------------------------------
 void
-cmTarget::AddSystemIncludeDirectories(const std::set<std::string> &incs)
+cmTarget::AddSystemIncludeDirectories(const std::set<cmStdString> &incs)
 {
-  for(std::set<std::string>::const_iterator li = incs.begin();
+  for(std::set<cmStdString>::const_iterator li = incs.begin();
       li != incs.end(); ++li)
     {
     this->SystemIncludeDirectories.insert(*li);
@@ -1270,7 +1388,7 @@ void cmTarget::GatherDependencies( const cmMakefile& mf,
 }
 
 //----------------------------------------------------------------------------
-static bool whiteListedInterfaceProperty(const std::string& prop)
+static bool whiteListedInterfaceProperty(const char *prop)
 {
   if(cmHasLiteralPrefix(prop, "INTERFACE_"))
     {
@@ -1290,7 +1408,7 @@ static bool whiteListedInterfaceProperty(const std::string& prop)
 
   if (std::binary_search(cmArrayBegin(builtIns),
                          cmArrayEnd(builtIns),
-                         prop.c_str(),
+                         prop,
                          cmStrCmp(prop)))
     {
     return true;
@@ -1305,8 +1423,12 @@ static bool whiteListedInterfaceProperty(const std::string& prop)
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::SetProperty(const std::string& prop, const char* value)
+void cmTarget::SetProperty(const char* prop, const char* value)
 {
+  if (!prop)
+    {
+    return;
+    }
   if (this->GetType() == INTERFACE_LIBRARY
       && !whiteListedInterfaceProperty(prop))
     {
@@ -1317,14 +1439,14 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
     return;
     }
 
-  if (prop == "NAME")
+  if (strcmp(prop, "NAME") == 0)
     {
     cmOStringStream e;
     e << "NAME property is read-only\n";
     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
     return;
     }
-  if(prop == "INCLUDE_DIRECTORIES")
+  if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
     {
     cmListFileBacktrace lfbt;
     this->Makefile->GetBacktrace(lfbt);
@@ -1335,7 +1457,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
                           new cmTargetInternals::TargetPropertyEntry(cge));
     return;
     }
-  if(prop == "COMPILE_OPTIONS")
+  if(strcmp(prop,"COMPILE_OPTIONS") == 0)
     {
     cmListFileBacktrace lfbt;
     this->Makefile->GetBacktrace(lfbt);
@@ -1346,7 +1468,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
                           new cmTargetInternals::TargetPropertyEntry(cge));
     return;
     }
-  if(prop == "COMPILE_DEFINITIONS")
+  if(strcmp(prop,"COMPILE_DEFINITIONS") == 0)
     {
     cmListFileBacktrace lfbt;
     this->Makefile->GetBacktrace(lfbt);
@@ -1357,7 +1479,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
                           new cmTargetInternals::TargetPropertyEntry(cge));
     return;
     }
-  if(prop == "EXPORT_NAME" && this->IsImported())
+  if(strcmp(prop,"EXPORT_NAME") == 0 && this->IsImported())
     {
     cmOStringStream e;
     e << "EXPORT_NAME property can't be set on imported targets (\""
@@ -1365,7 +1487,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
     return;
     }
-  if (prop == "LINK_LIBRARIES")
+  if (strcmp(prop, "LINK_LIBRARIES") == 0)
     {
     this->Internal->LinkImplementationPropertyEntries.clear();
     cmListFileBacktrace lfbt;
@@ -1379,9 +1501,13 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::AppendProperty(const std::string& prop, const char* value,
+void cmTarget::AppendProperty(const char* prop, const char* value,
                               bool asString)
 {
+  if (!prop)
+    {
+    return;
+    }
   if (this->GetType() == INTERFACE_LIBRARY
       && !whiteListedInterfaceProperty(prop))
     {
@@ -1391,14 +1517,14 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
     return;
     }
-  if (prop == "NAME")
+  if (strcmp(prop, "NAME") == 0)
     {
     cmOStringStream e;
     e << "NAME property is read-only\n";
     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
     return;
     }
-  if(prop == "INCLUDE_DIRECTORIES")
+  if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
     {
     cmListFileBacktrace lfbt;
     this->Makefile->GetBacktrace(lfbt);
@@ -1407,7 +1533,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
               new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
     return;
     }
-  if(prop == "COMPILE_OPTIONS")
+  if(strcmp(prop,"COMPILE_OPTIONS") == 0)
     {
     cmListFileBacktrace lfbt;
     this->Makefile->GetBacktrace(lfbt);
@@ -1416,7 +1542,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
               new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
     return;
     }
-  if(prop == "COMPILE_DEFINITIONS")
+  if(strcmp(prop,"COMPILE_DEFINITIONS") == 0)
     {
     cmListFileBacktrace lfbt;
     this->Makefile->GetBacktrace(lfbt);
@@ -1425,7 +1551,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
               new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
     return;
     }
-  if(prop == "EXPORT_NAME" && this->IsImported())
+  if(strcmp(prop,"EXPORT_NAME") == 0 && this->IsImported())
     {
     cmOStringStream e;
     e << "EXPORT_NAME property can't be set on imported targets (\""
@@ -1433,7 +1559,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
     return;
     }
-  if (prop == "LINK_LIBRARIES")
+  if (strcmp(prop, "LINK_LIBRARIES") == 0)
     {
     cmListFileBacktrace lfbt;
     this->Makefile->GetBacktrace(lfbt);
@@ -1540,7 +1666,7 @@ static void processIncludeDirectories(cmTarget const* tgt,
       std::vector<std::string> &includes,
       std::set<std::string> &uniqueIncludes,
       cmGeneratorExpressionDAGChecker *dagChecker,
-      const std::string& config, bool debugIncludes)
+      const char *config, bool debugIncludes)
 {
   cmMakefile *mf = tgt->GetMakefile();
 
@@ -1549,7 +1675,7 @@ static void processIncludeDirectories(cmTarget const* tgt,
     {
     bool testIsOff = true;
     bool cacheIncludes = false;
-    std::vector<std::string>& entryIncludes = (*it)->CachedEntries;
+    std::vector<std::string> entryIncludes = (*it)->CachedEntries;
     if(!entryIncludes.empty())
       {
       testIsOff = false;
@@ -1705,7 +1831,7 @@ static void processIncludeDirectories(cmTarget const* tgt,
 
 //----------------------------------------------------------------------------
 std::vector<std::string>
-cmTarget::GetIncludeDirectories(const std::string& config) const
+cmTarget::GetIncludeDirectories(const char *config) const
 {
   std::vector<std::string> includes;
   std::set<std::string> uniqueIncludes;
@@ -1742,7 +1868,8 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
                             config,
                             debugIncludes);
 
-  if (!this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[config])
+  std::string configString = config ? config : "";
+  if (!this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[configString])
     {
     for (std::vector<cmValueWithOrigin>::const_iterator
         it = this->Internal->LinkImplementationPropertyEntries.begin(),
@@ -1779,7 +1906,7 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
                                                               includeGenex);
 
       this->Internal
-        ->CachedLinkInterfaceIncludeDirectoriesEntries[config].push_back(
+        ->CachedLinkInterfaceIncludeDirectoriesEntries[configString].push_back(
                         new cmTargetInternals::TargetPropertyEntry(cge,
                                                               it->Value));
       }
@@ -1807,14 +1934,14 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
         cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
                   ge.Parse(libDir.c_str());
         this->Internal
-                ->CachedLinkInterfaceIncludeDirectoriesEntries[config]
+                ->CachedLinkInterfaceIncludeDirectoriesEntries[configString]
                 .push_back(new cmTargetInternals::TargetPropertyEntry(cge));
         }
       }
     }
 
   processIncludeDirectories(this,
-    this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries[config],
+    this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries[configString],
                             includes,
                             uniqueIncludes,
                             &dagChecker,
@@ -1828,7 +1955,7 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
     }
   else
     {
-    this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[config]
+    this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[configString]
                                                                       = true;
     }
 
@@ -1841,7 +1968,7 @@ static void processCompileOptionsInternal(cmTarget const* tgt,
       std::vector<std::string> &options,
       std::set<std::string> &uniqueOptions,
       cmGeneratorExpressionDAGChecker *dagChecker,
-      const std::string& config, bool debugOptions, const char *logName)
+      const char *config, bool debugOptions, const char *logName)
 {
   cmMakefile *mf = tgt->GetMakefile();
 
@@ -1900,7 +2027,7 @@ static void processCompileOptions(cmTarget const* tgt,
       std::vector<std::string> &options,
       std::set<std::string> &uniqueOptions,
       cmGeneratorExpressionDAGChecker *dagChecker,
-      const std::string& config, bool debugOptions)
+      const char *config, bool debugOptions)
 {
   processCompileOptionsInternal(tgt, entries, options, uniqueOptions,
                                 dagChecker, config, debugOptions, "options");
@@ -1908,7 +2035,7 @@ static void processCompileOptions(cmTarget const* tgt,
 
 //----------------------------------------------------------------------------
 void cmTarget::GetAutoUicOptions(std::vector<std::string> &result,
-                                 const std::string& config) const
+                                 const char *config) const
 {
   const char *prop
             = this->GetLinkInterfaceDependentStringProperty("AUTOUIC_OPTIONS",
@@ -1934,7 +2061,7 @@ void cmTarget::GetAutoUicOptions(std::vector<std::string> &result,
 
 //----------------------------------------------------------------------------
 void cmTarget::GetCompileOptions(std::vector<std::string> &result,
-                                 const std::string& config) const
+                                 const char *config) const
 {
   std::set<std::string> uniqueOptions;
   cmListFileBacktrace lfbt;
@@ -1970,7 +2097,8 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
                             config,
                             debugOptions);
 
-  if (!this->Internal->CacheLinkInterfaceCompileOptionsDone[config])
+  std::string configString = config ? config : "";
+  if (!this->Internal->CacheLinkInterfaceCompileOptionsDone[configString])
     {
     for (std::vector<cmValueWithOrigin>::const_iterator
         it = this->Internal->LinkImplementationPropertyEntries.begin(),
@@ -2007,14 +2135,14 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
                                                                 optionGenex);
 
       this->Internal
-        ->CachedLinkInterfaceCompileOptionsEntries[config].push_back(
+        ->CachedLinkInterfaceCompileOptionsEntries[configString].push_back(
                         new cmTargetInternals::TargetPropertyEntry(cge,
                                                               it->Value));
       }
     }
 
   processCompileOptions(this,
-    this->Internal->CachedLinkInterfaceCompileOptionsEntries[config],
+    this->Internal->CachedLinkInterfaceCompileOptionsEntries[configString],
                             result,
                             uniqueOptions,
                             &dagChecker,
@@ -2027,7 +2155,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
     }
   else
     {
-    this->Internal->CacheLinkInterfaceCompileOptionsDone[config] = true;
+    this->Internal->CacheLinkInterfaceCompileOptionsDone[configString] = true;
     }
 }
 
@@ -2037,7 +2165,7 @@ static void processCompileDefinitions(cmTarget const* tgt,
       std::vector<std::string> &options,
       std::set<std::string> &uniqueOptions,
       cmGeneratorExpressionDAGChecker *dagChecker,
-      const std::string& config, bool debugOptions)
+      const char *config, bool debugOptions)
 {
   processCompileOptionsInternal(tgt, entries, options, uniqueOptions,
                                 dagChecker, config, debugOptions,
@@ -2046,7 +2174,7 @@ static void processCompileDefinitions(cmTarget const* tgt,
 
 //----------------------------------------------------------------------------
 void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
-                                            const std::string& config) const
+                                            const char *config) const
 {
   std::set<std::string> uniqueOptions;
   cmListFileBacktrace lfbt;
@@ -2082,7 +2210,8 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
                             config,
                             debugDefines);
 
-  if (!this->Internal->CacheLinkInterfaceCompileDefinitionsDone[config])
+  std::string configString = config ? config : "";
+  if (!this->Internal->CacheLinkInterfaceCompileDefinitionsDone[configString])
     {
     for (std::vector<cmValueWithOrigin>::const_iterator
         it = this->Internal->LinkImplementationPropertyEntries.begin(),
@@ -2119,11 +2248,11 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
                                                                 defsGenex);
 
       this->Internal
-        ->CachedLinkInterfaceCompileDefinitionsEntries[config].push_back(
+        ->CachedLinkInterfaceCompileDefinitionsEntries[configString].push_back(
                         new cmTargetInternals::TargetPropertyEntry(cge,
                                                               it->Value));
       }
-    if (!config.empty())
+    if (config)
       {
       std::string configPropName = "COMPILE_DEFINITIONS_"
                                           + cmSystemTools::UpperCase(config);
@@ -2146,7 +2275,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
             cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
                                                         ge.Parse(configProp);
             this->Internal
-              ->CachedLinkInterfaceCompileDefinitionsEntries[config]
+              ->CachedLinkInterfaceCompileDefinitionsEntries[configString]
                   .push_back(new cmTargetInternals::TargetPropertyEntry(cge));
             }
             break;
@@ -2161,7 +2290,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
     }
 
   processCompileDefinitions(this,
-    this->Internal->CachedLinkInterfaceCompileDefinitionsEntries[config],
+    this->Internal->CachedLinkInterfaceCompileDefinitionsEntries[configString],
                             list,
                             uniqueOptions,
                             &dagChecker,
@@ -2175,13 +2304,13 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
     }
   else
     {
-    this->Internal->CacheLinkInterfaceCompileDefinitionsDone[config]
+    this->Internal->CacheLinkInterfaceCompileDefinitionsDone[configString]
                                                                       = true;
     }
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::MaybeInvalidatePropertyCache(const std::string& prop)
+void cmTarget::MaybeInvalidatePropertyCache(const char* prop)
 {
   // Wipe out maps caching information affected by this property.
   if(this->IsImported() && cmHasLiteralPrefix(prop, "IMPORTED"))
@@ -2196,8 +2325,8 @@ void cmTarget::MaybeInvalidatePropertyCache(const std::string& prop)
 
 //----------------------------------------------------------------------------
 static void cmTargetCheckLINK_INTERFACE_LIBRARIES(
-  const std::string& prop, const char* value, cmMakefile* context,
-  bool imported)
+  const char* prop, const char* value, cmMakefile* context, bool imported
+  )
 {
   // Look for link-type keywords in the value.
   static cmsys::RegularExpression
@@ -2261,8 +2390,7 @@ static void cmTargetCheckINTERFACE_LINK_LIBRARIES(const char* value,
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::CheckProperty(const std::string& prop,
-                             cmMakefile* context) const
+void cmTarget::CheckProperty(const char* prop, cmMakefile* context) const
 {
   // Certain properties need checking.
   if(cmHasLiteralPrefix(prop, "LINK_INTERFACE_LIBRARIES"))
@@ -2305,8 +2433,7 @@ bool cmTarget::HaveWellDefinedOutputFiles() const
 }
 
 //----------------------------------------------------------------------------
-cmTarget::OutputInfo const* cmTarget::GetOutputInfo(
-    const std::string& config) const
+cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config) const
 {
   // There is no output information for imported targets.
   if(this->IsImported())
@@ -2328,7 +2455,7 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(
 
   // Lookup/compute/cache the output information for this configuration.
   std::string config_upper;
-  if(!config.empty())
+  if(config && *config)
     {
     config_upper = cmSystemTools::UpperCase(config);
     }
@@ -2351,8 +2478,7 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetDirectory(const std::string& config,
-                                   bool implib) const
+std::string cmTarget::GetDirectory(const char* config, bool implib) const
 {
   if (this->IsImported())
     {
@@ -2370,7 +2496,7 @@ std::string cmTarget::GetDirectory(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetPDBDirectory(const std::string& config) const
+std::string cmTarget::GetPDBDirectory(const char* config) const
 {
   if(OutputInfo const* info = this->GetOutputInfo(config))
     {
@@ -2381,7 +2507,7 @@ std::string cmTarget::GetPDBDirectory(const std::string& config) const
 }
 
 //----------------------------------------------------------------------------
-const char* cmTarget::GetLocation(const std::string& config) const
+const char* cmTarget::GetLocation(const char* config) const
 {
   if (this->IsImported())
     {
@@ -2394,7 +2520,7 @@ const char* cmTarget::GetLocation(const std::string& config) const
 }
 
 //----------------------------------------------------------------------------
-const char* cmTarget::ImportedGetLocation(const std::string& config) const
+const char* cmTarget::ImportedGetLocation(const char* config) const
 {
   static std::string location;
   location = this->ImportedGetFullPath(config, false);
@@ -2402,11 +2528,11 @@ const char* cmTarget::ImportedGetLocation(const std::string& config) const
 }
 
 //----------------------------------------------------------------------------
-const char* cmTarget::NormalGetLocation(const std::string& config) const
+const char* cmTarget::NormalGetLocation(const char* config) const
 {
   static std::string location;
   // Handle the configuration-specific case first.
-  if(!config.empty())
+  if(config)
     {
     location = this->GetFullPath(config, false);
     return location.c_str();
@@ -2479,10 +2605,9 @@ void cmTarget::GetTargetVersion(bool soversion,
 }
 
 //----------------------------------------------------------------------------
-const char* cmTarget::GetFeature(const std::string& feature,
-                                 const std::string& config) const
+const char* cmTarget::GetFeature(const char* feature, const char* config) const
 {
-  if(!config.empty())
+  if(config && *config)
     {
     std::string featureConfig = feature;
     featureConfig += "_";
@@ -2500,7 +2625,7 @@ const char* cmTarget::GetFeature(const std::string& feature,
 }
 
 //----------------------------------------------------------------------------
-const char *cmTarget::GetProperty(const std::string& prop) const
+const char *cmTarget::GetProperty(const char* prop) const
 {
   return this->GetProperty(prop, cmProperty::TARGET);
 }
@@ -2543,9 +2668,14 @@ bool cmTarget::HandleLocationPropertyPolicy() const
 }
 
 //----------------------------------------------------------------------------
-const char *cmTarget::GetProperty(const std::string& prop,
+const char *cmTarget::GetProperty(const char* prop,
                                   cmProperty::ScopeType scope) const
 {
+  if(!prop)
+    {
+    return 0;
+    }
+
   if (this->GetType() == INTERFACE_LIBRARY
       && !whiteListedInterfaceProperty(prop))
     {
@@ -2556,7 +2686,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
     return 0;
     }
 
-  if (prop == "NAME")
+  if (strcmp(prop, "NAME") == 0)
     {
     return this->GetName();
     }
@@ -2569,7 +2699,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
      this->GetType() == cmTarget::MODULE_LIBRARY ||
      this->GetType() == cmTarget::UNKNOWN_LIBRARY)
     {
-    if(prop == "LOCATION")
+    if(strcmp(prop,"LOCATION") == 0)
       {
       if (!this->HandleLocationPropertyPolicy())
         {
@@ -2585,7 +2715,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       // cannot take into account the per-configuration name of the
       // target because the configuration type may not be known at
       // CMake time.
-      this->Properties.SetProperty("LOCATION", this->GetLocation(""),
+      this->Properties.SetProperty("LOCATION", this->GetLocation(0),
                                    cmProperty::TARGET);
       }
 
@@ -2596,13 +2726,13 @@ const char *cmTarget::GetProperty(const std::string& prop,
         {
         return 0;
         }
-      const char* configName = prop.c_str() + 9;
+      std::string configName = prop+9;
       this->Properties.SetProperty(prop,
-                                   this->GetLocation(configName),
+                                   this->GetLocation(configName.c_str()),
                                    cmProperty::TARGET);
       }
     }
-  if(prop == "INCLUDE_DIRECTORIES")
+  if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
     {
     static std::string output;
     output = "";
@@ -2620,7 +2750,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       }
     return output.c_str();
     }
-  if(prop == "COMPILE_OPTIONS")
+  if(strcmp(prop,"COMPILE_OPTIONS") == 0)
     {
     static std::string output;
     output = "";
@@ -2638,7 +2768,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       }
     return output.c_str();
     }
-  if(prop == "COMPILE_DEFINITIONS")
+  if(strcmp(prop,"COMPILE_DEFINITIONS") == 0)
     {
     static std::string output;
     output = "";
@@ -2656,7 +2786,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       }
     return output.c_str();
     }
-  if(prop == "LINK_LIBRARIES")
+  if(strcmp(prop,"LINK_LIBRARIES") == 0)
     {
     static std::string output;
     output = "";
@@ -2673,12 +2803,12 @@ const char *cmTarget::GetProperty(const std::string& prop,
     return output.c_str();
     }
 
-  if (prop == "IMPORTED")
+  if (strcmp(prop,"IMPORTED") == 0)
     {
     return this->IsImported()?"TRUE":"FALSE";
     }
 
-  if(prop == "SOURCES")
+  if(!strcmp(prop,"SOURCES"))
     {
     cmOStringStream ss;
     const char* sep = "";
@@ -2707,7 +2837,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
     }
 
   // the type property returns what type the target is
-  if (prop == "TYPE")
+  if (!strcmp(prop,"TYPE"))
     {
     return cmTarget::GetTargetTypeName(this->GetType());
     }
@@ -2722,7 +2852,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::GetPropertyAsBool(const std::string& prop) const
+bool cmTarget::GetPropertyAsBool(const char* prop) const
 {
   return cmSystemTools::IsOn(this->GetProperty(prop));
 }
@@ -2731,9 +2861,8 @@ bool cmTarget::GetPropertyAsBool(const std::string& prop) const
 class cmTargetCollectLinkLanguages
 {
 public:
-  cmTargetCollectLinkLanguages(cmTarget const* target,
-                               const std::string& config,
-                               std::set<std::string>& languages,
+  cmTargetCollectLinkLanguages(cmTarget const* target, const char* config,
+                               std::set<cmStdString>& languages,
                                cmTarget const* head):
     Config(config), Languages(languages), HeadTarget(head),
     Makefile(target->GetMakefile()), Target(target)
@@ -2804,8 +2933,8 @@ public:
       }
     }
 private:
-  std::string Config;
-  std::set<std::string>& Languages;
+  const char* Config;
+  std::set<cmStdString>& Languages;
   cmTarget const* HeadTarget;
   cmMakefile* Makefile;
   const cmTarget* Target;
@@ -2813,7 +2942,7 @@ private:
 };
 
 //----------------------------------------------------------------------------
-const char* cmTarget::GetLinkerLanguage(const std::string& config,
+const char* cmTarget::GetLinkerLanguage(const char* config,
                                         cmTarget const* head) const
 {
   cmTarget const* headTarget = head ? head : this;
@@ -2823,11 +2952,10 @@ const char* cmTarget::GetLinkerLanguage(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
-cmTarget::LinkClosure const* cmTarget::GetLinkClosure(
-                                                  const std::string& config,
+cmTarget::LinkClosure const* cmTarget::GetLinkClosure(const char* config,
                                                   cmTarget const* head) const
 {
-  TargetConfigPair key(head, cmSystemTools::UpperCase(config));
+  TargetConfigPair key(head, cmSystemTools::UpperCase(config ? config : ""));
   cmTargetInternals::LinkClosureMapType::iterator
     i = this->Internal->LinkClosureMap.find(key);
   if(i == this->Internal->LinkClosureMap.end())
@@ -2847,7 +2975,7 @@ class cmTargetSelectLinker
   cmTarget const* Target;
   cmMakefile* Makefile;
   cmGlobalGenerator* GG;
-  std::set<std::string> Preferred;
+  std::set<cmStdString> Preferred;
 public:
   cmTargetSelectLinker(cmTarget const* target): Preference(0), Target(target)
     {
@@ -2879,7 +3007,7 @@ public:
       e << "Target " << this->Target->GetName()
         << " contains multiple languages with the highest linker preference"
         << " (" << this->Preference << "):\n";
-      for(std::set<std::string>::const_iterator
+      for(std::set<cmStdString>::const_iterator
             li = this->Preferred.begin(); li != this->Preferred.end(); ++li)
         {
         e << "  " << *li << "\n";
@@ -2894,11 +3022,11 @@ public:
 };
 
 //----------------------------------------------------------------------------
-void cmTarget::ComputeLinkClosure(const std::string& config, LinkClosure& lc,
+void cmTarget::ComputeLinkClosure(const char* config, LinkClosure& lc,
                                   cmTarget const* head) const
 {
   // Get languages built in this target.
-  std::set<std::string> languages;
+  std::set<cmStdString> languages;
   LinkImplementation const* impl = this->GetLinkImplementation(config, head);
   for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
       li != impl->Languages.end(); ++li)
@@ -2915,7 +3043,7 @@ void cmTarget::ComputeLinkClosure(const std::string& config, LinkClosure& lc,
     }
 
   // Store the transitive closure of languages.
-  for(std::set<std::string>::const_iterator li = languages.begin();
+  for(std::set<cmStdString>::const_iterator li = languages.begin();
       li != languages.end(); ++li)
     {
     lc.Languages.push_back(*li);
@@ -2943,7 +3071,7 @@ void cmTarget::ComputeLinkClosure(const std::string& config, LinkClosure& lc,
       }
 
     // Now consider languages that propagate from linked targets.
-    for(std::set<std::string>::const_iterator sit = languages.begin();
+    for(std::set<cmStdString>::const_iterator sit = languages.begin();
         sit != languages.end(); ++sit)
       {
       std::string propagates = "CMAKE_"+*sit+"_LINKER_PREFERENCE_PROPAGATES";
@@ -3007,7 +3135,7 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetPDBName(const std::string& config) const
+std::string cmTarget::GetPDBName(const char* config) const
 {
   std::string prefix;
   std::string base;
@@ -3015,7 +3143,8 @@ std::string cmTarget::GetPDBName(const std::string& config) const
   this->GetFullNameInternal(config, false, prefix, base, suffix);
 
   std::vector<std::string> props;
-  std::string configUpper = cmSystemTools::UpperCase(config);
+  std::string configUpper =
+    cmSystemTools::UpperCase(config? config : "");
   if(!configUpper.empty())
     {
     // PDB_NAME_<CONFIG>
@@ -3038,7 +3167,7 @@ std::string cmTarget::GetPDBName(const std::string& config) const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::HasSOName(const std::string& config) const
+bool cmTarget::HasSOName(const char* config) const
 {
   // soname is supported only for shared libraries and modules,
   // and then only when the platform supports an soname flag.
@@ -3050,7 +3179,7 @@ bool cmTarget::HasSOName(const std::string& config) const
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetSOName(const std::string& config) const
+std::string cmTarget::GetSOName(const char* config) const
 {
   if(this->IsImported())
     {
@@ -3092,7 +3221,7 @@ std::string cmTarget::GetSOName(const std::string& config) const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::HasMacOSXRpathInstallNameDir(const std::string& config) const
+bool cmTarget::HasMacOSXRpathInstallNameDir(const char* config) const
 {
   bool install_name_is_rpath = false;
   bool macosx_rpath = false;
@@ -3204,8 +3333,7 @@ bool cmTarget::MacOSXRpathInstallNameDirDefault() const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::IsImportedSharedLibWithoutSOName(
-                                          const std::string& config) const
+bool cmTarget::IsImportedSharedLibWithoutSOName(const char* config) const
 {
   if(this->IsImported() && this->GetType() == cmTarget::SHARED_LIBRARY)
     {
@@ -3218,7 +3346,7 @@ bool cmTarget::IsImportedSharedLibWithoutSOName(
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::NormalGetRealName(const std::string& config) const
+std::string cmTarget::NormalGetRealName(const char* config) const
 {
   // This should not be called for imported targets.
   // TODO: Split cmTarget into a class hierarchy to get compile-time
@@ -3256,8 +3384,7 @@ std::string cmTarget::NormalGetRealName(const std::string& config) const
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetFullName(const std::string& config,
-                                  bool implib) const
+std::string cmTarget::GetFullName(const char* config, bool implib) const
 {
   if(this->IsImported())
     {
@@ -3271,7 +3398,7 @@ std::string cmTarget::GetFullName(const std::string& config,
 
 //----------------------------------------------------------------------------
 std::string
-cmTarget::GetFullNameImported(const std::string& config, bool implib) const
+cmTarget::GetFullNameImported(const char* config, bool implib) const
 {
   return cmSystemTools::GetFilenameName(
     this->ImportedGetFullPath(config, implib));
@@ -3279,15 +3406,14 @@ cmTarget::GetFullNameImported(const std::string& config, bool implib) const
 
 //----------------------------------------------------------------------------
 void cmTarget::GetFullNameComponents(std::string& prefix, std::string& base,
-                                     std::string& suffix,
-                                     const std::string& config,
+                                     std::string& suffix, const char* config,
                                      bool implib) const
 {
   this->GetFullNameInternal(config, implib, prefix, base, suffix);
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetFullPath(const std::string& config, bool implib,
+std::string cmTarget::GetFullPath(const char* config, bool implib,
                                   bool realname) const
 {
   if(this->IsImported())
@@ -3301,8 +3427,8 @@ std::string cmTarget::GetFullPath(const std::string& config, bool implib,
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::NormalGetFullPath(const std::string& config,
-                                        bool implib, bool realname) const
+std::string cmTarget::NormalGetFullPath(const char* config, bool implib,
+                                        bool realname) const
 {
   std::string fpath = this->GetDirectory(config, implib);
   fpath += "/";
@@ -3330,7 +3456,7 @@ std::string cmTarget::NormalGetFullPath(const std::string& config,
 
 //----------------------------------------------------------------------------
 std::string
-cmTarget::ImportedGetFullPath(const std::string& config, bool implib) const
+cmTarget::ImportedGetFullPath(const char* config, bool implib) const
 {
   std::string result;
   if(cmTarget::ImportInfo const* info = this->GetImportInfo(config, this))
@@ -3347,7 +3473,7 @@ cmTarget::ImportedGetFullPath(const std::string& config, bool implib) const
 
 //----------------------------------------------------------------------------
 std::string
-cmTarget::GetFullNameInternal(const std::string& config, bool implib) const
+cmTarget::GetFullNameInternal(const char* config, bool implib) const
 {
   std::string prefix;
   std::string base;
@@ -3357,7 +3483,7 @@ cmTarget::GetFullNameInternal(const std::string& config, bool implib) const
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::GetFullNameInternal(const std::string& config,
+void cmTarget::GetFullNameInternal(const char* config,
                                    bool implib,
                                    std::string& outPrefix,
                                    std::string& outBase,
@@ -3403,7 +3529,7 @@ void cmTarget::GetFullNameInternal(const std::string& config,
                               ? this->GetProperty("IMPORT_SUFFIX")
                               : this->GetProperty("SUFFIX"));
   const char* configPostfix = 0;
-  if(!config.empty())
+  if(config && *config)
     {
     std::string configProp = cmSystemTools::UpperCase(config);
     configProp += "_POSTFIX";
@@ -3499,7 +3625,7 @@ void cmTarget::GetLibraryNames(std::string& name,
                                std::string& realName,
                                std::string& impName,
                                std::string& pdbName,
-                               const std::string& config) const
+                               const char* config) const
 {
   // This should not be called for imported targets.
   // TODO: Split cmTarget into a class hierarchy to get compile-time
@@ -3603,7 +3729,7 @@ void cmTarget::GetExecutableNames(std::string& name,
                                   std::string& realName,
                                   std::string& impName,
                                   std::string& pdbName,
-                                  const std::string& config) const
+                                  const char* config) const
 {
   // This should not be called for imported targets.
   // TODO: Split cmTarget into a class hierarchy to get compile-time
@@ -3681,7 +3807,7 @@ bool cmTarget::GetImplibGNUtoMS(std::string const& gnuName,
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::SetPropertyDefault(const std::string& property,
+void cmTarget::SetPropertyDefault(const char* property,
                                   const char* default_value)
 {
   // Compute the name of the variable holding the default value.
@@ -3699,7 +3825,7 @@ void cmTarget::SetPropertyDefault(const std::string& property,
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::HaveBuildTreeRPATH(const std::string& config) const
+bool cmTarget::HaveBuildTreeRPATH(const char *config) const
 {
   if (this->GetPropertyAsBool("SKIP_BUILD_RPATH"))
     {
@@ -3719,7 +3845,7 @@ bool cmTarget::HaveInstallTreeRPATH() const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::NeedRelinkBeforeInstall(const std::string& config) const
+bool cmTarget::NeedRelinkBeforeInstall(const char* config) const
 {
   // Only executables and shared libraries can have an rpath and may
   // need relinking.
@@ -3782,8 +3908,7 @@ bool cmTarget::NeedRelinkBeforeInstall(const std::string& config) const
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetInstallNameDirForBuildTree(
-    const std::string& config) const
+std::string cmTarget::GetInstallNameDirForBuildTree(const char* config) const
 {
   // If building directly for installation then the build tree install_name
   // is the same as the install tree.
@@ -3905,11 +4030,10 @@ const char* cmTarget::GetOutputTargetType(bool implib) const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::ComputeOutputDir(const std::string& config,
+bool cmTarget::ComputeOutputDir(const char* config,
                                 bool implib, std::string& out) const
 {
   bool usesDefaultOutputDir = false;
-  std::string conf = config;
 
   // Look for a target property defining the target output directory
   // based on the target type.
@@ -3923,7 +4047,7 @@ bool cmTarget::ComputeOutputDir(const std::string& config,
     }
 
   // Check for a per-configuration output directory target property.
-  std::string configUpper = cmSystemTools::UpperCase(conf);
+  std::string configUpper = cmSystemTools::UpperCase(config? config : "");
   const char* configProp = 0;
   std::string configPropStr = targetTypeName;
   if(!configPropStr.empty())
@@ -3940,7 +4064,7 @@ bool cmTarget::ComputeOutputDir(const std::string& config,
     out = config_outdir;
 
     // Skip per-configuration subdirectory.
-    conf = "";
+    config = 0;
     }
   else if(const char* outdir = this->GetProperty(propertyName))
     {
@@ -3973,27 +4097,25 @@ bool cmTarget::ComputeOutputDir(const std::string& config,
          (out.c_str(), this->Makefile->GetStartOutputDirectory()));
 
   // The generator may add the configuration's subdirectory.
-  if(!conf.empty())
+  if(config && *config)
     {
     const char *platforms = this->Makefile->GetDefinition(
       "CMAKE_XCODE_EFFECTIVE_PLATFORMS");
     std::string suffix =
       usesDefaultOutputDir && platforms ? "$(EFFECTIVE_PLATFORM_NAME)" : "";
     this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
-      AppendDirectoryForConfig("/", conf, suffix.c_str(), out);
+      AppendDirectoryForConfig("/", config, suffix.c_str(), out);
     }
 
   return usesDefaultOutputDir;
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::ComputePDBOutputDir(const std::string& config,
-                                   std::string& out) const
+bool cmTarget::ComputePDBOutputDir(const char* config, std::string& out) const
 {
   // Look for a target property defining the target output directory
   // based on the target type.
   std::string targetTypeName = "PDB";
-  std::string conf = config;
   const char* propertyName = 0;
   std::string propertyNameStr = targetTypeName;
   if(!propertyNameStr.empty())
@@ -4003,7 +4125,7 @@ bool cmTarget::ComputePDBOutputDir(const std::string& config,
     }
 
   // Check for a per-configuration output directory target property.
-  std::string configUpper = cmSystemTools::UpperCase(conf);
+  std::string configUpper = cmSystemTools::UpperCase(config? config : "");
   const char* configProp = 0;
   std::string configPropStr = targetTypeName;
   if(!configPropStr.empty())
@@ -4020,7 +4142,7 @@ bool cmTarget::ComputePDBOutputDir(const std::string& config,
     out = config_outdir;
 
     // Skip per-configuration subdirectory.
-    conf = "";
+    config = 0;
     }
   else if(const char* outdir = this->GetProperty(propertyName))
     {
@@ -4039,29 +4161,27 @@ bool cmTarget::ComputePDBOutputDir(const std::string& config,
          (out.c_str(), this->Makefile->GetStartOutputDirectory()));
 
   // The generator may add the configuration's subdirectory.
-  if(!conf.empty())
+  if(config && *config)
     {
     this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
-      AppendDirectoryForConfig("/", conf, "", out);
+      AppendDirectoryForConfig("/", config, "", out);
     }
   return true;
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::UsesDefaultOutputDir(const std::string& config,
-                                    bool implib) const
+bool cmTarget::UsesDefaultOutputDir(const char* config, bool implib) const
 {
   std::string dir;
   return this->ComputeOutputDir(config, implib, dir);
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetOutputName(const std::string& config,
-                                    bool implib) const
+std::string cmTarget::GetOutputName(const char* config, bool implib) const
 {
   std::vector<std::string> props;
   std::string type = this->GetOutputTargetType(implib);
-  std::string configUpper = cmSystemTools::UpperCase(config);
+  std::string configUpper = cmSystemTools::UpperCase(config? config : "");
   if(!type.empty() && !configUpper.empty())
     {
     // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME_<CONFIG>
@@ -4395,7 +4515,7 @@ std::string compatibilityAgree(CompatibleType t, bool dominant)
 template<typename PropertyType>
 PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
                                           const std::string &p,
-                                          const std::string& config,
+                                          const char *config,
                                           const char *defaultValue,
                                           CompatibleType t,
                                           PropertyType *)
@@ -4410,13 +4530,12 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
   assert((impliedByUse ^ explicitlySet)
       || (!impliedByUse && !explicitlySet));
 
-  std::vector<cmTarget*> deps;
-  tgt->GetTransitiveTargetClosure(config, tgt, deps);
-
-  if(deps.empty())
+  cmComputeLinkInformation *info = tgt->GetLinkInformation(config);
+  if(!info)
     {
     return propContent;
     }
+  const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
   bool propInitialized = explicitlySet;
 
   std::string report = " * Target \"";
@@ -4436,7 +4555,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
     report += "\" property not set.\n";
     }
 
-  for(std::vector<cmTarget*>::const_iterator li =
+  for(cmComputeLinkInformation::ItemVector::const_iterator li =
       deps.begin();
       li != deps.end(); ++li)
     {
@@ -4446,20 +4565,23 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
     // target itself has a POSITION_INDEPENDENT_CODE which disagrees
     // with a dependency.
 
-    cmTarget const* theTarget = *li;
+    if (!li->Target)
+      {
+      continue;
+      }
 
-    const bool ifaceIsSet = theTarget->GetProperties()
+    const bool ifaceIsSet = li->Target->GetProperties()
                             .find("INTERFACE_" + p)
-                            != theTarget->GetProperties().end();
+                            != li->Target->GetProperties().end();
     PropertyType ifacePropContent =
-                    getTypedProperty<PropertyType>(theTarget,
+                    getTypedProperty<PropertyType>(li->Target,
                               ("INTERFACE_" + p).c_str(), 0);
 
     std::string reportEntry;
     if (ifaceIsSet)
       {
       reportEntry += " * Target \"";
-      reportEntry += theTarget->GetName();
+      reportEntry += li->Target->GetName();
       reportEntry += "\" property value \"";
       reportEntry += valueAsString<PropertyType>(ifacePropContent);
       reportEntry += "\" ";
@@ -4480,7 +4602,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
           e << "Property " << p << " on target \""
             << tgt->GetName() << "\" does\nnot match the "
             "INTERFACE_" << p << " property requirement\nof "
-            "dependency \"" << theTarget->GetName() << "\".\n";
+            "dependency \"" << li->Target->GetName() << "\".\n";
           cmSystemTools::Error(e.str().c_str());
           break;
           }
@@ -4514,7 +4636,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
             << tgt->GetName() << "\" is\nimplied to be " << defaultValue
             << " because it was used to determine the link libraries\n"
                "already. The INTERFACE_" << p << " property on\ndependency \""
-            << theTarget->GetName() << "\" is in conflict.\n";
+            << li->Target->GetName() << "\" is in conflict.\n";
           cmSystemTools::Error(e.str().c_str());
           break;
           }
@@ -4545,7 +4667,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
             {
             cmOStringStream e;
             e << "The INTERFACE_" << p << " property of \""
-              << theTarget->GetName() << "\" does\nnot agree with the value "
+              << li->Target->GetName() << "\" does\nnot agree with the value "
                 "of " << p << " already determined\nfor \""
               << tgt->GetName() << "\".\n";
             cmSystemTools::Error(e.str().c_str());
@@ -4579,7 +4701,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
 
 //----------------------------------------------------------------------------
 bool cmTarget::GetLinkInterfaceDependentBoolProperty(const std::string &p,
-                                              const std::string& config) const
+                                                     const char *config) const
 {
   return checkInterfacePropertyCompatibility<bool>(this, p, config, "FALSE",
                                                    BoolType, 0);
@@ -4587,8 +4709,8 @@ bool cmTarget::GetLinkInterfaceDependentBoolProperty(const std::string &p,
 
 //----------------------------------------------------------------------------
 const char * cmTarget::GetLinkInterfaceDependentStringProperty(
-                                              const std::string &p,
-                                              const std::string& config) const
+                                                      const std::string &p,
+                                                      const char *config) const
 {
   return checkInterfacePropertyCompatibility<const char *>(this,
                                                            p,
@@ -4599,8 +4721,8 @@ const char * cmTarget::GetLinkInterfaceDependentStringProperty(
 
 //----------------------------------------------------------------------------
 const char * cmTarget::GetLinkInterfaceDependentNumberMinProperty(
-                                              const std::string &p,
-                                              const std::string& config) const
+                                                      const std::string &p,
+                                                      const char *config) const
 {
   return checkInterfacePropertyCompatibility<const char *>(this,
                                                            p,
@@ -4611,8 +4733,8 @@ const char * cmTarget::GetLinkInterfaceDependentNumberMinProperty(
 
 //----------------------------------------------------------------------------
 const char * cmTarget::GetLinkInterfaceDependentNumberMaxProperty(
-                                              const std::string &p,
-                                              const std::string& config) const
+                                                      const std::string &p,
+                                                      const char *config) const
 {
   return checkInterfacePropertyCompatibility<const char *>(this,
                                                            p,
@@ -4623,22 +4745,26 @@ const char * cmTarget::GetLinkInterfaceDependentNumberMaxProperty(
 
 //----------------------------------------------------------------------------
 bool isLinkDependentProperty(cmTarget const* tgt, const std::string &p,
-                             const std::string& interfaceProperty,
-                             const std::string& config)
+                             const char *interfaceProperty,
+                             const char *config)
 {
-  std::vector<cmTarget*> deps;
-  tgt->GetTransitiveTargetClosure(config, tgt, deps);
-
-  if(deps.empty())
+  cmComputeLinkInformation *info = tgt->GetLinkInformation(config);
+  if(!info)
     {
     return false;
     }
 
-  for(std::vector<cmTarget*>::const_iterator li =
+  const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
+
+  for(cmComputeLinkInformation::ItemVector::const_iterator li =
       deps.begin();
       li != deps.end(); ++li)
     {
-    const char *prop = (*li)->GetProperty(interfaceProperty);
+    if (!li->Target)
+      {
+      continue;
+      }
+    const char *prop = li->Target->GetProperty(interfaceProperty);
     if (!prop)
       {
       continue;
@@ -4662,7 +4788,7 @@ bool isLinkDependentProperty(cmTarget const* tgt, const std::string &p,
 
 //----------------------------------------------------------------------------
 bool cmTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p,
-                                           const std::string& config) const
+                                           const char *config) const
 {
   if (this->TargetTypeValue == OBJECT_LIBRARY
       || this->TargetTypeValue == INTERFACE_LIBRARY)
@@ -4676,7 +4802,7 @@ bool cmTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p,
 
 //----------------------------------------------------------------------------
 bool cmTarget::IsLinkInterfaceDependentStringProperty(const std::string &p,
-                                    const std::string& config) const
+                                    const char *config) const
 {
   if (this->TargetTypeValue == OBJECT_LIBRARY
       || this->TargetTypeValue == INTERFACE_LIBRARY)
@@ -4690,7 +4816,7 @@ bool cmTarget::IsLinkInterfaceDependentStringProperty(const std::string &p,
 
 //----------------------------------------------------------------------------
 bool cmTarget::IsLinkInterfaceDependentNumberMinProperty(const std::string &p,
-                                    const std::string& config) const
+                                    const char *config) const
 {
   if (this->TargetTypeValue == OBJECT_LIBRARY
       || this->TargetTypeValue == INTERFACE_LIBRARY)
@@ -4703,7 +4829,7 @@ bool cmTarget::IsLinkInterfaceDependentNumberMinProperty(const std::string &p,
 
 //----------------------------------------------------------------------------
 bool cmTarget::IsLinkInterfaceDependentNumberMaxProperty(const std::string &p,
-                                    const std::string& config) const
+                                    const char *config) const
 {
   if (this->TargetTypeValue == OBJECT_LIBRARY
       || this->TargetTypeValue == INTERFACE_LIBRARY)
@@ -4715,7 +4841,7 @@ bool cmTarget::IsLinkInterfaceDependentNumberMaxProperty(const std::string &p,
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::GetLanguages(std::set<std::string>& languages) const
+void cmTarget::GetLanguages(std::set<cmStdString>& languages) const
 {
   for(std::vector<cmSourceFile*>::const_iterator
         i = this->SourceFiles.begin(); i != this->SourceFiles.end(); ++i)
@@ -4728,7 +4854,7 @@ void cmTarget::GetLanguages(std::set<std::string>& languages) const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::IsChrpathUsed(const std::string& config) const
+bool cmTarget::IsChrpathUsed(const char* config) const
 {
   // Only certain target types have an rpath.
   if(!(this->GetType() == cmTarget::SHARED_LIBRARY ||
@@ -4795,8 +4921,7 @@ bool cmTarget::IsChrpathUsed(const std::string& config) const
 
 //----------------------------------------------------------------------------
 cmTarget::ImportInfo const*
-cmTarget::GetImportInfo(const std::string& config,
-                        cmTarget const* headTarget) const
+cmTarget::GetImportInfo(const char* config, cmTarget const* headTarget) const
 {
   // There is no imported information for non-imported targets.
   if(!this->IsImported())
@@ -4807,7 +4932,7 @@ cmTarget::GetImportInfo(const std::string& config,
   // Lookup/compute/cache the import information for this
   // configuration.
   std::string config_upper;
-  if(!config.empty())
+  if(config && *config)
     {
     config_upper = cmSystemTools::UpperCase(config);
     }
@@ -5161,8 +5286,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
 }
 
 //----------------------------------------------------------------------------
-cmTarget::LinkInterface const* cmTarget::GetLinkInterface(
-                                                  const std::string& config,
+cmTarget::LinkInterface const* cmTarget::GetLinkInterface(const char* config,
                                                   cmTarget const* head) const
 {
   // Imported targets have their own link interface.
@@ -5184,7 +5308,7 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(
     }
 
   // Lookup any existing link interface for this configuration.
-  TargetConfigPair key(head, cmSystemTools::UpperCase(config));
+  TargetConfigPair key(head, cmSystemTools::UpperCase(config? config : ""));
 
   cmTargetInternals::LinkInterfaceMapType::iterator
     i = this->Internal->LinkInterfaceMap.find(key);
@@ -5192,127 +5316,24 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(
     {
     // Compute the link interface for this configuration.
     cmTargetInternals::OptionalLinkInterface iface;
-    iface.ExplicitLibraries =
-        this->ComputeLinkInterfaceLibraries(config, iface, head, iface.Exists);
-    if (iface.Exists)
-      {
-      this->Internal->ComputeLinkInterface(this, config, iface,
-                                           head, iface.ExplicitLibraries);
-      }
+    iface.Exists = this->ComputeLinkInterface(config, iface, head);
 
     // Store the information for this configuration.
     cmTargetInternals::LinkInterfaceMapType::value_type entry(key, iface);
     i = this->Internal->LinkInterfaceMap.insert(entry).first;
     }
-  else if(!i->second.Complete)
-    {
-      this->Internal->ComputeLinkInterface(this, config,
-                                           i->second,
-                                              head,
-                                              i->second.ExplicitLibraries);
-    }
 
-  return i->second.Exists ? &i->second : 0;
+  return i->second.Exists? &i->second : 0;
 }
 
 //----------------------------------------------------------------------------
-cmTarget::LinkInterface const*
-cmTarget::GetLinkInterfaceLibraries(const std::string& config,
-                                    cmTarget const* head) const
-{
-  // Imported targets have their own link interface.
-  if(this->IsImported())
-    {
-    if(cmTarget::ImportInfo const* info = this->GetImportInfo(config, head))
-      {
-      return &info->LinkInterface;
-      }
-    return 0;
-    }
-
-  // Link interfaces are not supported for executables that do not
-  // export symbols.
-  if(this->GetType() == cmTarget::EXECUTABLE &&
-     !this->IsExecutableWithExports())
-    {
-    return 0;
-    }
-
-  // Lookup any existing link interface for this configuration.
-  TargetConfigPair key(head, cmSystemTools::UpperCase(config));
-
-  cmTargetInternals::LinkInterfaceMapType::iterator
-    i = this->Internal->LinkInterfaceMap.find(key);
-  if(i == this->Internal->LinkInterfaceMap.end())
-    {
-    // Compute the link interface for this configuration.
-    cmTargetInternals::OptionalLinkInterface iface;
-    iface.ExplicitLibraries = this->ComputeLinkInterfaceLibraries(config,
-                                                                iface,
-                                                                head,
-                                                                iface.Exists);
-
-    // Store the information for this configuration.
-    cmTargetInternals::LinkInterfaceMapType::value_type entry(key, iface);
-    i = this->Internal->LinkInterfaceMap.insert(entry).first;
-    }
-
-  return i->second.Exists ? &i->second : 0;
-}
-
-//----------------------------------------------------------------------------
-void processILibs(const std::string& config,
-                  cmTarget const* headTarget,
-                  std::string const& name,
-                  std::vector<cmTarget*>& tgts, std::set<cmTarget*>& emitted)
-{
-  if (cmTarget* tgt = headTarget->GetMakefile()
-                                ->FindTargetToUse(name.c_str()))
-    {
-    if (emitted.insert(tgt).second)
-      {
-      tgts.push_back(tgt);
-      std::vector<std::string> ilibs;
-      cmTarget::LinkInterface const* iface =
-                          tgt->GetLinkInterfaceLibraries(config, headTarget);
-      if (iface)
-        {
-        for(std::vector<std::string>::const_iterator
-            it = iface->Libraries.begin();
-            it != iface->Libraries.end(); ++it)
-          {
-          processILibs(config, headTarget, *it, tgts, emitted);
-          }
-        }
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::GetTransitiveTargetClosure(const std::string& config,
+void cmTarget::GetTransitivePropertyLinkLibraries(
+                                      const char* config,
                                       cmTarget const* headTarget,
-                                      std::vector<cmTarget*> &tgts) const
+                                      std::vector<std::string> &libs) const
 {
-  std::set<cmTarget*> emitted;
-
-  cmTarget::LinkImplementation const* impl
-      = this->GetLinkImplementationLibraries(config, headTarget);
-
-  for(std::vector<std::string>::const_iterator it = impl->Libraries.begin();
-      it != impl->Libraries.end(); ++it)
-    {
-      processILibs(config, headTarget, *it, tgts, emitted);
-    }
-}
-
-// TODO: Rename. Not actually transitive.
-//----------------------------------------------------------------------------
-void cmTarget::GetTransitivePropertyTargets(const std::string& config,
-                                      cmTarget const* headTarget,
-                                      std::vector<cmTarget*> &tgts) const
-{
-  cmTarget::LinkInterface const* iface =
-                          this->GetLinkInterfaceLibraries(config, headTarget);
+  cmTarget::LinkInterface const* iface = this->GetLinkInterface(config,
+                                                                headTarget);
   if (!iface)
     {
     return;
@@ -5321,15 +5342,7 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config,
       || this->GetPolicyStatusCMP0022() == cmPolicies::WARN
       || this->GetPolicyStatusCMP0022() == cmPolicies::OLD)
     {
-    for(std::vector<std::string>::const_iterator it = iface->Libraries.begin();
-        it != iface->Libraries.end(); ++it)
-      {
-      if (cmTarget* tgt = headTarget->GetMakefile()
-                                    ->FindTargetToUse(it->c_str()))
-        {
-        tgts.push_back(tgt);
-        }
-      }
+    libs = iface->Libraries;
     return;
     }
 
@@ -5347,34 +5360,21 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config,
   cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
                                               linkIfaceProp, 0, 0);
   dagChecker.SetTransitivePropertiesOnly();
-  std::vector<std::string> libs;
   cmSystemTools::ExpandListArgument(ge.Parse(interfaceLibs)->Evaluate(
                                       this->Makefile,
                                       config,
                                       false,
                                       headTarget,
                                       this, &dagChecker), libs);
-
-  for(std::vector<std::string>::const_iterator it = libs.begin();
-      it != libs.end(); ++it)
-    {
-    if (cmTarget* tgt = headTarget->GetMakefile()
-                                  ->FindTargetToUse(it->c_str()))
-      {
-      tgts.push_back(tgt);
-      }
-    }
 }
 
 //----------------------------------------------------------------------------
-const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
-                                           LinkInterface& iface,
-                                           cmTarget const* headTarget,
-                                           bool &exists) const
+bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
+                                    cmTarget const* headTarget) const
 {
   // Construct the property name suffix for this configuration.
   std::string suffix = "_";
-  if(!config.empty())
+  if(config && *config)
     {
     suffix += cmSystemTools::UpperCase(config);
     }
@@ -5446,10 +5446,8 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
      (this->GetType() == cmTarget::EXECUTABLE ||
       (this->GetType() == cmTarget::MODULE_LIBRARY)))
     {
-    exists = false;
-    return 0;
+    return false;
     }
-  exists = true;
 
   if(explicitLibraries)
     {
@@ -5464,6 +5462,52 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
                                         false,
                                         headTarget,
                                         this, &dagChecker), iface.Libraries);
+
+    if(this->GetType() == cmTarget::SHARED_LIBRARY
+        || this->GetType() == cmTarget::STATIC_LIBRARY
+        || this->GetType() == cmTarget::INTERFACE_LIBRARY)
+      {
+      // Shared libraries may have runtime implementation dependencies
+      // on other shared libraries that are not in the interface.
+      std::set<cmStdString> emitted;
+      for(std::vector<std::string>::const_iterator
+            li = iface.Libraries.begin(); li != iface.Libraries.end(); ++li)
+        {
+        emitted.insert(*li);
+        }
+      if (this->GetType() != cmTarget::INTERFACE_LIBRARY)
+        {
+        LinkImplementation const* impl = this->GetLinkImplementation(config,
+                                                                  headTarget);
+        for(std::vector<std::string>::const_iterator
+              li = impl->Libraries.begin(); li != impl->Libraries.end(); ++li)
+          {
+          if(emitted.insert(*li).second)
+            {
+            if(cmTarget* tgt = this->Makefile->FindTargetToUse(*li))
+              {
+              // This is a runtime dependency on another shared library.
+              if(tgt->GetType() == cmTarget::SHARED_LIBRARY)
+                {
+                iface.SharedDeps.push_back(*li);
+                }
+              }
+            else
+              {
+              // TODO: Recognize shared library file names.  Perhaps this
+              // should be moved to cmComputeLinkInformation, but that creates
+              // a chicken-and-egg problem since this list is needed for its
+              // construction.
+              }
+            }
+          }
+        if(this->LinkLanguagePropagatesToDependents())
+          {
+          // Targets using this archive need its language runtime libraries.
+          iface.Languages = impl->Languages;
+          }
+        }
+      }
     }
   else if (this->PolicyStatusCMP0022 == cmPolicies::WARN
         || this->PolicyStatusCMP0022 == cmPolicies::OLD)
@@ -5473,9 +5517,17 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
     // to the link implementation.
     {
     // The link implementation is the default link interface.
-    LinkImplementation const* impl =
-        this->GetLinkImplementationLibraries(config, headTarget);
+    LinkImplementation const* impl = this->GetLinkImplementation(config,
+                                                              headTarget);
+    iface.ImplementationIsInterface = true;
     iface.Libraries = impl->Libraries;
+    iface.WrongConfigLibraries = impl->WrongConfigLibraries;
+    if(this->LinkLanguagePropagatesToDependents())
+      {
+      // Targets using this archive need its language runtime libraries.
+      iface.Languages = impl->Languages;
+      }
+
     if(this->PolicyStatusCMP0022 == cmPolicies::WARN &&
        !this->Internal->PolicyWarnedCMP0022)
       {
@@ -5540,148 +5592,30 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
         }
       }
     }
-  return explicitLibraries;
-}
-
-//----------------------------------------------------------------------------
-void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget,
-                                             const std::string& config,
-                                             OptionalLinkInterface& iface,
-                                             cmTarget const* headTarget,
-                                          const char* explicitLibraries) const
-{
-  if(explicitLibraries)
-    {
-    if(thisTarget->GetType() == cmTarget::SHARED_LIBRARY
-        || thisTarget->GetType() == cmTarget::STATIC_LIBRARY
-        || thisTarget->GetType() == cmTarget::INTERFACE_LIBRARY)
-      {
-      // Shared libraries may have runtime implementation dependencies
-      // on other shared libraries that are not in the interface.
-      std::set<std::string> emitted;
-      for(std::vector<std::string>::const_iterator
-          li = iface.Libraries.begin(); li != iface.Libraries.end(); ++li)
-        {
-        emitted.insert(*li);
-        }
-      if (thisTarget->GetType() != cmTarget::INTERFACE_LIBRARY)
-        {
-        cmTarget::LinkImplementation const* impl =
-            thisTarget->GetLinkImplementation(config, headTarget);
-        for(std::vector<std::string>::const_iterator
-              li = impl->Libraries.begin(); li != impl->Libraries.end(); ++li)
-          {
-          if(emitted.insert(*li).second)
-            {
-            if(cmTarget* tgt = thisTarget->Makefile->FindTargetToUse(*li))
-              {
-              // This is a runtime dependency on another shared library.
-              if(tgt->GetType() == cmTarget::SHARED_LIBRARY)
-                {
-                iface.SharedDeps.push_back(*li);
-                }
-              }
-            else
-              {
-              // TODO: Recognize shared library file names.  Perhaps this
-              // should be moved to cmComputeLinkInformation, but that creates
-              // a chicken-and-egg problem since this list is needed for its
-              // construction.
-              }
-            }
-          }
-        if(thisTarget->LinkLanguagePropagatesToDependents())
-          {
-          // Targets using this archive need its language runtime libraries.
-          iface.Languages = impl->Languages;
-          }
-        }
-      }
-    }
-  else if (thisTarget->PolicyStatusCMP0022 == cmPolicies::WARN
-        || thisTarget->PolicyStatusCMP0022 == cmPolicies::OLD)
-    {
-    // The link implementation is the default link interface.
-    cmTarget::LinkImplementation const* impl =
-                        thisTarget->GetLinkImplementation(config, headTarget);
-    iface.ImplementationIsInterface = true;
-    iface.WrongConfigLibraries = impl->WrongConfigLibraries;
-    if(thisTarget->LinkLanguagePropagatesToDependents())
-      {
-      // Targets using this archive need its language runtime libraries.
-      iface.Languages = impl->Languages;
-      }
-    }
 
-  if(thisTarget->GetType() == cmTarget::STATIC_LIBRARY)
+  if(this->GetType() == cmTarget::STATIC_LIBRARY)
     {
-    // Construct the property name suffix for this configuration.
-    std::string suffix = "_";
-    if(!config.empty())
-      {
-      suffix += cmSystemTools::UpperCase(config);
-      }
-    else
-      {
-      suffix += "NOCONFIG";
-      }
-
     // How many repetitions are needed if this library has cyclic
     // dependencies?
     std::string propName = "LINK_INTERFACE_MULTIPLICITY";
     propName += suffix;
-    if(const char* config_reps = thisTarget->GetProperty(propName.c_str()))
+    if(const char* config_reps = this->GetProperty(propName.c_str()))
       {
       sscanf(config_reps, "%u", &iface.Multiplicity);
       }
     else if(const char* reps =
-            thisTarget->GetProperty("LINK_INTERFACE_MULTIPLICITY"))
+            this->GetProperty("LINK_INTERFACE_MULTIPLICITY"))
       {
       sscanf(reps, "%u", &iface.Multiplicity);
       }
     }
-  iface.Complete = true;
-}
 
-//----------------------------------------------------------------------------
-cmTarget::LinkImplementation const*
-cmTarget::GetLinkImplementation(const std::string& config,
-                                cmTarget const* head) const
-{
-  // There is no link implementation for imported targets.
-  if(this->IsImported())
-    {
-    return 0;
-    }
-
-  // Lookup any existing link implementation for this configuration.
-  TargetConfigPair key(head, cmSystemTools::UpperCase(config));
-
-  cmTargetInternals::LinkImplMapType::iterator
-    i = this->Internal->LinkImplMap.find(key);
-  if(i == this->Internal->LinkImplMap.end())
-    {
-    // Compute the link implementation for this configuration.
-    LinkImplementation impl;
-    this->ComputeLinkImplementation(config, impl, head);
-    this->ComputeLinkImplementationLanguages(impl);
-
-    // Store the information for this configuration.
-    cmTargetInternals::LinkImplMapType::value_type entry(key, impl);
-    i = this->Internal->LinkImplMap.insert(entry).first;
-    }
-  else if (i->second.Languages.empty())
-    {
-    this->ComputeLinkImplementationLanguages(i->second);
-    }
-
-  return &i->second;
+  return true;
 }
 
 //----------------------------------------------------------------------------
 cmTarget::LinkImplementation const*
-cmTarget::GetLinkImplementationLibraries(const std::string& config,
-                                         cmTarget const* head) const
+cmTarget::GetLinkImplementation(const char* config, cmTarget const* head) const
 {
   // There is no link implementation for imported targets.
   if(this->IsImported())
@@ -5690,7 +5624,7 @@ cmTarget::GetLinkImplementationLibraries(const std::string& config,
     }
 
   // Lookup any existing link implementation for this configuration.
-  TargetConfigPair key(head, cmSystemTools::UpperCase(config));
+  TargetConfigPair key(head, cmSystemTools::UpperCase(config? config : ""));
 
   cmTargetInternals::LinkImplMapType::iterator
     i = this->Internal->LinkImplMap.find(key);
@@ -5709,7 +5643,7 @@ cmTarget::GetLinkImplementationLibraries(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::ComputeLinkImplementation(const std::string& config,
+void cmTarget::ComputeLinkImplementation(const char* config,
                                          LinkImplementation& impl,
                                          cmTarget const* head) const
 {
@@ -5781,14 +5715,9 @@ void cmTarget::ComputeLinkImplementation(const std::string& config,
       impl.WrongConfigLibraries.push_back(item);
       }
     }
-}
 
-//----------------------------------------------------------------------------
-void
-cmTarget::ComputeLinkImplementationLanguages(LinkImplementation& impl) const
-{
   // This target needs runtime libraries for its source languages.
-  std::set<std::string> languages;
+  std::set<cmStdString> languages;
   // Get languages used in our source files.
   this->GetLanguages(languages);
   // Get languages used in object library sources.
@@ -5805,7 +5734,7 @@ cmTarget::ComputeLinkImplementationLanguages(LinkImplementation& impl) const
       }
     }
   // Copy the set of langauges to the link implementation.
-  for(std::set<std::string>::iterator li = languages.begin();
+  for(std::set<cmStdString>::iterator li = languages.begin();
       li != languages.end(); ++li)
     {
     impl.Languages.push_back(*li);
@@ -5873,15 +5802,15 @@ std::string cmTarget::CheckCMP0004(std::string const& item) const
 
 template<typename PropertyType>
 PropertyType getLinkInterfaceDependentProperty(cmTarget const* tgt,
-                                               const std::string& prop,
-                                               const std::string& config,
+                                               const std::string prop,
+                                               const char *config,
                                                CompatibleType,
                                                PropertyType *);
 
 template<>
 bool getLinkInterfaceDependentProperty(cmTarget const* tgt,
-                                       const std::string& prop,
-                                       const std::string& config,
+                                       const std::string prop,
+                                       const char *config,
                                        CompatibleType, bool *)
 {
   return tgt->GetLinkInterfaceDependentBoolProperty(prop, config);
@@ -5889,8 +5818,8 @@ bool getLinkInterfaceDependentProperty(cmTarget const* tgt,
 
 template<>
 const char * getLinkInterfaceDependentProperty(cmTarget const* tgt,
-                                               const std::string& prop,
-                                               const std::string& config,
+                                               const std::string prop,
+                                               const char *config,
                                                CompatibleType t,
                                                const char **)
 {
@@ -5914,9 +5843,9 @@ const char * getLinkInterfaceDependentProperty(cmTarget const* tgt,
 template<typename PropertyType>
 void checkPropertyConsistency(cmTarget const* depender,
                               cmTarget const* dependee,
-                              const std::string& propName,
-                              std::set<std::string> &emitted,
-                              const std::string& config,
+                              const char *propName,
+                              std::set<cmStdString> &emitted,
+                              const char *config,
                               CompatibleType t,
                               PropertyType *)
 {
@@ -5959,10 +5888,10 @@ void checkPropertyConsistency(cmTarget const* depender,
     }
 }
 
-static std::string intersect(const std::set<std::string> &s1,
-                             const std::set<std::string> &s2)
+static cmStdString intersect(const std::set<cmStdString> &s1,
+                             const std::set<cmStdString> &s2)
 {
-  std::set<std::string> intersect;
+  std::set<cmStdString> intersect;
   std::set_intersection(s1.begin(),s1.end(),
                         s2.begin(),s2.end(),
                       std::inserter(intersect,intersect.begin()));
@@ -5972,11 +5901,11 @@ static std::string intersect(const std::set<std::string> &s1,
     }
   return "";
 }
-static std::string intersect(const std::set<std::string> &s1,
-                       const std::set<std::string> &s2,
-                       const std::set<std::string> &s3)
+static cmStdString intersect(const std::set<cmStdString> &s1,
+                       const std::set<cmStdString> &s2,
+                       const std::set<cmStdString> &s3)
 {
-  std::string result;
+  cmStdString result;
   result = intersect(s1, s2);
   if (!result.empty())
     return result;
@@ -5985,12 +5914,12 @@ static std::string intersect(const std::set<std::string> &s1,
     return result;
   return intersect(s2, s3);
 }
-static std::string intersect(const std::set<std::string> &s1,
-                       const std::set<std::string> &s2,
-                       const std::set<std::string> &s3,
-                       const std::set<std::string> &s4)
+static cmStdString intersect(const std::set<cmStdString> &s1,
+                       const std::set<cmStdString> &s2,
+                       const std::set<cmStdString> &s3,
+                       const std::set<cmStdString> &s4)
 {
-  std::string result;
+  cmStdString result;
   result = intersect(s1, s2);
   if (!result.empty())
     return result;
@@ -6005,14 +5934,14 @@ static std::string intersect(const std::set<std::string> &s1,
 
 //----------------------------------------------------------------------------
 void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
-                                          const std::string& config) const
+                                          const char* config) const
 {
   const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
 
-  std::set<std::string> emittedBools;
-  std::set<std::string> emittedStrings;
-  std::set<std::string> emittedMinNumbers;
-  std::set<std::string> emittedMaxNumbers;
+  std::set<cmStdString> emittedBools;
+  std::set<cmStdString> emittedStrings;
+  std::set<cmStdString> emittedMinNumbers;
+  std::set<cmStdString> emittedMaxNumbers;
 
   for(cmComputeLinkInformation::ItemVector::const_iterator li =
       deps.begin();
@@ -6064,7 +5993,7 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
   if (!prop.empty())
     {
     std::set<std::string> props;
-    std::set<std::string>::const_iterator i = emittedBools.find(prop);
+    std::set<cmStdString>::const_iterator i = emittedBools.find(prop);
     if (i != emittedBools.end())
       {
       props.insert("COMPATIBLE_INTERFACE_BOOL");
@@ -6109,12 +6038,12 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
 
 //----------------------------------------------------------------------------
 cmComputeLinkInformation*
-cmTarget::GetLinkInformation(const std::string& config,
-                             cmTarget const* head) const
+cmTarget::GetLinkInformation(const char* config, cmTarget const* head) const
 {
   cmTarget const* headTarget = head ? head : this;
   // Lookup any existing information for this configuration.
-  TargetConfigPair key(headTarget, cmSystemTools::UpperCase(config));
+  TargetConfigPair key(headTarget,
+                                  cmSystemTools::UpperCase(config?config:""));
   cmTargetLinkInformationMap::iterator
     i = this->LinkInformation.find(key);
   if(i == this->LinkInformation.end())
@@ -6141,7 +6070,7 @@ cmTarget::GetLinkInformation(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetFrameworkDirectory(const std::string& config,
+std::string cmTarget::GetFrameworkDirectory(const char* config,
                                             bool rootDir) const
 {
   std::string fpath;
@@ -6156,7 +6085,7 @@ std::string cmTarget::GetFrameworkDirectory(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetCFBundleDirectory(const std::string& config,
+std::string cmTarget::GetCFBundleDirectory(const char* config,
                                            bool contentOnly) const
 {
   std::string fpath;
@@ -6175,7 +6104,7 @@ std::string cmTarget::GetCFBundleDirectory(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetAppBundleDirectory(const std::string& config,
+std::string cmTarget::GetAppBundleDirectory(const char* config,
                                             bool contentOnly) const
 {
   std::string fpath = this->GetFullName(config, false);
@@ -6187,7 +6116,7 @@ std::string cmTarget::GetAppBundleDirectory(const std::string& config,
 
 //----------------------------------------------------------------------------
 std::string cmTarget::BuildMacContentDirectory(const std::string& base,
-                                               const std::string& config,
+                                               const char* config,
                                                bool contentOnly) const
 {
   std::string fpath = base;
@@ -6207,7 +6136,7 @@ std::string cmTarget::BuildMacContentDirectory(const std::string& base,
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetMacContentDirectory(const std::string& config,
+std::string cmTarget::GetMacContentDirectory(const char* config,
                                              bool implib) const
 {
   // Start with the output directory for the target.
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 317d00c..271824b 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -93,7 +93,7 @@ public:
   /**
    * Set the target type
    */
-  void SetType(TargetType f, const std::string& name);
+  void SetType(TargetType f, const char* name);
 
   void MarkAsImported();
 
@@ -140,30 +140,58 @@ public:
     }
 
   /**
+   * Flags for a given source file as used in this target. Typically assigned
+   * via SET_TARGET_PROPERTIES when the property is a list of source files.
+   */
+  enum SourceFileType
+  {
+    SourceFileTypeNormal,
+    SourceFileTypePrivateHeader, // is in "PRIVATE_HEADER" target property
+    SourceFileTypePublicHeader,  // is in "PUBLIC_HEADER" target property
+    SourceFileTypeResource,      // is in "RESOURCE" target property *or*
+                                 // has MACOSX_PACKAGE_LOCATION=="Resources"
+    SourceFileTypeMacContent     // has MACOSX_PACKAGE_LOCATION!="Resources"
+  };
+  struct SourceFileFlags
+  {
+    SourceFileFlags(): Type(SourceFileTypeNormal), MacFolder(0) {}
+    SourceFileFlags(SourceFileFlags const& r):
+      Type(r.Type), MacFolder(r.MacFolder) {}
+    SourceFileType Type;
+    const char* MacFolder; // location inside Mac content folders
+  };
+
+  /**
+   * Get the flags for a given source file as used in this target
+   */
+  struct SourceFileFlags
+  GetTargetSourceFileFlags(const cmSourceFile* sf) const;
+
+  /**
    * Add sources to the target.
    */
   void AddSources(std::vector<std::string> const& srcs);
-  cmSourceFile* AddSource(const std::string& src);
+  cmSourceFile* AddSource(const char* src);
 
   enum LinkLibraryType {GENERAL, DEBUG, OPTIMIZED};
 
   //* how we identify a library, by name and type
-  typedef std::pair<std::string, LinkLibraryType> LibraryID;
+  typedef std::pair<cmStdString, LinkLibraryType> LibraryID;
 
   typedef std::vector<LibraryID > LinkLibraryVectorType;
   const LinkLibraryVectorType &GetLinkLibraries() const {
   return this->LinkLibraries;}
   const LinkLibraryVectorType &GetOriginalLinkLibraries() const
     {return this->OriginalLinkLibraries;}
-  void GetDirectLinkLibraries(const std::string& config,
+  void GetDirectLinkLibraries(const char *config,
                               std::vector<std::string> &,
                               cmTarget const* head) const;
-  void GetInterfaceLinkLibraries(const std::string& config,
+  void GetInterfaceLinkLibraries(const char *config,
                               std::vector<std::string> &,
                               cmTarget const* head) const;
 
   /** Compute the link type to use for the given configuration.  */
-  LinkLibraryType ComputeLinkType(const std::string& config) const;
+  LinkLibraryType ComputeLinkType(const char* config) const;
 
   /**
    * Clear the dependency information recorded for this target, if any.
@@ -173,7 +201,7 @@ public:
   // Check to see if a library is a framework and treat it different on Mac
   bool NameResolvesToFramework(const std::string& libname) const;
   void AddLinkLibrary(cmMakefile& mf,
-                      const std::string& target, const std::string& lib,
+                      const char *target, const char* lib,
                       LinkLibraryType llt);
   enum TLLSignature {
     KeywordTLLSignature,
@@ -187,7 +215,7 @@ public:
 
   const std::vector<std::string>& GetLinkDirectories() const;
 
-  void AddLinkDirectory(const std::string& d);
+  void AddLinkDirectory(const char* d);
 
   /**
    * Set the path where this target should be installed. This is relative to
@@ -214,26 +242,23 @@ public:
    * name as would be specified to the ADD_EXECUTABLE or UTILITY_SOURCE
    * commands. It is not a full path nor does it have an extension.
    */
-  void AddUtility(const std::string& u, cmMakefile *makefile = 0);
+  void AddUtility(const char* u, cmMakefile *makefile = 0);
   ///! Get the utilities used by this target
-  std::set<std::string>const& GetUtilities() const { return this->Utilities; }
-  cmListFileBacktrace const* GetUtilityBacktrace(const std::string& u) const;
+  std::set<cmStdString>const& GetUtilities() const { return this->Utilities; }
+  cmListFileBacktrace const* GetUtilityBacktrace(const char* u) const;
 
   /** Finalize the target at the end of the Configure step.  */
   void FinishConfigure();
 
   ///! Set/Get a property of this target file
-  void SetProperty(const std::string& prop, const char *value);
-  void AppendProperty(const std::string&  prop, const char* value,
-          bool asString=false);
-  const char *GetProperty(const std::string& prop) const;
-  const char *GetProperty(const std::string& prop,
-          cmProperty::ScopeType scope) const;
-  bool GetPropertyAsBool(const std::string& prop) const;
-  void CheckProperty(const std::string& prop, cmMakefile* context) const;
-
-  const char* GetFeature(const std::string& feature,
-                         const std::string& config) const;
+  void SetProperty(const char *prop, const char *value);
+  void AppendProperty(const char* prop, const char* value,bool asString=false);
+  const char *GetProperty(const char *prop) const;
+  const char *GetProperty(const char *prop, cmProperty::ScopeType scope) const;
+  bool GetPropertyAsBool(const char *prop) const;
+  void CheckProperty(const char* prop, cmMakefile* context) const;
+
+  const char* GetFeature(const char* feature, const char* config) const;
 
   bool IsImported() const {return this->IsImportedTarget;}
 
@@ -265,16 +290,11 @@ public:
 
   /** Get the link interface for the given configuration.  Returns 0
       if the target cannot be linked.  */
-  LinkInterface const* GetLinkInterface(const std::string& config,
-                                        cmTarget const* headTarget) const;
-  LinkInterface const* GetLinkInterfaceLibraries(const std::string& config,
+  LinkInterface const* GetLinkInterface(const char* config,
                                         cmTarget const* headTarget) const;
-  void GetTransitivePropertyTargets(const std::string& config,
-                                        cmTarget const* headTarget,
-                                        std::vector<cmTarget*> &libs) const;
-  void GetTransitiveTargetClosure(const std::string& config,
+  void GetTransitivePropertyLinkLibraries(const char* config,
                                         cmTarget const* headTarget,
-                                        std::vector<cmTarget*> &libs) const;
+                                        std::vector<std::string> &libs) const;
 
   /** The link implementation specifies the direct library
       dependencies needed by the object files of the target.  */
@@ -290,13 +310,9 @@ public:
     // Needed only for OLD behavior of CMP0003.
     std::vector<std::string> WrongConfigLibraries;
   };
-  LinkImplementation const* GetLinkImplementation(const std::string& config,
+  LinkImplementation const* GetLinkImplementation(const char* config,
                                                   cmTarget const* head) const;
 
-  LinkImplementation const*
-  GetLinkImplementationLibraries(const std::string& config,
-                                 cmTarget const* head) const;
-
   /** Link information from the transitive closure of the link
       implementation and the interfaces of its dependencies.  */
   struct LinkClosure
@@ -307,7 +323,7 @@ public:
     // Languages whose runtime libraries must be linked.
     std::vector<std::string> Languages;
   };
-  LinkClosure const* GetLinkClosure(const std::string& config,
+  LinkClosure const* GetLinkClosure(const char* config,
                                     cmTarget const* head) const;
 
   /** Strip off leading and trailing whitespace from an item named in
@@ -318,19 +334,18 @@ public:
       configuration name is given then the generator will add its
       subdirectory for that configuration.  Otherwise just the canonical
       output directory is given.  */
-  std::string GetDirectory(const std::string& config = "",
-                           bool implib = false) const;
+  std::string GetDirectory(const char* config = 0, bool implib = false) const;
 
   /** Get the directory in which this targets .pdb files will be placed.
       If the configuration name is given then the generator will add its
       subdirectory for that configuration.  Otherwise just the canonical
       pdb output directory is given.  */
-  std::string GetPDBDirectory(const std::string& config = "") const;
+  std::string GetPDBDirectory(const char* config = 0) const;
 
   /** Get the location of the target in the build tree for the given
       configuration.  This location is suitable for use as the LOCATION
       target property.  */
-  const char* GetLocation(const std::string& config) const;
+  const char* GetLocation(const char* config) const;
 
   /** Get the target major and minor version numbers interpreted from
       the VERSION property.  Version 0 is returned if the property is
@@ -343,41 +358,44 @@ public:
   void
   GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const;
 
+  /**
+   * Make sure the full path to all source files is known.
+   */
+  bool FindSourceFiles();
+
   ///! Return the preferred linker language for this target
-  const char* GetLinkerLanguage(const std::string& config = "",
+  const char* GetLinkerLanguage(const char* config = 0,
                                 cmTarget const* head = 0) const;
 
   /** Get the full name of the target according to the settings in its
       makefile.  */
-  std::string GetFullName(const std::string& config="",
-                          bool implib = false) const;
+  std::string GetFullName(const char* config=0, bool implib = false) const;
   void GetFullNameComponents(std::string& prefix,
                              std::string& base, std::string& suffix,
-                             const std::string& config="",
-                             bool implib = false) const;
+                             const char* config=0, bool implib = false) const;
 
   /** Get the name of the pdb file for the target.  */
-  std::string GetPDBName(const std::string& config="") const;
+  std::string GetPDBName(const char* config=0) const;
 
   /** Whether this library has soname enabled and platform supports it.  */
-  bool HasSOName(const std::string& config) const;
+  bool HasSOName(const char* config) const;
 
   /** Get the soname of the target.  Allowed only for a shared library.  */
-  std::string GetSOName(const std::string& config) const;
+  std::string GetSOName(const char* config) const;
 
   /** Whether this library has \@rpath and platform supports it.  */
-  bool HasMacOSXRpathInstallNameDir(const std::string& config) const;
+  bool HasMacOSXRpathInstallNameDir(const char* config) const;
 
   /** Whether this library defaults to \@rpath.  */
   bool MacOSXRpathInstallNameDirDefault() const;
 
   /** Test for special case of a third-party shared library that has
       no soname at all.  */
-  bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
+  bool IsImportedSharedLibWithoutSOName(const char* config) const;
 
   /** Get the full path to the target according to the settings in its
       makefile and the configuration type.  */
-  std::string GetFullPath(const std::string& config="", bool implib = false,
+  std::string GetFullPath(const char* config=0, bool implib = false,
                           bool realname = false) const;
 
   /** Get the names of the library needed to generate a build rule
@@ -385,15 +403,14 @@ public:
       should be called only on a library target.  */
   void GetLibraryNames(std::string& name, std::string& soName,
                        std::string& realName, std::string& impName,
-                       std::string& pdbName, const std::string& config) const;
+                       std::string& pdbName, const char* config) const;
 
   /** Get the names of the executable needed to generate a build rule
       that takes into account executable version numbers.  This should
       be called only on an executable target.  */
   void GetExecutableNames(std::string& name, std::string& realName,
                           std::string& impName,
-                          std::string& pdbName,
-                          const std::string& config) const;
+                          std::string& pdbName, const char* config) const;
 
   /** Does this target have a GNU implib to convert to MS format?  */
   bool HasImplibGNUtoMS() const;
@@ -406,24 +423,24 @@ public:
   /**
    * Compute whether this target must be relinked before installing.
    */
-  bool NeedRelinkBeforeInstall(const std::string& config) const;
+  bool NeedRelinkBeforeInstall(const char* config) const;
 
-  bool HaveBuildTreeRPATH(const std::string& config) const;
+  bool HaveBuildTreeRPATH(const char *config) const;
   bool HaveInstallTreeRPATH() const;
 
   /** Return true if builtin chrpath will work for this target */
-  bool IsChrpathUsed(const std::string& config) const;
+  bool IsChrpathUsed(const char* config) const;
 
   /** Return the install name directory for the target in the
     * build tree.  For example: "\@rpath/", "\@loader_path/",
     * or "/full/path/to/library".  */
-  std::string GetInstallNameDirForBuildTree(const std::string& config) const;
+  std::string GetInstallNameDirForBuildTree(const char* config) const;
 
   /** Return the install name directory for the target in the
     * install tree.  For example: "\@rpath/" or "\@loader_path/". */
   std::string GetInstallNameDirForInstallTree() const;
 
-  cmComputeLinkInformation* GetLinkInformation(const std::string& config,
+  cmComputeLinkInformation* GetLinkInformation(const char* config,
                                                cmTarget const* head = 0) const;
 
   // Get the properties
@@ -442,14 +459,14 @@ public:
   const char* GetExportMacro() const;
 
   void GetCompileDefinitions(std::vector<std::string> &result,
-                             const std::string& config) const;
+                             const char *config) const;
 
   // Compute the set of languages compiled by the target.  This is
   // computed every time it is called because the languages can change
   // when source file properties are changed and we do not have enough
   // information to forward these property changes to the targets
   // until we have per-target object file properties.
-  void GetLanguages(std::set<std::string>& languages) const;
+  void GetLanguages(std::set<cmStdString>& languages) const;
 
   /** Return whether this target is an executable with symbol exports
       enabled.  */
@@ -490,29 +507,26 @@ public:
 
   /** Return whether this target uses the default value for its output
       directory.  */
-  bool UsesDefaultOutputDir(const std::string& config, bool implib) const;
+  bool UsesDefaultOutputDir(const char* config, bool implib) const;
 
   /** @return the mac content directory for this target. */
-  std::string GetMacContentDirectory(const std::string& config,
+  std::string GetMacContentDirectory(const char* config,
                                      bool implib) const;
 
   /** @return whether this target have a well defined output file name. */
   bool HaveWellDefinedOutputFiles() const;
 
   /** @return the Mac framework directory without the base. */
-  std::string GetFrameworkDirectory(const std::string& config,
-                                    bool rootDir) const;
+  std::string GetFrameworkDirectory(const char* config, bool rootDir) const;
 
   /** @return the Mac CFBundle directory without the base */
-  std::string GetCFBundleDirectory(const std::string& config,
-                                   bool contentOnly) const;
+  std::string GetCFBundleDirectory(const char* config, bool contentOnly) const;
 
   /** @return the Mac App directory without the base */
-  std::string GetAppBundleDirectory(const std::string& config,
+  std::string GetAppBundleDirectory(const char* config,
                                     bool contentOnly) const;
 
-  std::vector<std::string> GetIncludeDirectories(
-                     const std::string& config) const;
+  std::vector<std::string> GetIncludeDirectories(const char *config) const;
   void InsertInclude(const cmValueWithOrigin &entry,
                      bool before = false);
   void InsertCompileOption(const cmValueWithOrigin &entry,
@@ -522,36 +536,36 @@ public:
   void AppendBuildInterfaceIncludes();
 
   void GetCompileOptions(std::vector<std::string> &result,
-                         const std::string& config) const;
+                         const char *config) const;
   void GetAutoUicOptions(std::vector<std::string> &result,
-                         const std::string& config) const;
+                         const char *config) const;
 
   bool IsNullImpliedByLinkLibraries(const std::string &p) const;
   bool IsLinkInterfaceDependentBoolProperty(const std::string &p,
-                         const std::string& config) const;
+                                            const char *config) const;
   bool IsLinkInterfaceDependentStringProperty(const std::string &p,
-                         const std::string& config) const;
+                                              const char *config) const;
   bool IsLinkInterfaceDependentNumberMinProperty(const std::string &p,
-                         const std::string& config) const;
+                                                 const char *config) const;
   bool IsLinkInterfaceDependentNumberMaxProperty(const std::string &p,
-                         const std::string& config) const;
+                                                 const char *config) const;
 
   bool GetLinkInterfaceDependentBoolProperty(const std::string &p,
-                                             const std::string& config) const;
+                                             const char *config) const;
 
   const char *GetLinkInterfaceDependentStringProperty(const std::string &p,
-                         const std::string& config) const;
+                                                    const char *config) const;
   const char *GetLinkInterfaceDependentNumberMinProperty(const std::string &p,
-                         const std::string& config) const;
+                                                    const char *config) const;
   const char *GetLinkInterfaceDependentNumberMaxProperty(const std::string &p,
-                         const std::string& config) const;
+                                                    const char *config) const;
 
   std::string GetDebugGeneratorExpressions(const std::string &value,
                                   cmTarget::LinkLibraryType llt) const;
 
-  void AddSystemIncludeDirectories(const std::set<std::string> &incs);
+  void AddSystemIncludeDirectories(const std::set<cmStdString> &incs);
   void AddSystemIncludeDirectories(const std::vector<std::string> &incs);
-  std::set<std::string> const & GetSystemIncludeDirectories() const
+  std::set<cmStdString> const & GetSystemIncludeDirectories() const
     { return this->SystemIncludeDirectories; }
 
   bool LinkLanguagePropagatesToDependents() const
@@ -567,7 +581,7 @@ private:
 
   // The set of include directories that are marked as system include
   // directories.
-  std::set<std::string> SystemIncludeDirectories;
+  std::set<cmStdString> SystemIncludeDirectories;
 
   std::vector<std::pair<TLLSignature, cmListFileBacktrace> > TLLCommands;
 
@@ -624,43 +638,39 @@ private:
 
   const char* GetSuffixVariableInternal(bool implib) const;
   const char* GetPrefixVariableInternal(bool implib) const;
-  std::string GetFullNameInternal(const std::string& config,
-                                  bool implib) const;
-  void GetFullNameInternal(const std::string& config, bool implib,
+  std::string GetFullNameInternal(const char* config, bool implib) const;
+  void GetFullNameInternal(const char* config, bool implib,
                            std::string& outPrefix, std::string& outBase,
                            std::string& outSuffix) const;
 
   // 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 std::string& property,
-                          const char* default_value);
+  void SetPropertyDefault(const char* property, const char* default_value);
 
   // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
   const char* GetOutputTargetType(bool implib) const;
 
   // Get the target base name.
-  std::string GetOutputName(const std::string& config, bool implib) const;
+  std::string GetOutputName(const char* config, bool implib) const;
 
-  const char* ImportedGetLocation(const std::string& config) const;
-  const char* NormalGetLocation(const std::string& config) const;
+  const char* ImportedGetLocation(const char* config) const;
+  const char* NormalGetLocation(const char* config) const;
 
-  std::string GetFullNameImported(const std::string& config,
-                                  bool implib) const;
+  std::string GetFullNameImported(const char* config, bool implib) const;
 
-  std::string ImportedGetFullPath(const std::string& config,
-                                  bool implib) const;
-  std::string NormalGetFullPath(const std::string& config, bool implib,
+  std::string ImportedGetFullPath(const char* config, bool implib) const;
+  std::string NormalGetFullPath(const char* config, bool implib,
                                 bool realname) const;
 
   /** Get the real name of the target.  Allowed only for non-imported
       targets.  When a library or executable file is versioned this is
       the full versioned name.  If the target is not versioned this is
       the same as GetFullName.  */
-  std::string NormalGetRealName(const std::string& config) const;
+  std::string NormalGetRealName(const char* config) const;
 
   /** Append to @a base the mac content directory and return it. */
   std::string BuildMacContentDirectory(const std::string& base,
-                                       const std::string& config,
+                                       const char* config,
                                        bool contentOnly) const;
 
 private:
@@ -675,13 +685,13 @@ private:
   LinkLibraryVectorType PrevLinkedLibraries;
   bool LinkLibrariesAnalyzed;
   std::vector<std::string> LinkDirectories;
-  std::set<std::string> LinkDirectoriesEmmitted;
+  std::set<cmStdString> LinkDirectoriesEmmitted;
   bool HaveInstallRule;
   std::string InstallPath;
   std::string RuntimeInstallPath;
   mutable std::string ExportMacro;
-  std::set<std::string> Utilities;
-  std::map<std::string, cmListFileBacktrace> UtilityBacktraces;
+  std::set<cmStdString> Utilities;
+  std::map<cmStdString, cmListFileBacktrace> UtilityBacktraces;
   bool RecordDependencies;
   mutable cmPropertyMap Properties;
   LinkLibraryVectorType OriginalLinkLibraries;
@@ -697,38 +707,34 @@ private:
 
   // Cache target output paths for each configuration.
   struct OutputInfo;
-  OutputInfo const* GetOutputInfo(const std::string& config) const;
+  OutputInfo const* GetOutputInfo(const char* config) const;
   bool
-  ComputeOutputDir(const std::string& config, bool implib,
-                   std::string& out) const;
-  bool ComputePDBOutputDir(const std::string& config, std::string& out) const;
+  ComputeOutputDir(const char* config, bool implib, std::string& out) const;
+  bool ComputePDBOutputDir(const char* config, std::string& out) const;
 
   // Cache import information from properties for each configuration.
   struct ImportInfo;
-  ImportInfo const* GetImportInfo(const std::string& config,
+  ImportInfo const* GetImportInfo(const char* config,
                                         cmTarget const* workingTarget) const;
   void ComputeImportInfo(std::string const& desired_config, ImportInfo& info,
                                         cmTarget const* head) const;
 
   mutable cmTargetLinkInformationMap LinkInformation;
   void CheckPropertyCompatibility(cmComputeLinkInformation *info,
-                                  const std::string& config) const;
+                                  const char* config) const;
 
-  const char* ComputeLinkInterfaceLibraries(const std::string& config,
-                                            LinkInterface& iface,
-                                            cmTarget const* head,
-                                            bool &exists) const;
+  bool ComputeLinkInterface(const char* config, LinkInterface& iface,
+                                        cmTarget const* head) const;
 
-  void ComputeLinkImplementation(const std::string& config,
+  void ComputeLinkImplementation(const char* config,
                                  LinkImplementation& impl,
                                  cmTarget const* head) const;
-  void ComputeLinkImplementationLanguages(LinkImplementation& impl) const;
-  void ComputeLinkClosure(const std::string& config, LinkClosure& lc,
+  void ComputeLinkClosure(const char* config, LinkClosure& lc,
                           cmTarget const* head) const;
 
   void ClearLinkMaps();
 
-  void MaybeInvalidatePropertyCache(const std::string& prop);
+  void MaybeInvalidatePropertyCache(const char* prop);
 
   void ProcessSourceExpression(std::string const& expr);
 
@@ -750,6 +756,7 @@ private:
   friend class cmTargetTraceDependencies;
   cmTargetInternalPointer Internal;
 
+  void ConstructSourceFileFlags() const;
   void ComputeVersionedName(std::string& vName,
                             std::string const& prefix,
                             std::string const& base,
@@ -758,9 +765,9 @@ private:
                             const char* version) const;
 };
 
-typedef std::map<std::string,cmTarget> cmTargets;
+typedef std::map<cmStdString,cmTarget> cmTargets;
 
-class cmTargetSet: public std::set<std::string> {};
-class cmTargetManifest: public std::map<std::string, cmTargetSet> {};
+class cmTargetSet: public std::set<cmStdString> {};
+class cmTargetManifest: public std::map<cmStdString, cmTargetSet> {};
 
 #endif
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 8dc407b..02da933 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -39,7 +39,7 @@ bool cmTargetLinkLibrariesCommand
   // Lookup the target for which libraries are specified.
   this->Target =
     this->Makefile->GetCMakeInstance()
-    ->GetGlobalGenerator()->FindTarget(args[0].c_str());
+    ->GetGlobalGenerator()->FindTarget(0, args[0].c_str());
   if(!this->Target)
     {
     cmake::MessageType t = cmake::FATAL_ERROR;  // fail by default
@@ -272,7 +272,7 @@ bool cmTargetLinkLibrariesCommand
       {
       // The link type was specified by the previous argument.
       haveLLT = false;
-      if (!this->HandleLibrary(args[i], llt))
+      if (!this->HandleLibrary(args[i].c_str(), llt))
         {
         return false;
         }
@@ -301,7 +301,7 @@ bool cmTargetLinkLibrariesCommand
           llt = cmTarget::OPTIMIZED;
           }
         }
-      if (!this->HandleLibrary(args[i], llt))
+      if (!this->HandleLibrary(args[i].c_str(), llt))
         {
         return false;
         }
@@ -352,7 +352,7 @@ cmTargetLinkLibrariesCommand
 
 //----------------------------------------------------------------------------
 bool
-cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
+cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
                                             cmTarget::LinkLibraryType llt)
 {
   if(this->Target->GetType() == cmTarget::INTERFACE_LIBRARY
@@ -479,13 +479,13 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
       {
       prop = "LINK_INTERFACE_LIBRARIES_";
       prop += *i;
-      this->Target->AppendProperty(prop.c_str(), lib.c_str());
+      this->Target->AppendProperty(prop.c_str(), lib);
       }
     }
   if(llt == cmTarget::OPTIMIZED || llt == cmTarget::GENERAL)
     {
     // Put in the non-DEBUG configuration interfaces.
-    this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib.c_str());
+    this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib);
 
     // Make sure the DEBUG configuration interfaces exist so that the
     // general one will not be used as a fall-back.
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index e2f3743..6fbf722 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -62,7 +62,7 @@ private:
 
   ProcessingState CurrentProcessingState;
 
-  bool HandleLibrary(const std::string& lib, cmTarget::LinkLibraryType llt);
+  bool HandleLibrary(const char* lib, cmTarget::LinkLibraryType llt);
 };
 
 
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index 4539c55..195690e 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -33,7 +33,7 @@ bool cmTargetPropCommandBase
     }
   this->Target =
     this->Makefile->GetCMakeInstance()
-    ->GetGlobalGenerator()->FindTarget(args[0].c_str());
+    ->GetGlobalGenerator()->FindTarget(0, args[0].c_str());
   if(!this->Target)
     {
     this->Target = this->Makefile->FindTargetToUse(args[0]);
diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx
index 28a7bb1..9cda978 100644
--- a/Source/cmTest.cxx
+++ b/Source/cmTest.cxx
@@ -38,8 +38,12 @@ cmListFileBacktrace const& cmTest::GetBacktrace() const
 }
 
 //----------------------------------------------------------------------------
-void cmTest::SetName(const std::string& name)
+void cmTest::SetName(const char* name)
 {
+  if ( !name )
+    {
+    name = "";
+    }
   this->Name = name;
 }
 
@@ -50,7 +54,7 @@ void cmTest::SetCommand(std::vector<std::string> const& command)
 }
 
 //----------------------------------------------------------------------------
-const char *cmTest::GetProperty(const std::string& prop) const
+const char *cmTest::GetProperty(const char* prop) const
 {
   bool chain = false;
   const char *retVal =
@@ -63,20 +67,28 @@ const char *cmTest::GetProperty(const std::string& prop) const
 }
 
 //----------------------------------------------------------------------------
-bool cmTest::GetPropertyAsBool(const std::string& prop) const
+bool cmTest::GetPropertyAsBool(const char* prop) const
 {
   return cmSystemTools::IsOn(this->GetProperty(prop));
 }
 
 //----------------------------------------------------------------------------
-void cmTest::SetProperty(const std::string& prop, const char* value)
+void cmTest::SetProperty(const char* prop, const char* value)
 {
+  if (!prop)
+    {
+    return;
+    }
+
   this->Properties.SetProperty(prop, value, cmProperty::TEST);
 }
 
 //----------------------------------------------------------------------------
-void cmTest::AppendProperty(const std::string& prop,
-                            const char* value, bool asString)
+void cmTest::AppendProperty(const char* prop, const char* value, bool asString)
 {
+  if (!prop)
+    {
+    return;
+    }
   this->Properties.AppendProperty(prop, value, cmProperty::TEST, asString);
 }
diff --git a/Source/cmTest.h b/Source/cmTest.h
index 368b586..1fe8fc0 100644
--- a/Source/cmTest.h
+++ b/Source/cmTest.h
@@ -31,7 +31,7 @@ public:
   ~cmTest();
 
   ///! Set the test name
-  void SetName(const std::string& name);
+  void SetName(const char* name);
   const char* GetName() const { return this->Name.c_str(); }
 
   void SetCommand(std::vector<std::string> const& command);
@@ -46,11 +46,10 @@ public:
   void Print() const;
 
   ///! Set/Get a property of this source file
-  void SetProperty(const std::string& prop, const char *value);
-  void AppendProperty(const std::string& prop,
-                      const char* value,bool asString=false);
-  const char *GetProperty(const std::string& prop) const;
-  bool GetPropertyAsBool(const std::string& prop) const;
+  void SetProperty(const char *prop, const char *value);
+  void AppendProperty(const char* prop, const char* value,bool asString=false);
+  const char *GetProperty(const char *prop) const;
+  bool GetPropertyAsBool(const char *prop) const;
   cmPropertyMap &GetProperties() { return this->Properties; };
 
   /** Get the cmMakefile instance that owns this test.  */
@@ -65,7 +64,7 @@ public:
 
 private:
   cmPropertyMap Properties;
-  std::string Name;
+  cmStdString Name;
   std::vector<std::string> Command;
 
   bool OldStyle;
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index a21e1aa..5dc3e60 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -64,7 +64,7 @@ void cmTestGenerator::GenerateScriptActions(std::ostream& os,
 
 //----------------------------------------------------------------------------
 void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
-                                              const std::string& config,
+                                              const char* config,
                                               Indent const& indent)
 {
   this->TestGenerated = true;
diff --git a/Source/cmTestGenerator.h b/Source/cmTestGenerator.h
index 5446553..2c69fc3 100644
--- a/Source/cmTestGenerator.h
+++ b/Source/cmTestGenerator.h
@@ -32,7 +32,7 @@ protected:
   virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent);
   virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
   virtual void GenerateScriptForConfig(std::ostream& os,
-                                       const std::string& config,
+                                       const char* config,
                                        Indent const& indent);
   virtual void GenerateScriptNoConfig(std::ostream& os, Indent const& indent);
   virtual bool NeedsScriptNoConfig() const;
diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h
index c86fad0..790c75a 100644
--- a/Source/cmVariableWatch.h
+++ b/Source/cmVariableWatch.h
@@ -81,7 +81,7 @@ protected:
   };
 
   typedef std::vector< Pair* > VectorOfPairs;
-  typedef std::map<std::string, VectorOfPairs > StringToVectorOfPairs;
+  typedef std::map<cmStdString, VectorOfPairs > StringToVectorOfPairs;
 
   StringToVectorOfPairs WatchMap;
 };
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index a5c5e8a..ed7e243 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -140,7 +140,7 @@ cmVisualStudio10TargetGenerator::~cmVisualStudio10TargetGenerator()
 
 void cmVisualStudio10TargetGenerator::WritePlatformConfigTag(
   const char* tag,
-  const std::string& config,
+  const char* config,
   int indentLevel,
   const char* attribute,
   const char* end,
@@ -1666,10 +1666,10 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
   linkOptions.AddFlag("ImportLibrary", imLib.c_str());
   linkOptions.AddFlag("ProgramDataBaseFile", pdb.c_str());
   linkOptions.Parse(flags.c_str());
-  std::string def = this->GeneratorTarget->GetModuleDefinitionFile();
-  if(!def.empty())
+  if(!this->GeneratorTarget->ModuleDefinitionFile.empty())
     {
-    linkOptions.AddFlag("ModuleDefinitionFile", def.c_str());
+    linkOptions.AddFlag("ModuleDefinitionFile",
+                        this->GeneratorTarget->ModuleDefinitionFile.c_str());
     }
 
   this->LinkOptions[config] = pOptions.release();
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 8d69254..d1f3d19 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -98,7 +98,7 @@ private:
 
 private:
   typedef cmVisualStudioGeneratorOptions Options;
-  typedef std::map<std::string, Options*> OptionsMap;
+  typedef std::map<cmStdString, Options*> OptionsMap;
   OptionsMap ClOptions;
   OptionsMap LinkOptions;
   std::string PathToVcxproj;
@@ -113,7 +113,7 @@ private:
   cmLocalVisualStudio7Generator* LocalGenerator;
   std::set<cmSourceFile*> SourcesVisited;
 
-  typedef std::map<std::string, ToolSources> ToolSourceMap;
+  typedef std::map<cmStdString, ToolSources> ToolSourceMap;
   ToolSourceMap Tools;
 };
 
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 5debec1..6aca787 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -300,7 +300,7 @@ cmVisualStudioGeneratorOptions
 {
   if(this->Version >= cmLocalVisualStudioGenerator::VS10)
     {
-    for(std::map<std::string, std::string>::iterator m = this->FlagMap.begin();
+    for(std::map<cmStdString, cmStdString>::iterator m = this->FlagMap.begin();
         m != this->FlagMap.end(); ++m)
       {
       fout << indent;
@@ -326,7 +326,7 @@ cmVisualStudioGeneratorOptions
     }
   else
     {
-    for(std::map<std::string, std::string>::iterator m = this->FlagMap.begin();
+    for(std::map<cmStdString, cmStdString>::iterator m = this->FlagMap.begin();
         m != this->FlagMap.end(); ++m)
       {
       fout << indent << m->first << "=\"" << m->second << "\"\n";
diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx
index 3302a8d..6abf6bf 100644
--- a/Source/cmXCodeObject.cxx
+++ b/Source/cmXCodeObject.cxx
@@ -108,7 +108,7 @@ void cmXCodeObject::Print(std::ostream& out)
     {
     out << separator;
     }
-  std::map<std::string, cmXCodeObject*>::iterator i;
+  std::map<cmStdString, cmXCodeObject*>::iterator i;
   cmXCodeObject::Indent(3*indentFactor, out);
   out << "isa = " << PBXTypeNames[this->IsA]  << ";" << separator;
   for(i = this->ObjectAttributes.begin();
@@ -138,7 +138,7 @@ void cmXCodeObject::Print(std::ostream& out)
       }
     else if(object->TypeValue == ATTRIBUTE_GROUP)
       {
-      std::map<std::string, cmXCodeObject*>::iterator j;
+      std::map<cmStdString, cmXCodeObject*>::iterator j;
       out << i->first << " = {" << separator;
       for(j = object->ObjectAttributes.begin(); j !=
             object->ObjectAttributes.end(); ++j)
@@ -236,7 +236,7 @@ void cmXCodeObject::CopyAttributes(cmXCodeObject* copy)
 }
 
 //----------------------------------------------------------------------------
-void cmXCodeObject::PrintString(std::ostream& os,std::string String)
+void cmXCodeObject::PrintString(std::ostream& os,cmStdString String)
 {
   // The string needs to be quoted if it contains any characters
   // considered special by the Xcode project file parser.
@@ -266,7 +266,7 @@ void cmXCodeObject::PrintString(std::ostream& os) const
 }
 
 //----------------------------------------------------------------------------
-void cmXCodeObject::SetString(const std::string& s)
+void cmXCodeObject::SetString(const char* s)
 {
   this->String = s;
 }
diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h
index 029e255..b89f78c 100644
--- a/Source/cmXCodeObject.h
+++ b/Source/cmXCodeObject.h
@@ -30,14 +30,14 @@ public:
                  PBXCopyFilesBuildPhase,
                  None
   };
-  class StringVec: public std::vector<std::string> {};
+  class StringVec: public std::vector<cmStdString> {};
   static const char* PBXTypeNames[];
   virtual ~cmXCodeObject();
   cmXCodeObject(PBXType ptype, Type type);
   Type GetType() { return this->TypeValue;}
   PBXType GetIsA() { return this->IsA;}
 
-  void SetString(const std::string& s);
+  void SetString(const char* s);
   const char* GetString()
     {
       return this->String.c_str();
@@ -131,7 +131,7 @@ public:
         }
       this->DependLibraries[configName].push_back(l);
     }
-  std::map<std::string, StringVec> const& GetDependLibraries()
+  std::map<cmStdString, StringVec> const& GetDependLibraries()
     {
       return this->DependLibraries;
     }
@@ -144,27 +144,27 @@ public:
         }
       this->DependTargets[configName].push_back(tName);
     }
-  std::map<std::string, StringVec> const& GetDependTargets()
+  std::map<cmStdString, StringVec> const& GetDependTargets()
     {
     return this->DependTargets;
     }
   std::vector<cmXCodeObject*> const& GetObjectList() { return this->List;}
   void SetComment(const char* c) { this->Comment = c;}
-  static void PrintString(std::ostream& os,std::string String);
+  static void PrintString(std::ostream& os,cmStdString String);
 protected:
   void PrintString(std::ostream& os) const;
 
   cmTarget* Target;
   Type TypeValue;
-  std::string Id;
+  cmStdString Id;
   PBXType IsA;
   int Version;
-  std::string Comment;
-  std::string String;
+  cmStdString Comment;
+  cmStdString String;
   cmXCodeObject* Object;
   std::vector<cmXCodeObject*> List;
-  std::map<std::string, StringVec> DependLibraries;
-  std::map<std::string, StringVec> DependTargets;
-  std::map<std::string, cmXCodeObject*> ObjectAttributes;
+  std::map<cmStdString, StringVec> DependLibraries;
+  std::map<cmStdString, StringVec> DependTargets;
+  std::map<cmStdString, cmXCodeObject*> ObjectAttributes;
 };
 #endif
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 5dfcc0e..33fb0fc 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1069,13 +1069,13 @@ cmGlobalGenerator* cmake::CreateGlobalGenerator(const char* name)
   return generator;
 }
 
-void cmake::SetHomeDirectory(const std::string& dir)
+void cmake::SetHomeDirectory(const char* dir)
 {
   this->cmHomeDirectory = dir;
   cmSystemTools::ConvertToUnixSlashes(this->cmHomeDirectory);
 }
 
-void cmake::SetHomeOutputDirectory(const std::string& lib)
+void cmake::SetHomeOutputDirectory(const char* lib)
 {
   this->HomeOutputDirectory = lib;
   cmSystemTools::ConvertToUnixSlashes(this->HomeOutputDirectory);
@@ -1202,7 +1202,7 @@ struct SaveCacheEntry
   cmCacheManager::CacheEntryType type;
 };
 
-int cmake::HandleDeleteCacheVariables(const std::string& var)
+int cmake::HandleDeleteCacheVariables(const char* var)
 {
   std::vector<std::string> argsSplit;
   cmSystemTools::ExpandListArgument(std::string(var), argsSplit, true);
@@ -1725,7 +1725,7 @@ int cmake::Generate()
   return 0;
 }
 
-void cmake::AddCacheEntry(const std::string& key, const char* value,
+void cmake::AddCacheEntry(const char* key, const char* value,
                           const char* helpString,
                           int type)
 {
@@ -1734,7 +1734,7 @@ void cmake::AddCacheEntry(const std::string& key, const char* value,
                                     cmCacheManager::CacheEntryType(type));
 }
 
-const char* cmake::GetCacheDefinition(const std::string& name) const
+const char* cmake::GetCacheDefinition(const char* name) const
 {
   return this->CacheManager->GetCacheValue(name);
 }
@@ -2144,8 +2144,7 @@ void cmake::GenerateGraphViz(const char* fileName) const
 #endif
 }
 
-void cmake::DefineProperty(const std::string& name,
-                           cmProperty::ScopeType scope,
+void cmake::DefineProperty(const char *name, cmProperty::ScopeType scope,
                            const char *ShortDescription,
                            const char *FullDescription,
                            bool chained)
@@ -2156,7 +2155,7 @@ void cmake::DefineProperty(const std::string& name,
 }
 
 cmPropertyDefinition *cmake
-::GetPropertyDefinition(const std::string& name,
+::GetPropertyDefinition(const char *name,
                         cmProperty::ScopeType scope)
 {
   if (this->IsPropertyDefined(name,scope))
@@ -2166,22 +2165,25 @@ cmPropertyDefinition *cmake
   return 0;
 }
 
-bool cmake::IsPropertyDefined(const std::string& name,
-                              cmProperty::ScopeType scope)
+bool cmake::IsPropertyDefined(const char *name, cmProperty::ScopeType scope)
 {
   return this->PropertyDefinitions[scope].IsPropertyDefined(name);
 }
 
-bool cmake::IsPropertyChained(const std::string& name,
-                              cmProperty::ScopeType scope)
+bool cmake::IsPropertyChained(const char *name, cmProperty::ScopeType scope)
 {
   return this->PropertyDefinitions[scope].IsPropertyChained(name);
 }
 
-void cmake::SetProperty(const std::string& prop, const char* value)
+void cmake::SetProperty(const char* prop, const char* value)
 {
+  if (!prop)
+    {
+    return;
+    }
+
   // Special hook to invalidate cached value.
-  if(prop == "DEBUG_CONFIGURATIONS")
+  if(strcmp(prop, "DEBUG_CONFIGURATIONS") == 0)
     {
     this->DebugConfigs.clear();
     }
@@ -2189,11 +2191,15 @@ void cmake::SetProperty(const std::string& prop, const char* value)
   this->Properties.SetProperty(prop, value, cmProperty::GLOBAL);
 }
 
-void cmake::AppendProperty(const std::string& prop,
-                           const char* value, bool asString)
+void cmake::AppendProperty(const char* prop, const char* value, bool asString)
 {
+  if (!prop)
+    {
+    return;
+    }
+
   // Special hook to invalidate cached value.
-  if(prop == "DEBUG_CONFIGURATIONS")
+  if(strcmp(prop, "DEBUG_CONFIGURATIONS") == 0)
     {
     this->DebugConfigs.clear();
     }
@@ -2201,19 +2207,23 @@ void cmake::AppendProperty(const std::string& prop,
   this->Properties.AppendProperty(prop, value, cmProperty::GLOBAL, asString);
 }
 
-const char *cmake::GetProperty(const std::string& prop)
+const char *cmake::GetProperty(const char* prop)
 {
   return this->GetProperty(prop, cmProperty::GLOBAL);
 }
 
-const char *cmake::GetProperty(const std::string& prop,
-                               cmProperty::ScopeType scope)
+const char *cmake::GetProperty(const char* prop, cmProperty::ScopeType scope)
 {
+  if(!prop)
+    {
+    return 0;
+    }
   bool chain = false;
 
   // watch for special properties
+  std::string propname = prop;
   std::string output = "";
-  if ( prop == "CACHE_VARIABLES" )
+  if ( propname == "CACHE_VARIABLES" )
     {
     cmCacheManager::CacheIterator cit =
       this->GetCacheManager()->GetCacheIterator();
@@ -2227,7 +2237,7 @@ const char *cmake::GetProperty(const std::string& prop,
       }
     this->SetProperty("CACHE_VARIABLES", output.c_str());
     }
-  else if ( prop == "COMMANDS" )
+  else if ( propname == "COMMANDS" )
     {
     cmake::RegisteredCommandsMap::iterator cmds
         = this->GetCommands()->begin();
@@ -2242,12 +2252,12 @@ const char *cmake::GetProperty(const std::string& prop,
       }
     this->SetProperty("COMMANDS",output.c_str());
     }
-  else if ( prop == "IN_TRY_COMPILE" )
+  else if ( propname == "IN_TRY_COMPILE" )
     {
     this->SetProperty("IN_TRY_COMPILE",
                       this->GetIsInTryCompile()? "1":"0");
     }
-  else if ( prop == "ENABLED_LANGUAGES" )
+  else if ( propname == "ENABLED_LANGUAGES" )
     {
     std::string lang;
     if(this->GlobalGenerator)
@@ -2268,7 +2278,7 @@ const char *cmake::GetProperty(const std::string& prop,
   return this->Properties.GetPropertyValue(prop, scope, chain);
 }
 
-bool cmake::GetPropertyAsBool(const std::string& prop)
+bool cmake::GetPropertyAsBool(const char* prop)
 {
   return cmSystemTools::IsOn(this->GetProperty(prop));
 }
@@ -2676,7 +2686,7 @@ int cmake::Build(const std::string& dir,
                     nativeOptions);
 }
 
-void cmake::WatchUnusedCli(const std::string& var)
+void cmake::WatchUnusedCli(const char* var)
 {
 #ifdef CMAKE_BUILD_WITH_CMAKE
   this->VariableWatch->AddWatch(var, cmWarnUnusedCliWarning, this);
@@ -2687,7 +2697,7 @@ void cmake::WatchUnusedCli(const std::string& var)
 #endif
 }
 
-void cmake::UnwatchUnusedCli(const std::string& var)
+void cmake::UnwatchUnusedCli(const char* var)
 {
 #ifdef CMAKE_BUILD_WITH_CMAKE
   this->VariableWatch->RemoveWatch(var, cmWarnUnusedCliWarning);
@@ -2701,7 +2711,7 @@ void cmake::RunCheckForUnusedVariables()
   bool haveUnused = false;
   cmOStringStream msg;
   msg << "Manually-specified variables were not used by the project:";
-  for(std::map<std::string, bool>::const_iterator
+  for(std::map<cmStdString, bool>::const_iterator
         it = this->UsedCliVariables.begin();
       it != this->UsedCliVariables.end(); ++it)
     {
diff --git a/Source/cmake.h b/Source/cmake.h
index 933502a..dfec55c 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -91,7 +91,7 @@ class cmake
      */
     FIND_PACKAGE_MODE
   };
-  typedef std::map<std::string, cmCommand*> RegisteredCommandsMap;
+  typedef std::map<cmStdString, cmCommand*> RegisteredCommandsMap;
 
   /// Default constructor
   cmake();
@@ -110,12 +110,12 @@ class cmake
    * CMakeLists files by recursing up the tree starting at the StartDirectory
    * and going up until it reaches the HomeDirectory.
    */
-  void SetHomeDirectory(const std::string& dir);
+  void SetHomeDirectory(const char* dir);
   const char* GetHomeDirectory() const
     {
     return this->cmHomeDirectory.c_str();
     }
-  void SetHomeOutputDirectory(const std::string& lib);
+  void SetHomeOutputDirectory(const char* lib);
   const char* GetHomeOutputDirectory() const
     {
     return this->HomeOutputDirectory.c_str();
@@ -130,7 +130,7 @@ class cmake
    * recursing up the tree starting at the StartDirectory and going up until
    * it reaches the HomeDirectory.
    */
-  void SetStartDirectory(const std::string& dir)
+  void SetStartDirectory(const char* dir)
     {
       this->cmStartDirectory = dir;
       cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
@@ -139,7 +139,7 @@ class cmake
     {
       return this->cmStartDirectory.c_str();
     }
-  void SetStartOutputDirectory(const std::string& lib)
+  void SetStartOutputDirectory(const char* lib)
     {
       this->StartOutputDirectory = lib;
       cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
@@ -203,9 +203,9 @@ class cmake
   /**
    * Given a variable name, return its value (as a string).
    */
-  const char* GetCacheDefinition(const std::string&) const;
+  const char* GetCacheDefinition(const char*) const;
   ///! Add an entry into the cache
-  void AddCacheEntry(const std::string& key, const char* value,
+  void AddCacheEntry(const char* key, const char* value,
                      const char* helpString,
                      int type);
 
@@ -269,13 +269,11 @@ class cmake
   void GetGeneratorDocumentation(std::vector<cmDocumentationEntry>&);
 
   ///! Set/Get a property of this target file
-  void SetProperty(const std::string& prop, const char *value);
-  void AppendProperty(const std::string& prop,
-                      const char *value,bool asString=false);
-  const char *GetProperty(const std::string& prop);
-  const char *GetProperty(const std::string& prop,
-                          cmProperty::ScopeType scope);
-  bool GetPropertyAsBool(const std::string& prop);
+  void SetProperty(const char *prop, const char *value);
+  void AppendProperty(const char *prop, const char *value,bool asString=false);
+  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; };
@@ -319,18 +317,18 @@ class cmake
   void MarkCliAsUsed(const std::string& variable);
 
   // Define a property
-  void DefineProperty(const std::string& name, cmProperty::ScopeType scope,
+  void DefineProperty(const char *name, cmProperty::ScopeType scope,
                       const char *ShortDescription,
                       const char *FullDescription,
                       bool chain = false);
 
   // get property definition
   cmPropertyDefinition *GetPropertyDefinition
-  (const std::string& name, cmProperty::ScopeType scope);
+  (const char *name, cmProperty::ScopeType scope);
 
   // Is a property defined?
-  bool IsPropertyDefined(const std::string& name, cmProperty::ScopeType scope);
-  bool IsPropertyChained(const std::string& name, cmProperty::ScopeType scope);
+  bool IsPropertyDefined(const char *name, cmProperty::ScopeType scope);
+  bool IsPropertyChained(const char *name, cmProperty::ScopeType scope);
 
   /** Get the list of configurations (in upper case) considered to be
       debugging configurations.*/
@@ -357,21 +355,21 @@ class cmake
             const std::vector<std::string>& nativeOptions,
             bool clean);
 
-  void UnwatchUnusedCli(const std::string& var);
-  void WatchUnusedCli(const std::string& var);
+  void UnwatchUnusedCli(const char* var);
+  void WatchUnusedCli(const char* var);
 protected:
   void RunCheckForUnusedVariables();
   void InitializeProperties();
-  int HandleDeleteCacheVariables(const std::string& var);
+  int HandleDeleteCacheVariables(const char* var);
   cmPropertyMap Properties;
-  std::set<std::pair<std::string,cmProperty::ScopeType> > AccessedProperties;
+  std::set<std::pair<cmStdString,cmProperty::ScopeType> > AccessedProperties;
 
   std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>
   PropertyDefinitions;
 
   typedef
      cmExternalMakefileProjectGenerator* (*CreateExtraGeneratorFunctionType)();
-  typedef std::map<std::string,
+  typedef std::map<cmStdString,
                 CreateExtraGeneratorFunctionType> RegisteredExtraGeneratorsMap;
   typedef std::vector<cmGlobalGeneratorFactory*> RegisteredGeneratorsVector;
   RegisteredCommandsMap Commands;
@@ -432,7 +430,7 @@ private:
   bool WarnUnused;
   bool WarnUnusedCli;
   bool CheckSystemVars;
-  std::map<std::string, bool> UsedCliVariables;
+  std::map<cmStdString, bool> UsedCliVariables;
   std::string CMakeEditCommand;
   std::string CXXEnvironment;
   std::string CCEnvironment;
diff --git a/Source/cmcldeps.cxx b/Source/cmcldeps.cxx
index 55fc633..faa5fa7 100644
--- a/Source/cmcldeps.cxx
+++ b/Source/cmcldeps.cxx
@@ -198,7 +198,7 @@ static int process( const std::string& srcfilename,
   std::vector<std::string> args;
   cmSystemTools::ParseWindowsCommandLine(cmd.c_str(), args);
   // convert to correct vector type for RunSingleCommand
-  std::vector<std::string> command;
+  std::vector<cmStdString> command;
   for(std::vector<std::string>::iterator i = args.begin();
       i != args.end(); ++i)
     {
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 603b6d0..4ac1986 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -677,7 +677,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
       {
       std::string flags = args[2];
       std::string outFile = args[3];
-      std::vector<std::string> files;
+      std::vector<cmStdString> files;
       for (std::string::size_type cc = 4; cc < args.size(); cc ++)
         {
         files.push_back(args[cc]);
@@ -1143,7 +1143,7 @@ int cmcmd::VisualStudioLink(std::vector<std::string>& args, int type)
 }
 
 int cmcmd::ParseVisualStudioLinkCommand(std::vector<std::string>& args,
-                                        std::vector<std::string>& command,
+                                        std::vector<cmStdString>& command,
                                         std::string& targetName)
 {
   std::vector<std::string>::iterator i = args.begin();
@@ -1171,14 +1171,14 @@ int cmcmd::ParseVisualStudioLinkCommand(std::vector<std::string>& args,
 }
 
 bool cmcmd::RunCommand(const char* comment,
-                       std::vector<std::string>& command,
+                       std::vector<cmStdString>& command,
                        bool verbose,
                        int* retCodeOut)
 {
   if(verbose)
     {
     std::cout << comment << ":\n";
-    for(std::vector<std::string>::iterator i = command.begin();
+    for(std::vector<cmStdString>::iterator i = command.begin();
         i != command.end(); ++i)
       {
       std::cout << i->c_str() << " ";
@@ -1239,16 +1239,16 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args,
   //    7.  Finally, the Linker does another incremental link, but since the
   //    only thing that has changed is the *.res file that contains the
   //    manifest it is a short link.
-  std::vector<std::string> linkCommand;
+  std::vector<cmStdString> linkCommand;
   std::string targetName;
   if(cmcmd::ParseVisualStudioLinkCommand(args, linkCommand, targetName) == -1)
     {
     return -1;
     }
   std::string manifestArg = "/MANIFESTFILE:";
-  std::vector<std::string> rcCommand;
+  std::vector<cmStdString> rcCommand;
   rcCommand.push_back(cmSystemTools::FindProgram("rc.exe"));
-  std::vector<std::string> mtCommand;
+  std::vector<cmStdString> mtCommand;
   mtCommand.push_back(cmSystemTools::FindProgram("mt.exe"));
   std::string tempManifest;
   tempManifest = targetName;
@@ -1349,7 +1349,7 @@ int cmcmd::VisualStudioLinkNonIncremental(std::vector<std::string>& args,
                                           bool hasManifest,
                                           bool verbose)
 {
-  std::vector<std::string> linkCommand;
+  std::vector<cmStdString> linkCommand;
   std::string targetName;
   if(cmcmd::ParseVisualStudioLinkCommand(args, linkCommand, targetName) == -1)
     {
@@ -1368,7 +1368,7 @@ int cmcmd::VisualStudioLinkNonIncremental(std::vector<std::string>& args,
     {
     return 0;
     }
-  std::vector<std::string> mtCommand;
+  std::vector<cmStdString> mtCommand;
   mtCommand.push_back(cmSystemTools::FindProgram("mt.exe"));
   mtCommand.push_back("/nologo");
   mtCommand.push_back("/manifest");
diff --git a/Source/cmcmd.h b/Source/cmcmd.h
index 2bfbae7..4517ebf 100644
--- a/Source/cmcmd.h
+++ b/Source/cmcmd.h
@@ -43,10 +43,10 @@ protected:
                                             bool hasManifest,
                                             bool verbose);
   static int ParseVisualStudioLinkCommand(std::vector<std::string>& args,
-                                          std::vector<std::string>& command,
+                                          std::vector<cmStdString>& command,
                                           std::string& targetName);
   static bool RunCommand(const char* comment,
-                         std::vector<std::string>& command,
+                         std::vector<cmStdString>& command,
                          bool verbose,
                          int* retCodeOut = 0);
 };
diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx
index 279bcd5..dc1ce24 100644
--- a/Tests/CMakeLib/run_compile_commands.cxx
+++ b/Tests/CMakeLib/run_compile_commands.cxx
@@ -2,14 +2,14 @@
 
 class CompileCommandParser {
 public:
-  class CommandType: public std::map<std::string, std::string>
+  class CommandType: public std::map<cmStdString, cmStdString>
   {
   public:
-    std::string const& at(std::string const& k) const
+    cmStdString const& at(cmStdString const& k) const
       {
       const_iterator i = this->find(k);
       if(i != this->end()) { return i->second; }
-      static std::string emptyString;
+      static cmStdString emptyString;
       return emptyString;
       }
   };
@@ -127,7 +127,7 @@ int main ()
       it = parser.GetTranslationUnits().begin(),
       end = parser.GetTranslationUnits().end(); it != end; ++it)
     {
-    std::vector<std::string> command;
+    std::vector<cmStdString> command;
     cmSystemTools::ParseUnixCommandLine(it->at("command").c_str(), command);
     if (!cmSystemTools::RunSingleCommand(
             command, 0, 0, it->at("directory").c_str()))
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 8dcc77a..8074a01 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -208,9 +208,9 @@ if(BUILD_TESTING)
   endif()
   ADD_TEST_MACRO(Simple Simple)
   ADD_TEST_MACRO(PreOrder PreOrder)
-#   ADD_TEST_MACRO(MissingSourceFile MissingSourceFile)
-#   set_tests_properties(MissingSourceFile PROPERTIES
-#     PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file:[ \r\n]*DoesNotExist/MissingSourceFile.c")
+  ADD_TEST_MACRO(MissingSourceFile MissingSourceFile)
+  set_tests_properties(MissingSourceFile PROPERTIES
+    PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file:[ \r\n]*DoesNotExist/MissingSourceFile.c")
   if(CMAKE_Fortran_COMPILER)
     ADD_TEST_MACRO(FortranOnly FortranOnly)
   endif()
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
index 82a34d5..17b8a5c 100644
--- a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
@@ -1,11 +1,4 @@
 CMake Debug Log:
-  Boolean compatibility of property "BOOL_PROP7" for target
-  "CompatibleInterface" \(result: "FALSE"\):
-
-   \* Target "CompatibleInterface" property is implied by use.
-   \* Target "iface1" property value "FALSE" \(Agree\)
-+
-CMake Debug Log:
   Boolean compatibility of property "BOOL_PROP1" for target
   "CompatibleInterface" \(result: "TRUE"\):
 
@@ -47,6 +40,13 @@ CMake Debug Log:
    \* Target "iface2" property value "FALSE" \(Agree\)
 +
 CMake Debug Log:
+  Boolean compatibility of property "BOOL_PROP7" for target
+  "CompatibleInterface" \(result: "FALSE"\):
+
+   \* Target "CompatibleInterface" property is implied by use.
+   \* Target "iface1" property value "FALSE" \(Agree\)
++
+CMake Debug Log:
   String compatibility of property "STRING_PROP1" for target
   "CompatibleInterface" \(result: "prop1"\):
 
diff --git a/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt b/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt
index b4188b3..411cd7c 100644
--- a/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt
+++ b/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt
@@ -1,7 +1,9 @@
-CMake Error in CMakeLists.txt:
+CMake Error at MissingSource.cmake:1 \(add_library\):
   Cannot find source file:
 
     missing.c
 
   Tried extensions( \.[A-Za-z+]+|
  )*
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/interface_library/global-interface-stderr.txt b/Tests/RunCMake/interface_library/global-interface-stderr.txt
index 80fd594..24edd0f 100644
--- a/Tests/RunCMake/interface_library/global-interface-stderr.txt
+++ b/Tests/RunCMake/interface_library/global-interface-stderr.txt
@@ -1,7 +1,9 @@
-CMake Error in CMakeLists.txt:
+CMake Error at global-interface.cmake:2 \(add_library\):
   Cannot find source file:
 
     GLOBAL
 
   Tried extensions \.c \.C \.c\+\+ \.cc \.cpp \.cxx \.m \.M \.mm \.h \.hh \.h\+\+ \.hm \.hpp
   \.hxx \.in \.txx
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)

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

Summary of changes:
 Modules/FindCUDA.cmake                             |    2 +-
 Source/CPack/cmCPackGenerator.cxx                  |   26 +-
 Source/CPack/cmCPackGenerator.h                    |   24 +-
 Source/CPack/cmCPackGeneratorFactory.cxx           |   13 +-
 Source/CPack/cmCPackGeneratorFactory.h             |   10 +-
 Source/CPack/cmCPackOSXX11Generator.cxx            |    6 +-
 Source/CPack/cmCPackOSXX11Generator.h              |    7 +-
 Source/CPack/cmCPackPackageMakerGenerator.cxx      |    5 +-
 Source/CPack/cmCPackPackageMakerGenerator.h        |    3 +-
 Source/CPack/cpack.cxx                             |    2 +-
 Source/CTest/cmCTestBZR.cxx                        |    4 +-
 Source/CTest/cmCTestBuildAndTestHandler.h          |    2 +-
 Source/CTest/cmCTestBuildHandler.cxx               |   12 +-
 Source/CTest/cmCTestBuildHandler.h                 |   14 +-
 Source/CTest/cmCTestCVS.cxx                        |    6 +-
 Source/CTest/cmCTestCVS.h                          |    4 +-
 Source/CTest/cmCTestCoverageCommand.h              |    2 +-
 Source/CTest/cmCTestCoverageHandler.cxx            |   24 +-
 Source/CTest/cmCTestCoverageHandler.h              |   12 +-
 Source/CTest/cmCTestGIT.cxx                        |    4 +-
 Source/CTest/cmCTestGenericHandler.cxx             |   14 +-
 Source/CTest/cmCTestGenericHandler.h               |    8 +-
 Source/CTest/cmCTestGlobalVC.cxx                   |    2 +-
 Source/CTest/cmCTestGlobalVC.h                     |    4 +-
 Source/CTest/cmCTestHG.cxx                         |    4 +-
 Source/CTest/cmCTestLaunch.cxx                     |    2 +-
 Source/CTest/cmCTestLaunch.h                       |    2 +-
 Source/CTest/cmCTestMemCheckHandler.cxx            |   34 +-
 Source/CTest/cmCTestMemCheckHandler.h              |   10 +-
 Source/CTest/cmCTestMultiProcessHandler.cxx        |    2 +-
 Source/CTest/cmCTestMultiProcessHandler.h          |   10 +-
 Source/CTest/cmCTestP4.cxx                         |    8 +-
 Source/CTest/cmCTestSVN.cxx                        |    8 +-
 Source/CTest/cmCTestScriptHandler.cxx              |    4 +-
 Source/CTest/cmCTestScriptHandler.h                |   28 +-
 Source/CTest/cmCTestSubmitCommand.cxx              |    6 +-
 Source/CTest/cmCTestSubmitHandler.cxx              |   98 +-
 Source/CTest/cmCTestSubmitHandler.h                |   60 +-
 Source/CTest/cmCTestTestHandler.cxx                |   30 +-
 Source/CTest/cmCTestTestHandler.h                  |   18 +-
 Source/CTest/cmCTestUploadCommand.cxx              |    2 +-
 Source/CTest/cmCTestVC.cxx                         |    4 +-
 Source/CTest/cmParseGTMCoverage.cxx                |    2 +-
 Source/CTest/cmParseMumpsCoverage.cxx              |    2 +-
 Source/CTest/cmParseMumpsCoverage.h                |    2 +-
 Source/CTest/cmParsePHPCoverage.cxx                |    4 +-
 Source/CTest/cmParsePHPCoverage.h                  |    2 +-
 Source/CursesDialog/cmCursesPathWidget.cxx         |    2 +-
 Source/cmAuxSourceDirectoryCommand.cxx             |    4 +-
 Source/cmCTest.cxx                                 |   44 +-
 Source/cmCTest.h                                   |   34 +-
 Source/cmCacheManager.cxx                          |   67 +-
 Source/cmCacheManager.h                            |   48 +-
 Source/cmCommand.h                                 |    2 +-
 Source/cmCommandArgumentParserHelper.cxx           |   12 +-
 Source/cmCommandArgumentParserHelper.h             |    6 +-
 Source/cmComputeLinkDepends.cxx                    |   16 +-
 Source/cmComputeLinkDepends.h                      |    7 +-
 Source/cmComputeLinkInformation.cxx                |   15 +-
 Source/cmComputeLinkInformation.h                  |   14 +-
 Source/cmComputeTargetDepends.cxx                  |   26 +-
 Source/cmComputeTargetDepends.h                    |   12 +-
 Source/cmCoreTryCompile.cxx                        |    2 +-
 Source/cmCryptoHash.cxx                            |   10 +-
 Source/cmCryptoHash.h                              |    4 +-
 Source/cmCustomCommand.h                           |    2 +-
 Source/cmCustomCommandGenerator.cxx                |    2 +-
 Source/cmCustomCommandGenerator.h                  |    5 +-
 Source/cmDefinitions.cxx                           |   28 +-
 Source/cmDefinitions.h                             |   28 +-
 Source/cmDependsC.cxx                              |   16 +-
 Source/cmDependsC.h                                |   16 +-
 Source/cmDependsFortran.cxx                        |   40 +-
 Source/cmDependsJavaParserHelper.cxx               |   24 +-
 Source/cmDependsJavaParserHelper.h                 |   20 +-
 Source/cmDocumentation.cxx                         |    4 +-
 Source/cmDocumentation.h                           |    2 +-
 Source/cmDynamicLoader.cxx                         |    8 +-
 Source/cmExportBuildFileGenerator.cxx              |    8 +-
 Source/cmExportBuildFileGenerator.h                |    4 +-
 Source/cmExportCommand.cxx                         |    2 +-
 Source/cmExportFileGenerator.cxx                   |   40 +-
 Source/cmExportFileGenerator.h                     |   26 +-
 Source/cmExportInstallFileGenerator.cxx            |   11 +-
 Source/cmExportInstallFileGenerator.h              |   10 +-
 Source/cmExportLibraryDependenciesCommand.cxx      |   14 +-
 Source/cmExportTryCompileFileGenerator.cxx         |    5 +-
 Source/cmExportTryCompileFileGenerator.h           |    8 +-
 Source/cmExprParserHelper.h                        |    4 +-
 Source/cmExtraCodeBlocksGenerator.cxx              |    8 +-
 Source/cmExtraCodeLiteGenerator.cxx                |    8 +-
 Source/cmExtraEclipseCDT4Generator.cxx             |    2 +-
 Source/cmExtraSublimeTextGenerator.cxx             |    2 +-
 Source/cmFileTimeComparison.cxx                    |    4 +-
 Source/cmFindBase.cxx                              |    6 +-
 Source/cmFindBase.h                                |   10 +-
 Source/cmFindCommon.cxx                            |    2 +-
 Source/cmFindCommon.h                              |    6 +-
 Source/cmFindLibraryCommand.cxx                    |    4 +-
 Source/cmFindPackageCommand.cxx                    |    5 +-
 Source/cmFindPackageCommand.h                      |   14 +-
 Source/cmFindPathCommand.cxx                       |   10 +-
 Source/cmGeneratedFileStream.cxx                   |    7 +-
 Source/cmGeneratedFileStream.h                     |    2 +-
 Source/cmGeneratorExpression.cxx                   |   22 +-
 Source/cmGeneratorExpression.h                     |   12 +-
 Source/cmGeneratorExpressionDAGChecker.cxx         |    6 +-
 Source/cmGeneratorExpressionDAGChecker.h           |    2 +-
 Source/cmGeneratorExpressionEvaluationFile.cxx     |    4 +-
 Source/cmGeneratorExpressionEvaluationFile.h       |    2 +-
 Source/cmGeneratorExpressionEvaluator.cxx          |  198 ++--
 Source/cmGeneratorExpressionEvaluator.h            |    4 +-
 Source/cmGeneratorExpressionLexer.cxx              |    6 +-
 Source/cmGeneratorExpressionLexer.h                |    2 +-
 Source/cmGeneratorTarget.cxx                       |  537 ++++-------
 Source/cmGeneratorTarget.h                         |   77 +-
 Source/cmGetCMakePropertyCommand.cxx               |    4 +-
 Source/cmGlobalGenerator.cxx                       |  138 ++-
 Source/cmGlobalGenerator.h                         |   68 +-
 Source/cmGlobalKdevelopGenerator.cxx               |   10 +-
 Source/cmGlobalNinjaGenerator.cxx                  |    2 +-
 Source/cmGlobalUnixMakefileGenerator3.cxx          |   12 +-
 Source/cmGlobalUnixMakefileGenerator3.h            |    2 +-
 Source/cmGlobalVisualStudio6Generator.cxx          |   10 +-
 Source/cmGlobalVisualStudio6Generator.h            |    4 +-
 Source/cmGlobalVisualStudio71Generator.cxx         |   12 +-
 Source/cmGlobalVisualStudio71Generator.h           |    2 +-
 Source/cmGlobalVisualStudio7Generator.cxx          |   18 +-
 Source/cmGlobalVisualStudio7Generator.h            |    8 +-
 Source/cmGlobalVisualStudio8Generator.cxx          |    8 +-
 Source/cmGlobalVisualStudioGenerator.cxx           |    8 +-
 Source/cmGlobalVisualStudioGenerator.h             |    4 +-
 Source/cmGlobalXCodeGenerator.cxx                  |  127 ++-
 Source/cmGlobalXCodeGenerator.h                    |   18 +-
 Source/cmGraphVizWriter.cxx                        |   24 +-
 Source/cmGraphVizWriter.h                          |   12 +-
 Source/cmIDEOptions.cxx                            |    4 +-
 Source/cmIDEOptions.h                              |    4 +-
 Source/cmIncludeDirectoryCommand.cxx               |    2 +-
 Source/cmInstallCommand.cxx                        |    2 +-
 Source/cmInstallExportGenerator.cxx                |    4 +-
 Source/cmInstallGenerator.cxx                      |    2 +-
 Source/cmInstallGenerator.h                        |    2 +-
 Source/cmInstallTargetGenerator.cxx                |   33 +-
 Source/cmInstallTargetGenerator.h                  |   25 +-
 Source/cmListCommand.cxx                           |   10 +-
 Source/cmListCommand.h                             |    4 +-
 Source/cmLoadCacheCommand.cxx                      |    4 +-
 Source/cmLoadCacheCommand.h                        |    2 +-
 Source/cmLocalGenerator.cxx                        |  157 ++--
 Source/cmLocalGenerator.h                          |   60 +-
 Source/cmLocalNinjaGenerator.h                     |    4 +-
 Source/cmLocalUnixMakefileGenerator3.cxx           |   16 +-
 Source/cmLocalUnixMakefileGenerator3.h             |   18 +-
 Source/cmLocalVisualStudio6Generator.cxx           |   24 +-
 Source/cmLocalVisualStudio7Generator.cxx           |   34 +-
 Source/cmLocalVisualStudio7Generator.h             |    4 +-
 Source/cmLocalVisualStudioGenerator.cxx            |    2 +-
 Source/cmLocalXCodeGenerator.cxx                   |    6 +-
 Source/cmLocalXCodeGenerator.h                     |    3 +-
 Source/cmMakeDepend.cxx                            |    2 +-
 Source/cmMakeDepend.h                              |    8 +-
 Source/cmMakefile.cxx                              |  343 ++++---
 Source/cmMakefile.h                                |  136 ++-
 Source/cmMakefileLibraryTargetGenerator.cxx        |    4 +-
 Source/cmMakefileLibraryTargetGenerator.h          |    3 +-
 Source/cmMakefileTargetGenerator.cxx               |   30 +-
 Source/cmMakefileTargetGenerator.h                 |   22 +-
 Source/cmNinjaNormalTargetGenerator.cxx            |    4 +-
 Source/cmNinjaTargetGenerator.cxx                  |   12 +-
 Source/cmNinjaTargetGenerator.h                    |    8 +-
 Source/cmOSXBundleGenerator.cxx                    |   35 +-
 Source/cmOSXBundleGenerator.h                      |    9 +-
 Source/cmOrderDirectories.cxx                      |   20 +-
 Source/cmOrderDirectories.h                        |   10 +-
 Source/cmProperty.cxx                              |    5 +-
 Source/cmProperty.h                                |    5 +-
 Source/cmPropertyDefinition.cxx                    |    2 +-
 Source/cmPropertyDefinition.h                      |    2 +-
 Source/cmPropertyDefinitionMap.cxx                 |   21 +-
 Source/cmPropertyDefinitionMap.h                   |    8 +-
 Source/cmPropertyMap.cxx                           |   16 +-
 Source/cmPropertyMap.h                             |   10 +-
 Source/cmQtAutoGenerators.cxx                      |   54 +-
 Source/cmQtAutoGenerators.h                        |    8 +-
 Source/cmRST.cxx                                   |    4 +-
 Source/cmRST.h                                     |    4 +-
 Source/cmScriptGenerator.cxx                       |   23 +-
 Source/cmScriptGenerator.h                         |   12 +-
 Source/cmSetPropertyCommand.cxx                    |   14 +-
 Source/cmSetPropertyCommand.h                      |    2 +-
 Source/cmSetTestsPropertiesCommand.cxx             |    2 +-
 Source/cmSetTestsPropertiesCommand.h               |    2 +-
 Source/cmSourceFile.cxx                            |   48 +-
 Source/cmSourceFile.h                              |   15 +-
 Source/cmSourceFileLocation.cxx                    |   29 +-
 Source/cmSourceFileLocation.h                      |   10 +-
 Source/cmSourceGroup.cxx                           |    4 +-
 Source/cmSourceGroup.h                             |    4 +-
 Source/cmStandardIncludes.h                        |   13 +-
 Source/cmSystemTools.cxx                           |   73 +-
 Source/cmSystemTools.h                             |   28 +-
 Source/cmTarget.cxx                                |  963 +++++++++-----------
 Source/cmTarget.h                                  |  243 ++---
 Source/cmTargetLinkLibrariesCommand.cxx            |   12 +-
 Source/cmTargetLinkLibrariesCommand.h              |    2 +-
 Source/cmTargetPropCommandBase.cxx                 |    2 +-
 Source/cmTest.cxx                                  |   24 +-
 Source/cmTest.h                                    |   13 +-
 Source/cmTestGenerator.cxx                         |    2 +-
 Source/cmTestGenerator.h                           |    2 +-
 Source/cmVariableWatch.h                           |    2 +-
 Source/cmVisualStudio10TargetGenerator.cxx         |    8 +-
 Source/cmVisualStudio10TargetGenerator.h           |    4 +-
 Source/cmVisualStudioGeneratorOptions.cxx          |    4 +-
 Source/cmXCodeObject.cxx                           |    8 +-
 Source/cmXCodeObject.h                             |   22 +-
 Source/cmake.cxx                                   |   66 +-
 Source/cmake.h                                     |   46 +-
 Source/cmcldeps.cxx                                |    2 +-
 Source/cmcmd.cxx                                   |   18 +-
 Source/cmcmd.h                                     |    4 +-
 Tests/CMakeLib/run_compile_commands.cxx            |    8 +-
 Tests/CMakeLists.txt                               |    6 +-
 .../CompatibleInterface/DebugProperties-stderr.txt |   14 +-
 .../ObjectLibrary/MissingSource-stderr.txt         |    4 +-
 .../interface_library/global-interface-stderr.txt  |    4 +-
 227 files changed, 2730 insertions(+), 2900 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list