[Cmake-commits] [cmake-commits] hoffman committed cmAddLibraryCommand.cxx 1.36 1.36.2.1 cmAddLibraryCommand.h 1.22 1.22.2.1 cmAddSubDirectoryCommand.h 1.7 1.7.2.1 cmCMakePolicyCommand.cxx 1.2.2.1 1.2.2.2 cmCMakePolicyCommand.h 1.4.2.1 1.4.2.2 cmCacheManager.cxx 1.100 1.100.2.1 cmComputeLinkDepends.cxx 1.12.2.5 1.12.2.6 cmComputeLinkDepends.h 1.5.2.5 1.5.2.6 cmComputeLinkInformation.cxx 1.24.2.9 1.24.2.10 cmComputeTargetDepends.cxx 1.2 1.2.2.1 cmComputeTargetDepends.h 1.2 1.2.2.1 cmDocumentVariables.cxx 1.18.2.2 1.18.2.3 cmDocumentation.cxx 1.69.2.1 1.69.2.2 cmDocumentation.h 1.33 1.33.2.1 cmExtraCodeBlocksGenerator.cxx 1.18 1.18.2.1 cmFileCommand.cxx 1.103.2.5 1.103.2.6 cmFileCommand.h 1.35.2.2 1.35.2.3 cmFindPackageCommand.cxx 1.36.2.2 1.36.2.3 cmFindPackageCommand.h 1.19.2.1 1.19.2.2 cmGlobalGenerator.cxx 1.227.2.6 1.227.2.7 cmGlobalKdevelopGenerator.cxx 1.29.2.1 1.29.2.2 cmGlobalVisualStudio7Generator.cxx 1.99.2.1 1.99.2.2 cmGlobalXCodeGenerator.cxx 1.186.2.6 1.186.2.7 cmIfCommand.cxx 1.84.2.1 1.84.2.2 cmIfCommand.h 1.46.2.1 1.46.2.2 cmLocalGenerator.cxx 1.269.2.6 1.269.2.7 cmLocalGenerator.h 1.103 1.103.2.1 cmMakefile.cxx 1.463.2.7 1.463.2.8 cmMakefile.h 1.230.2.3 1.230.2.4 cmMakefileExecutableTargetGenerator.cxx 1.46.2.1 1.46.2.2 cmMakefileLibraryTargetGenerator.cxx 1.58.2.3 1.58.2.4 cmMakefileLibraryTargetGenerator.h 1.6.2.2 1.6.2.3 cmPolicies.cxx 1.20.2.6 1.20.2.7 cmPolicies.h 1.10.2.4 1.10.2.5 cmReturnCommand.h 1.2 1.2.2.1 cmSetPropertyCommand.cxx 1.6.2.1 1.6.2.2 cmSetTargetPropertiesCommand.cxx 1.9 1.9.2.1 cmStringCommand.cxx 1.27 1.27.2.1 cmSystemTools.cxx 1.368.2.5 1.368.2.6 cmSystemTools.h 1.150.2.2 1.150.2.3 cmTarget.cxx 1.207.2.9 1.207.2.10 cmTarget.h 1.109.2.6 1.109.2.7 cmTargetLinkLibrariesCommand.cxx 1.25 1.25.2.1 cmTargetLinkLibrariesCommand.h 1.15 1.15.2.1 cmXCodeObject.cxx 1.24.2.1 1.24.2.2 cmXCodeObject.h 1.18 1.18.2.1 cmake.cxx 1.375.2.11 1.375.2.12 cmakemain.cxx 1.80.2.2 1.80.2.3

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Sep 3 09:43:20 EDT 2008


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

Modified Files:
      Tag: CMake-2-6
	cmAddLibraryCommand.cxx cmAddLibraryCommand.h 
	cmAddSubDirectoryCommand.h cmCMakePolicyCommand.cxx 
	cmCMakePolicyCommand.h cmCacheManager.cxx 
	cmComputeLinkDepends.cxx cmComputeLinkDepends.h 
	cmComputeLinkInformation.cxx cmComputeTargetDepends.cxx 
	cmComputeTargetDepends.h cmDocumentVariables.cxx 
	cmDocumentation.cxx cmDocumentation.h 
	cmExtraCodeBlocksGenerator.cxx cmFileCommand.cxx 
	cmFileCommand.h cmFindPackageCommand.cxx 
	cmFindPackageCommand.h cmGlobalGenerator.cxx 
	cmGlobalKdevelopGenerator.cxx 
	cmGlobalVisualStudio7Generator.cxx cmGlobalXCodeGenerator.cxx 
	cmIfCommand.cxx cmIfCommand.h cmLocalGenerator.cxx 
	cmLocalGenerator.h cmMakefile.cxx cmMakefile.h 
	cmMakefileExecutableTargetGenerator.cxx 
	cmMakefileLibraryTargetGenerator.cxx 
	cmMakefileLibraryTargetGenerator.h cmPolicies.cxx cmPolicies.h 
	cmReturnCommand.h cmSetPropertyCommand.cxx 
	cmSetTargetPropertiesCommand.cxx cmStringCommand.cxx 
	cmSystemTools.cxx cmSystemTools.h cmTarget.cxx cmTarget.h 
	cmTargetLinkLibrariesCommand.cxx 
	cmTargetLinkLibrariesCommand.h cmXCodeObject.cxx 
	cmXCodeObject.h cmake.cxx cmakemain.cxx 
Log Message:
ENH: 2.6.2 rc 2 merge from main tree


Index: cmComputeLinkDepends.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkDepends.h,v
retrieving revision 1.5.2.5
retrieving revision 1.5.2.6
diff -C 2 -d -r1.5.2.5 -r1.5.2.6
*** cmComputeLinkDepends.h	30 Jul 2008 18:54:49 -0000	1.5.2.5
--- cmComputeLinkDepends.h	3 Sep 2008 13:43:17 -0000	1.5.2.6
***************
*** 47,53 ****
      cmTarget* Target;
      bool IsSharedDep;
!     LinkEntry(): Item(), Target(0), IsSharedDep(false) {}
      LinkEntry(LinkEntry const& r):
!       Item(r.Item), Target(r.Target), IsSharedDep(r.IsSharedDep) {}
    };
  
--- 47,55 ----
      cmTarget* Target;
      bool IsSharedDep;
!     bool IsFlag;
!     LinkEntry(): Item(), Target(0), IsSharedDep(false), IsFlag(false) {}
      LinkEntry(LinkEntry const& r):
!       Item(r.Item), Target(r.Target), IsSharedDep(r.IsSharedDep),
!       IsFlag(r.IsFlag) {}
    };
  
***************
*** 86,89 ****
--- 88,92 ----
                        std::vector<std::string> const& libs);
    std::string CleanItemName(std::string const& item);
+   cmTarget* FindTargetToLink(const char* name);
  
    // One entry for each unique item.
***************
*** 129,141 ****
    void OrderLinkEntires();
    std::vector<char> ComponentVisited;
    std::vector<int> FinalLinkOrder;
!   void DisplayComponents(cmComputeComponentGraph const& ccg);
!   void VisitComponent(cmComputeComponentGraph const& ccg, unsigned int i);
!   void EmitComponent(NodeList const& nl);
    void DisplayFinalEntries();
  
!   // Preservation of original link line.
    std::vector<int> OriginalEntries;
-   void PreserveOriginalEntries();
  
    // Compatibility help.
--- 132,162 ----
    void OrderLinkEntires();
    std::vector<char> ComponentVisited;
+   std::vector<int> ComponentOrder;
+   int ComponentOrderId;
+   struct PendingComponent
+   {
+     // The real component id.  Needed because the map is indexed by
+     // component topological index.
+     int Id;
+ 
+     // The number of times the component needs to be seen.  This is
+     // always 1 for trivial components and is initially 2 for
+     // non-trivial components.
+     int Count;
+ 
+     // The entries yet to be seen to complete the component.
+     std::set<int> Entries;
+   };
+   std::map<int, PendingComponent> PendingComponents;
+   cmComputeComponentGraph* CCG;
    std::vector<int> FinalLinkOrder;
!   void DisplayComponents();
!   void VisitComponent(unsigned int c);
!   void VisitEntry(int index);
!   PendingComponent& MakePendingComponent(unsigned int component);
    void DisplayFinalEntries();
  
!   // Record of the original link line.
    std::vector<int> OriginalEntries;
  
    // Compatibility help.

Index: cmSystemTools.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSystemTools.h,v
retrieving revision 1.150.2.2
retrieving revision 1.150.2.3
diff -C 2 -d -r1.150.2.2 -r1.150.2.3
*** cmSystemTools.h	29 May 2008 13:15:32 -0000	1.150.2.2
--- cmSystemTools.h	3 Sep 2008 13:43:18 -0000	1.150.2.3
***************
*** 397,401 ****
  
    /** Try to remove the RPATH from an ELF binary.  */
!   static bool RemoveRPath(std::string const& file, std::string* emsg = 0);
  
    /** Check whether the RPATH in an ELF binary contains the path
--- 397,402 ----
  
    /** Try to remove the RPATH from an ELF binary.  */
!   static bool RemoveRPath(std::string const& file, std::string* emsg = 0,
!                           bool* removed = 0);
  
    /** Check whether the RPATH in an ELF binary contains the path

Index: cmPolicies.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmPolicies.cxx,v
retrieving revision 1.20.2.6
retrieving revision 1.20.2.7
diff -C 2 -d -r1.20.2.6 -r1.20.2.7
*** cmPolicies.cxx	28 Jul 2008 15:31:35 -0000	1.20.2.6
--- cmPolicies.cxx	3 Sep 2008 13:43:18 -0000	1.20.2.7
***************
*** 348,351 ****
--- 348,352 ----
  }
  
+ //----------------------------------------------------------------------------
  bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf, 
                                      const char *version)
***************
*** 409,412 ****
--- 410,414 ----
  
    // now loop over all the policies and set them as appropriate
+   std::vector<cmPolicies::PolicyID> ancientPolicies;
    std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i 
      = this->Policies.begin();
***************
*** 415,419 ****
      if (i->second->IsPolicyNewerThan(majorVer,minorVer,patchVer))
      {
!       if (!mf->SetPolicy(i->second->ID, cmPolicies::WARN))
        {
          return false;
--- 417,425 ----
      if (i->second->IsPolicyNewerThan(majorVer,minorVer,patchVer))
      {
!       if(i->second->Status == cmPolicies::REQUIRED_ALWAYS)
!       {
!         ancientPolicies.push_back(i->first);
!       }
!       else if (!mf->SetPolicy(i->second->ID, cmPolicies::WARN))
        {
          return false;
***************
*** 428,530 ****
      }
    }
-   return true;
- }
  
! // is this a valid status the listfile can set this policy to?
! bool cmPolicies::IsValidPolicyStatus(cmPolicies::PolicyID id, 
!                                      cmPolicies::PolicyStatus status)
! {
!   // if they are setting a feature to anything other than OLD or WARN and the
!   // feature is not known about then that is an error
!   if (this->Policies.find(id) == this->Policies.end())
!   {
!     if (status == cmPolicies::WARN ||
!         status == cmPolicies::OLD)
      {
!       return true;
!     }
!     cmOStringStream error;
!     error << 
!       "Error: an attempt was made to enable the new behavior for " <<
!       "a new feature that is in a later version of CMake than "
!       "what you are runing, please upgrade to a newer version "
!       "of CMake.";
!     cmSystemTools::Error(error.str().c_str());
!     return false;  
!   }
! 
!   // now we know the feature is defined, so the only issue is if someone is
!   // setting it to WARN or OLD when the feature is REQUIRED_ALWAYS
!   if ((status == cmPolicies::WARN || 
!       status == cmPolicies::OLD) && 
!       this->Policies[id]->Status == cmPolicies::REQUIRED_ALWAYS)
!   {
!     cmOStringStream error;
!     error << 
!       "Error: an attempt was made to enable the old behavior for " <<
!       "a feature that is no longer supported. The feature in " <<
!       "question is feature " <<
!       id <<
!       " which had new behavior introduced in CMake version " <<
!       this->Policies[id]->GetVersionString() <<
!       " please either update your CMakeLists files to conform to " <<
!       "the new behavior " <<
!       "or use an older version of CMake that still supports " <<
!       "the old behavior. Run cmake --help-policies " <<
!       id << " for more information.";
!     cmSystemTools::Error(error.str().c_str());
      return false;
-   }
-   
-   return true;
- }
- 
- // is this a valid status the listfile can set this policy to?
- bool cmPolicies::IsValidUsedPolicyStatus(cmPolicies::PolicyID id, 
-                                          cmPolicies::PolicyStatus status)
- {
-   // if they are setting a feature to anything other than OLD or WARN and the
-   // feature is not known about then that is an error
-   if (this->Policies.find(id) == this->Policies.end())
-   {
-     if (status == cmPolicies::WARN ||
-         status == cmPolicies::OLD)
-     {
-       return true;
      }
-     cmOStringStream error;
-     error << 
-       "Error: an attempt was made to enable the new behavior for " <<
-       "a new feature that is in a later version of CMake than "
-       "what you are runing, please upgrade to a newer version "
-       "of CMake.";
-     cmSystemTools::Error(error.str().c_str());
-     return false;  
-   }
  
-   // now we know the feature is defined, so the only issue is if someone is
-   // setting it to WARN or OLD when the feature is REQUIRED_ALWAYS
-   if ((status == cmPolicies::WARN || 
-       status == cmPolicies::OLD) && 
-       (this->Policies[id]->Status == cmPolicies::REQUIRED_ALWAYS ||
-        this->Policies[id]->Status == cmPolicies::REQUIRED_IF_USED))
-   {
-     cmOStringStream error;
-     error << 
-       "Error: an attempt was made to enable the old behavior for " <<
-       "a feature that is no longer supported. The feature in " <<
-       "question is feature " <<
-       id <<
-       " which had new behavior introduced in CMake version " <<
-       this->Policies[id]->GetVersionString() <<
-       " please either update your CMakeLists files to conform to " <<
-       "the new behavior " <<
-       "or use an older version of CMake that still supports " <<
-       "the old behavior. Run cmake --help-policies " <<
-       id << " for more information.";
-     cmSystemTools::Error(error.str().c_str());
-     return false;
-   }
-   
    return true;
  }
--- 434,447 ----
      }
    }
  
!   // Make sure the project does not use any ancient policies.
!   if(!ancientPolicies.empty())
      {
!     this->DiagnoseAncientPolicies(ancientPolicies,
!                                   majorVer, minorVer, patchVer, mf);
!     cmSystemTools::SetFatalErrorOccured();
      return false;
      }
  
    return true;
  }
***************
*** 672,673 ****
--- 589,635 ----
    }
  }
+ 
+ //----------------------------------------------------------------------------
+ std::string
+ cmPolicies::GetRequiredAlwaysPolicyError(cmPolicies::PolicyID id)
+ {
+   std::string pid = this->GetPolicyIDString(id);
+   cmOStringStream e;
+   e << "Policy " << pid << " may not be set to OLD behavior because this "
+     << "version of CMake no longer supports it.  "
+     << "The policy was introduced in "
+     << "CMake version " << this->Policies[id]->GetVersionString()
+     << ", and use of NEW behavior is now required."
+     << "\n"
+     << "Please either update your CMakeLists.txt files to conform to "
+     << "the new behavior or use an older version of CMake that still "
+     << "supports the old behavior.  "
+     << "Run cmake --help-policy " << pid << " for more information.";
+   return e.str();
+ }
+ 
+ //----------------------------------------------------------------------------
+ void
+ cmPolicies::DiagnoseAncientPolicies(std::vector<PolicyID> const& ancient,
+                                     unsigned int majorVer,
+                                     unsigned int minorVer,
+                                     unsigned int patchVer,
+                                     cmMakefile* mf)
+ {
+   cmOStringStream e;
+   e << "The project requests behavior compatible with CMake version \""
+     << majorVer << "." << minorVer << "." << patchVer
+     << "\", which requires OLD the behavior for some policies:\n";
+   for(std::vector<PolicyID>::const_iterator
+         i = ancient.begin(); i != ancient.end(); ++i)
+     {
+     cmPolicy const* policy = this->Policies[*i];
+     e << "  " << policy->IDString << ": " << policy->ShortDescription << "\n";
+     }
+   e << "However, this version of CMake no longer supports the OLD "
+     << "behavior for these policies.  "
+     << "Please either update your CMakeLists.txt files to conform to "
+     << "the new behavior or use an older version of CMake that still "
+     << "supports the old behavior.";
+   mf->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
+ }

Index: cmIfCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.cxx,v
retrieving revision 1.84.2.1
retrieving revision 1.84.2.2
diff -C 2 -d -r1.84.2.1 -r1.84.2.2
*** cmIfCommand.cxx	24 Mar 2008 22:23:26 -0000	1.84.2.1
--- cmIfCommand.cxx	3 Sep 2008 13:43:17 -0000	1.84.2.2
***************
*** 341,345 ****
          IncrementArguments(newArgs,argP1,argP2);
          reducible = 1;
!         }
        // does a command exist
        if (*arg == "COMMAND" && argP1  != newArgs.end())
--- 341,345 ----
          IncrementArguments(newArgs,argP1,argP2);
          reducible = 1;
!         } 
        // does a command exist
        if (*arg == "COMMAND" && argP1  != newArgs.end())
***************
*** 358,361 ****
--- 358,377 ----
          reducible = 1;
          }
+       // does a target exist
+       if (*arg == "TARGET" && argP1  != newArgs.end())
+         {
+         if(makefile->FindTargetToUse((argP1)->c_str()))
+           {
+           *arg = "1";
+           }
+         else 
+           {
+           *arg = "0";
+           }
+         newArgs.erase(argP1);
+         argP1 = arg;
+         IncrementArguments(newArgs,argP1,argP2);
+         reducible = 1;
+         }
        // does a policy exist
        if (*arg == "POLICY" && argP1 != newArgs.end())

Index: cmIfCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.h,v
retrieving revision 1.46.2.1
retrieving revision 1.46.2.2
diff -C 2 -d -r1.46.2.1 -r1.46.2.2
*** cmIfCommand.h	24 Mar 2008 22:23:26 -0000	1.46.2.1
--- cmIfCommand.h	3 Sep 2008 13:43:17 -0000	1.46.2.2
***************
*** 143,146 ****
--- 143,148 ----
        "True if the given name is an existing policy "
        "(of the form CMP<NNNN>).\n"
+       "  if(TARGET target-name)\n"
+       "True if the given name is an existing target, built or imported.\n"
        "  if(EXISTS file-name)\n"
        "  if(EXISTS directory-name)\n"

Index: cmFindPackageCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFindPackageCommand.h,v
retrieving revision 1.19.2.1
retrieving revision 1.19.2.2
diff -C 2 -d -r1.19.2.1 -r1.19.2.2
*** cmFindPackageCommand.h	13 Jun 2008 12:55:17 -0000	1.19.2.1
--- cmFindPackageCommand.h	3 Sep 2008 13:43:17 -0000	1.19.2.2
***************
*** 125,128 ****
--- 125,129 ----
    bool NoBuilds;
    bool DebugMode;
+   bool UseLib64Paths;
    std::vector<std::string> Names;
    std::vector<std::string> Configs;

Index: cmComputeTargetDepends.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeTargetDepends.h,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C 2 -d -r1.2 -r1.2.2.1
*** cmComputeTargetDepends.h	7 Feb 2008 21:14:05 -0000	1.2
--- cmComputeTargetDepends.h	3 Sep 2008 13:43:17 -0000	1.2.2.1
***************
*** 49,53 ****
    void CollectDepends();
    void CollectTargetDepends(int depender_index);
!   void AddTargetDepend(int depender_index, const char* dependee_name);
    void ComputeFinalDepends(cmComputeComponentGraph const& ccg);
  
--- 49,54 ----
    void CollectDepends();
    void CollectTargetDepends(int depender_index);
!   void AddTargetDepend(int depender_index, const char* dependee_name,
!                        bool linking);
    void ComputeFinalDepends(cmComputeComponentGraph const& ccg);
  

Index: cmSystemTools.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSystemTools.cxx,v
retrieving revision 1.368.2.5
retrieving revision 1.368.2.6
diff -C 2 -d -r1.368.2.5 -r1.368.2.6
*** cmSystemTools.cxx	29 May 2008 13:15:32 -0000	1.368.2.5
--- cmSystemTools.cxx	3 Sep 2008 13:43:18 -0000	1.368.2.6
***************
*** 27,30 ****
--- 27,31 ----
  # include <cmsys/Terminal.h>
  #endif
+ #include <cmsys/stl/algorithm>
  
  #if defined(_WIN32)
***************
*** 1393,1397 ****
    //std::string ext = cmSystemTools::LowerCase(cext);
    std::string ext = cext;
!   if ( ext == "c" || ext == ".c" ) { return cmSystemTools::C_FILE_FORMAT; }
    if ( 
      ext == "C" || ext == ".C" ||
--- 1394,1400 ----
    //std::string ext = cmSystemTools::LowerCase(cext);
    std::string ext = cext;
!   if ( ext == "c" || ext == ".c" || 
!        ext == "m" || ext == ".m" 
!     ) { return cmSystemTools::C_FILE_FORMAT; }
    if ( 
      ext == "C" || ext == ".C" ||
***************
*** 1401,1405 ****
      ext == "cpp" || ext == ".cpp" ||
      ext == "cxx" || ext == ".cxx" ||
-     ext == "m" || ext == ".m" ||
      ext == "mm" || ext == ".mm"
      ) { return cmSystemTools::CXX_FILE_FORMAT; }
--- 1404,1407 ----
***************
*** 2329,2332 ****
--- 2331,2344 ----
  #endif
  
+ #if defined(CMAKE_USE_ELF_PARSER)
+ struct cmSystemToolsRPathInfo
+ {
+   unsigned long Position;
+   unsigned long Size;
+   std::string Name;
+   std::string Value;
+ };
+ #endif
+ 
  //----------------------------------------------------------------------------
  bool cmSystemTools::ChangeRPath(std::string const& file,
***************
*** 2341,2375 ****
      *changed = false;
      }
!   unsigned long rpathPosition = 0;
!   unsigned long rpathSize = 0;
!   std::string rpathPrefix;
!   std::string rpathSuffix;
    {
    // Parse the ELF binary.
    cmELF elf(file.c_str());
  
!   // Get the RPATH or RUNPATH entry from it.
!   cmELF::StringEntry const* se = elf.GetRPath();
!   if(!se)
      {
!     se = elf.GetRunPath();
      }
  
!   if(se)
      {
      // Make sure the current rpath contains the old rpath.
!     std::string::size_type pos = cmSystemToolsFindRPath(se->Value, oldRPath);
      if(pos == std::string::npos)
        {
        // If it contains the new rpath instead then it is okay.
!       if(cmSystemToolsFindRPath(se->Value, newRPath) != std::string::npos)
          {
!         return true;
          }
        if(emsg)
          {
          cmOStringStream e;
!         e << "The current RPATH is:\n"
!           << "  " << se->Value << "\n"
            << "which does not contain:\n"
            << "  " << oldRPath << "\n"
--- 2353,2421 ----
      *changed = false;
      }
!   int rp_count = 0;
!   cmSystemToolsRPathInfo rp[2];
    {
    // Parse the ELF binary.
    cmELF elf(file.c_str());
  
!   // Get the RPATH and RUNPATH entries from it.
!   int se_count = 0;
!   cmELF::StringEntry const* se[2] = {0, 0};
!   const char* se_name[2] = {0, 0};
!   if(cmELF::StringEntry const* se_rpath = elf.GetRPath())
      {
!     se[se_count] = se_rpath;
!     se_name[se_count] = "RPATH";
!     ++se_count;
!     }
!   if(cmELF::StringEntry const* se_runpath = elf.GetRunPath())
!     {
!     se[se_count] = se_runpath;
!     se_name[se_count] = "RUNPATH";
!     ++se_count;
!     }
!   if(se_count == 0)
!     {
!     if(newRPath.empty())
!       {
!       // The new rpath is empty and there is no rpath anyway so it is
!       // okay.
!       return true;
!       }
!     else
!       {
!       if(emsg)
!         {
!         *emsg = "No valid ELF RPATH or RUNPATH entry exists in the file; ";
!         *emsg += elf.GetErrorMessage();
!         }
!       return false;
!       }
      }
  
!   for(int i=0; i < se_count; ++i)
      {
+     // If both RPATH and RUNPATH refer to the same string literal it
+     // needs to be changed only once.
+     if(rp_count && rp[0].Position == se[i]->Position)
+       {
+       continue;
+       }
+ 
      // Make sure the current rpath contains the old rpath.
!     std::string::size_type pos =
!       cmSystemToolsFindRPath(se[i]->Value, oldRPath);
      if(pos == std::string::npos)
        {
        // If it contains the new rpath instead then it is okay.
!       if(cmSystemToolsFindRPath(se[i]->Value, newRPath) != std::string::npos)
          {
!         continue;
          }
        if(emsg)
          {
          cmOStringStream e;
!         e << "The current " << se_name[i] << " is:\n"
!           << "  " << se[i]->Value << "\n"
            << "which does not contain:\n"
            << "  " << oldRPath << "\n"
***************
*** 2380,2424 ****
        }
  
!     // Store information about the entry.
!     rpathPosition = se->Position;
!     rpathSize = se->Size;
  
!     // Store the part of the path we must preserve.
!     rpathPrefix = se->Value.substr(0, pos);
!     rpathSuffix = se->Value.substr(pos+oldRPath.length(), oldRPath.npos);
!     }
!   else if(newRPath.empty())
!     {
!     // The new rpath is empty and there is no rpath anyway so it is
!     // okay.
!     return true;
!     }
!   else
!     {
!     if(emsg)
        {
!       *emsg = "No valid ELF RPATH entry exists in the file; ";
!       *emsg += elf.GetErrorMessage();
        }
!     return false;
      }
    }
-   // Compute the full new rpath.
-   std::string rpath = rpathPrefix;
-   rpath += newRPath;
-   rpath += rpathSuffix;
  
!   // Make sure there is enough room to store the new rpath and at
!   // least one null terminator.
!   if(rpathSize < rpath.length()+1)
      {
!     if(emsg)
!       {
!       *emsg = "The replacement RPATH is too long.";
!       }
!     return false;
      }
  
!   // Open the file for update and seek to the RPATH position.
    std::ofstream f(file.c_str(),
                    std::ios::in | std::ios::out | std::ios::binary);
--- 2426,2467 ----
        }
  
!     // Store information about the entry in the file.
!     rp[rp_count].Position = se[i]->Position;
!     rp[rp_count].Size = se[i]->Size;
!     rp[rp_count].Name = se_name[i];
  
!     // Construct the new value which preserves the part of the path
!     // not being changed.
!     rp[rp_count].Value = se[i]->Value.substr(0, pos);
!     rp[rp_count].Value += newRPath;
!     rp[rp_count].Value += se[i]->Value.substr(pos+oldRPath.length(),
!                                               oldRPath.npos);
! 
!     // Make sure there is enough room to store the new rpath and at
!     // least one null terminator.
!     if(rp[rp_count].Size < rp[rp_count].Value.length()+1)
        {
!       if(emsg)
!         {
!         *emsg = "The replacement path is too long for the ";
!         *emsg += se_name[i];
!         *emsg += " entry.";
!         }
!       return false;
        }
! 
!     // This entry is ready for update.
!     ++rp_count;
      }
    }
  
!   // If no runtime path needs to be changed, we are done.
!   if(rp_count == 0)
      {
!     return true;
      }
  
!   {
!   // Open the file for update.
    std::ofstream f(file.c_str(),
                    std::ios::in | std::ios::out | std::ios::binary);
***************
*** 2431,2468 ****
      return false;
      }
!   if(!f.seekp(rpathPosition))
      {
!     if(emsg)
        {
!       *emsg = "Error seeking to RPATH position.";
        }
-     return false;
-     }
  
!   // Write the new rpath.  Follow it with enough null terminators to
!   // fill the string table entry.
!   f << rpath;
!   for(unsigned long i=rpath.length(); i < rpathSize; ++i)
!     {
!     f << '\0';
!     }
  
!   // Make sure everything was okay.
!   if(f)
!     {
!     if(changed)
        {
!       *changed = true;
        }
-     return true;
      }
!   else
      {
!     if(emsg)
!       {
!       *emsg = "Error writing the new rpath to the file.";
!       }
!     return false;
      }
  #else
    (void)file;
--- 2474,2521 ----
      return false;
      }
! 
!   // Store the new RPATH and RUNPATH strings.
!   for(int i=0; i < rp_count; ++i)
      {
!     // Seek to the RPATH position.
!     if(!f.seekp(rp[i].Position))
        {
!       if(emsg)
!         {
!         *emsg = "Error seeking to ";
!         *emsg += rp[i].Name;
!         *emsg += " position.";
!         }
!       return false;
        }
  
!     // Write the new rpath.  Follow it with enough null terminators to
!     // fill the string table entry.
!     f << rp[i].Value;
!     for(unsigned long j=rp[i].Value.length(); j < rp[i].Size; ++j)
!       {
!       f << '\0';
!       }
  
!     // Make sure it wrote correctly.
!     if(!f)
        {
!       if(emsg)
!         {
!         *emsg = "Error writing the new ";
!         *emsg += rp[i].Name;
!         *emsg += " string to the file.";
!         }
!       return false;
        }
      }
!   }
! 
!   // Everything was updated successfully.
!   if(changed)
      {
!     *changed = true;
      }
+   return true;
  #else
    (void)file;
***************
*** 2476,2485 ****
  
  //----------------------------------------------------------------------------
! bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg)
  {
  #if defined(CMAKE_USE_ELF_PARSER)
!   unsigned long rpathPosition = 0;
!   unsigned long rpathSize = 0;
!   unsigned long rpathEntryPosition = 0;
    std::vector<char> bytes;
    {
--- 2529,2544 ----
  
  //----------------------------------------------------------------------------
! bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg,
!                                 bool* removed)
  {
  #if defined(CMAKE_USE_ELF_PARSER)
!   if(removed)
!     {
!     *removed = false;
!     }
!   int zeroCount = 0;
!   unsigned long zeroPosition[2] = {0,0};
!   unsigned long zeroSize[2] = {0,0};
!   unsigned long bytesBegin = 0;
    std::vector<char> bytes;
    {
***************
*** 2487,2530 ****
    cmELF elf(file.c_str());
  
!   // Get the RPATH or RUNPATH entry from it.
!   cmELF::StringEntry const* se = elf.GetRPath();
!   if(!se)
      {
!     se = elf.GetRunPath();
      }
! 
!   if(se)
      {
!     // Store information about the entry.
!     rpathPosition = se->Position;
!     rpathSize = se->Size;
!     rpathEntryPosition = elf.GetDynamicEntryPosition(se->IndexInSection);
  
!     // Get the file range containing the rest of the DYNAMIC table
!     // after the RPATH entry.
!     unsigned long nextEntryPosition =
!       elf.GetDynamicEntryPosition(se->IndexInSection+1);
!     unsigned int count = elf.GetDynamicEntryCount();
!     if(count == 0)
        {
!       // This should happen only for invalid ELF files where a DT_NULL
!       // appears before the end of the table.
!       if(emsg)
!         {
!         *emsg = "DYNAMIC section contains a DT_NULL before the end.";
!         }
!       return false;
        }
!     unsigned long nullEntryPosition = elf.GetDynamicEntryPosition(count);
  
!     // Allocate and fill a buffer with zeros.
!     bytes.resize(nullEntryPosition - rpathEntryPosition, 0);
  
!     // Read the part of the DYNAMIC section header that will move.
!     // The remainder of the buffer will be left with zeros which
!     // represent a DT_NULL entry.
!     if(!elf.ReadBytes(nextEntryPosition,
!                       nullEntryPosition - nextEntryPosition,
!                       &bytes[0]))
        {
        if(emsg)
--- 2546,2621 ----
    cmELF elf(file.c_str());
  
!   // Get the RPATH and RUNPATH entries from it and sort them by index
!   // in the dynamic section header.
!   int se_count = 0;
!   cmELF::StringEntry const* se[2] = {0, 0};
!   if(cmELF::StringEntry const* se_rpath = elf.GetRPath())
      {
!     se[se_count++] = se_rpath;
      }
!   if(cmELF::StringEntry const* se_runpath = elf.GetRunPath())
      {
!     se[se_count++] = se_runpath;
!     }
!   if(se_count == 0)
!     {
!     // There is no RPATH or RUNPATH anyway.
!     return true;
!     }
!   if(se_count == 2 && se[1]->IndexInSection < se[0]->IndexInSection)
!     {
!     cmsys_stl::swap(se[0], se[1]);
!     }
  
!   // Get the size of the dynamic section header.
!   unsigned int count = elf.GetDynamicEntryCount();
!   if(count == 0)
!     {
!     // This should happen only for invalid ELF files where a DT_NULL
!     // appears before the end of the table.
!     if(emsg)
        {
!       *emsg = "DYNAMIC section contains a DT_NULL before the end.";
        }
!     return false;
!     }
  
!   // Save information about the string entries to be zeroed.
!   zeroCount = se_count;
!   for(int i=0; i < se_count; ++i)
!     {
!     zeroPosition[i] = se[i]->Position;
!     zeroSize[i] = se[i]->Size;
!     }
  
!   // Get the range of file positions corresponding to each entry and
!   // the rest of the table after them.
!   unsigned long entryBegin[3] = {0,0,0};
!   unsigned long entryEnd[2] = {0,0};
!   for(int i=0; i < se_count; ++i)
!     {
!     entryBegin[i] = elf.GetDynamicEntryPosition(se[i]->IndexInSection);
!     entryEnd[i] = elf.GetDynamicEntryPosition(se[i]->IndexInSection+1);
!     }
!   entryBegin[se_count] = elf.GetDynamicEntryPosition(count);
! 
!   // The data are to be written over the old table entries starting at
!   // the first one being removed.
!   bytesBegin = entryBegin[0];
!   unsigned long bytesEnd = entryBegin[se_count];
! 
!   // Allocate a buffer to hold the part of the file to be written.
!   // Initialize it with zeros.
!   bytes.resize(bytesEnd - bytesBegin, 0);
! 
!   // Read the part of the DYNAMIC section header that will move.
!   // The remainder of the buffer will be left with zeros which
!   // represent a DT_NULL entry.
!   char* data = &bytes[0];
!   for(int i=0; i < se_count; ++i)
!     {
!     // Read data between the entries being removed.
!     unsigned long sz = entryBegin[i+1] - entryEnd[i];
!     if(sz > 0 && !elf.ReadBytes(entryEnd[i], sz, data))
        {
        if(emsg)
***************
*** 2534,2542 ****
        return false;
        }
!     }
!   else
!     {
!     // There is no RPATH or RUNPATH anyway.
!     return true;
      }
    }
--- 2625,2629 ----
        return false;
        }
!     data += sz;
      }
    }
***************
*** 2555,2559 ****
  
    // Write the new DYNAMIC table header.
!   if(!f.seekp(rpathEntryPosition))
      {
      if(emsg)
--- 2642,2646 ----
  
    // Write the new DYNAMIC table header.
!   if(!f.seekp(bytesBegin))
      {
      if(emsg)
***************
*** 2572,2605 ****
      }
  
!   // Fill the RPATH string with zero bytes.
!   if(!f.seekp(rpathPosition))
      {
!     if(emsg)
        {
!       *emsg = "Error seeking to RPATH position.";
        }
-     return false;
-     }
-   for(unsigned long i=0; i < rpathSize; ++i)
-     {
-     f << '\0';
      }
  
!   // Make sure everything was okay.
!   if(f)
!     {
!     return true;
!     }
!   else
      {
!     if(emsg)
!       {
!       *emsg = "Error writing the empty rpath to the file.";
!       }
!     return false;
      }
  #else
    (void)file;
    (void)emsg;
    return false;
  #endif
--- 2659,2697 ----
      }
  
!   // Fill the RPATH and RUNPATH strings with zero bytes.
!   for(int i=0; i < zeroCount; ++i)
      {
!     if(!f.seekp(zeroPosition[i]))
        {
!       if(emsg)
!         {
!         *emsg = "Error seeking to RPATH position.";
!         }
!       return false;
!       }
!     for(unsigned long j=0; j < zeroSize[i]; ++j)
!       {
!       f << '\0';
!       }
!     if(!f)
!       {
!       if(emsg)
!         {
!         *emsg = "Error writing the empty rpath string to the file.";
!         }
!       return false;
        }
      }
  
!   // Everything was updated successfully.
!   if(removed)
      {
!     *removed = true;
      }
+   return true;
  #else
    (void)file;
    (void)emsg;
+   (void)removed;
    return false;
  #endif

Index: cmakemain.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmakemain.cxx,v
retrieving revision 1.80.2.2
retrieving revision 1.80.2.3
diff -C 2 -d -r1.80.2.2 -r1.80.2.3
*** cmakemain.cxx	6 Aug 2008 21:04:20 -0000	1.80.2.2
--- cmakemain.cxx	3 Sep 2008 13:43:18 -0000	1.80.2.3
***************
*** 304,310 ****
  int do_cmake(int ac, char** av)
  {
- #ifdef CMAKE_BUILD_WITH_CMAKE
-   cmDocumentation doc;
- #endif
    int nocwd = 0;
  
--- 304,307 ----
***************
*** 317,321 ****
  
  #ifdef CMAKE_BUILD_WITH_CMAKE
!   if(doc.CheckOptions(ac, av) || nocwd)
      { 
      // Construct and print requested documentation.
--- 314,319 ----
  
  #ifdef CMAKE_BUILD_WITH_CMAKE
!   cmDocumentation doc;
!   if(doc.CheckOptions(ac, av, "-E") || nocwd)
      { 
      // Construct and print requested documentation.
***************
*** 419,445 ****
        command = true;
        }
!     else if (strcmp(av[i], "-N") == 0)
        {
        view_only = true;
        }
!     else if (strcmp(av[i], "-L") == 0)
        {
        list_cached = true;
        }
!     else if (strcmp(av[i], "-LA") == 0)
        {
        list_all_cached = true;
        }
!     else if (strcmp(av[i], "-LH") == 0)
        {
        list_cached = true;
        list_help = true;
        }
!     else if (strcmp(av[i], "-LAH") == 0)
        {
        list_all_cached = true;
        list_help = true;
        }
!     else if (strncmp(av[i], "-P", strlen("-P")) == 0)
        {
        if ( i == ac -1 )
--- 417,443 ----
        command = true;
        }
!     else if (!command && strcmp(av[i], "-N") == 0)
        {
        view_only = true;
        }
!     else if (!command && strcmp(av[i], "-L") == 0)
        {
        list_cached = true;
        }
!     else if (!command && strcmp(av[i], "-LA") == 0)
        {
        list_all_cached = true;
        }
!     else if (!command && strcmp(av[i], "-LH") == 0)
        {
        list_cached = true;
        list_help = true;
        }
!     else if (!command && strcmp(av[i], "-LAH") == 0)
        {
        list_all_cached = true;
        list_help = true;
        }
!     else if (!command && strncmp(av[i], "-P", strlen("-P")) == 0)
        {
        if ( i == ac -1 )
***************
*** 460,464 ****
        }
      }
- 
    if(command)
      {
--- 458,461 ----

Index: cmMakefileLibraryTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.cxx,v
retrieving revision 1.58.2.3
retrieving revision 1.58.2.4
diff -C 2 -d -r1.58.2.3 -r1.58.2.4
*** cmMakefileLibraryTargetGenerator.cxx	6 Aug 2008 21:04:19 -0000	1.58.2.3
--- cmMakefileLibraryTargetGenerator.cxx	3 Sep 2008 13:43:18 -0000	1.58.2.4
***************
*** 236,241 ****
  
  //----------------------------------------------------------------------------
! void cmMakefileLibraryTargetGenerator::CreateFramework()
  {
    // TODO: Use the cmMakefileTargetGenerator::ExtraFiles vector to
    // drive rules to create these files at build time.
--- 236,250 ----
  
  //----------------------------------------------------------------------------
! void
! cmMakefileLibraryTargetGenerator
! ::CreateFramework(std::string const& targetName)
  {
+   // Configure the Info.plist file into the Resources directory.
+   this->MacContentFolders.insert("Resources");
+   std::string plist = this->MacContentDirectory + "Resources/Info.plist";
+   this->LocalGenerator->GenerateFrameworkInfoPList(this->Target,
+                                                    targetName.c_str(),
+                                                    plist.c_str());
+ 
    // TODO: Use the cmMakefileTargetGenerator::ExtraFiles vector to
    // drive rules to create these files at build time.
***************
*** 389,393 ****
      {
      outpath = this->MacContentDirectory;
!     this->CreateFramework();
      }
    else if(relink)
--- 398,402 ----
      {
      outpath = this->MacContentDirectory;
!     this->CreateFramework(targetName);
      }
    else if(relink)

Index: cmTarget.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.h,v
retrieving revision 1.109.2.6
retrieving revision 1.109.2.7
diff -C 2 -d -r1.109.2.6 -r1.109.2.7
*** cmTarget.h	6 Aug 2008 21:04:20 -0000	1.109.2.6
--- cmTarget.h	3 Sep 2008 13:43:18 -0000	1.109.2.7
***************
*** 81,85 ****
    enum TargetType { EXECUTABLE, STATIC_LIBRARY,
                      SHARED_LIBRARY, MODULE_LIBRARY, UTILITY, GLOBAL_TARGET,
!                     INSTALL_FILES, INSTALL_PROGRAMS, INSTALL_DIRECTORY};
    static const char* TargetTypeNames[];
    enum CustomCommandType { PRE_BUILD, PRE_LINK, POST_BUILD };
--- 81,86 ----
    enum TargetType { EXECUTABLE, STATIC_LIBRARY,
                      SHARED_LIBRARY, MODULE_LIBRARY, UTILITY, GLOBAL_TARGET,
!                     INSTALL_FILES, INSTALL_PROGRAMS, INSTALL_DIRECTORY,
!                     UNKNOWN_LIBRARY};
    static const char* TargetTypeNames[];
    enum CustomCommandType { PRE_BUILD, PRE_LINK, POST_BUILD };
***************
*** 245,248 ****
--- 246,250 ----
    const char *GetProperty(const char *prop, cmProperty::ScopeType scope);
    bool GetPropertyAsBool(const char *prop);
+   void CheckProperty(const char* prop, cmMakefile* context);
  
    bool IsImported() const {return this->IsImportedTarget;}
***************
*** 394,397 ****
--- 396,402 ----
    bool IsExecutableWithExports();
  
+   /** Return whether this target may be used to link another target.  */
+   bool IsLinkable();
+ 
    /** Return whether this target is a shared library Framework on
        Apple.  */

Index: cmTargetLinkLibrariesCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTargetLinkLibrariesCommand.cxx,v
retrieving revision 1.25
retrieving revision 1.25.2.1
diff -C 2 -d -r1.25 -r1.25.2.1
*** cmTargetLinkLibrariesCommand.cxx	23 Jan 2008 15:27:59 -0000	1.25
--- cmTargetLinkLibrariesCommand.cxx	3 Sep 2008 13:43:18 -0000	1.25.2.1
***************
*** 17,20 ****
--- 17,27 ----
  #include "cmTargetLinkLibrariesCommand.h"
  
+ const char* cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[3] =
+ {
+   "general",
+   "debug",
+   "optimized"
+ };
+ 
  // cmTargetLinkLibrariesCommand
  bool cmTargetLinkLibrariesCommand
***************
*** 33,81 ****
      return true;
      }
    // add libraries, nothe that there is an optional prefix 
    // of debug and optimized than can be used
!   std::vector<std::string>::const_iterator i = args.begin();
!   
!   for(++i; i != args.end(); ++i)
      {
!     if (*i == "debug")
        {
!       ++i;
!       if(i == args.end())
          {
!         this->SetError
!           ("The \"debug\" argument must be followed by a library");
!         return false;
          }
-       this->Makefile->AddLinkLibraryForTarget(args[0].c_str(),i->c_str(),
-                                           cmTarget::DEBUG);
        }
!     else if (*i == "optimized")
        {
!       ++i;
!       if(i == args.end())
          {
!         this->SetError(
!           "The \"optimized\" argument must be followed by a library");
!         return false;
          }
!       this->Makefile->AddLinkLibraryForTarget(args[0].c_str(),i->c_str(),
!                                  cmTarget::OPTIMIZED);
        }
!     else if (*i == "general")
        {
!       ++i;
!       if(i == args.end())
          {
!         this->SetError(
!           "The \"general\" argument must be followed by a library");
!         return false;
          }
!       this->Makefile->AddLinkLibraryForTarget(args[0].c_str(),i->c_str(),
!                                  cmTarget::GENERAL);
        }
      else
        {
!       // make sure the type is correct if it is currently general.  So if you
        // do a target_link_libraries(foo optimized bar) it will stay optimized
        // and not use the lookup.  As there maybe the case where someone has
--- 40,119 ----
      return true;
      }
+ 
+   // Lookup the target for which libraries are specified.
+   this->Target =
+     this->Makefile->GetCMakeInstance()
+     ->GetGlobalGenerator()->FindTarget(0, args[0].c_str());
+   if(!this->Target)
+     {
+     cmOStringStream e;
+     e << "Cannot specify link libraries for target \"" << args[0] << "\" "
+       << "which is not built by this project.";
+     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+     cmSystemTools::SetFatalErrorOccured();
+     return true;
+     }
+ 
+   // Keep track of link configuration specifiers.
+   cmTarget::LinkLibraryType llt = cmTarget::GENERAL;
+   bool haveLLT = false;
+ 
+   // Start with primary linking and switch to link interface
+   // specification when the keyword is encountered.
+   this->DoingInterface = false;
+ 
    // add libraries, nothe that there is an optional prefix 
    // of debug and optimized than can be used
!   for(unsigned int i=1; i < args.size(); ++i)
      {
!     if(args[i] == "LINK_INTERFACE_LIBRARIES")
        {
!       this->DoingInterface = true;
!       if(i != 1)
          {
!         this->Makefile->IssueMessage(
!           cmake::FATAL_ERROR,
!           "The LINK_INTERFACE_LIBRARIES option must appear as the second "
!           "argument, just after the target name."
!           );
!         return true;
          }
        }
!     else if(args[i] == "debug")
        {
!       if(haveLLT)
          {
!         this->LinkLibraryTypeSpecifierWarning(llt, cmTarget::DEBUG);
          }
!       llt = cmTarget::DEBUG;
!       haveLLT = true;
        }
!     else if(args[i] == "optimized")
        {
!       if(haveLLT)
          {
!         this->LinkLibraryTypeSpecifierWarning(llt, cmTarget::OPTIMIZED);
          }
!       llt = cmTarget::OPTIMIZED;
!       haveLLT = true;
!       }
!     else if(args[i] == "general")
!       {
!       if(haveLLT)
!         {
!         this->LinkLibraryTypeSpecifierWarning(llt, cmTarget::GENERAL);
!         }
!       llt = cmTarget::GENERAL;
!       haveLLT = true;
!       }
!     else if(haveLLT)
!       {
!       // The link type was specified by the previous argument.
!       haveLLT = false;
!       this->HandleLibrary(args[i].c_str(), llt);
        }
      else
        {
!       // Lookup old-style cache entry if type is unspecified.  So if you
        // do a target_link_libraries(foo optimized bar) it will stay optimized
        // and not use the lookup.  As there maybe the case where someone has
***************
*** 83,87 ****
        // only there for backwards compatibility when mixing projects built
        // with old versions of CMake and new)
!       cmTarget::LinkLibraryType llt = cmTarget::GENERAL;
        std::string linkType = args[0];
        linkType += "_LINK_TYPE";
--- 121,125 ----
        // only there for backwards compatibility when mixing projects built
        // with old versions of CMake and new)
!       llt = cmTarget::GENERAL;
        std::string linkType = args[0];
        linkType += "_LINK_TYPE";
***************
*** 99,105 ****
            }
          }
!       this->Makefile->AddLinkLibraryForTarget(args[0].c_str(),i->c_str(),llt);
        }
      } 
    return true;
  }
--- 137,215 ----
            }
          }
!       this->HandleLibrary(args[i].c_str(), llt);
        }
      } 
+ 
+   // Make sure the last argument was not a library type specifier.
+   if(haveLLT)
+     {
+     cmOStringStream e;
+     e << "The \"" << this->LinkLibraryTypeNames[llt]
+       << "\" argument must be followed by a library.";
+     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+     cmSystemTools::SetFatalErrorOccured();
+     }
+ 
+   // If the INTERFACE option was given, make sure the
+   // LINK_INTERFACE_LIBRARIES property exists.  This allows the
+   // command to be used to specify an empty link interface.
+   if(this->DoingInterface &&
+      !this->Target->GetProperty("LINK_INTERFACE_LIBRARIES"))
+     {
+     this->Target->SetProperty("LINK_INTERFACE_LIBRARIES", "");
+     }
+ 
    return true;
  }
+ 
+ //----------------------------------------------------------------------------
+ void
+ cmTargetLinkLibrariesCommand
+ ::LinkLibraryTypeSpecifierWarning(int left, int right)
+ {
+   cmOStringStream w;
+   w << "Link library type specifier \""
+     << this->LinkLibraryTypeNames[left] << "\" is followed by specifier \""
+     << this->LinkLibraryTypeNames[right] << "\" instead of a library name.  "
+     << "The first specifier will be ignored.";
+   this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ }
+ 
+ //----------------------------------------------------------------------------
+ void
+ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
+                                             cmTarget::LinkLibraryType llt)
+ {
+   // Handle normal case first.
+   if(!this->DoingInterface)
+     {
+     this->Makefile
+       ->AddLinkLibraryForTarget(this->Target->GetName(), lib, llt);
+     return;
+     }
+ 
+   // Include this library in the link interface for the target.
+   if(llt == cmTarget::DEBUG)
+     {
+     // Put in only the DEBUG configuration interface.
+     this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES_DEBUG", lib);
+     }
+   else if(llt == cmTarget::OPTIMIZED)
+     {
+     // Put in only the non-DEBUG configuration interface.
+     this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib);
+ 
+     // Make sure the DEBUG configuration interface exists so that this
+     // one will not be used as a fall-back.
+     if(!this->Target->GetProperty("LINK_INTERFACE_LIBRARIES_DEBUG"))
+       {
+       this->Target->SetProperty("LINK_INTERFACE_LIBRARIES_DEBUG", "");
+       }
+     }
+   else
+     {
+     // Put in both the DEBUG and non-DEBUG configuration interfaces.
+     this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib);
+     this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES_DEBUG", lib);
+     }
+ }

Index: cmAddSubDirectoryCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddSubDirectoryCommand.h,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -C 2 -d -r1.7 -r1.7.2.1
*** cmAddSubDirectoryCommand.h	23 Jan 2008 15:27:59 -0000	1.7
--- cmAddSubDirectoryCommand.h	3 Sep 2008 13:43:16 -0000	1.7.2.1
***************
*** 80,90 ****
        "input file continues beyond this command.\n"
  
!       "If the EXCLUDE_FROM_ALL argument is provided then this subdirectory "
!       "will not be included in build by default. Users will have to "
!       "explicitly start a build in the generated output directory. "
!       "This is useful for having cmake create a build system for a "
!       "set of examples in a project. One would want cmake to generate "
!       "a single build system for all the examples, but one may not want "
!       "the targets to show up in the main build system.";
      }
    
--- 80,98 ----
        "input file continues beyond this command.\n"
  
!       "If the EXCLUDE_FROM_ALL argument is provided then targets in the "
!       "subdirectory will not be included in the ALL target of the parent "
!       "directory by default, and will be excluded from IDE project files.  "
!       "Users must explicitly build targets in the subdirectory.  "
!       "This is meant for use when the subdirectory contains a separate part "
!       "of the project that is useful but not necessary, such as a set of "
!       "examples.  "
!       "Typically the subdirectory should contain its own project() command "
!       "invocation so that a full build system will be generated in the "
!       "subdirectory (such as a VS IDE solution file).  "
!       "Note that inter-target dependencies supercede this exclusion.  "
!       "If a target built by the parent project depends on a target in the "
!       "subdirectory, the dependee target will be included in the parent "
!       "project build system to satisfy the dependency."
!       ;
      }
    

Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.207.2.9
retrieving revision 1.207.2.10
diff -C 2 -d -r1.207.2.9 -r1.207.2.10
*** cmTarget.cxx	6 Aug 2008 21:04:19 -0000	1.207.2.9
--- cmTarget.cxx	3 Sep 2008 13:43:18 -0000	1.207.2.10
***************
*** 23,26 ****
--- 23,27 ----
  #include "cmComputeLinkInformation.h"
  #include "cmListFileCache.h"
+ #include <cmsys/RegularExpression.hxx>
  #include <map>
  #include <set>
***************
*** 31,35 ****
    "EXECUTABLE", "STATIC_LIBRARY",
    "SHARED_LIBRARY", "MODULE_LIBRARY", "UTILITY", "GLOBAL_TARGET",
!   "INSTALL_FILES", "INSTALL_PROGRAMS", "INSTALL_DIRECTORY"
  };
  
--- 32,37 ----
    "EXECUTABLE", "STATIC_LIBRARY",
    "SHARED_LIBRARY", "MODULE_LIBRARY", "UTILITY", "GLOBAL_TARGET",
!   "INSTALL_FILES", "INSTALL_PROGRAMS", "INSTALL_DIRECTORY",
!   "UNKNOWN_LIBRARY"
  };
  
***************
*** 246,250 ****
       "configuration of an imported target.  "
       "Configuration names correspond to those provided by the project "
!      "from which the target is imported.");
  
    cm->DefineProperty
--- 248,254 ----
       "configuration of an imported target.  "
       "Configuration names correspond to those provided by the project "
!      "from which the target is imported.  "
!      "If set, this property completely overrides the generic property "
!      "for the named configuration.");
  
    cm->DefineProperty
***************
*** 254,258 ****
       "target is linked to another target.  "
       "The libraries will be included on the link line for the target.  "
!      "Ignored for non-imported targets.");
  
    cm->DefineProperty
--- 258,264 ----
       "target is linked to another target.  "
       "The libraries will be included on the link line for the target.  "
!      "Unlike the LINK_INTERFACE_LIBRARIES property, this property applies "
!      "to all imported target types, including STATIC libraries.  "
!      "This property is ignored for non-imported targets.");
  
    cm->DefineProperty
***************
*** 262,266 ****
       "configuration of an imported target.  "
       "Configuration names correspond to those provided by the project "
!      "from which the target is imported.");
  
    cm->DefineProperty
--- 268,274 ----
       "configuration of an imported target.  "
       "Configuration names correspond to those provided by the project "
!      "from which the target is imported.  "
!      "If set, this property completely overrides the generic property "
!      "for the named configuration.");
  
    cm->DefineProperty
***************
*** 278,281 ****
--- 286,290 ----
       "symlink just inside the framework folder.  "
       "For DLLs this is the location of the \".dll\" part of the library.  "
+      "For UNKNOWN libraries this is the location of the file to be linked.  "
       "Ignored for non-imported targets.");
  
***************
*** 399,403 ****
       "If the list is empty then no transitive link dependencies will be "
       "incorporated when this target is linked into another target even if "
!      "the default set is non-empty.");
  
    cm->DefineProperty
--- 408,413 ----
       "If the list is empty then no transitive link dependencies will be "
       "incorporated when this target is linked into another target even if "
!      "the default set is non-empty.  "
!      "This property is ignored for STATIC libraries.");
  
    cm->DefineProperty
***************
*** 405,409 ****
       "Per-configuration list of public interface libraries for a target.",
       "This is the configuration-specific version of "
!      "LINK_INTERFACE_LIBRARIES.");
  
    cm->DefineProperty
--- 415,421 ----
       "Per-configuration list of public interface libraries for a target.",
       "This is the configuration-specific version of "
!      "LINK_INTERFACE_LIBRARIES.  "
!      "If set, this property completely overrides the generic property "
!      "for the named configuration.");
  
    cm->DefineProperty
***************
*** 578,581 ****
--- 590,613 ----
  
    cm->DefineProperty
+     ("MACOSX_FRAMEWORK_INFO_PLIST", cmProperty::TARGET,
+      "Specify a custom Info.plist template for a Mac OS X Framework.",
+      "An library target with FRAMEWORK enabled will be built as a "
+      "framework on Mac OS X.  "
+      "By default its Info.plist file is created by configuring a template "
+      "called MacOSXFrameworkInfo.plist.in located in the CMAKE_MODULE_PATH.  "
+      "This property specifies an alternative template file name which "
+      "may be a full path.\n"
+      "The following target properties may be set to specify content to "
+      "be configured into the file:\n"
+      "  MACOSX_FRAMEWORK_ICON_FILE\n"
+      "  MACOSX_FRAMEWORK_IDENTIFIER\n"
+      "  MACOSX_FRAMEWORK_SHORT_VERSION_STRING\n"
+      "  MACOSX_FRAMEWORK_BUNDLE_VERSION\n"
+      "CMake variables of the same name may be set to affect all targets "
+      "in a directory that do not have each specific property set.  "
+      "If a custom Info.plist is specified by this property it may of course "
+      "hard-code all the settings instead of using the target properties.");
+ 
+   cm->DefineProperty
      ("ENABLE_EXPORTS", cmProperty::TARGET,
       "Specify whether an executable exports symbols for loadable modules.",
***************
*** 788,791 ****
--- 820,833 ----
  
  //----------------------------------------------------------------------------
+ bool cmTarget::IsLinkable()
+ {
+   return (this->GetType() == cmTarget::STATIC_LIBRARY ||
+           this->GetType() == cmTarget::SHARED_LIBRARY ||
+           this->GetType() == cmTarget::MODULE_LIBRARY ||
+           this->GetType() == cmTarget::UNKNOWN_LIBRARY ||
+           this->IsExecutableWithExports());
+ }
+ 
+ //----------------------------------------------------------------------------
  bool cmTarget::IsFrameworkOnApple()
  {
***************
*** 1671,1674 ****
--- 1713,1779 ----
  
  //----------------------------------------------------------------------------
+ static void cmTargetCheckLINK_INTERFACE_LIBRARIES(
+   const char* prop, const char* value, cmMakefile* context, bool imported
+   )
+ {
+   // Look for link-type keywords in the value.
+   static cmsys::RegularExpression
+     keys("(^|;)(debug|optimized|general)(;|$)");
+   if(!keys.find(value))
+     {
+     return;
+     }
+ 
+   // Support imported and non-imported versions of the property.
+   const char* base = (imported?
+                       "IMPORTED_LINK_INTERFACE_LIBRARIES" :
+                       "LINK_INTERFACE_LIBRARIES");
+ 
+   // Report an error.
+   cmOStringStream e;
+   e << "Property " << prop << " may not contain link-type keyword \""
+     << keys.match(2) << "\".  "
+     << "The " << base << " property has a per-configuration "
+     << "version called " << base << "_<CONFIG> which may be "
+     << "used to specify per-configuration rules.";
+   if(!imported)
+     {
+     e << "  "
+       << "Alternatively, an IMPORTED library may be created, configured "
+       << "with a per-configuration location, and then named in the "
+       << "property value.  "
+       << "See the add_library command's IMPORTED mode for details."
+       << "\n"
+       << "If you have a list of libraries that already contains the "
+       << "keyword, use the target_link_libraries command with its "
+       << "LINK_INTERFACE_LIBRARIES mode to set the property.  "
+       << "The command automatically recognizes link-type keywords and sets "
+       << "the LINK_INTERFACE_LIBRARIES and LINK_INTERFACE_LIBRARIES_DEBUG "
+       << "properties accordingly.";
+     }
+   context->IssueMessage(cmake::FATAL_ERROR, e.str());
+ }
+ 
+ //----------------------------------------------------------------------------
+ void cmTarget::CheckProperty(const char* prop, cmMakefile* context)
+ {
+   // Certain properties need checking.
+   if(strncmp(prop, "LINK_INTERFACE_LIBRARIES", 24) == 0)
+     {
+     if(const char* value = this->GetProperty(prop))
+       {
+       cmTargetCheckLINK_INTERFACE_LIBRARIES(prop, value, context, false);
+       }
+     }
+   if(strncmp(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES", 33) == 0)
+     {
+     if(const char* value = this->GetProperty(prop))
+       {
+       cmTargetCheckLINK_INTERFACE_LIBRARIES(prop, value, context, true);
+       }
+     }
+ }
+ 
+ //----------------------------------------------------------------------------
  void cmTarget::MarkAsImported()
  {
***************
*** 1861,1865 ****
       this->GetType() == cmTarget::STATIC_LIBRARY ||
       this->GetType() == cmTarget::SHARED_LIBRARY ||
!      this->GetType() == cmTarget::MODULE_LIBRARY)
      {
      if(!this->IsImported() && strcmp(prop,"LOCATION") == 0)
--- 1966,1971 ----
       this->GetType() == cmTarget::STATIC_LIBRARY ||
       this->GetType() == cmTarget::SHARED_LIBRARY ||
!      this->GetType() == cmTarget::MODULE_LIBRARY ||
!      this->GetType() == cmTarget::UNKNOWN_LIBRARY)
      {
      if(!this->IsImported() && strcmp(prop,"LOCATION") == 0)
***************
*** 1958,1961 ****
--- 2064,2070 ----
          return "INSTALL_DIRECTORY";
          // break; /* unreachable */
+       case cmTarget::UNKNOWN_LIBRARY:
+         return "UNKNOWN_LIBRARY";
+         // break; /* unreachable */
        }
      return 0;
***************
*** 2044,2052 ****
      case cmTarget::EXECUTABLE:
        return "_LINK_EXECUTABLE";
!     case cmTarget::UTILITY:
!     case cmTarget::GLOBAL_TARGET:
!     case cmTarget::INSTALL_FILES:
!     case cmTarget::INSTALL_PROGRAMS:
!     case cmTarget::INSTALL_DIRECTORY:
        break;
      }
--- 2153,2157 ----
      case cmTarget::EXECUTABLE:
        return "_LINK_EXECUTABLE";
!     default:
        break;
      }
***************
*** 2074,2082 ****
                ? "CMAKE_IMPORT_LIBRARY_SUFFIX"
                : "CMAKE_EXECUTABLE_SUFFIX");
!     case cmTarget::UTILITY:
!     case cmTarget::GLOBAL_TARGET:
!     case cmTarget::INSTALL_FILES:
!     case cmTarget::INSTALL_PROGRAMS:
!     case cmTarget::INSTALL_DIRECTORY:
        break;
      }
--- 2179,2183 ----
                ? "CMAKE_IMPORT_LIBRARY_SUFFIX"
                : "CMAKE_EXECUTABLE_SUFFIX");
!     default:
        break;
      }
***************
*** 2103,2111 ****
      case cmTarget::EXECUTABLE:
        return (implib? "CMAKE_IMPORT_LIBRARY_PREFIX" : "");
!     case cmTarget::UTILITY:
!     case cmTarget::GLOBAL_TARGET:
!     case cmTarget::INSTALL_FILES:
!     case cmTarget::INSTALL_PROGRAMS:
!     case cmTarget::INSTALL_DIRECTORY:
        break;
      }
--- 2204,2208 ----
      case cmTarget::EXECUTABLE:
        return (implib? "CMAKE_IMPORT_LIBRARY_PREFIX" : "");
!     default:
        break;
      }

Index: cmCacheManager.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCacheManager.cxx,v
retrieving revision 1.100
retrieving revision 1.100.2.1
diff -C 2 -d -r1.100 -r1.100.2.1
*** cmCacheManager.cxx	29 Jan 2008 22:30:48 -0000	1.100
--- cmCacheManager.cxx	3 Sep 2008 13:43:17 -0000	1.100.2.1
***************
*** 715,722 ****
      this->Cache.erase(i);
      }
-   else
-     {
-     std::cerr << "Failed to remove entry:" << key << std::endl;
-     }
  }
  
--- 715,718 ----

Index: cmGlobalXCodeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v
retrieving revision 1.186.2.6
retrieving revision 1.186.2.7
diff -C 2 -d -r1.186.2.6 -r1.186.2.7
*** cmGlobalXCodeGenerator.cxx	6 Aug 2008 21:04:19 -0000	1.186.2.6
--- cmGlobalXCodeGenerator.cxx	3 Sep 2008 13:43:17 -0000	1.186.2.7
***************
*** 690,694 ****
          cmtarget.GetTargetSourceFileFlags(*i);
  
!       if(strcmp(filetype->GetString(), "\"compiled.mach-o.objfile\"") == 0)
          {
          externalObjFiles.push_back(xsf);
--- 690,694 ----
          cmtarget.GetTargetSourceFileFlags(*i);
  
!       if(strcmp(filetype->GetString(), "compiled.mach-o.objfile") == 0)
          {
          externalObjFiles.push_back(xsf);
***************
*** 1437,1440 ****
--- 1437,1452 ----
        buildSettings->AddAttribute("FRAMEWORK_VERSION",
                                    this->CreateString(version.c_str()));
+ 
+       std::string plist = this->ComputeInfoPListLocation(target);
+       // Xcode will create the final version of Info.plist at build time,
+       // so let it replace the framework name.  This avoids creating
+       // a per-configuration Info.plist file.
+       this->CurrentLocalGenerator
+         ->GenerateFrameworkInfoPList(&target, "$(EXECUTABLE_NAME)",
+                                      plist.c_str());
+       std::string path =
+         this->ConvertToRelativeForXCode(plist.c_str());
+       buildSettings->AddAttribute("INFOPLIST_FILE",
+                                   this->CreateString(path.c_str()));
        }
      else
***************
*** 1958,1977 ****
        {
        std::string oldValue = attr->GetString();
- 
-       // unescape escaped quotes internal to the string:
-       cmSystemTools::ReplaceString(oldValue, "\\\"", "\"");
- 
-       // remove surrounding quotes, if any:
-       std::string::size_type len = oldValue.length();
-       if(oldValue[0] == '\"' && oldValue[len-1] == '\"')
-         {
-         oldValue = oldValue.substr(1, len-2);
-         }
- 
        oldValue += " ";
        oldValue += value;
- 
-       // SetString automatically escapes internal quotes and then surrounds
-       // the result with quotes if necessary...
        attr->SetString(oldValue.c_str());
        }
--- 1970,1975 ----

Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.375.2.11
retrieving revision 1.375.2.12
diff -C 2 -d -r1.375.2.11 -r1.375.2.12
*** cmake.cxx	6 Aug 2008 21:04:20 -0000	1.375.2.11
--- cmake.cxx	3 Sep 2008 13:43:18 -0000	1.375.2.12
***************
*** 1872,1876 ****
    // erase the property to avoid infinite recursion
    this->SetProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", "");
! 
    cmCacheManager::CacheIterator ci = this->CacheManager->NewIterator();
    std::vector<SaveCacheEntry> saved;
--- 1872,1879 ----
    // erase the property to avoid infinite recursion
    this->SetProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", "");
!   if(this->GetIsInTryCompile())
!     {
!     return 0;
!     }
    cmCacheManager::CacheIterator ci = this->CacheManager->NewIterator();
    std::vector<SaveCacheEntry> saved;

Index: cmAddLibraryCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddLibraryCommand.h,v
retrieving revision 1.22
retrieving revision 1.22.2.1
diff -C 2 -d -r1.22 -r1.22.2.1
*** cmAddLibraryCommand.h	11 Feb 2008 18:35:39 -0000	1.22
--- cmAddLibraryCommand.h	3 Sep 2008 13:43:16 -0000	1.22.2.1
***************
*** 101,105 ****
        "The add_library command can also create IMPORTED library "
        "targets using this signature:\n"
!       "  add_library(<name> <SHARED|STATIC|MODULE> IMPORTED)\n"
        "An IMPORTED library target references a library file located "
        "outside the project.  "
--- 101,105 ----
        "The add_library command can also create IMPORTED library "
        "targets using this signature:\n"
!       "  add_library(<name> <SHARED|STATIC|MODULE|UNKNOWN> IMPORTED)\n"
        "An IMPORTED library target references a library file located "
        "outside the project.  "

Index: cmXCodeObject.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmXCodeObject.cxx,v
retrieving revision 1.24.2.1
retrieving revision 1.24.2.2
diff -C 2 -d -r1.24.2.1 -r1.24.2.2
*** cmXCodeObject.cxx	15 May 2008 19:39:57 -0000	1.24.2.1
--- cmXCodeObject.cxx	3 Sep 2008 13:43:18 -0000	1.24.2.2
***************
*** 152,156 ****
          if(j->second->TypeValue == STRING)
            {
!           out << j->first << " = " << j->second->String << ";";
            }
          else if(j->second->TypeValue == OBJECT_LIST)
--- 152,158 ----
          if(j->second->TypeValue == STRING)
            {
!           out << j->first << " = ";
!           j->second->PrintString(out);
!           out << ";";
            }
          else if(j->second->TypeValue == OBJECT_LIST)
***************
*** 161,165 ****
              if(j->second->List[k]->TypeValue == STRING)
                {
!               out << j->second->List[k]->String << ", ";
                }
              else
--- 163,168 ----
              if(j->second->List[k]->TypeValue == STRING)
                {
!               j->second->List[k]->PrintString(out);
!               out << ", ";
                }
              else
***************
*** 193,197 ****
      else if(object->TypeValue == STRING)
        {
!       out << i->first << " = " << object->String << ";" << separator;
        }
      else
--- 196,202 ----
      else if(object->TypeValue == STRING)
        {
!       out << i->first << " = ";
!       object->PrintString(out);
!       out << ";" << separator;
        }
      else
***************
*** 231,258 ****
  
  //----------------------------------------------------------------------------
! void cmXCodeObject::SetString(const char* s)
  {
!   std::string ss = s;
!   if(ss.size() == 0)
!     {
!     this->String = "\"\"";
!     return;
!     }
!   // escape quotes
!   cmSystemTools::ReplaceString(ss, "\"", "\\\"");
!   bool needQuote = false;
!   this->String = "";
!   if(ss.find_first_of(" <>.+-=@") != ss.npos)
!     {
!     needQuote = true;
!     }
!   if(needQuote)
!     {
!     this->String = "\"";
!     }
!   this->String += ss;
!   if(needQuote)
      {
!     this->String += "\"";
      }
  }
--- 236,266 ----
  
  //----------------------------------------------------------------------------
! void cmXCodeObject::PrintString(std::ostream& os) const
  {
!   // The string needs to be quoted if it contains any characters
!   // considered special by the Xcode project file parser.
!   bool needQuote =
!     (this->String.empty() ||
!      this->String.find_first_of(" <>.+-=@") != this->String.npos);
!   const char* quote = needQuote? "\"" : "";
! 
!   // Print the string, quoted and escaped as necessary.
!   os << quote;
!   for(std::string::const_iterator i = this->String.begin();
!       i != this->String.end(); ++i)
      {
!     if(*i == '"')
!       {
!       // Escape double-quotes.
!       os << '\\';
!       }
!     os << *i;
      }
+   os << quote;
+ }
+ 
+ //----------------------------------------------------------------------------
+ void cmXCodeObject::SetString(const char* s)
+ {
+   this->String = s;
  }

Index: cmStringCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmStringCommand.cxx,v
retrieving revision 1.27
retrieving revision 1.27.2.1
diff -C 2 -d -r1.27 -r1.27.2.1
*** cmStringCommand.cxx	23 Jan 2008 15:27:59 -0000	1.27
--- cmStringCommand.cxx	3 Sep 2008 13:43:18 -0000	1.27.2.1
***************
*** 223,227 ****
      if(args.size() < 6)
        {
!       this->SetError("sub-command REGEX, mode MATCH needs "
                       "at least 6 arguments total to command.");
        return false;
--- 223,227 ----
      if(args.size() < 6)
        {
!       this->SetError("sub-command REGEX, mode REPLACE needs "
                       "at least 6 arguments total to command.");
        return false;

Index: cmGlobalKdevelopGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalKdevelopGenerator.cxx,v
retrieving revision 1.29.2.1
retrieving revision 1.29.2.2
diff -C 2 -d -r1.29.2.1 -r1.29.2.2
*** cmGlobalKdevelopGenerator.cxx	30 Mar 2008 13:09:22 -0000	1.29.2.1
--- cmGlobalKdevelopGenerator.cxx	3 Sep 2008 13:43:17 -0000	1.29.2.2
***************
*** 281,287 ****
    else
      {
!     // add all subdirectories to the kdevelop blacklist
!     // so they are not monitored for added or removed files
!     // since this is basically handled by adding files to the cmake files
      cmsys::Directory d;
      if (d.Load(projectDir.c_str()))
--- 281,287 ----
    else
      {
!     // add all subdirectories which are cmake build directories to the 
!     // kdevelop blacklist so they are not monitored for added or removed files
!     // since this is handled by adding files to the cmake files
      cmsys::Directory d;
      if (d.Load(projectDir.c_str()))
***************
*** 298,302 ****
            if (cmSystemTools::FileIsDirectory(tmp.c_str()))
              {
!             this->Blacklist.push_back(nextFile);
              }
            }
--- 298,307 ----
            if (cmSystemTools::FileIsDirectory(tmp.c_str()))
              {
!             tmp += "/CMakeCache.txt";
!             if ((nextFile == "CMakeFiles") 
!                 || (cmSystemTools::FileExists(tmp.c_str())))
!               {
!               this->Blacklist.push_back(nextFile);
!               }
              }
            }
***************
*** 472,479 ****
          "      <makebin>" << this->GlobalGenerator->GetLocalGenerators()[0]->
              GetMakefile()->GetRequiredDefinition("CMAKE_BUILD_TOOL") 
!             << " VERBOSE=1 </makebin>\n"
          "      <selectedenvironment>default</selectedenvironment>\n"
          "      <environments>\n"
!         "        <default/>\n"
          "      </environments>\n"
          "    </make>\n";
--- 477,486 ----
          "      <makebin>" << this->GlobalGenerator->GetLocalGenerators()[0]->
              GetMakefile()->GetRequiredDefinition("CMAKE_BUILD_TOOL") 
!             << " </makebin>\n"
          "      <selectedenvironment>default</selectedenvironment>\n"
          "      <environments>\n"
!         "        <default>\n"
!         "          <envvar value=\"1\" name=\"VERBOSE\" />\n"
!         "        </default>\n"
          "      </environments>\n"
          "    </make>\n";

Index: cmMakefileExecutableTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileExecutableTargetGenerator.cxx,v
retrieving revision 1.46.2.1
retrieving revision 1.46.2.2
diff -C 2 -d -r1.46.2.1 -r1.46.2.2
*** cmMakefileExecutableTargetGenerator.cxx	8 Apr 2008 16:22:50 -0000	1.46.2.1
--- cmMakefileExecutableTargetGenerator.cxx	3 Sep 2008 13:43:18 -0000	1.46.2.2
***************
*** 505,508 ****
--- 505,509 ----
    cmSystemTools::MakeDirectory(outpath.c_str());
    outpath += "/";
+   this->Makefile->AddCMakeDependFile(outpath.c_str());
  
    // Configure the Info.plist file.  Note that it needs the executable name
***************
*** 512,514 ****
--- 513,516 ----
                                                 targetName.c_str(),
                                                 plist.c_str());
+   this->Makefile->AddCMakeDependFile(plist.c_str());
  }

Index: cmMakefileLibraryTargetGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.h,v
retrieving revision 1.6.2.2
retrieving revision 1.6.2.3
diff -C 2 -d -r1.6.2.2 -r1.6.2.3
*** cmMakefileLibraryTargetGenerator.h	6 Aug 2008 21:04:19 -0000	1.6.2.2
--- cmMakefileLibraryTargetGenerator.h	3 Sep 2008 13:43:18 -0000	1.6.2.3
***************
*** 38,42 ****
    // MacOSX Framework support methods
    void WriteFrameworkRules(bool relink);
!   void CreateFramework();
  
    // Store the computd framework version for OS X Frameworks.
--- 38,42 ----
    // MacOSX Framework support methods
    void WriteFrameworkRules(bool relink);
!   void CreateFramework(std::string const& targetName);
  
    // Store the computd framework version for OS X Frameworks.

Index: cmReturnCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmReturnCommand.h,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C 2 -d -r1.2 -r1.2.2.1
*** cmReturnCommand.h	23 Jan 2008 23:34:19 -0000	1.2
--- cmReturnCommand.h	3 Sep 2008 13:43:18 -0000	1.2.2.1
***************
*** 58,62 ****
    virtual const char* GetTerseDocumentation() 
      {
!     return "Return from a directory or function.";
      }
    
--- 58,62 ----
    virtual const char* GetTerseDocumentation() 
      {
!     return "Return from a file, directory or function.";
      }
    
***************
*** 68,75 ****
      return
        "  return()\n"
!       "Returns from a directory or function. When this command is "
!       "encountered, it caused process of the current function or "
!       "directory to stop and control is return to the caller of the "
!       "function, or the parent directory if any. Note that a macro "
        "is not a function and does not handle return like a function does.";
      }
--- 68,79 ----
      return
        "  return()\n"
!       "Returns from a file, directory or function. When this command is "
!       "encountered in an included file (via include() or find_package()), "
!       "it causes processing of the current file to stop and control is "
!       "returned to the including file. If it is encountered in a file which "
!       "is not included by another file, e.g. a CMakeLists.txt, control is "
!       "returned to the parent directory if there is one. "
!       "If return is called in a function, control is returned to the caller "
!       "of the function. Note that a macro "
        "is not a function and does not handle return like a function does.";
      }

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.463.2.7
retrieving revision 1.463.2.8
diff -C 2 -d -r1.463.2.7 -r1.463.2.8
*** cmMakefile.cxx	6 Aug 2008 21:04:19 -0000	1.463.2.7
--- cmMakefile.cxx	3 Sep 2008 13:43:17 -0000	1.463.2.8
***************
*** 1223,1227 ****
        {
        // CMake versions below 2.4 allowed linking to modules.
!       bool allowModules = this->NeedBackwardsCompatibility(2,3);
        // if it is not a static or shared library then you can not link to it
        if(!((tgt->GetType() == cmTarget::STATIC_LIBRARY) ||
--- 1223,1227 ----
        {
        // CMake versions below 2.4 allowed linking to modules.
!       bool allowModules = this->NeedBackwardsCompatibility(2,2);
        // if it is not a static or shared library then you can not link to it
        if(!((tgt->GetType() == cmTarget::STATIC_LIBRARY) ||
***************
*** 1230,1244 ****
          {
          cmOStringStream e;
!         e << "Attempt to add link target " << lib << " of type: "
            << cmTarget::TargetTypeNames[static_cast<int>(tgt->GetType())]
!           << "\nto target " << target
!           << ". One can only link to STATIC or SHARED libraries, or "
            << "to executables with the ENABLE_EXPORTS property set.";
          // in older versions of cmake linking to modules was allowed
          if( tgt->GetType() == cmTarget::MODULE_LIBRARY )
            {
!           e <<
!             "\nTo allow linking of modules set "
!             "CMAKE_BACKWARDS_COMPATIBILITY to 2.2 or lower\n";
            }
          // if no modules are allowed then this is always an error
--- 1230,1247 ----
          {
          cmOStringStream e;
!         e << "Target \"" << lib << "\" of type "
            << cmTarget::TargetTypeNames[static_cast<int>(tgt->GetType())]
!           << " may not be linked into another target.  "
!           << "One may link only to STATIC or SHARED libraries, or "
            << "to executables with the ENABLE_EXPORTS property set.";
          // in older versions of cmake linking to modules was allowed
          if( tgt->GetType() == cmTarget::MODULE_LIBRARY )
            {
!           e << "\n"
!             << "If you are developing a new project, re-organize it to avoid "
!             << "linking to modules.  "
!             << "If you are just trying to build an existing project, "
!             << "set CMAKE_BACKWARDS_COMPATIBILITY to 2.2 or lower to allow "
!             << "linking to modules.";
            }
          // if no modules are allowed then this is always an error
***************
*** 1248,1252 ****
             (allowModules && tgt->GetType() != cmTarget::MODULE_LIBRARY))
            {
!           cmSystemTools::Error(e.str().c_str());
            }
          }
--- 1251,1255 ----
             (allowModules && tgt->GetType() != cmTarget::MODULE_LIBRARY))
            {
!           this->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
            }
          }
***************
*** 3461,3508 ****
  }
  
! cmPolicies::PolicyStatus cmMakefile
! ::GetPolicyStatus(cmPolicies::PolicyID id)
  {
!   cmPolicies::PolicyStatus status = cmPolicies::REQUIRED_IF_USED;
!   PolicyMap::iterator mappos;
!   int vecpos;
!   bool done = false;
  
!   // check our policy stack first
!   for (vecpos = static_cast<int>(this->PolicyStack.size()) - 1; 
!        vecpos >= 0 && !done; vecpos--)
!   {
!     mappos = this->PolicyStack[vecpos].find(id);
!     if (mappos != this->PolicyStack[vecpos].end())
      {
!       status = mappos->second;
!       done = true;
      }
!   }
!   
!   // if not found then 
!   if (!done)
!   {
!     // pass the buck to our parent if we have one
!     if (this->LocalGenerator->GetParent())
      {
!       cmMakefile *parent = 
!         this->LocalGenerator->GetParent()->GetMakefile();
!       return parent->GetPolicyStatus(id);
      }
!     // otherwise use the default
!     else
      {
!       status = this->GetPolicies()->GetPolicyStatus(id);
      }
!   }
!   
!   // warn if we see a REQUIRED_IF_USED above a OLD or WARN
!   if (!this->GetPolicies()->IsValidUsedPolicyStatus(id,status))
!   {
!     return cmPolicies::REQUIRED_IF_USED;
!   }
!   
!   return status;
  }
  
--- 3464,3520 ----
  }
  
! //----------------------------------------------------------------------------
! cmPolicies::PolicyStatus
! cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id)
  {
!   // Get the current setting of the policy.
!   cmPolicies::PolicyStatus cur = this->GetPolicyStatusInternal(id);
  
!   // If the policy is required to be set to NEW but is not, ignore the
!   // current setting and tell the caller.
!   if(cur != cmPolicies::NEW)
      {
!     if(cur == cmPolicies::REQUIRED_ALWAYS ||
!        cur == cmPolicies::REQUIRED_IF_USED)
!       {
!       return cur;
!       }
!     cmPolicies::PolicyStatus def = this->GetPolicies()->GetPolicyStatus(id);
!     if(def == cmPolicies::REQUIRED_ALWAYS ||
!        def == cmPolicies::REQUIRED_IF_USED)
!       {
!       return def;
!       }
      }
! 
!   // The current setting is okay.
!   return cur;
! }
! 
! //----------------------------------------------------------------------------
! cmPolicies::PolicyStatus
! cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id)
! {
!   // Is the policy set in our stack?
!   for(std::vector<PolicyMap>::reverse_iterator
!         psi = this->PolicyStack.rbegin();
!       psi != this->PolicyStack.rend(); ++psi)
      {
!     PolicyMap::const_iterator pse = psi->find(id);
!     if(pse != psi->end())
!       {
!       return pse->second;
!       }
      }
! 
!   // If we have a parent directory, recurse up to it.
!   if(this->LocalGenerator->GetParent())
      {
!     cmMakefile* parent = this->LocalGenerator->GetParent()->GetMakefile();
!     return parent->GetPolicyStatusInternal(id);
      }
! 
!   // The policy is not set.  Use the default for this CMake version.
!   return this->GetPolicies()->GetPolicyStatus(id);
  }
  
***************
*** 3521,3555 ****
  }
  
! bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, 
                             cmPolicies::PolicyStatus status)
  {
!   // setting a REQUIRED_ALWAYS policy to WARN or OLD is an insta error
!   if (this->GetPolicies()->
!       IsValidPolicyStatus(id,status))
!   {
!     this->PolicyStack.back()[id] = status;
  
!     // Special hook for presenting compatibility variable as soon as
!     // the user requests it.
!     if(id == cmPolicies::CMP0001 &&
!        (status == cmPolicies::WARN || status == cmPolicies::OLD))
        {
!       if(!(this->GetCacheManager()
!            ->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")))
!         {
!         // Set it to 2.4 because that is the last version where the
!         // variable had meaning.
!         this->AddCacheDefinition
!           ("CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
!            "For backwards compatibility, what version of CMake "
!            "commands and "
!            "syntax should this version of CMake try to support.",
!            cmCacheManager::STRING);
!         }
        }
  
!     return true;
!   }
!   return false;
  }
  
--- 3533,3574 ----
  }
  
! //----------------------------------------------------------------------------
! bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
                             cmPolicies::PolicyStatus status)
  {
!   // A REQUIRED_ALWAYS policy may be set only to NEW.
!   if(status != cmPolicies::NEW &&
!      this->GetPolicies()->GetPolicyStatus(id) ==
!      cmPolicies::REQUIRED_ALWAYS)
!     {
!     std::string msg =
!       this->GetPolicies()->GetRequiredAlwaysPolicyError(id);
!     this->IssueMessage(cmake::FATAL_ERROR, msg.c_str());
!     return false;
!     }
  
!   // Store the setting.
!   this->PolicyStack.back()[id] = status;
! 
!   // Special hook for presenting compatibility variable as soon as
!   // the user requests it.
!   if(id == cmPolicies::CMP0001 &&
!      (status == cmPolicies::WARN || status == cmPolicies::OLD))
!     {
!     if(!(this->GetCacheManager()
!          ->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")))
        {
!       // Set it to 2.4 because that is the last version where the
!       // variable had meaning.
!       this->AddCacheDefinition
!         ("CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
!          "For backwards compatibility, what version of CMake "
!          "commands and "
!          "syntax should this version of CMake try to support.",
!          cmCacheManager::STRING);
        }
+     }
  
!   return true;
  }
  

Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.269.2.6
retrieving revision 1.269.2.7
diff -C 2 -d -r1.269.2.6 -r1.269.2.7
*** cmLocalGenerator.cxx	6 Aug 2008 21:04:19 -0000	1.269.2.6
--- cmLocalGenerator.cxx	3 Sep 2008 13:43:17 -0000	1.269.2.7
***************
*** 102,105 ****
--- 102,142 ----
    this->UseRelativePaths = this->Makefile->IsOn("CMAKE_USE_RELATIVE_PATHS");
  
+   // Choose a maximum object file name length.
+   {
+ #if defined(_WIN32) || defined(__CYGWIN__)
+   this->ObjectPathMax = 250;
+ #else
+   this->ObjectPathMax = 1000;
+ #endif
+   const char* plen = this->Makefile->GetDefinition("CMAKE_OBJECT_PATH_MAX");
+   if(plen && *plen)
+     {
+     unsigned int pmax;
+     if(sscanf(plen, "%u", &pmax) == 1)
+       {
+       if(pmax >= 128)
+         {
+         this->ObjectPathMax = pmax;
+         }
+       else
+         {
+         cmOStringStream w;
+         w << "CMAKE_OBJECT_PATH_MAX is set to " << pmax
+           << ", which is less than the minimum of 128.  "
+           << "The value will be ignored.";
+         this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+         }
+       }
+     else
+       {
+       cmOStringStream w;
+       w << "CMAKE_OBJECT_PATH_MAX is set to \"" << plen
+         << "\", which fails to parse as a positive integer.  "
+         << "The value will be ignored.";
+       this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+       }
+     }
+   }
+ 
    this->Configured = true;
  
***************
*** 724,732 ****
          }
          break; 
!       case cmTarget::UTILITY:
!       case cmTarget::GLOBAL_TARGET:
!       case cmTarget::INSTALL_FILES:
!       case cmTarget::INSTALL_PROGRAMS:
!       case cmTarget::INSTALL_DIRECTORY:
          break;
        }
--- 761,765 ----
          }
          break; 
!       default:
          break;
        }
***************
*** 1442,1450 ****
        }
        break; 
!     case cmTarget::UTILITY:
!     case cmTarget::GLOBAL_TARGET:
!     case cmTarget::INSTALL_FILES:
!     case cmTarget::INSTALL_PROGRAMS:
!     case cmTarget::INSTALL_DIRECTORY:
        break;
      }
--- 1475,1479 ----
        }
        break; 
!     default:
        break;
      }
***************
*** 1715,1718 ****
--- 1744,1748 ----
        case cmTarget::SHARED_LIBRARY:
        case cmTarget::MODULE_LIBRARY:
+       case cmTarget::UNKNOWN_LIBRARY:
          {
          // Get the location of the target's output file and depend on it.
***************
*** 2322,2335 ****
  }
  
! static bool cmLocalGeneratorCheckObjectName(std::string& objName,
!                                             std::string::size_type dir_len)
  {
-   // Choose a maximum file name length.
- #if defined(_WIN32) || defined(__CYGWIN__)
-   std::string::size_type const max_total_len = 250;
- #else
-   std::string::size_type const max_total_len = 1000;
- #endif
- 
    // Enforce the maximum file name length if possible.
    std::string::size_type max_obj_len = max_total_len;
--- 2352,2360 ----
  }
  
! static
! bool cmLocalGeneratorCheckObjectName(std::string& objName,
!                                      std::string::size_type dir_len,
!                                      std::string::size_type max_total_len)
  {
    // Enforce the maximum file name length if possible.
    std::string::size_type max_obj_len = max_total_len;
***************
*** 2422,2426 ****
  
  #if defined(CM_LG_ENCODE_OBJECT_NAMES)
!     cmLocalGeneratorCheckObjectName(ssin, dir_len);
  #else
      (void)dir_len;
--- 2447,2451 ----
  
  #if defined(CM_LG_ENCODE_OBJECT_NAMES)
!     cmLocalGeneratorCheckObjectName(ssin, dir_len, this->ObjectPathMax);
  #else
      (void)dir_len;
***************
*** 2839,2840 ****
--- 2864,2905 ----
    mf->PopScope();
  }
+ 
+ //----------------------------------------------------------------------------
+ void cmLocalGenerator::GenerateFrameworkInfoPList(cmTarget* target,
+                                                   const char* targetName,
+                                                   const char* fname)
+ {
+   // Find the Info.plist template.
+   const char* in = target->GetProperty("MACOSX_FRAMEWORK_INFO_PLIST");
+   std::string inFile = (in && *in)? in : "MacOSXFrameworkInfo.plist.in";
+   if(!cmSystemTools::FileIsFullPath(inFile.c_str()))
+     {
+     std::string inMod = this->Makefile->GetModulesFile(inFile.c_str());
+     if(!inMod.empty())
+       {
+       inFile = inMod;
+       }
+     }
+   if(!cmSystemTools::FileExists(inFile.c_str(), true))
+     {
+     cmOStringStream e;
+     e << "Target " << target->GetName() << " Info.plist template \""
+       << inFile << "\" could not be found.";
+     cmSystemTools::Error(e.str().c_str());
+     return;
+     }
+ 
+   // Convert target properties to variables in an isolated makefile
+   // scope to configure the file.  If properties are set they will
+   // override user make variables.  If not the configuration will fall
+   // back to the directory-level values set by the user.
+   cmMakefile* mf = this->Makefile;
+   mf->PushScope();
+   mf->AddDefinition("MACOSX_FRAMEWORK_NAME", targetName);
+   cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_ICON_FILE");
+   cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_IDENTIFIER");
+   cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_SHORT_VERSION_STRING");
+   cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_BUNDLE_VERSION");
+   mf->ConfigureFile(inFile.c_str(), fname, false, false, false);
+   mf->PopScope();
+ }

Index: cmCMakePolicyCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCMakePolicyCommand.h,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -C 2 -d -r1.4.2.1 -r1.4.2.2
*** cmCMakePolicyCommand.h	18 Mar 2008 14:23:54 -0000	1.4.2.1
--- cmCMakePolicyCommand.h	3 Sep 2008 13:43:17 -0000	1.4.2.2
***************
*** 109,112 ****
--- 109,117 ----
        "and set the policy state to NEW."
        "\n"
+       "  cmake_policy(GET CMP<NNNN> <variable>)\n"
+       "Check whether a given policy is set to OLD or NEW behavior.  "
+       "The output variable value will be \"OLD\" or \"NEW\" if the "
+       "policy is set, and empty otherwise."
+       "\n"
        "  cmake_policy(PUSH)\n"
        "  cmake_policy(POP)\n"
***************
*** 124,127 ****
--- 129,133 ----
  private:
    bool HandleSetMode(std::vector<std::string> const& args);
+   bool HandleGetMode(std::vector<std::string> const& args);
    bool HandleVersionMode(std::vector<std::string> const& args);
  };

Index: cmAddLibraryCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddLibraryCommand.cxx,v
retrieving revision 1.36
retrieving revision 1.36.2.1
diff -C 2 -d -r1.36 -r1.36.2.1
*** cmAddLibraryCommand.cxx	11 Feb 2008 22:33:46 -0000	1.36
--- cmAddLibraryCommand.cxx	3 Sep 2008 13:43:16 -0000	1.36.2.1
***************
*** 69,72 ****
--- 69,78 ----
        haveSpecifiedType = true;
        }
+     else if(libType == "UNKNOWN")
+       {
+       ++s;
+       type = cmTarget::UNKNOWN_LIBRARY;
+       haveSpecifiedType = true;
+       }
      else if(*s == "EXCLUDE_FROM_ALL")
        {
***************
*** 128,131 ****
--- 134,147 ----
      }
  
+   // A non-imported target may not have UNKNOWN type.
+   if(type == cmTarget::UNKNOWN_LIBRARY)
+     {
+     this->Makefile->IssueMessage(
+       cmake::FATAL_ERROR,
+       "The UNKNOWN library type may be used only for IMPORTED libraries."
+       );
+     return true;
+     }
+ 
    // Enforce name uniqueness.
    {

Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.227.2.6
retrieving revision 1.227.2.7
diff -C 2 -d -r1.227.2.6 -r1.227.2.7
*** cmGlobalGenerator.cxx	31 Jul 2008 15:52:24 -0000	1.227.2.6
--- cmGlobalGenerator.cxx	3 Sep 2008 13:43:17 -0000	1.227.2.7
***************
*** 765,769 ****
    if ( !this->CMakeInstance->GetScriptMode() )
      {
!     this->CMakeInstance->UpdateProgress("Configuring done", -1);
      }
  }
--- 765,774 ----
    if ( !this->CMakeInstance->GetScriptMode() )
      {
!     const char* msg = "Configuring done";
!     if(cmSystemTools::GetErrorOccuredFlag())
!       {
!       msg = "Configuring incomplete, errors occurred!";
!       }
!     this->CMakeInstance->UpdateProgress(msg, -1);
      }
  }
***************
*** 861,865 ****
    {
    cmComputeTargetDepends ctd(this);
!   ctd.Compute();
    std::vector<cmTarget*> const& targets = ctd.GetTargets();
    for(std::vector<cmTarget*>::const_iterator ti = targets.begin();
--- 866,873 ----
    {
    cmComputeTargetDepends ctd(this);
!   if(!ctd.Compute())
!     {
!     return;
!     }
    std::vector<cmTarget*> const& targets = ctd.GetTargets();
    for(std::vector<cmTarget*>::const_iterator ti = targets.begin();

Index: cmFileCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFileCommand.cxx,v
retrieving revision 1.103.2.5
retrieving revision 1.103.2.6
diff -C 2 -d -r1.103.2.5 -r1.103.2.6
*** cmFileCommand.cxx	29 May 2008 13:15:28 -0000	1.103.2.5
--- cmFileCommand.cxx	3 Sep 2008 13:43:17 -0000	1.103.2.6
***************
*** 673,676 ****
--- 673,688 ----
    for ( ; i != args.end(); ++i )
      {
+     if ( *i == "RECURSE_SYMLINKS_OFF" )
+       {
+       g.RecurseThroughSymlinksOff();
+       ++i;
+       if ( i == args.end() )
+         {
+         this->SetError(
+           "GLOB requires a glob expression after RECURSE_SYMLINKS_OFF");
+         return false;
+         }
+       }
+ 
      if ( *i == "RELATIVE" )
        {
***************
*** 689,692 ****
--- 701,705 ----
          }
        }
+ 
      if ( !cmsys::SystemTools::FileIsFullPath(i->c_str()) )
        {
***************
*** 707,710 ****
--- 720,724 ----
        g.FindFiles(*i);
        }
+ 
      std::vector<std::string>::size_type cc;
      std::vector<std::string>& files = g.GetFiles();
***************
*** 1487,1491 ****
    bool have_ft = cmSystemTools::FileTimeGet(file, ft);
    std::string emsg;
!   if(!cmSystemTools::RemoveRPath(file, &emsg))
      {
      cmOStringStream e;
--- 1501,1506 ----
    bool have_ft = cmSystemTools::FileTimeGet(file, ft);
    std::string emsg;
!   bool removed;
!   if(!cmSystemTools::RemoveRPath(file, &emsg, &removed))
      {
      cmOStringStream e;
***************
*** 1496,1502 ****
      success = false;
      }
!   if(success && have_ft)
      {
!     cmSystemTools::FileTimeSet(file, ft);
      }
    cmSystemTools::FileTimeDelete(ft);
--- 1511,1527 ----
      success = false;
      }
!   if(success)
      {
!     if(removed)
!       {
!       std::string message = "Removed runtime path from \"";
!       message += file;
!       message += "\"";
!       this->Makefile->DisplayStatus(message.c_str(), -1);
!       }
!     if(have_ft)
!       {
!       cmSystemTools::FileTimeSet(file, ft);
!       }
      }
    cmSystemTools::FileTimeDelete(ft);

Index: cmDocumentation.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentation.h,v
retrieving revision 1.33
retrieving revision 1.33.2.1
diff -C 2 -d -r1.33 -r1.33.2.1
*** cmDocumentation.h	4 Mar 2008 14:16:33 -0000	1.33
--- cmDocumentation.h	3 Sep 2008 13:43:17 -0000	1.33.2.1
***************
*** 46,52 ****
     * true if documentation options are found, and false otherwise.
     * When true is returned, PrintRequestedDocumentation should be
!    * called.
     */
!   bool CheckOptions(int argc, const char* const* argv);
    
    /**
--- 46,55 ----
     * true if documentation options are found, and false otherwise.
     * When true is returned, PrintRequestedDocumentation should be
!    * called.  exitOpt can be used for things like cmake -E, so that 
!    * all arguments after the -E are ignored and not searched for
!    * help arguments.
     */
!   bool CheckOptions(int argc, const char* const* argv, 
!                     const char* exitOpt =0);
    
    /**

Index: cmFindPackageCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFindPackageCommand.cxx,v
retrieving revision 1.36.2.2
retrieving revision 1.36.2.3
diff -C 2 -d -r1.36.2.2 -r1.36.2.3
*** cmFindPackageCommand.cxx	25 Jun 2008 13:51:32 -0000	1.36.2.2
--- cmFindPackageCommand.cxx	3 Sep 2008 13:43:17 -0000	1.36.2.3
***************
*** 64,67 ****
--- 64,68 ----
    this->NoModule = false;
    this->DebugMode = false;
+   this->UseLib64Paths = false;
    this->VersionMajor = 0;
    this->VersionMinor = 0;
***************
*** 299,302 ****
--- 300,315 ----
    this->DebugMode = this->Makefile->IsOn("CMAKE_FIND_DEBUG_MODE");
  
+   // Lookup whether lib64 paths should be used.
+   if(const char* sizeof_dptr =
+      this->Makefile->GetDefinition("CMAKE_SIZEOF_VOID_P"))
+     {
+     if(atoi(sizeof_dptr) == 8 &&
+        this->Makefile->GetCMakeInstance()
+        ->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS"))
+       {
+       this->UseLib64Paths = true;
+       }
+     }
+ 
    // Find the current root path mode.
    this->SelectDefaultRootPathMode();
***************
*** 1458,1471 ****
  {
  public:
!   cmFileListGeneratorEnumerate(const char* p1, const char* p2):
!     cmFileListGeneratorBase()
!     {
!     this->Vector.push_back(p1);
!     this->Vector.push_back(p2);
!     }
    cmFileListGeneratorEnumerate(cmFileListGeneratorEnumerate const& r):
      cmFileListGeneratorBase(), Vector(r.Vector) {}
  private:
!   std::vector<std::string> Vector;
    virtual bool Search(std::string const& parent, cmFileList& lister)
      {
--- 1471,1480 ----
  {
  public:
!   cmFileListGeneratorEnumerate(std::vector<std::string> const& v):
!     cmFileListGeneratorBase(), Vector(v) {}
    cmFileListGeneratorEnumerate(cmFileListGeneratorEnumerate const& r):
      cmFileListGeneratorBase(), Vector(r.Vector) {}
  private:
!   std::vector<std::string> const& Vector;
    virtual bool Search(std::string const& parent, cmFileList& lister)
      {
***************
*** 1717,1720 ****
--- 1726,1738 ----
    }
  
+   // Construct list of common install locations (lib and share).
+   std::vector<std::string> common;
+   if(this->UseLib64Paths)
+     {
+     common.push_back("lib64");
+     }
+   common.push_back("lib");
+   common.push_back("share");
+ 
    //  PREFIX/(share|lib)/(Foo|foo|FOO).*/
    {
***************
*** 1722,1726 ****
    lister
      / cmFileListGeneratorFixed(prefix)
!     / cmFileListGeneratorEnumerate("lib", "share")
      / cmFileListGeneratorProject(this->Names);
    if(lister.Search())
--- 1740,1744 ----
    lister
      / cmFileListGeneratorFixed(prefix)
!     / cmFileListGeneratorEnumerate(common)
      / cmFileListGeneratorProject(this->Names);
    if(lister.Search())
***************
*** 1735,1739 ****
    lister
      / cmFileListGeneratorFixed(prefix)
!     / cmFileListGeneratorEnumerate("lib", "share")
      / cmFileListGeneratorProject(this->Names)
      / cmFileListGeneratorCaseInsensitive("cmake");
--- 1753,1757 ----
    lister
      / cmFileListGeneratorFixed(prefix)
!     / cmFileListGeneratorEnumerate(common)
      / cmFileListGeneratorProject(this->Names)
      / cmFileListGeneratorCaseInsensitive("cmake");

Index: cmPolicies.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmPolicies.h,v
retrieving revision 1.10.2.4
retrieving revision 1.10.2.5
diff -C 2 -d -r1.10.2.4 -r1.10.2.5
*** cmPolicies.h	28 Jul 2008 15:31:35 -0000	1.10.2.4
--- cmPolicies.h	3 Sep 2008 13:43:18 -0000	1.10.2.5
***************
*** 76,87 ****
    bool ApplyPolicyVersion(cmMakefile *mf, const char *version);
  
-   ///! test to see if setting a policy to a specific value is valid
-   bool IsValidPolicyStatus(cmPolicies::PolicyID id, 
-                            cmPolicies::PolicyStatus status);
- 
-   ///! test to see if setting a policy to a specific value is valid, when used
-   bool IsValidUsedPolicyStatus(cmPolicies::PolicyID id, 
-                                cmPolicies::PolicyStatus status);
- 
    ///! return a warning string for a given policy
    std::string GetPolicyWarning(cmPolicies::PolicyID id);
--- 76,79 ----
***************
*** 90,93 ****
--- 82,88 ----
    std::string GetRequiredPolicyError(cmPolicies::PolicyID id);
  
+   ///! return an error string for when a required policy is unspecified
+   std::string GetRequiredAlwaysPolicyError(cmPolicies::PolicyID id);
+ 
    ///! Get docs for policies
    void GetDocumentation(std::vector<cmDocumentationEntry>& v);
***************
*** 97,101 ****
    std::map<PolicyID,cmPolicy *> Policies;
    std::map<std::string,PolicyID> PolicyStringMap;
!   
  };
  
--- 92,99 ----
    std::map<PolicyID,cmPolicy *> Policies;
    std::map<std::string,PolicyID> PolicyStringMap;
! 
!   void DiagnoseAncientPolicies(std::vector<PolicyID> const& ancient,
!                                unsigned int majorVer, unsigned int minorVer,
!                                unsigned int patchVer, cmMakefile* mf);
  };
  

Index: cmGlobalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.cxx,v
retrieving revision 1.99.2.1
retrieving revision 1.99.2.2
diff -C 2 -d -r1.99.2.1 -r1.99.2.2
*** cmGlobalVisualStudio7Generator.cxx	1 May 2008 16:35:39 -0000	1.99.2.1
--- cmGlobalVisualStudio7Generator.cxx	3 Sep 2008 13:43:17 -0000	1.99.2.2
***************
*** 744,747 ****
--- 744,748 ----
    {"PrecompiledHeaderThrough", "Yu", "Precompiled Header Name", "",
     cmVS7FlagTable::UserValueRequired},
+   {"WholeProgramOptimization", "LTCG", "WholeProgramOptimization", "TRUE", 0},
  
    // Exception handling mode.  If no entries match, it will be FALSE.

Index: cmDocumentation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentation.cxx,v
retrieving revision 1.69.2.1
retrieving revision 1.69.2.2
diff -C 2 -d -r1.69.2.1 -r1.69.2.2
*** cmDocumentation.cxx	22 Jul 2008 18:04:24 -0000	1.69.2.1
--- cmDocumentation.cxx	3 Sep 2008 13:43:17 -0000	1.69.2.2
***************
*** 657,661 ****
  
  //----------------------------------------------------------------------------
! bool cmDocumentation::CheckOptions(int argc, const char* const* argv)
  {
    // Providing zero arguments gives usage information.
--- 657,662 ----
  
  //----------------------------------------------------------------------------
! bool cmDocumentation::CheckOptions(int argc, const char* const* argv,
!                                    const char* exitOpt)
  {
    // Providing zero arguments gives usage information.
***************
*** 674,677 ****
--- 675,682 ----
    for(int i=1; i < argc; ++i)
      {
+     if(exitOpt && strcmp(argv[i], exitOpt) == 0)
+       {
+       return result;
+       }
      RequestedHelpItem help;
      // Check if this is a supported help option.

Index: cmTargetLinkLibrariesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTargetLinkLibrariesCommand.h,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -C 2 -d -r1.15 -r1.15.2.1
*** cmTargetLinkLibrariesCommand.h	6 Feb 2008 20:23:36 -0000	1.15
--- cmTargetLinkLibrariesCommand.h	3 Sep 2008 13:43:18 -0000	1.15.2.1
***************
*** 65,83 ****
      {
      return
!       "  target_link_libraries(target library1\n"
!       "                        <debug | optimized | general> library2\n"
!       "                        ...)\n"
        "Specify a list of libraries to be linked into the specified target.  "
-       "The debug and optimized strings may be used to indicate that "
-       "the next library listed is to be used only for that specific "
-       "type of build. general indicates it is used for all build types "
-       "and is assumed if not specified.\n"
        "If any library name matches that of a target in the current project "
        "a dependency will automatically be added in the build system to make "
!       "sure the library being linked is up-to-date before the target links.";
      }
    
    cmTypeMacro(cmTargetLinkLibrariesCommand, cmCommand);
  private:
  };
  
--- 65,117 ----
      {
      return
!       "  target_link_libraries(<target> [lib1 [lib2 [...]]]\n"
!       "                        [[debug|optimized|general] <lib>] ...)\n"
        "Specify a list of libraries to be linked into the specified target.  "
        "If any library name matches that of a target in the current project "
        "a dependency will automatically be added in the build system to make "
!       "sure the library being linked is up-to-date before the target links."
!       "\n"
!       "A \"debug\", \"optimized\", or \"general\" keyword indicates that "
!       "the library immediately following it is to be used only for the "
!       "corresponding build configuration.  "
!       "The \"debug\" keyword corresponds to the Debug configuration.  "
!       "The \"optimized\" keyword corresponds to all other configurations.  "
!       "The \"general\" keyword corresponds to all configurations, and is "
!       "purely optional (assumed if omitted).  "
!       "Higher granularity may be achieved for per-configuration rules "
!       "by creating and linking to IMPORTED library targets.  "
!       "See the IMPORTED mode of the add_library command for more "
!       "information.  "
!       "\n"
!       "Library dependencies are transitive by default.  "
!       "When this target is linked into another target then the libraries "
!       "linked to this target will appear on the link line for the other "
!       "target too.  "
!       "See the LINK_INTERFACE_LIBRARIES target property to override the "
!       "set of transitive link dependencies for a target."
!       "\n"
!       "  target_link_libraries(<target> LINK_INTERFACE_LIBRARIES\n"
!       "                        [[debug|optimized|general] <lib>] ...)\n"
!       "The LINK_INTERFACE_LIBRARIES mode appends the libraries "
!       "to the LINK_INTERFACE_LIBRARIES and LINK_INTERFACE_LIBRARIES_DEBUG "
!       "target properties instead of using them for linking.  "
!       "Libraries specified as \"debug\" are appended to the "
!       "the LINK_INTERFACE_LIBRARIES_DEBUG property.  "
!       "Libraries specified as \"optimized\" are appended to the "
!       "the LINK_INTERFACE_LIBRARIES property.  "
!       "Libraries specified as \"general\" (or without any keyword) are "
!       "appended to both properties."
!       ;
      }
    
    cmTypeMacro(cmTargetLinkLibrariesCommand, cmCommand);
  private:
+   void LinkLibraryTypeSpecifierWarning(int left, int right);
+   static const char* LinkLibraryTypeNames[3];
+ 
+   cmTarget* Target;
+   bool DoingInterface;
+ 
+   void HandleLibrary(const char* lib, cmTarget::LinkLibraryType llt);
  };
  

Index: cmLocalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.h,v
retrieving revision 1.103
retrieving revision 1.103.2.1
diff -C 2 -d -r1.103 -r1.103.2.1
*** cmLocalGenerator.h	14 Feb 2008 20:31:08 -0000	1.103
--- cmLocalGenerator.h	3 Sep 2008 13:43:17 -0000	1.103.2.1
***************
*** 276,279 ****
--- 276,286 ----
    void GenerateAppleInfoPList(cmTarget* target, const char* targetName,
                                const char* fname);
+ 
+   /**
+    * Generate a Mac OS X framework Info.plist file.
+    */
+   void GenerateFrameworkInfoPList(cmTarget* target,
+                                   const char* targetName,
+                                   const char* fname);
  protected:
    /** Construct a comment for a custom command.  */
***************
*** 349,352 ****
--- 356,360 ----
    std::map<cmStdString, cmStdString> LanguageToIncludeFlags;
    std::map<cmStdString, cmStdString> UniqueObjectNamesMap;
+   std::string::size_type ObjectPathMax;
    bool WindowsShell;
    bool WindowsVSIDE;

Index: cmSetPropertyCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetPropertyCommand.cxx,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -C 2 -d -r1.6.2.1 -r1.6.2.2
*** cmSetPropertyCommand.cxx	2 Apr 2008 13:16:05 -0000	1.6.2.1
--- cmSetPropertyCommand.cxx	3 Sep 2008 13:43:18 -0000	1.6.2.2
***************
*** 272,275 ****
--- 272,278 ----
      }
  
+   // Check the resulting value.
+   target->CheckProperty(name, this->Makefile);
+ 
    return true;
  }

Index: cmSetTargetPropertiesCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetTargetPropertiesCommand.cxx,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C 2 -d -r1.9 -r1.9.2.1
*** cmSetTargetPropertiesCommand.cxx	28 Jan 2008 13:38:36 -0000	1.9
--- cmSetTargetPropertiesCommand.cxx	3 Sep 2008 13:43:18 -0000	1.9.2.1
***************
*** 104,107 ****
--- 104,108 ----
        target->SetProperty(propertyPairs[k].c_str(),
                            propertyPairs[k+1].c_str());
+       target->CheckProperty(propertyPairs[k].c_str(), mf);
        }
      }

Index: cmCMakePolicyCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCMakePolicyCommand.cxx,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -C 2 -d -r1.2.2.1 -r1.2.2.2
*** cmCMakePolicyCommand.cxx	24 Mar 2008 22:23:26 -0000	1.2.2.1
--- cmCMakePolicyCommand.cxx	3 Sep 2008 13:43:16 -0000	1.2.2.2
***************
*** 33,36 ****
--- 33,40 ----
      return this->HandleSetMode(args);
      }
+   else if(args[0] == "GET")
+     {
+     return this->HandleGetMode(args);
+     }
    else if(args[0] == "PUSH")
      {
***************
*** 105,108 ****
--- 109,169 ----
  
  //----------------------------------------------------------------------------
+ bool cmCMakePolicyCommand::HandleGetMode(std::vector<std::string> const& args)
+ {
+   if(args.size() != 3)
+     {
+     this->SetError("GET must be given exactly 2 additional arguments.");
+     return false;
+     }
+ 
+   // Get arguments.
+   std::string const& id = args[1];
+   std::string const& var = args[2];
+ 
+   // Lookup the policy number.
+   cmPolicies::PolicyID pid;
+   if(!this->Makefile->GetPolicies()->GetPolicyID(id.c_str(), pid))
+     {
+     cmOStringStream e;
+     e << "GET given policy \"" << id << "\" which is not known to this "
+       << "version of CMake.";
+     this->SetError(e.str().c_str());
+     return false;
+     }
+ 
+   // Lookup the policy setting.
+   cmPolicies::PolicyStatus status = this->Makefile->GetPolicyStatus(pid);
+   switch (status)
+     {
+     case cmPolicies::OLD:
+       // Report that the policy is set to OLD.
+       this->Makefile->AddDefinition(var.c_str(), "OLD");
+       break;
+     case cmPolicies::WARN:
+       // Report that the policy is not set.
+       this->Makefile->AddDefinition(var.c_str(), "");
+       break;
+     case cmPolicies::NEW:
+       // Report that the policy is set to NEW.
+       this->Makefile->AddDefinition(var.c_str(), "NEW");
+       break;
+     case cmPolicies::REQUIRED_IF_USED:
+     case cmPolicies::REQUIRED_ALWAYS:
+       // The policy is required to be set before anything needs it.
+       {
+       cmOStringStream e;
+       e << this->Makefile->GetPolicies()->GetRequiredPolicyError(pid)
+         << "\n"
+         << "The call to cmake_policy(GET " << id << " ...) at which this "
+         << "error appears requests the policy, and this version of CMake "
+         << "requires that the policy be set to NEW before it is checked.";
+       this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+       }
+     }
+ 
+   return true;
+ }
+ 
+ //----------------------------------------------------------------------------
  bool
  cmCMakePolicyCommand::HandleVersionMode(std::vector<std::string> const& args)

Index: cmComputeLinkDepends.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkDepends.cxx,v
retrieving revision 1.12.2.5
retrieving revision 1.12.2.6
diff -C 2 -d -r1.12.2.5 -r1.12.2.6
*** cmComputeLinkDepends.cxx	30 Jul 2008 18:54:49 -0000	1.12.2.5
--- cmComputeLinkDepends.cxx	3 Sep 2008 13:43:17 -0000	1.12.2.6
***************
*** 34,41 ****
  the string naming it.  A graph of dependencies is created in which
  each node corresponds to one item and directed eges lead from nodes to
! those which must *precede* them on the link line.  For example, the
  graph
  
!   C -> B -> A
  
  will lead to the link line order
--- 34,41 ----
  the string naming it.  A graph of dependencies is created in which
  each node corresponds to one item and directed eges lead from nodes to
! those which must *follow* them on the link line.  For example, the
  graph
  
!   A -> B -> C
  
  will lead to the link line order
***************
*** 51,55 ****
  names correspond to targets (built or imported) and those for which an
  old-style <item>_LIB_DEPENDS variable is defined.  All other items are
! unknown and we must infer dependencies for them.
  
  Known items have dependency lists ordered based on how the user
--- 51,57 ----
  names correspond to targets (built or imported) and those for which an
  old-style <item>_LIB_DEPENDS variable is defined.  All other items are
! unknown and we must infer dependencies for them.  For items that look
! like flags (beginning with '-') we trivially infer no dependencies,
! and do not include them in the dependencies of other items.
  
  Known items have dependency lists ordered based on how the user
***************
*** 64,72 ****
  The explicitly known dependencies form graph edges
  
!   X <- Y  ,  X <- A  ,  X <- B  ,  Y <- A  ,  Y <- B
  
  We can also infer the edge
  
!   A <- B
  
  because *every* time A appears B is seen on its right.  We do not know
--- 66,74 ----
  The explicitly known dependencies form graph edges
  
!   X -> Y  ,  X -> A  ,  X -> B  ,  Y -> A  ,  Y -> B
  
  We can also infer the edge
  
!   A -> B
  
  because *every* time A appears B is seen on its right.  We do not know
***************
*** 92,101 ****
  The explicit edges are
  
!   X <- Y  ,  X <- A  ,  X <- B  ,  X <- C  ,  Y <- A  ,  Y <- B  ,  Y <- C
  
  For the unknown items, we infer dependencies by looking at the
  "follow" sets:
  
!   A: intersect( {B,Y,C} , {C,B} ) = {B,C} ; infer edges  A <- B  ,  A <- C
    B: intersect( {Y,C}   , {}    ) = {}    ; infer no edges
    C: intersect( {}      , {B}   ) = {}    ; infer no edges
--- 94,103 ----
  The explicit edges are
  
!   X -> Y  ,  X -> A  ,  X -> B  ,  X -> C  ,  Y -> A  ,  Y -> B  ,  Y -> C
  
  For the unknown items, we infer dependencies by looking at the
  "follow" sets:
  
!   A: intersect( {B,Y,C} , {C,B} ) = {B,C} ; infer edges  A -> B  ,  A -> C
    B: intersect( {Y,C}   , {}    ) = {}    ; infer no edges
    C: intersect( {}      , {B}   ) = {}    ; infer no edges
***************
*** 106,160 ****
  ------------------------------------------------------------------------------
  
! Once the complete graph is formed from all known and inferred
! dependencies we must use it to produce a valid link line.  If the
! dependency graph were known to be acyclic a simple depth-first-search
! would produce a correct link line.  Unfortunately we cannot make this
! assumption so the following technique is used.
  
  The original graph is converted to a directed acyclic graph in which
  each node corresponds to a strongly connected component of the
  original graph.  For example, the dependency graph
  
!   X <- A <- B <- C <- A <- Y
  
  contains strongly connected components {X}, {A,B,C}, and {Y}.  The
  implied directed acyclic graph (DAG) is
  
!   {X} <- {A,B,C} <- {Y}
! 
! The final list of link items is constructed by a series of
! depth-first-searches through this DAG of components.  When visiting a
! component all outgoing edges are followed first because the neighbors
! must precede it.  Once neighbors across all edges have been emitted it
! is safe to emit the current component.
! 
! Trivial components (those with one item) are handled simply by
! emitting the item.  Non-trivial components (those with more than one
! item) are assumed to consist only of static libraries that may be
! safely repeated on the link line.  We emit members of the component
! multiple times (see code below for details).  The final link line for
! the example graph might be
  
!   X A B C A B C Y
  
  ------------------------------------------------------------------------------
  
! The initial exploration of dependencies using a BFS associates an
! integer index with each link item.  When the graph is built outgoing
! edges are sorted by this index.
  
! This preserves the original link order as much as possible subject to
! the dependencies.  We then further preserve the original link line by
! appending items to make sure all those that might be static libraries
! appear in the order and multiplicity that they do in the original
! line.
  
! After the initial exploration of the link interface tree, any
! transitive (dependent) shared libraries that were encountered and not
! included in the interface are processed in their own BFS.  This BFS
! follows only the dependent library lists and not the link interfaces.
! They are added to the link items with a mark indicating that the are
! transitive dependencies.  Then cmComputeLinkInformation deals with
! them on a per-platform basis.
  
  */
--- 108,176 ----
  ------------------------------------------------------------------------------
  
! The initial exploration of dependencies using a BFS associates an
! integer index with each link item.  When the graph is built outgoing
! edges are sorted by this index.
  
+ After the initial exploration of the link interface tree, any
+ transitive (dependent) shared libraries that were encountered and not
+ included in the interface are processed in their own BFS.  This BFS
+ follows only the dependent library lists and not the link interfaces.
+ They are added to the link items with a mark indicating that the are
+ transitive dependencies.  Then cmComputeLinkInformation deals with
+ them on a per-platform basis.
+ 
+ The complete graph formed from all known and inferred dependencies may
+ not be acyclic, so an acyclic version must be created.
  The original graph is converted to a directed acyclic graph in which
  each node corresponds to a strongly connected component of the
  original graph.  For example, the dependency graph
  
!   X -> A -> B -> C -> A -> Y
  
  contains strongly connected components {X}, {A,B,C}, and {Y}.  The
  implied directed acyclic graph (DAG) is
  
!   {X} -> {A,B,C} -> {Y}
  
! We then compute a topological order for the DAG nodes to serve as a
! reference for satisfying dependencies efficiently.  We perform the DFS
! in reverse order and assign topological order indices counting down so
! that the result is as close to the original BFS order as possible
! without violating dependencies.
  
  ------------------------------------------------------------------------------
  
! The final link entry order is constructed as follows.  We first walk
! through and emit the *original* link line as specified by the user.
! As each item is emitted, a set of pending nodes in the component DAG
! is maintained.  When a pending component has been completely seen, it
! is removed from the pending set and its dependencies (following edges
! of the DAG) are added.  A trivial component (those with one item) is
! complete as soon as its item is seen.  A non-trivial component (one
! with more than one item; assumed to be static libraries) is complete
! when *all* its entries have been seen *twice* (all entries seen once,
! then all entries seen again, not just each entry twice).  A pending
! component tracks which items have been seen and a count of how many
! times the component needs to be seen (once for trivial components,
! twice for non-trivial).  If at any time another component finishes and
! re-adds an already pending component, the pending component is reset
! so that it needs to be seen in its entirety again.  This ensures that
! all dependencies of a component are satisified no matter where it
! appears.
  
! After the original link line has been completed, we append to it the
! remaining pending components and their dependencies.  This is done by
! repeatedly emitting the first item from the first pending component
! and following the same update rules as when traversing the original
! link line.  Since the pending components are kept in topological order
! they are emitted with minimal repeats (we do not want to emit a
! component just to have it added again when another component is
! completed later).  This process continues until no pending components
! remain.  We know it will terminate because the component graph is
! guaranteed to be acyclic.
  
! The final list of items produced by this procedure consists of the
! original user link line followed by minimal additional items needed to
! satisfy dependencies.
  
  */
***************
*** 172,176 ****
  
    // The configuration being linked.
!   this->Config = config;
  
    // Enable debug mode if requested.
--- 188,192 ----
  
    // The configuration being linked.
!   this->Config = (config && *config)? config : 0;
  
    // Enable debug mode if requested.
***************
*** 179,182 ****
--- 195,201 ----
    // Assume no compatibility until set.
    this->OldLinkDirMode = false;
+ 
+   // No computation has been done.
+   this->CCG = 0;
  }
  
***************
*** 190,193 ****
--- 209,213 ----
      delete *i;
      }
+   delete this->CCG;
  }
  
***************
*** 243,247 ****
    // Compute the final ordering.
    this->OrderLinkEntires();
-   this->PreserveOriginalEntries();
  
    // Compute the final set of link entries.
--- 263,266 ----
***************
*** 293,297 ****
    LinkEntry& entry = this->EntryList[index];
    entry.Item = item;
!   entry.Target = this->Makefile->FindTargetToUse(entry.Item.c_str());
  
    // If the item has dependencies queue it to follow them.
--- 312,318 ----
    LinkEntry& entry = this->EntryList[index];
    entry.Item = item;
!   entry.Target = this->FindTargetToLink(entry.Item.c_str());
!   entry.IsFlag = (!entry.Target && item[0] == '-' && item[1] != 'l' &&
!                   item.substr(0, 10) != "-framework");
  
    // If the item has dependencies queue it to follow them.
***************
*** 313,317 ****
        this->BFSQueue.push(qe);
        }
!     else
        {
        // The item dependencies are not known.  We need to infer them.
--- 334,338 ----
        this->BFSQueue.push(qe);
        }
!     else if(!entry.IsFlag)
        {
        // The item dependencies are not known.  We need to infer them.
***************
*** 388,392 ****
      LinkEntry& entry = this->EntryList[lei->second];
      entry.Item = dep.Item;
!     entry.Target = this->Makefile->FindTargetToUse(dep.Item.c_str());
  
      // This item was added specifically because it is a dependent
--- 409,413 ----
      LinkEntry& entry = this->EntryList[lei->second];
      entry.Item = dep.Item;
!     entry.Target = this->FindTargetToLink(dep.Item.c_str());
  
      // This item was added specifically because it is a dependent
***************
*** 400,406 ****
    LinkEntry& entry = this->EntryList[index];
  
!   // This shared library dependency must be preceded by the item that
!   // listed it.
!   this->EntryConstraintGraph[index].push_back(dep.DependerIndex);
  
    // Target items may have their own dependencies.
--- 421,427 ----
    LinkEntry& entry = this->EntryList[index];
  
!   // This shared library dependency must follow the item that listed
!   // it.
!   this->EntryConstraintGraph[dep.DependerIndex].push_back(index);
  
    // Target items may have their own dependencies.
***************
*** 553,560 ****
      int dependee_index = this->AddLinkEntry(item);
  
!     // The depender must come before the dependee.
      if(depender_index >= 0)
        {
!       this->EntryConstraintGraph[dependee_index].push_back(depender_index);
        }
      else
--- 574,581 ----
      int dependee_index = this->AddLinkEntry(item);
  
!     // The dependee must come after the depender.
      if(depender_index >= 0)
        {
!       this->EntryConstraintGraph[depender_index].push_back(dependee_index);
        }
      else
***************
*** 573,576 ****
--- 594,598 ----
        // targets.
        if(!this->EntryList[dependee_index].Target &&
+          !this->EntryList[dependee_index].IsFlag &&
           dependee_index != dsi->first)
          {
***************
*** 656,659 ****
--- 678,700 ----
  
  //----------------------------------------------------------------------------
+ cmTarget* cmComputeLinkDepends::FindTargetToLink(const char* name)
+ {
+   // Look for a target.
+   cmTarget* tgt = this->Makefile->FindTargetToUse(name);
+ 
+   // Skip targets that will not really be linked.  This is probably a
+   // name conflict between an external library and an executable
+   // within the project.
+   if(tgt && tgt->GetType() == cmTarget::EXECUTABLE &&
+      !tgt->IsExecutableWithExports())
+     {
+     tgt = 0;
+     }
+ 
+   // Return the target found, if any.
+   return tgt;
+ }
+ 
+ //----------------------------------------------------------------------------
  void cmComputeLinkDepends::InferDependencies()
  {
***************
*** 688,692 ****
        {
        int dependee_index = *j;
!       this->EntryConstraintGraph[dependee_index].push_back(depender_index);
        }
      }
--- 729,733 ----
        {
        int dependee_index = *j;
!       this->EntryConstraintGraph[depender_index].push_back(dependee_index);
        }
      }
***************
*** 720,724 ****
      for(NodeList::const_iterator j = nl.begin(); j != nl.end(); ++j)
        {
!       e << "  item " << *j << " must precede it\n";
        }
      }
--- 761,765 ----
      for(NodeList::const_iterator j = nl.begin(); j != nl.end(); ++j)
        {
!       e << "  item " << *j << " must follow it\n";
        }
      }
***************
*** 734,752 ****
    // the BFS.  This should preserve the original order when no
    // constraints disallow it.
!   cmComputeComponentGraph ccg(this->EntryConstraintGraph);
!   Graph const& cgraph = ccg.GetComponentGraph();
    if(this->DebugMode)
      {
!     this->DisplayComponents(ccg);
      }
  
!   // Setup visit tracking.
!   this->ComponentVisited.resize(cgraph.size(), 0);
  
!   // The component graph is guaranteed to be acyclic.  Start a DFS
!   // from every entry.
!   for(unsigned int c=0; c < cgraph.size(); ++c)
      {
!     this->VisitComponent(ccg, c);
      }
  }
--- 775,818 ----
    // the BFS.  This should preserve the original order when no
    // constraints disallow it.
!   this->CCG = new cmComputeComponentGraph(this->EntryConstraintGraph);
! 
!   // The component graph is guaranteed to be acyclic.  Start a DFS
!   // from every entry to compute a topological order for the
!   // components.
!   Graph const& cgraph = this->CCG->GetComponentGraph();
!   int n = static_cast<int>(cgraph.size());
!   this->ComponentVisited.resize(cgraph.size(), 0);
!   this->ComponentOrder.resize(cgraph.size(), n);
!   this->ComponentOrderId = n;
!   // Run in reverse order so the topological order will preserve the
!   // original order where there are no constraints.
!   for(int c = n-1; c >= 0; --c)
!     {
!     this->VisitComponent(c);
!     }
! 
!   // Display the component graph.
    if(this->DebugMode)
      {
!     this->DisplayComponents();
      }
  
!   // Start with the original link line.
!   for(std::vector<int>::const_iterator i = this->OriginalEntries.begin();
!       i != this->OriginalEntries.end(); ++i)
!     {
!     this->VisitEntry(*i);
!     }
  
!   // Now explore anything left pending.  Since the component graph is
!   // guaranteed to be acyclic we know this will terminate.
!   while(!this->PendingComponents.empty())
      {
!     // Visit one entry from the first pending component.  The visit
!     // logic will update the pending components accordingly.  Since
!     // the pending components are kept in topological order this will
!     // not repeat one.
!     int e = *this->PendingComponents.begin()->second.Entries.begin();
!     this->VisitEntry(e);
      }
  }
***************
*** 754,761 ****
  //----------------------------------------------------------------------------
  void
! cmComputeLinkDepends::DisplayComponents(cmComputeComponentGraph const& ccg)
  {
    fprintf(stderr, "The strongly connected components are:\n");
!   std::vector<NodeList> const& components = ccg.GetComponents();
    for(unsigned int c=0; c < components.size(); ++c)
      {
--- 820,827 ----
  //----------------------------------------------------------------------------
  void
! cmComputeLinkDepends::DisplayComponents()
  {
    fprintf(stderr, "The strongly connected components are:\n");
!   std::vector<NodeList> const& components = this->CCG->GetComponents();
    for(unsigned int c=0; c < components.size(); ++c)
      {
***************
*** 768,771 ****
--- 834,844 ----
                this->EntryList[i].Item.c_str());
        }
+     NodeList const& ol = this->CCG->GetComponentGraphEdges(c);
+     for(NodeList::const_iterator oi = ol.begin(); oi != ol.end(); ++oi)
+       {
+       fprintf(stderr, "  followed by Component (%d)\n", *oi);
+       }
+     fprintf(stderr, "  topo order index %d\n",
+             this->ComponentOrder[c]);
      }
    fprintf(stderr, "\n");
***************
*** 773,779 ****
  
  //----------------------------------------------------------------------------
! void
! cmComputeLinkDepends::VisitComponent(cmComputeComponentGraph const& ccg,
!                                      unsigned int c)
  {
    // Check if the node has already been visited.
--- 846,850 ----
  
  //----------------------------------------------------------------------------
! void cmComputeLinkDepends::VisitComponent(unsigned int c)
  {
    // Check if the node has already been visited.
***************
*** 787,833 ****
  
    // Visit the neighbors of the component first.
!   NodeList const& nl = ccg.GetComponentGraphEdges(c);
!   for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
      {
!     this->VisitComponent(ccg, *ni);
      }
  
!   // Now that all items required to come before this one have been
!   // emmitted, emit this component's items.
!   this->EmitComponent(ccg.GetComponent(c));
  }
  
  //----------------------------------------------------------------------------
! void cmComputeLinkDepends::EmitComponent(NodeList const& nl)
  {
!   assert(!nl.empty());
  
!   // Handle trivial components.
!   if(nl.size() == 1)
      {
!     this->FinalLinkOrder.push_back(nl[0]);
!     return;
      }
  
!   // This is a non-trivial strongly connected component of the
!   // original graph.  It consists of two or more libraries (archives)
!   // that mutually require objects from one another.  In the worst
!   // case we may have to repeat the list of libraries as many times as
!   // there are object files in the biggest archive.  For now we just
!   // list them twice.
!   //
!   // The list of items in the component has been sorted by the order
!   // of discovery in the original BFS of dependencies.  This has the
!   // advantage that the item directly linked by a target requiring
!   // this component will come first which minimizes the number of
!   // repeats needed.
!   for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
      {
!     this->FinalLinkOrder.push_back(*ni);
      }
!   for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
      {
!     this->FinalLinkOrder.push_back(*ni);
      }
  }
  
--- 858,981 ----
  
    // Visit the neighbors of the component first.
!   // Run in reverse order so the topological order will preserve the
!   // original order where there are no constraints.
!   NodeList const& nl = this->CCG->GetComponentGraphEdges(c);
!   for(NodeList::const_reverse_iterator ni = nl.rbegin();
!       ni != nl.rend(); ++ni)
      {
!     this->VisitComponent(*ni);
      }
  
!   // Assign an ordering id to this component.
!   this->ComponentOrder[c] = --this->ComponentOrderId;
  }
  
  //----------------------------------------------------------------------------
! void cmComputeLinkDepends::VisitEntry(int index)
  {
!   // Include this entry on the link line.
!   this->FinalLinkOrder.push_back(index);
  
!   // This entry has now been seen.  Update its component.
!   bool completed = false;
!   int component = this->CCG->GetComponentMap()[index];
!   std::map<int, PendingComponent>::iterator mi =
!     this->PendingComponents.find(this->ComponentOrder[component]);
!   if(mi != this->PendingComponents.end())
      {
!     // The entry is in an already pending component.
!     PendingComponent& pc = mi->second;
! 
!     // Remove the entry from those pending in its component.
!     pc.Entries.erase(index);
!     if(pc.Entries.empty())
!       {
!       // The complete component has been seen since it was last needed.
!       --pc.Count;
! 
!       if(pc.Count == 0)
!         {
!         // The component has been completed.
!         this->PendingComponents.erase(mi);
!         completed = true;
!         }
!       else
!         {
!         // The whole component needs to be seen again.
!         NodeList const& nl = this->CCG->GetComponent(component);
!         assert(nl.size() > 1);
!         pc.Entries.insert(nl.begin(), nl.end());
!         }
!       }
      }
+   else
+     {
+     // The entry is not in an already pending component.
+     NodeList const& nl = this->CCG->GetComponent(component);
+     if(nl.size() > 1)
+       {
+       // This is a non-trivial component.  It is now pending.
+       PendingComponent& pc = this->MakePendingComponent(component);
  
!       // The starting entry has already been seen.
!       pc.Entries.erase(index);
!       }
!     else
!       {
!       // This is a trivial component, so it is already complete.
!       completed = true;
!       }
!     }
! 
!   // If the entry completed a component, the component's dependencies
!   // are now pending.
!   if(completed)
      {
!     NodeList const& ol = this->CCG->GetComponentGraphEdges(component);
!     for(NodeList::const_iterator oi = ol.begin(); oi != ol.end(); ++oi)
!       {
!       // This entire component is now pending no matter whether it has
!       // been partially seen already.
!       this->MakePendingComponent(*oi);
!       }
      }
! }
! 
! //----------------------------------------------------------------------------
! cmComputeLinkDepends::PendingComponent&
! cmComputeLinkDepends::MakePendingComponent(unsigned int component)
! {
!   // Create an entry (in topological order) for the component.
!   PendingComponent& pc =
!     this->PendingComponents[this->ComponentOrder[component]];
!   pc.Id = component;
!   NodeList const& nl = this->CCG->GetComponent(component);
! 
!   if(nl.size() == 1)
      {
!     // Trivial components need be seen only once.
!     pc.Count = 1;
!     }
!   else
!     {
!     // This is a non-trivial strongly connected component of the
!     // original graph.  It consists of two or more libraries
!     // (archives) that mutually require objects from one another.  In
!     // the worst case we may have to repeat the list of libraries as
!     // many times as there are object files in the biggest archive.
!     // For now we just list them twice.
!     //
!     // The list of items in the component has been sorted by the order
!     // of discovery in the original BFS of dependencies.  This has the
!     // advantage that the item directly linked by a target requiring
!     // this component will come first which minimizes the number of
!     // repeats needed.
!     pc.Count = 2;
      }
+ 
+   // Store the entries to be seen.
+   pc.Entries.insert(nl.begin(), nl.end());
+ 
+   return pc;
  }
  
***************
*** 863,867 ****
    // directories of targets linked in another configuration as link
    // directories.
!   if(cmTarget* tgt = this->Makefile->FindTargetToUse(item.c_str()))
      {
      if(!tgt->IsImported())
--- 1011,1015 ----
    // directories of targets linked in another configuration as link
    // directories.
!   if(cmTarget* tgt = this->FindTargetToLink(item.c_str()))
      {
      if(!tgt->IsImported())
***************
*** 871,918 ****
      }
  }
- 
- //----------------------------------------------------------------------------
- void cmComputeLinkDepends::PreserveOriginalEntries()
- {
-   // Skip the part of the input sequence that already appears in the
-   // output.
-   std::vector<int>::const_iterator in = this->OriginalEntries.begin();
-   std::vector<int>::const_iterator out = this->FinalLinkOrder.begin();
-   while(in != this->OriginalEntries.end() &&
-         out != this->FinalLinkOrder.end())
-     {
-     cmTarget* tgt = this->EntryList[*in].Target;
-     if(tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY)
-       {
-       // Skip input items known to not be static libraries.
-       ++in;
-       }
-     else if(*in == *out)
-       {
-       // The input and output items match.  Move on to the next items.
-       ++in;
-       ++out;
-       }
-     else
-       {
-       // The output item does not match the next input item.  Skip it.
-       ++out;
-       }
-     }
- 
-   // Append the part of the input sequence that does not already
-   // appear in the output.
-   while(in != this->OriginalEntries.end())
-     {
-     cmTarget* tgt = this->EntryList[*in].Target;
-     if(tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY)
-       {
-       // Skip input items known to not be static libraries.
-       ++in;
-       }
-     else
-       {
-       this->FinalLinkOrder.push_back(*in++);
-       }
-     }
- }
--- 1019,1020 ----

Index: cmMakefile.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.h,v
retrieving revision 1.230.2.3
retrieving revision 1.230.2.4
diff -C 2 -d -r1.230.2.3 -r1.230.2.4
*** cmMakefile.h	30 Jun 2008 20:10:36 -0000	1.230.2.3
--- cmMakefile.h	3 Sep 2008 13:43:18 -0000	1.230.2.4
***************
*** 901,904 ****
--- 901,905 ----
                     cmPolicies::PolicyStatus> PolicyMap;
    std::vector<PolicyMap> PolicyStack;
+   cmPolicies::PolicyStatus GetPolicyStatusInternal(cmPolicies::PolicyID id);
  
    bool CheckCMP0000;

Index: cmExtraCodeBlocksGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExtraCodeBlocksGenerator.cxx,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -C 2 -d -r1.18 -r1.18.2.1
*** cmExtraCodeBlocksGenerator.cxx	25 Nov 2007 12:45:18 -0000	1.18
--- cmExtraCodeBlocksGenerator.cxx	3 Sep 2008 13:43:17 -0000	1.18.2.1
***************
*** 94,99 ****
  
  
! /* create the project file, if it already exists, merge it with the
! existing one, otherwise create a new one */
  void cmExtraCodeBlocksGenerator::CreateProjectFile(
                                       const std::vector<cmLocalGenerator*>& lgs)
--- 94,98 ----
  
  
! /* create the project file */
  void cmExtraCodeBlocksGenerator::CreateProjectFile(
                                       const std::vector<cmLocalGenerator*>& lgs)
***************
*** 101,105 ****
    const cmMakefile* mf=lgs[0]->GetMakefile();
    std::string outputDir=mf->GetStartOutputDirectory();
-   std::string projectDir=mf->GetHomeDirectory();
    std::string projectName=mf->GetProjectName();
  
--- 100,103 ----
***************
*** 109,122 ****
    sessionFilename+=projectName+".layout";
  
! /*  if (cmSystemTools::FileExists(filename.c_str()))
!     {
!     this->MergeProjectFiles(outputDir, projectDir, filename,
!                             cmakeFilePattern, sessionFilename);
!     }
!   else */
!     {
!     this->CreateNewProjectFile(lgs, filename);
!     }
! 
  }
  
--- 107,111 ----
    sessionFilename+=projectName+".layout";
  
!   this->CreateNewProjectFile(lgs, filename);
  }
  

Index: cmDocumentVariables.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentVariables.cxx,v
retrieving revision 1.18.2.2
retrieving revision 1.18.2.3
diff -C 2 -d -r1.18.2.2 -r1.18.2.3
*** cmDocumentVariables.cxx	22 Jul 2008 18:04:24 -0000	1.18.2.2
--- cmDocumentVariables.cxx	3 Sep 2008 13:43:17 -0000	1.18.2.3
***************
*** 737,740 ****
--- 737,758 ----
       "Variables That Describe the System");
  
+   cm->DefineProperty
+     ("CMAKE_OBJECT_PATH_MAX", cmProperty::VARIABLE,
+      "Maximum object file full-path length allowed by native build tools.",
+      "CMake computes for every source file an object file name that is "
+      "unique to the source file and deterministic with respect to the "
+      "full path to the source file.  "
+      "This allows multiple source files in a target to share the same name "
+      "if they lie in different directories without rebuilding when one is "
+      "added or removed.  "
+      "However, it can produce long full paths in a few cases, so CMake "
+      "shortens the path using a hashing scheme when the full path to an "
+      "object file exceeds a limit.  "
+      "CMake has a built-in limit for each platform that is sufficient for "
+      "common tools, but some native tools may have a lower limit.  "
+      "This variable may be set to specify the limit explicitly.  "
+      "The value must be an integer no less than 128.",false,
+      "Variables That Describe the System");
+ 
    // Variables that affect the building of object files and 
    // targets.

Index: cmComputeTargetDepends.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeTargetDepends.cxx,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C 2 -d -r1.2 -r1.2.2.1
*** cmComputeTargetDepends.cxx	7 Feb 2008 21:14:05 -0000	1.2
--- cmComputeTargetDepends.cxx	3 Sep 2008 13:43:17 -0000	1.2.2.1
***************
*** 215,219 ****
      if(emitted.insert(lib->first).second)
        {
!       this->AddTargetDepend(depender_index, lib->first.c_str());
        }
      }
--- 215,219 ----
      if(emitted.insert(lib->first).second)
        {
!       this->AddTargetDepend(depender_index, lib->first.c_str(), true);
        }
      }
***************
*** 227,231 ****
      if(emitted.insert(*util).second)
        {
!       this->AddTargetDepend(depender_index, util->c_str());
        }
      }
--- 227,231 ----
      if(emitted.insert(*util).second)
        {
!       this->AddTargetDepend(depender_index, util->c_str(), false);
        }
      }
***************
*** 234,238 ****
  //----------------------------------------------------------------------------
  void cmComputeTargetDepends::AddTargetDepend(int depender_index,
!                                              const char* dependee_name)
  {
    // Get the depender.
--- 234,239 ----
  //----------------------------------------------------------------------------
  void cmComputeTargetDepends::AddTargetDepend(int depender_index,
!                                              const char* dependee_name,
!                                              bool linking)
  {
    // Get the depender.
***************
*** 249,252 ****
--- 250,263 ----
      }
  
+   // Skip targets that will not really be linked.  This is probably a
+   // name conflict between an external library and an executable
+   // within the project.
+   if(linking && dependee &&
+      dependee->GetType() == cmTarget::EXECUTABLE &&
+      !dependee->IsExecutableWithExports())
+     {
+     dependee = 0;
+     }
+ 
    // If not found then skip then the dependee.
    if(!dependee)
***************
*** 366,370 ****
  
      // Describe the depender.
!     e << "  " << depender->GetName() << " of type "
        << cmTarget::TargetTypeNames[depender->GetType()] << "\n";
  
--- 377,381 ----
  
      // Describe the depender.
!     e << "  \"" << depender->GetName() << "\" of type "
        << cmTarget::TargetTypeNames[depender->GetType()] << "\n";
  
***************
*** 377,381 ****
          {
          cmTarget* dependee = this->Targets[j];
!         e << "    depends on " << dependee->GetName() << "\n";
          }
        }
--- 388,392 ----
          {
          cmTarget* dependee = this->Targets[j];
!         e << "    depends on \"" << dependee->GetName() << "\"\n";
          }
        }

Index: cmFileCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFileCommand.h,v
retrieving revision 1.35.2.2
retrieving revision 1.35.2.3
diff -C 2 -d -r1.35.2.2 -r1.35.2.3
*** cmFileCommand.h	1 May 2008 16:35:39 -0000	1.35.2.2
--- cmFileCommand.h	3 Sep 2008 13:43:17 -0000	1.35.2.3
***************
*** 78,82 ****
        "  file(GLOB variable [RELATIVE path] [globbing expressions]...)\n"
        "  file(GLOB_RECURSE variable [RELATIVE path] \n"
!       "       [globbing expressions]...)\n"
        "  file(REMOVE [file1 ...])\n"
        "  file(REMOVE_RECURSE [file1 ...])\n"
--- 78,82 ----
        "  file(GLOB variable [RELATIVE path] [globbing expressions]...)\n"
        "  file(GLOB_RECURSE variable [RELATIVE path] \n"
!       "       [RECURSE_SYMLINKS_OFF] [globbing expressions]...)\n"
        "  file(REMOVE [file1 ...])\n"
        "  file(REMOVE_RECURSE [file1 ...])\n"
***************
*** 127,131 ****
        "GLOB_RECURSE will generate similar list as the regular GLOB, except "
        "it will traverse all the subdirectories of the matched directory and "
!       "match the files.\n"
        "Examples of recursive globbing include:\n"
        "   /dir/*.py  - match all python files in /dir and subdirectories\n"
--- 127,133 ----
        "GLOB_RECURSE will generate similar list as the regular GLOB, except "
        "it will traverse all the subdirectories of the matched directory and "
!       "match the files. Subdirectories that are symlinks are traversed by "
!       "default to match the behavior of older CMake releases. Use "
!       "RECURSE_SYMLINKS_OFF to prevent recursion through symlinks.\n"
        "Examples of recursive globbing include:\n"
        "   /dir/*.py  - match all python files in /dir and subdirectories\n"

Index: cmXCodeObject.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmXCodeObject.h,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -C 2 -d -r1.18 -r1.18.2.1
*** cmXCodeObject.h	27 Jul 2007 14:55:24 -0000	1.18
--- cmXCodeObject.h	3 Sep 2008 13:43:18 -0000	1.18.2.1
***************
*** 148,151 ****
--- 148,153 ----
    void SetComment(const char* c) { this->Comment = c;}
  protected:
+   void PrintString(std::ostream& os) const;
+ 
    cmTarget* Target;
    Type TypeValue;

Index: cmComputeLinkInformation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkInformation.cxx,v
retrieving revision 1.24.2.9
retrieving revision 1.24.2.10
diff -C 2 -d -r1.24.2.9 -r1.24.2.10
*** cmComputeLinkInformation.cxx	30 Jul 2008 18:54:49 -0000	1.24.2.9
--- cmComputeLinkInformation.cxx	3 Sep 2008 13:43:17 -0000	1.24.2.10
***************
*** 582,589 ****
      }
  
!   if(tgt && (tgt->GetType() == cmTarget::STATIC_LIBRARY ||
!              tgt->GetType() == cmTarget::SHARED_LIBRARY ||
!              tgt->GetType() == cmTarget::MODULE_LIBRARY ||
!              impexe))
      {
      // This is a CMake target.  Ask the target for its real name.
--- 582,586 ----
      }
  
!   if(tgt && tgt->IsLinkable())
      {
      // This is a CMake target.  Ask the target for its real name.
***************
*** 1556,1559 ****
--- 1553,1564 ----
                                                  cmTarget* target)
  {
+   // Libraries with unknown type must be handled using just the file
+   // on disk.
+   if(target->GetType() == cmTarget::UNKNOWN_LIBRARY)
+     {
+     this->AddLibraryRuntimeInfo(fullPath);
+     return;
+     }
+ 
    // Skip targets that are not shared libraries (modules cannot be linked).
    if(target->GetType() != cmTarget::SHARED_LIBRARY)



More information about the Cmake-commits mailing list