[Cmake-commits] CMake branch, next, updated. v2.8.6-2041-ga3860c3

Stephen Kelly steveire at gmail.com
Sun Nov 27 18:18:19 EST 2011


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

The branch, next has been updated
       via  a3860c3931afde8695a962b7c9eb89bbd0827a25 (commit)
       via  539b0bb291dfd8469cd2018086d1a8fe55dd24c4 (commit)
       via  0793aec135dc5656540c6ad760ed39ee9c473d69 (commit)
       via  107f86876d675b353499b0166ac32f4894c69499 (commit)
       via  b7f961713a20bae65ce679abdfd77becea1c88f5 (commit)
       via  a075af5432c6e7405d24c5932b4243fc737ddd79 (commit)
       via  e49e2def771098cb1dce0a779c2d9da27b9b300e (commit)
       via  4a14e8cafd42828d4e1f15f808441441e8cacecc (commit)
       via  0adb88e0478e2470df266220ab2ef15490049d41 (commit)
       via  6fc5414acaa1e78e9eec0296477fd9693b08824f (commit)
       via  280c9a2f1a3016adb4cad38f0fb4320491e8b05d (commit)
       via  f94db2e1103404461920a274b79ffa48bf18215e (commit)
       via  81f8c3b090731ef3f6e65c6a8f3be02ff36a266d (commit)
      from  a95cfcaa54507b7ab2c223a951d18ed3fc92ced1 (commit)

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

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a3860c3931afde8695a962b7c9eb89bbd0827a25
commit a3860c3931afde8695a962b7c9eb89bbd0827a25
Merge: a95cfca 539b0bb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Nov 27 18:18:16 2011 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Nov 27 18:18:16 2011 -0500

    Merge topic 'target-include-directories' into next
    
    539b0bb Remove this feature to make space for the rewrite.
    0793aec Hack to workaround caching of flags per directory.
    107f868 Convert to a simple loop.
    b7f9617 Add the target_include_directories command.
    a075af5 Fix trailing whitespace.
    e49e2de Add API for adding to the target include directories.
    4a14e8c Add API to get the include directories from the before segment.
    0adb88e Make it possible to split the include directories.
    6fc5414 Populate separate vectors for config dependent includes.
    280c9a2 Extract and use the INCLUDE_DIRECTORIES target properties.
    f94db2e Exit the loop when we have determined the language.
    81f8c3b Trim trailing whitespace.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=539b0bb291dfd8469cd2018086d1a8fe55dd24c4
commit 539b0bb291dfd8469cd2018086d1a8fe55dd24c4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 28 00:16:19 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Nov 28 00:16:19 2011 +0100

    Remove this feature to make space for the rewrite.

diff --git a/Source/cmBootstrapCommands.cxx b/Source/cmBootstrapCommands.cxx
index b6406e1..cb5dc4c 100644
--- a/Source/cmBootstrapCommands.cxx
+++ b/Source/cmBootstrapCommands.cxx
@@ -87,7 +87,6 @@
 #include "cmSiteNameCommand.cxx"
 #include "cmStringCommand.cxx"
 #include "cmSubdirCommand.cxx"
-#include "cmTargetIncludeDirectoriesCommand.cxx"
 #include "cmTargetLinkLibrariesCommand.cxx"
 #include "cmTryCompileCommand.cxx"
 #include "cmTryRunCommand.cxx"
@@ -161,7 +160,6 @@ void GetBootstrapCommands(std::list<cmCommand*>& commands)
   commands.push_back(new cmSiteNameCommand);
   commands.push_back(new cmStringCommand);
   commands.push_back(new cmSubdirCommand);
-  commands.push_back(new cmTargetIncludeDirectoriesCommand);
   commands.push_back(new cmTargetLinkLibrariesCommand);
   commands.push_back(new cmTryCompileCommand);
   commands.push_back(new cmTryRunCommand);
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 50e000b..ffbeb48 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -574,11 +574,7 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
   std::string flags;
   flags += this->Makefile->GetSafeDefinition(varString.c_str());
   flags += " ";
-    {
-    std::vector<std::string> includes;
-    this->GetIncludeDirectories(includes, lang);
-    flags += this->GetIncludeFlags(includes, lang);
-    }
+  flags += this->GetIncludeFlags(lang);
   flags += this->Makefile->GetDefineFlags();
 
   // Construct the command lines.
@@ -1196,8 +1192,8 @@ cmLocalGenerator::ConvertToIncludeReference(std::string const& path)
 }
 
 //----------------------------------------------------------------------------
-const char* cmLocalGenerator::GetIncludeFlags(const std::vector<std::string> &includes,
-                                              const char* lang, bool forResponseFile)
+const char* cmLocalGenerator::GetIncludeFlags(const char* lang,
+                                              bool forResponseFile)
 {
   if(!lang)
     {
@@ -1207,10 +1203,13 @@ const char* cmLocalGenerator::GetIncludeFlags(const std::vector<std::string> &in
   key += forResponseFile? "@" : "";
   if(this->LanguageToIncludeFlags.count(key))
     {
-//     return this->LanguageToIncludeFlags[key].c_str();
+    return this->LanguageToIncludeFlags[key].c_str();
     }
 
   cmOStringStream includeFlags;
+  std::vector<std::string> includes;
+  this->GetIncludeDirectories(includes, lang);
+  std::vector<std::string>::iterator i;
 
   std::string flagVar = "CMAKE_INCLUDE_FLAG_";
   flagVar += lang;
@@ -1252,7 +1251,6 @@ const char* cmLocalGenerator::GetIncludeFlags(const std::vector<std::string> &in
 #ifdef __APPLE__
   emitted.insert("/System/Library/Frameworks");
 #endif
-  std::vector<std::string>::const_iterator i;
   for(i = includes.begin(); i != includes.end(); ++i)
     {
     if(this->Makefile->IsOn("APPLE")
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 7e737ef..0c5b9d0 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -146,8 +146,8 @@ public:
   ///! Append flags to a string.
   virtual void AppendFlags(std::string& flags, const char* newFlags);
   ///! Get the include flags for the current makefile and language
-  const char* GetIncludeFlags(const std::vector<std::string> &includes,
-                              const char* lang, bool forResponseFile = false);
+  const char* GetIncludeFlags(const char* lang,
+                              bool forResponseFile = false);
 
   /**
    * Encode a list of preprocessor definitions for the compiler
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index e3c73c7..8b91194 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -275,7 +275,7 @@ std::string cmMakefileTargetGenerator::GetFlags(const std::string &l)
     // Add shared-library flags if needed.
     this->LocalGenerator->AddSharedFlags(flags, lang, shared);
 
-    // Add include directory and target include flags.
+    // Add include directory flags.
     this->AddIncludeFlags(flags, lang);
 
     // Append old-style preprocessor definition flags.
@@ -1812,14 +1812,8 @@ void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags,
   responseVar += "_USE_RESPONSE_FILE_FOR_INCLUDES";
   bool useResponseFile = this->Makefile->IsOn(responseVar.c_str());
 
-
-  std::vector<std::string> includes;
-  this->Target->GetIncludeDirectoriesBefore(includes, this->ConfigName);
-  this->LocalGenerator->GetIncludeDirectories(includes, lang);
-  this->Target->GetIncludeDirectories(includes, this->ConfigName);
-
   std::string includeFlags =
-    this->LocalGenerator->GetIncludeFlags(includes, lang, useResponseFile);
+    this->LocalGenerator->GetIncludeFlags(lang, useResponseFile);
   if(includeFlags.empty())
     {
     return;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index dc1d4a0..f7d3ba9 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -25,7 +25,6 @@
 #include <queue>
 #include <stdlib.h> // required for atof
 #include <assert.h>
-#include <numeric> // For std::accumulate
 
 const char* cmTarget::GetTargetTypeName(TargetType targetType)
 {
@@ -133,7 +132,6 @@ cmTarget::cmTarget()
   this->HaveInstallRule = false;
   this->DLLPlatform = false;
   this->IsImportedTarget = false;
-  this->DirectoriesBeforeOffset = 0;
 }
 
 //----------------------------------------------------------------------------
@@ -4611,185 +4609,6 @@ cmTarget::GetLinkInformation(const char* config)
   return i->second;
 }
 
-void cmTarget::AddIncludeDirectory(const char* inc, bool before, const char *config)
-{
-  // if there is a newline then break it into multiple arguments
-  if (!inc)
-    {
-    return;
-    }
-
-  std::string propertyName = "INCLUDE_DIRECTORIES";
-  std::string configTypeUpper;
-
-  if (config)
-    {
-    propertyName += "_";
-    configTypeUpper = cmSystemTools::UpperCase(config);
-    propertyName += configTypeUpper;
-    }
-
-  std::vector<std::string> IncludeDirectories;
-  const char *incs = this->GetProperty(propertyName.c_str());
-  if (incs)
-    {
-    cmSystemTools::ExpandListArgument(incs, IncludeDirectories);
-    }
-
-  // Don't add an include directory that is already present.  Yes,
-  // this linear search results in n^2 behavior, but n won't be
-  // getting much bigger than 20.  We cannot use a set because of
-  // order dependency of the include path.
-  std::vector<std::string>::iterator i =
-    std::find(IncludeDirectories.begin(),
-              IncludeDirectories.end(), inc);
-
-  if(i == IncludeDirectories.end())
-    {
-    if (before)
-      {
-      // WARNING: this *is* expensive (linear time) since it's a vector
-      IncludeDirectories.insert(IncludeDirectories.begin(), inc);
-      ++(config ? this->ConfigDirectories[configTypeUpper] : this->DirectoriesBeforeOffset);
-      }
-    else
-      {
-      IncludeDirectories.push_back(inc);
-      }
-    }
-  else
-    {
-    if(before)
-      {
-      // Find it. If it's before (config ? this->ConfigDirectories[configTypeUpper] : this->DirectoriesBeforeOffset)'
-      // Then don't change that variable. Otherwise increase it.
-
-      std::vector<std::string>::iterator endOfBefore = IncludeDirectories.begin()
-                  + (config ? this->ConfigDirectories[configTypeUpper] : this->DirectoriesBeforeOffset);
-      if (i > endOfBefore)
-        ++(config ? this->ConfigDirectories[configTypeUpper] : this->DirectoriesBeforeOffset);
-
-      // if this before and already in the path then remove it
-      IncludeDirectories.erase(i);
-      // WARNING: this *is* expensive (linear time) since it's a vector
-      IncludeDirectories.insert(IncludeDirectories.begin(), inc);
-      }
-    }
-  // TODO: Store the vector in cmTarget instead of all this conversion
-  std::vector<std::string>::iterator dirs = IncludeDirectories.begin();
-  std::string propertyValue = *dirs;
-  ++dirs;
-  while(dirs != IncludeDirectories.end())
-    {
-    propertyValue += std::string(";") + *dirs;
-    ++dirs;
-    }
-  this->SetProperty(propertyName.c_str(), propertyValue.c_str());
-}
-
-void cmTarget::GetIncludeDirectoriesBefore(std::vector<std::string> &includes, const char* config)
-{
-  std::string configTypeUpper;
-  if (config)
-    {
-    configTypeUpper = cmSystemTools::UpperCase(config);
-    }
-  std::vector<std::string> targetIncludes;
-  const char *incs = this->GetProperty("INCLUDE_DIRECTORIES");
-  if (incs)
-    {
-    cmSystemTools::ExpandListArgument(incs, targetIncludes);
-    }
-
-  std::string defPropName = "INCLUDE_DIRECTORIES_";
-  defPropName += configTypeUpper;
-
-  std::vector<std::string> configTargetIncludes;
-  const char* config_incs = this->GetProperty(defPropName.c_str());
-  if (config_incs)
-    {
-    cmSystemTools::ExpandListArgument(config_incs, configTargetIncludes);
-    }
-
-  std::set<cmStdString> emitted;
-  for(std::vector<std::string>::const_iterator
-        li = includes.begin(); li != includes.end(); ++li)
-    {
-      emitted.insert(*li);
-    }
-
-  for(std::vector<std::string>::const_iterator li = targetIncludes.begin();
-        li != targetIncludes.end() && li != targetIncludes.begin() + this->DirectoriesBeforeOffset + 1; ++li)
-    {
-    if (emitted.insert(*li).second)
-      {
-        includes.push_back(*li);
-      }
-    }
-
-  for(std::vector<std::string>::const_iterator li = configTargetIncludes.begin();
-        li != configTargetIncludes.end() && li != configTargetIncludes.begin() + this->ConfigDirectories[configTypeUpper] + 1; ++li)
-    {
-    if (emitted.insert(*li).second)
-      {
-        includes.push_back(*li);
-      }
-    }
-}
-
-void cmTarget::GetIncludeDirectories(std::vector<std::string> &includes, const char* config)
-{
-  std::vector<std::string> targetIncludes;
-  const char *incs = this->GetProperty("INCLUDE_DIRECTORIES");
-  if (incs)
-    {
-    cmSystemTools::ExpandListArgument(incs, targetIncludes);
-    }
-
-  std::string configTypeUpper;
-  if (config)
-    {
-    configTypeUpper = cmSystemTools::UpperCase(config);
-    }
-
-  std::string defPropName = "INCLUDE_DIRECTORIES_";
-  defPropName += configTypeUpper;
-
-  std::vector<std::string> configTargetIncludes;
-  const char* config_incs = this->GetProperty(defPropName.c_str());
-  if (config_incs)
-    {
-    cmSystemTools::ExpandListArgument(config_incs, configTargetIncludes);
-    }
-
-  std::set<cmStdString> emitted;
-  for(std::vector<std::string>::const_iterator
-        li = includes.begin(); li != includes.end(); ++li)
-    {
-      emitted.insert(*li);
-    }
-
-  for(std::vector<std::string>::const_iterator
-        li = targetIncludes.begin() + this->DirectoriesBeforeOffset;
-        li != targetIncludes.end(); ++li)
-    {
-    if (emitted.insert(*li).second)
-      {
-        includes.push_back(*li);
-      }
-    }
-
-  for(std::vector<std::string>::const_iterator
-        li = configTargetIncludes.begin() + this->ConfigDirectories[configTypeUpper];
-        li != configTargetIncludes.end(); ++li)
-    {
-    if (emitted.insert(*li).second)
-      {
-        includes.push_back(*li);
-      }
-    }
-}
-
 //----------------------------------------------------------------------------
 cmTargetLinkInformationMap
 ::cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r): derived()
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 445d237..0abdddb 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -450,14 +450,6 @@ public:
       directory.  */
   bool UsesDefaultOutputDir(const char* config, bool implib);
 
-  void GetIncludeDirectoriesBefore(std::vector<std::string> &includes, const char *config);
-  void GetIncludeDirectories(std::vector<std::string> &includes, const char *config);
-
-  /**
-   * Add an include directory to the build for this target.
-   */
-  void AddIncludeDirectory(const char*, bool before = false, const char *config = 0);
-
 private:
   /**
    * A list of direct dependencies. Use in conjunction with DependencyMap.
@@ -566,8 +558,6 @@ private:
   LinkLibraryVectorType OriginalLinkLibraries;
   bool DLLPlatform;
   bool IsImportedTarget;
-  std::vector<std::string>::difference_type DirectoriesBeforeOffset;
-  std::map<cmStdString, std::vector<std::string>::difference_type> ConfigDirectories;
 
   // Cache target output paths for each configuration.
   struct OutputInfo;
diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx
deleted file mode 100644
index d1ca672..0000000
--- a/Source/cmTargetIncludeDirectoriesCommand.cxx
+++ /dev/null
@@ -1,129 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2011 Stephen Kelly <steveire at gmail.com>
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#include "cmTargetIncludeDirectoriesCommand.h"
-
-
-// cmTargetIncludeDirectoriesCommand
-bool cmTargetIncludeDirectoriesCommand
-::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
-{
-  if(args.size() < 1 )
-    {
-    return true;
-    }
-
-  std::vector<std::string>::const_iterator i = args.begin();
-
-  // Lookup the target for which libraries are specified.
-  this->Target =
-    this->Makefile->GetCMakeInstance()
-    ->GetGlobalGenerator()->FindTarget(0, i->c_str());
-  if(!this->Target)
-    {
-    cmake::MessageType t = cmake::FATAL_ERROR;  // fail by default
-    cmOStringStream e;
-    e << "Cannot specify link libraries for target \"" << args[0] << "\" "
-      << "which is not built by this project.";
-    }
-
-  ++i;
-
-  bool before = this->Makefile->IsOn("CMAKE_TARGET_INCLUDE_DIRECTORIES_BEFORE");
-
-  if ((*i) == "BEFORE")
-    {
-    before = true;
-    ++i;
-    }
-  else if ((*i) == "AFTER")
-    {
-    before = false;
-    ++i;
-    }
-
-  const char *config = 0;
-  if ((*i) == "CONFIG_TYPE")
-    {
-    ++i;
-    config = i->c_str();
-    ++i;
-    }
-
-  for(; i != args.end(); ++i)
-    {
-    if(i->size() == 0)
-      {
-      this->SetError("given empty-string as include directory.");
-      return false;
-      }
-    this->AddDirectory(i->c_str(), before, config);
-    }
-  return true;
-}
-
-// do a lot of cleanup on the arguments because this is one place where folks
-// sometimes take the output of a program and pass it directly into this
-// command not thinking that a single argument could be filled with spaces
-// and newlines etc liek below:
-//
-// "   /foo/bar
-//    /boo/hoo /dingle/berry "
-//
-// ideally that should be three separate arguments but when sucking the
-// output from a program and passing it into a command the cleanup doesn't
-// always happen
-//
-void cmTargetIncludeDirectoriesCommand::AddDirectory(const char *i,
-                                             bool before, const char *config)
-{
-  // break apart any line feed arguments
-  std::string ret = i;
-  std::string::size_type pos = 0;
-  if((pos = ret.find('\n', pos)) != std::string::npos)
-    {
-    if (pos)
-      {
-      this->AddDirectory(ret.substr(0,pos).c_str(), before, config);
-      }
-    if (ret.size()-pos-1)
-      {
-      this->AddDirectory(ret.substr(pos+1,ret.size()-pos-1).c_str(),
-                         before, config);
-      }
-    return;
-    }
-
-  // remove any leading or trailing spaces and \r
-  std::string::size_type b = ret.find_first_not_of(" \r");
-  std::string::size_type e = ret.find_last_not_of(" \r");
-  if ((b!=ret.npos) && (e!=ret.npos))
-    {
-    ret.assign(ret, b, 1+e-b);   // copy the remaining substring
-    }
-  else
-    {
-    return;         // if we get here, we had only whitespace in the string
-    }
-
-  if (!cmSystemTools::IsOff(ret.c_str()))
-    {
-    cmSystemTools::ConvertToUnixSlashes(ret);
-    if(!cmSystemTools::FileIsFullPath(ret.c_str()))
-      {
-      std::string tmp = this->Makefile->GetStartDirectory();
-      tmp += "/";
-      tmp += ret;
-      ret = tmp;
-      }
-    }
-  this->Target->AddIncludeDirectory(ret.c_str(), before, config);
-}
diff --git a/Source/cmTargetIncludeDirectoriesCommand.h b/Source/cmTargetIncludeDirectoriesCommand.h
deleted file mode 100644
index 005cb76..0000000
--- a/Source/cmTargetIncludeDirectoriesCommand.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2011 Stephen Kelly <steveire at gmail.com>
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#ifndef cmTargetIncludeDirectoriesCommand_h
-#define cmTargetIncludeDirectoriesCommand_h
-
-#include "cmCommand.h"
-
-/** \class cmTargetIncludeDirectoriesCommand
- * \brief Add include directories to the build for a particular target.
- *
- * cmIncludeDirectoriesCommand is used to specify directory locations
- * to search for included files when building a particular target.
- */
-class cmTargetIncludeDirectoriesCommand : public cmCommand
-{
-public:
-  /**
-   * This is a virtual constructor for the command.
-   */
-  virtual cmCommand* Clone()
-    {
-    return new cmTargetIncludeDirectoriesCommand;
-    }
-
-  /**
-   * This is called when the command is first encountered in
-   * the CMakeLists.txt file.
-   */
-  virtual bool InitialPass(std::vector<std::string> const& args,
-                           cmExecutionStatus &status);
-
-  /**
-   * The name of the command as specified in CMakeList.txt.
-   */
-  virtual const char* GetName() { return "target_include_directories";}
-
-  /**
-   * Succinct documentation.
-   */
-  virtual const char* GetTerseDocumentation()
-    {
-    return "Add include directories to the build for a particular target.";
-    }
-
-  /**
-   * More documentation.
-   */
-  virtual const char* GetFullDocumentation()
-    {
-    return
-      "  target_include_directories(target [BEFORE|AFTER] "
-      "                            [CONFIG_TYPE <config>] dir1 dir2 ...)\n"
-      "Add the given directories to those searched by the compiler for "
-      "include files when building target. By default the directories are "
-      "appended onto the current list of directories for the target.  "
-      "By using BEFORE or AFTER you can select between appending and "
-      "prepending.  The CONFIG_TYPE can be used to specify a build type "
-      "associated with the target include.";
-    }
-
-  cmTypeMacro(cmTargetIncludeDirectoriesCommand, cmCommand);
-
-protected:
-  // used internally
-  void AddDirectory(const char *arg, bool before, const char *config);
-
-private:
-  cmTarget *Target;
-};
-
-#endif
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index c4780f4..d691f46 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -605,10 +605,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
       mf->AddIncludeDirectory(dirIt->c_str(), false);
       }
 
-    std::vector<std::string> includeDirectories;
-    lg->GetIncludeDirectories(includeDirectories, language.c_str());
-    std::string includeFlags = lg->GetIncludeFlags(includeDirectories, language.c_str(), false);
-
+    std::string includeFlags = lg->GetIncludeFlags(language.c_str(), false);
     std::string definitions = mf->GetSafeDefinition("PACKAGE_DEFINITIONS");
     printf("%s %s\n", includeFlags.c_str(), definitions.c_str());
     }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0793aec135dc5656540c6ad760ed39ee9c473d69
commit 0793aec135dc5656540c6ad760ed39ee9c473d69
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 7 11:49:33 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Nov 7 11:50:49 2011 +0100

    Hack to workaround caching of flags per directory.
    
    This needs a better solution.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index b697f2b..50e000b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1207,7 +1207,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const std::vector<std::string> &in
   key += forResponseFile? "@" : "";
   if(this->LanguageToIncludeFlags.count(key))
     {
-    return this->LanguageToIncludeFlags[key].c_str();
+//     return this->LanguageToIncludeFlags[key].c_str();
     }
 
   cmOStringStream includeFlags;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=107f86876d675b353499b0166ac32f4894c69499
commit 107f86876d675b353499b0166ac32f4894c69499
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 7 11:48:50 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Nov 7 11:50:49 2011 +0100

    Convert to a simple loop.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 4ea7ff0..dc1d4a0 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4679,9 +4679,10 @@ void cmTarget::AddIncludeDirectory(const char* inc, bool before, const char *con
   std::vector<std::string>::iterator dirs = IncludeDirectories.begin();
   std::string propertyValue = *dirs;
   ++dirs;
-  if (dirs != IncludeDirectories.end())
+  while(dirs != IncludeDirectories.end())
     {
-    propertyValue += std::accumulate(dirs, IncludeDirectories.end(), std::string(";"));
+    propertyValue += std::string(";") + *dirs;
+    ++dirs;
     }
   this->SetProperty(propertyName.c_str(), propertyValue.c_str());
 }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b7f961713a20bae65ce679abdfd77becea1c88f5
commit b7f961713a20bae65ce679abdfd77becea1c88f5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Nov 6 22:53:47 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Nov 6 23:07:41 2011 +0100

    Add the target_include_directories command.

diff --git a/Source/cmBootstrapCommands.cxx b/Source/cmBootstrapCommands.cxx
index cb5dc4c..b6406e1 100644
--- a/Source/cmBootstrapCommands.cxx
+++ b/Source/cmBootstrapCommands.cxx
@@ -87,6 +87,7 @@
 #include "cmSiteNameCommand.cxx"
 #include "cmStringCommand.cxx"
 #include "cmSubdirCommand.cxx"
+#include "cmTargetIncludeDirectoriesCommand.cxx"
 #include "cmTargetLinkLibrariesCommand.cxx"
 #include "cmTryCompileCommand.cxx"
 #include "cmTryRunCommand.cxx"
@@ -160,6 +161,7 @@ void GetBootstrapCommands(std::list<cmCommand*>& commands)
   commands.push_back(new cmSiteNameCommand);
   commands.push_back(new cmStringCommand);
   commands.push_back(new cmSubdirCommand);
+  commands.push_back(new cmTargetIncludeDirectoriesCommand);
   commands.push_back(new cmTargetLinkLibrariesCommand);
   commands.push_back(new cmTryCompileCommand);
   commands.push_back(new cmTryRunCommand);
diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx
new file mode 100644
index 0000000..d1ca672
--- /dev/null
+++ b/Source/cmTargetIncludeDirectoriesCommand.cxx
@@ -0,0 +1,129 @@
+/*============================================================================
+  CMake - Cross Platform Makefile Generator
+  Copyright 2011 Stephen Kelly <steveire at gmail.com>
+
+  Distributed under the OSI-approved BSD License (the "License");
+  see accompanying file Copyright.txt for details.
+
+  This software is distributed WITHOUT ANY WARRANTY; without even the
+  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the License for more information.
+============================================================================*/
+#include "cmTargetIncludeDirectoriesCommand.h"
+
+
+// cmTargetIncludeDirectoriesCommand
+bool cmTargetIncludeDirectoriesCommand
+::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
+{
+  if(args.size() < 1 )
+    {
+    return true;
+    }
+
+  std::vector<std::string>::const_iterator i = args.begin();
+
+  // Lookup the target for which libraries are specified.
+  this->Target =
+    this->Makefile->GetCMakeInstance()
+    ->GetGlobalGenerator()->FindTarget(0, i->c_str());
+  if(!this->Target)
+    {
+    cmake::MessageType t = cmake::FATAL_ERROR;  // fail by default
+    cmOStringStream e;
+    e << "Cannot specify link libraries for target \"" << args[0] << "\" "
+      << "which is not built by this project.";
+    }
+
+  ++i;
+
+  bool before = this->Makefile->IsOn("CMAKE_TARGET_INCLUDE_DIRECTORIES_BEFORE");
+
+  if ((*i) == "BEFORE")
+    {
+    before = true;
+    ++i;
+    }
+  else if ((*i) == "AFTER")
+    {
+    before = false;
+    ++i;
+    }
+
+  const char *config = 0;
+  if ((*i) == "CONFIG_TYPE")
+    {
+    ++i;
+    config = i->c_str();
+    ++i;
+    }
+
+  for(; i != args.end(); ++i)
+    {
+    if(i->size() == 0)
+      {
+      this->SetError("given empty-string as include directory.");
+      return false;
+      }
+    this->AddDirectory(i->c_str(), before, config);
+    }
+  return true;
+}
+
+// do a lot of cleanup on the arguments because this is one place where folks
+// sometimes take the output of a program and pass it directly into this
+// command not thinking that a single argument could be filled with spaces
+// and newlines etc liek below:
+//
+// "   /foo/bar
+//    /boo/hoo /dingle/berry "
+//
+// ideally that should be three separate arguments but when sucking the
+// output from a program and passing it into a command the cleanup doesn't
+// always happen
+//
+void cmTargetIncludeDirectoriesCommand::AddDirectory(const char *i,
+                                             bool before, const char *config)
+{
+  // break apart any line feed arguments
+  std::string ret = i;
+  std::string::size_type pos = 0;
+  if((pos = ret.find('\n', pos)) != std::string::npos)
+    {
+    if (pos)
+      {
+      this->AddDirectory(ret.substr(0,pos).c_str(), before, config);
+      }
+    if (ret.size()-pos-1)
+      {
+      this->AddDirectory(ret.substr(pos+1,ret.size()-pos-1).c_str(),
+                         before, config);
+      }
+    return;
+    }
+
+  // remove any leading or trailing spaces and \r
+  std::string::size_type b = ret.find_first_not_of(" \r");
+  std::string::size_type e = ret.find_last_not_of(" \r");
+  if ((b!=ret.npos) && (e!=ret.npos))
+    {
+    ret.assign(ret, b, 1+e-b);   // copy the remaining substring
+    }
+  else
+    {
+    return;         // if we get here, we had only whitespace in the string
+    }
+
+  if (!cmSystemTools::IsOff(ret.c_str()))
+    {
+    cmSystemTools::ConvertToUnixSlashes(ret);
+    if(!cmSystemTools::FileIsFullPath(ret.c_str()))
+      {
+      std::string tmp = this->Makefile->GetStartDirectory();
+      tmp += "/";
+      tmp += ret;
+      ret = tmp;
+      }
+    }
+  this->Target->AddIncludeDirectory(ret.c_str(), before, config);
+}
diff --git a/Source/cmTargetIncludeDirectoriesCommand.h b/Source/cmTargetIncludeDirectoriesCommand.h
new file mode 100644
index 0000000..005cb76
--- /dev/null
+++ b/Source/cmTargetIncludeDirectoriesCommand.h
@@ -0,0 +1,80 @@
+/*============================================================================
+  CMake - Cross Platform Makefile Generator
+  Copyright 2011 Stephen Kelly <steveire at gmail.com>
+
+  Distributed under the OSI-approved BSD License (the "License");
+  see accompanying file Copyright.txt for details.
+
+  This software is distributed WITHOUT ANY WARRANTY; without even the
+  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the License for more information.
+============================================================================*/
+#ifndef cmTargetIncludeDirectoriesCommand_h
+#define cmTargetIncludeDirectoriesCommand_h
+
+#include "cmCommand.h"
+
+/** \class cmTargetIncludeDirectoriesCommand
+ * \brief Add include directories to the build for a particular target.
+ *
+ * cmIncludeDirectoriesCommand is used to specify directory locations
+ * to search for included files when building a particular target.
+ */
+class cmTargetIncludeDirectoriesCommand : public cmCommand
+{
+public:
+  /**
+   * This is a virtual constructor for the command.
+   */
+  virtual cmCommand* Clone()
+    {
+    return new cmTargetIncludeDirectoriesCommand;
+    }
+
+  /**
+   * This is called when the command is first encountered in
+   * the CMakeLists.txt file.
+   */
+  virtual bool InitialPass(std::vector<std::string> const& args,
+                           cmExecutionStatus &status);
+
+  /**
+   * The name of the command as specified in CMakeList.txt.
+   */
+  virtual const char* GetName() { return "target_include_directories";}
+
+  /**
+   * Succinct documentation.
+   */
+  virtual const char* GetTerseDocumentation()
+    {
+    return "Add include directories to the build for a particular target.";
+    }
+
+  /**
+   * More documentation.
+   */
+  virtual const char* GetFullDocumentation()
+    {
+    return
+      "  target_include_directories(target [BEFORE|AFTER] "
+      "                            [CONFIG_TYPE <config>] dir1 dir2 ...)\n"
+      "Add the given directories to those searched by the compiler for "
+      "include files when building target. By default the directories are "
+      "appended onto the current list of directories for the target.  "
+      "By using BEFORE or AFTER you can select between appending and "
+      "prepending.  The CONFIG_TYPE can be used to specify a build type "
+      "associated with the target include.";
+    }
+
+  cmTypeMacro(cmTargetIncludeDirectoriesCommand, cmCommand);
+
+protected:
+  // used internally
+  void AddDirectory(const char *arg, bool before, const char *config);
+
+private:
+  cmTarget *Target;
+};
+
+#endif

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a075af5432c6e7405d24c5932b4243fc737ddd79
commit a075af5432c6e7405d24c5932b4243fc737ddd79
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Nov 6 22:53:17 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Nov 6 23:07:41 2011 +0100

    Fix trailing whitespace.

diff --git a/Source/cmBootstrapCommands.cxx b/Source/cmBootstrapCommands.cxx
index 554f452..cb5dc4c 100644
--- a/Source/cmBootstrapCommands.cxx
+++ b/Source/cmBootstrapCommands.cxx
@@ -12,7 +12,7 @@
 // This file is used to compile all the commands
 // that CMake knows about at compile time.
 // This is sort of a boot strapping approach since you would
-// like to have CMake to build CMake.   
+// like to have CMake to build CMake.
 #include "cmCommands.h"
 #include "cmAddCustomCommandCommand.cxx"
 #include "cmAddCustomTargetCommand.cxx"
@@ -111,7 +111,7 @@ void GetBootstrapCommands(std::list<cmCommand*>& commands)
   commands.push_back(new cmDefinePropertyCommand);
   commands.push_back(new cmElseCommand);
   commands.push_back(new cmEnableLanguageCommand);
-  commands.push_back(new cmEnableTestingCommand);  
+  commands.push_back(new cmEnableTestingCommand);
   commands.push_back(new cmEndForEachCommand);
   commands.push_back(new cmEndFunctionCommand);
   commands.push_back(new cmEndIfCommand);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e49e2def771098cb1dce0a779c2d9da27b9b300e
commit e49e2def771098cb1dce0a779c2d9da27b9b300e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Nov 6 22:52:47 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Nov 6 23:07:41 2011 +0100

    Add API for adding to the target include directories.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 2ae25c9..4ea7ff0 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -25,6 +25,7 @@
 #include <queue>
 #include <stdlib.h> // required for atof
 #include <assert.h>
+#include <numeric> // For std::accumulate
 
 const char* cmTarget::GetTargetTypeName(TargetType targetType)
 {
@@ -4610,6 +4611,81 @@ cmTarget::GetLinkInformation(const char* config)
   return i->second;
 }
 
+void cmTarget::AddIncludeDirectory(const char* inc, bool before, const char *config)
+{
+  // if there is a newline then break it into multiple arguments
+  if (!inc)
+    {
+    return;
+    }
+
+  std::string propertyName = "INCLUDE_DIRECTORIES";
+  std::string configTypeUpper;
+
+  if (config)
+    {
+    propertyName += "_";
+    configTypeUpper = cmSystemTools::UpperCase(config);
+    propertyName += configTypeUpper;
+    }
+
+  std::vector<std::string> IncludeDirectories;
+  const char *incs = this->GetProperty(propertyName.c_str());
+  if (incs)
+    {
+    cmSystemTools::ExpandListArgument(incs, IncludeDirectories);
+    }
+
+  // Don't add an include directory that is already present.  Yes,
+  // this linear search results in n^2 behavior, but n won't be
+  // getting much bigger than 20.  We cannot use a set because of
+  // order dependency of the include path.
+  std::vector<std::string>::iterator i =
+    std::find(IncludeDirectories.begin(),
+              IncludeDirectories.end(), inc);
+
+  if(i == IncludeDirectories.end())
+    {
+    if (before)
+      {
+      // WARNING: this *is* expensive (linear time) since it's a vector
+      IncludeDirectories.insert(IncludeDirectories.begin(), inc);
+      ++(config ? this->ConfigDirectories[configTypeUpper] : this->DirectoriesBeforeOffset);
+      }
+    else
+      {
+      IncludeDirectories.push_back(inc);
+      }
+    }
+  else
+    {
+    if(before)
+      {
+      // Find it. If it's before (config ? this->ConfigDirectories[configTypeUpper] : this->DirectoriesBeforeOffset)'
+      // Then don't change that variable. Otherwise increase it.
+
+      std::vector<std::string>::iterator endOfBefore = IncludeDirectories.begin()
+                  + (config ? this->ConfigDirectories[configTypeUpper] : this->DirectoriesBeforeOffset);
+      if (i > endOfBefore)
+        ++(config ? this->ConfigDirectories[configTypeUpper] : this->DirectoriesBeforeOffset);
+
+      // if this before and already in the path then remove it
+      IncludeDirectories.erase(i);
+      // WARNING: this *is* expensive (linear time) since it's a vector
+      IncludeDirectories.insert(IncludeDirectories.begin(), inc);
+      }
+    }
+  // TODO: Store the vector in cmTarget instead of all this conversion
+  std::vector<std::string>::iterator dirs = IncludeDirectories.begin();
+  std::string propertyValue = *dirs;
+  ++dirs;
+  if (dirs != IncludeDirectories.end())
+    {
+    propertyValue += std::accumulate(dirs, IncludeDirectories.end(), std::string(";"));
+    }
+  this->SetProperty(propertyName.c_str(), propertyValue.c_str());
+}
+
 void cmTarget::GetIncludeDirectoriesBefore(std::vector<std::string> &includes, const char* config)
 {
   std::string configTypeUpper;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 68bc64a..445d237 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -453,6 +453,11 @@ public:
   void GetIncludeDirectoriesBefore(std::vector<std::string> &includes, const char *config);
   void GetIncludeDirectories(std::vector<std::string> &includes, const char *config);
 
+  /**
+   * Add an include directory to the build for this target.
+   */
+  void AddIncludeDirectory(const char*, bool before = false, const char *config = 0);
+
 private:
   /**
    * A list of direct dependencies. Use in conjunction with DependencyMap.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4a14e8cafd42828d4e1f15f808441441e8cacecc
commit 4a14e8cafd42828d4e1f15f808441441e8cacecc
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Nov 6 22:51:58 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Nov 6 22:51:58 2011 +0100

    Add API to get the include directories from the before segment.

diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 36465b5..e3c73c7 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1814,6 +1814,7 @@ void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags,
 
 
   std::vector<std::string> includes;
+  this->Target->GetIncludeDirectoriesBefore(includes, this->ConfigName);
   this->LocalGenerator->GetIncludeDirectories(includes, lang);
   this->Target->GetIncludeDirectories(includes, this->ConfigName);
 
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 57c7649..2ae25c9 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4610,6 +4610,56 @@ cmTarget::GetLinkInformation(const char* config)
   return i->second;
 }
 
+void cmTarget::GetIncludeDirectoriesBefore(std::vector<std::string> &includes, const char* config)
+{
+  std::string configTypeUpper;
+  if (config)
+    {
+    configTypeUpper = cmSystemTools::UpperCase(config);
+    }
+  std::vector<std::string> targetIncludes;
+  const char *incs = this->GetProperty("INCLUDE_DIRECTORIES");
+  if (incs)
+    {
+    cmSystemTools::ExpandListArgument(incs, targetIncludes);
+    }
+
+  std::string defPropName = "INCLUDE_DIRECTORIES_";
+  defPropName += configTypeUpper;
+
+  std::vector<std::string> configTargetIncludes;
+  const char* config_incs = this->GetProperty(defPropName.c_str());
+  if (config_incs)
+    {
+    cmSystemTools::ExpandListArgument(config_incs, configTargetIncludes);
+    }
+
+  std::set<cmStdString> emitted;
+  for(std::vector<std::string>::const_iterator
+        li = includes.begin(); li != includes.end(); ++li)
+    {
+      emitted.insert(*li);
+    }
+
+  for(std::vector<std::string>::const_iterator li = targetIncludes.begin();
+        li != targetIncludes.end() && li != targetIncludes.begin() + this->DirectoriesBeforeOffset + 1; ++li)
+    {
+    if (emitted.insert(*li).second)
+      {
+        includes.push_back(*li);
+      }
+    }
+
+  for(std::vector<std::string>::const_iterator li = configTargetIncludes.begin();
+        li != configTargetIncludes.end() && li != configTargetIncludes.begin() + this->ConfigDirectories[configTypeUpper] + 1; ++li)
+    {
+    if (emitted.insert(*li).second)
+      {
+        includes.push_back(*li);
+      }
+    }
+}
+
 void cmTarget::GetIncludeDirectories(std::vector<std::string> &includes, const char* config)
 {
   std::vector<std::string> targetIncludes;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 9c69100..68bc64a 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -450,6 +450,7 @@ public:
       directory.  */
   bool UsesDefaultOutputDir(const char* config, bool implib);
 
+  void GetIncludeDirectoriesBefore(std::vector<std::string> &includes, const char *config);
   void GetIncludeDirectories(std::vector<std::string> &includes, const char *config);
 
 private:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0adb88e0478e2470df266220ab2ef15490049d41
commit 0adb88e0478e2470df266220ab2ef15490049d41
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Nov 6 22:49:10 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Nov 6 22:49:10 2011 +0100

    Make it possible to split the include directories.
    
    One part of the directories can be made to go before the other.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 6d36631..57c7649 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -132,6 +132,7 @@ cmTarget::cmTarget()
   this->HaveInstallRule = false;
   this->DLLPlatform = false;
   this->IsImportedTarget = false;
+  this->DirectoriesBeforeOffset = 0;
 }
 
 //----------------------------------------------------------------------------
@@ -4642,7 +4643,8 @@ void cmTarget::GetIncludeDirectories(std::vector<std::string> &includes, const c
     }
 
   for(std::vector<std::string>::const_iterator
-        li = targetIncludes.begin(); li != targetIncludes.end(); ++li)
+        li = targetIncludes.begin() + this->DirectoriesBeforeOffset;
+        li != targetIncludes.end(); ++li)
     {
     if (emitted.insert(*li).second)
       {
@@ -4651,7 +4653,7 @@ void cmTarget::GetIncludeDirectories(std::vector<std::string> &includes, const c
     }
 
   for(std::vector<std::string>::const_iterator
-        li = configTargetIncludes.begin();
+        li = configTargetIncludes.begin() + this->ConfigDirectories[configTypeUpper];
         li != configTargetIncludes.end(); ++li)
     {
     if (emitted.insert(*li).second)
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index de77d79..9c69100 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -560,6 +560,8 @@ private:
   LinkLibraryVectorType OriginalLinkLibraries;
   bool DLLPlatform;
   bool IsImportedTarget;
+  std::vector<std::string>::difference_type DirectoriesBeforeOffset;
+  std::map<cmStdString, std::vector<std::string>::difference_type> ConfigDirectories;
 
   // Cache target output paths for each configuration.
   struct OutputInfo;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6fc5414acaa1e78e9eec0296477fd9693b08824f
commit 6fc5414acaa1e78e9eec0296477fd9693b08824f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Nov 6 22:47:36 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Nov 6 22:47:36 2011 +0100

    Populate separate vectors for config dependent includes.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 76dba88..6d36631 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4618,13 +4618,20 @@ void cmTarget::GetIncludeDirectories(std::vector<std::string> &includes, const c
     cmSystemTools::ExpandListArgument(incs, targetIncludes);
     }
 
+  std::string configTypeUpper;
+  if (config)
+    {
+    configTypeUpper = cmSystemTools::UpperCase(config);
+    }
+
   std::string defPropName = "INCLUDE_DIRECTORIES_";
-  defPropName += cmSystemTools::UpperCase(config);
+  defPropName += configTypeUpper;
 
+  std::vector<std::string> configTargetIncludes;
   const char* config_incs = this->GetProperty(defPropName.c_str());
   if (config_incs)
     {
-    cmSystemTools::ExpandListArgument(config_incs, targetIncludes);
+    cmSystemTools::ExpandListArgument(config_incs, configTargetIncludes);
     }
 
   std::set<cmStdString> emitted;
@@ -4642,6 +4649,16 @@ void cmTarget::GetIncludeDirectories(std::vector<std::string> &includes, const c
         includes.push_back(*li);
       }
     }
+
+  for(std::vector<std::string>::const_iterator
+        li = configTargetIncludes.begin();
+        li != configTargetIncludes.end(); ++li)
+    {
+    if (emitted.insert(*li).second)
+      {
+        includes.push_back(*li);
+      }
+    }
 }
 
 //----------------------------------------------------------------------------

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=280c9a2f1a3016adb4cad38f0fb4320491e8b05d
commit 280c9a2f1a3016adb4cad38f0fb4320491e8b05d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Nov 5 16:17:49 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Nov 5 17:00:17 2011 +0100

    Extract and use the INCLUDE_DIRECTORIES target properties.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index ffbeb48..b697f2b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -574,7 +574,11 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
   std::string flags;
   flags += this->Makefile->GetSafeDefinition(varString.c_str());
   flags += " ";
-  flags += this->GetIncludeFlags(lang);
+    {
+    std::vector<std::string> includes;
+    this->GetIncludeDirectories(includes, lang);
+    flags += this->GetIncludeFlags(includes, lang);
+    }
   flags += this->Makefile->GetDefineFlags();
 
   // Construct the command lines.
@@ -1192,8 +1196,8 @@ cmLocalGenerator::ConvertToIncludeReference(std::string const& path)
 }
 
 //----------------------------------------------------------------------------
-const char* cmLocalGenerator::GetIncludeFlags(const char* lang,
-                                              bool forResponseFile)
+const char* cmLocalGenerator::GetIncludeFlags(const std::vector<std::string> &includes,
+                                              const char* lang, bool forResponseFile)
 {
   if(!lang)
     {
@@ -1207,9 +1211,6 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang,
     }
 
   cmOStringStream includeFlags;
-  std::vector<std::string> includes;
-  this->GetIncludeDirectories(includes, lang);
-  std::vector<std::string>::iterator i;
 
   std::string flagVar = "CMAKE_INCLUDE_FLAG_";
   flagVar += lang;
@@ -1251,6 +1252,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang,
 #ifdef __APPLE__
   emitted.insert("/System/Library/Frameworks");
 #endif
+  std::vector<std::string>::const_iterator i;
   for(i = includes.begin(); i != includes.end(); ++i)
     {
     if(this->Makefile->IsOn("APPLE")
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 0c5b9d0..7e737ef 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -146,8 +146,8 @@ public:
   ///! Append flags to a string.
   virtual void AppendFlags(std::string& flags, const char* newFlags);
   ///! Get the include flags for the current makefile and language
-  const char* GetIncludeFlags(const char* lang,
-                              bool forResponseFile = false);
+  const char* GetIncludeFlags(const std::vector<std::string> &includes,
+                              const char* lang, bool forResponseFile = false);
 
   /**
    * Encode a list of preprocessor definitions for the compiler
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 8b91194..36465b5 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -275,7 +275,7 @@ std::string cmMakefileTargetGenerator::GetFlags(const std::string &l)
     // Add shared-library flags if needed.
     this->LocalGenerator->AddSharedFlags(flags, lang, shared);
 
-    // Add include directory flags.
+    // Add include directory and target include flags.
     this->AddIncludeFlags(flags, lang);
 
     // Append old-style preprocessor definition flags.
@@ -1812,8 +1812,13 @@ void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags,
   responseVar += "_USE_RESPONSE_FILE_FOR_INCLUDES";
   bool useResponseFile = this->Makefile->IsOn(responseVar.c_str());
 
+
+  std::vector<std::string> includes;
+  this->LocalGenerator->GetIncludeDirectories(includes, lang);
+  this->Target->GetIncludeDirectories(includes, this->ConfigName);
+
   std::string includeFlags =
-    this->LocalGenerator->GetIncludeFlags(lang, useResponseFile);
+    this->LocalGenerator->GetIncludeFlags(includes, lang, useResponseFile);
   if(includeFlags.empty())
     {
     return;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f7d3ba9..76dba88 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4609,6 +4609,41 @@ cmTarget::GetLinkInformation(const char* config)
   return i->second;
 }
 
+void cmTarget::GetIncludeDirectories(std::vector<std::string> &includes, const char* config)
+{
+  std::vector<std::string> targetIncludes;
+  const char *incs = this->GetProperty("INCLUDE_DIRECTORIES");
+  if (incs)
+    {
+    cmSystemTools::ExpandListArgument(incs, targetIncludes);
+    }
+
+  std::string defPropName = "INCLUDE_DIRECTORIES_";
+  defPropName += cmSystemTools::UpperCase(config);
+
+  const char* config_incs = this->GetProperty(defPropName.c_str());
+  if (config_incs)
+    {
+    cmSystemTools::ExpandListArgument(config_incs, targetIncludes);
+    }
+
+  std::set<cmStdString> emitted;
+  for(std::vector<std::string>::const_iterator
+        li = includes.begin(); li != includes.end(); ++li)
+    {
+      emitted.insert(*li);
+    }
+
+  for(std::vector<std::string>::const_iterator
+        li = targetIncludes.begin(); li != targetIncludes.end(); ++li)
+    {
+    if (emitted.insert(*li).second)
+      {
+        includes.push_back(*li);
+      }
+    }
+}
+
 //----------------------------------------------------------------------------
 cmTargetLinkInformationMap
 ::cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r): derived()
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 0abdddb..de77d79 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -450,6 +450,8 @@ public:
       directory.  */
   bool UsesDefaultOutputDir(const char* config, bool implib);
 
+  void GetIncludeDirectories(std::vector<std::string> &includes, const char *config);
+
 private:
   /**
    * A list of direct dependencies. Use in conjunction with DependencyMap.
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index d691f46..c4780f4 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -605,7 +605,10 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
       mf->AddIncludeDirectory(dirIt->c_str(), false);
       }
 
-    std::string includeFlags = lg->GetIncludeFlags(language.c_str(), false);
+    std::vector<std::string> includeDirectories;
+    lg->GetIncludeDirectories(includeDirectories, language.c_str());
+    std::string includeFlags = lg->GetIncludeFlags(includeDirectories, language.c_str(), false);
+
     std::string definitions = mf->GetSafeDefinition("PACKAGE_DEFINITIONS");
     printf("%s %s\n", includeFlags.c_str(), definitions.c_str());
     }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f94db2e1103404461920a274b79ffa48bf18215e
commit f94db2e1103404461920a274b79ffa48bf18215e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Nov 5 16:17:23 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Nov 5 16:22:17 2011 +0100

    Exit the loop when we have determined the language.

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index da6a1c6..e2c4561 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -232,6 +232,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
       if(ei->Language == "C" || ei->Language == "CXX")
         {
         lang_is_c_or_cxx = true;
+        break;
         }
       }
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=81f8c3b090731ef3f6e65c6a8f3be02ff36a266d
commit 81f8c3b090731ef3f6e65c6a8f3be02ff36a266d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Nov 5 16:17:05 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Nov 5 16:21:51 2011 +0100

    Trim trailing whitespace.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 65d6fa6..ffbeb48 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -96,14 +96,14 @@ void cmLocalGenerator::Configure()
   std::string filesDir = this->Makefile->GetStartOutputDirectory();
   filesDir += cmake::GetCMakeFilesDirectory();
   cmSystemTools::MakeDirectory(filesDir.c_str());
-  
+
   // find & read the list file
   this->ReadInputFile();
 
   // at the end of the ReadListFile handle any old style subdirs
   // first get all the subdirectories
   std::vector<cmLocalGenerator *> subdirs = this->GetChildren();
-  
+
   // for each subdir recurse
   std::vector<cmLocalGenerator *>::iterator sdi = subdirs.begin();
   for (; sdi != subdirs.end(); ++sdi)
@@ -112,7 +112,7 @@ void cmLocalGenerator::Configure()
       {
       this->Makefile->ConfigureSubDirectory(*sdi);
       }
-    }  
+    }
 
   // Check whether relative paths should be used for optionally
   // relative paths.
@@ -212,10 +212,10 @@ void cmLocalGenerator::ReadInputFile()
 }
 
 void cmLocalGenerator::SetupPathConversions()
-{  
+{
   // Setup the current output directory components for use by
   // Convert
-  std::string outdir; 
+  std::string outdir;
   outdir =
     cmSystemTools::CollapseFullPath(this->Makefile->GetHomeDirectory());
   cmSystemTools::SplitPath(outdir.c_str(), this->HomeDirectoryComponents);
@@ -225,12 +225,12 @@ void cmLocalGenerator::SetupPathConversions()
 
   outdir = cmSystemTools::CollapseFullPath
     (this->Makefile->GetHomeOutputDirectory());
-  cmSystemTools::SplitPath(outdir.c_str(), 
+  cmSystemTools::SplitPath(outdir.c_str(),
                            this->HomeOutputDirectoryComponents);
 
   outdir = cmSystemTools::CollapseFullPath
     (this->Makefile->GetStartOutputDirectory());
-  cmSystemTools::SplitPath(outdir.c_str(), 
+  cmSystemTools::SplitPath(outdir.c_str(),
                            this->StartOutputDirectoryComponents);
 }
 
@@ -289,17 +289,17 @@ void cmLocalGenerator::GenerateTestFiles()
   fout.SetCopyIfDifferent(true);
 
   fout << "# CMake generated Testfile for " << std::endl
-       << "# Source directory: " 
+       << "# Source directory: "
        << this->Makefile->GetStartDirectory() << std::endl
-       << "# Build directory: " 
+       << "# Build directory: "
        << this->Makefile->GetStartOutputDirectory() << std::endl
        << "# " << std::endl
        << "# This file includes the relevent testing commands "
        << "required for " << std::endl
        << "# testing this directory and lists subdirectories to "
        << "be tested as well." << std::endl;
-  
-  const char* testIncludeFile = 
+
+  const char* testIncludeFile =
     this->Makefile->GetProperty("TEST_INCLUDE_FILE");
   if ( testIncludeFile )
     {
@@ -320,7 +320,7 @@ void cmLocalGenerator::GenerateTestFiles()
     for(i = 0; i < this->Children.size(); ++i)
       {
       fout << "SUBDIRS(";
-      std::string outP = 
+      std::string outP =
         this->Children[i]->GetMakefile()->GetStartOutputDirectory();
       fout << this->Convert(outP.c_str(),START_OUTPUT);
       fout << ")" << std::endl;
@@ -472,7 +472,7 @@ void cmLocalGenerator::GenerateInstallRules()
   // Ask each install generator to write its code.
   std::vector<cmInstallGenerator*> const& installers =
     this->Makefile->GetInstallGenerators();
-  for(std::vector<cmInstallGenerator*>::const_iterator 
+  for(std::vector<cmInstallGenerator*>::const_iterator
         gi = installers.begin();
       gi != installers.end(); ++gi)
     {
@@ -553,15 +553,15 @@ void cmLocalGenerator::GenerateTargetManifest()
     }
 }
 
-void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname, 
-                                                      const char* lang, 
+void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
+                                                      const char* lang,
                                                       cmSourceFile& source,
                                                       cmTarget& )
-{ 
+{
   std::string objectDir = cmSystemTools::GetFilenamePath(std::string(ofname));
   objectDir = this->Convert(objectDir.c_str(),START_OUTPUT,SHELL);
   std::string objectFile = this->Convert(ofname,START_OUTPUT,SHELL);
-  std::string sourceFile = 
+  std::string sourceFile =
     this->Convert(source.GetFullPath().c_str(),START_OUTPUT,SHELL,true);
   std::string varString = "CMAKE_";
   varString += lang;
@@ -655,7 +655,7 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
         ofname += "/";
         ofname += obj;
         objVector.push_back(ofname);
-        this->AddCustomCommandToCreateObject(ofname.c_str(), 
+        this->AddCustomCommandToCreateObject(ofname.c_str(),
                                              llang, *(*i), target);
         objs += this->Convert(ofname.c_str(),START_OUTPUT,MAKEFILE);
         objs += " ";
@@ -672,7 +672,7 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
   // Shared Module:
   std::string linkLibs; // should be set
   std::string flags; // should be set
-  std::string linkFlags; // should be set 
+  std::string linkFlags; // should be set
   this->GetTargetFlags(linkLibs, flags, linkFlags, target);
   cmLocalGenerator::RuleVariables vars;
   vars.Language = llang;
@@ -682,17 +682,17 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
   vars.LinkLibraries = linkLibs.c_str();
   vars.Flags = flags.c_str();
   vars.LinkFlags = linkFlags.c_str();
- 
+
   std::string langFlags;
   this->AddLanguageFlags(langFlags, llang, 0);
   this->AddArchitectureFlags(langFlags, &target, llang, 0);
   vars.LanguageCompileFlags = langFlags.c_str();
-  
+
   cmCustomCommandLines commandLines;
   std::vector<std::string> rules;
   rules.push_back(this->Makefile->GetRequiredDefinition(createRule.c_str()));
   std::vector<std::string> commands;
-  cmSystemTools::ExpandList(rules, commands);  
+  cmSystemTools::ExpandList(rules, commands);
   for(std::vector<std::string>::iterator i = commands.begin();
       i != commands.end(); ++i)
     {
@@ -728,21 +728,21 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
     (this->Makefile->GetSource(targetFullPath.c_str()));
 }
 
-  
+
 void cmLocalGenerator
 ::CreateCustomTargetsAndCommands(std::set<cmStdString> const& lang)
-{ 
+{
   cmTargets &tgts = this->Makefile->GetTargets();
-  for(cmTargets::iterator l = tgts.begin(); 
+  for(cmTargets::iterator l = tgts.begin();
       l != tgts.end(); l++)
     {
     cmTarget& target = l->second;
     switch(target.GetType())
-      { 
+      {
       case cmTarget::STATIC_LIBRARY:
       case cmTarget::SHARED_LIBRARY:
       case cmTarget::MODULE_LIBRARY:
-      case cmTarget::EXECUTABLE: 
+      case cmTarget::EXECUTABLE:
         {
         const char* llang = target.GetLinkerLanguage();
         if(!llang)
@@ -759,7 +759,7 @@ void cmLocalGenerator
           this->AddBuildTargetRule(llang, target);
           }
         }
-        break; 
+        break;
       default:
         break;
       }
@@ -769,14 +769,14 @@ void cmLocalGenerator
 // List of variables that are replaced when
 // rules are expanced.  These variables are
 // replaced in the form <var> with GetSafeDefinition(var).
-// ${LANG} is replaced in the variable first with all enabled 
+// ${LANG} is replaced in the variable first with all enabled
 // languages.
 static const char* ruleReplaceVars[] =
 {
   "CMAKE_${LANG}_COMPILER",
   "CMAKE_SHARED_LIBRARY_CREATE_${LANG}_FLAGS",
   "CMAKE_SHARED_MODULE_CREATE_${LANG}_FLAGS",
-  "CMAKE_SHARED_MODULE_${LANG}_FLAGS", 
+  "CMAKE_SHARED_MODULE_${LANG}_FLAGS",
   "CMAKE_SHARED_LIBRARY_${LANG}_FLAGS",
   "CMAKE_${LANG}_LINK_FLAGS",
   "CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG",
@@ -807,7 +807,7 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
       return replaceValues.Flags;
       }
     }
-    
+
   if(replaceValues.Source)
     {
     if(variable == "SOURCE")
@@ -870,7 +870,7 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
     }
 
   if(replaceValues.Target)
-    { 
+    {
     if(variable == "TARGET_QUOTED")
       {
       std::string targetQuoted = replaceValues.Target;
@@ -1018,13 +1018,13 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
   int pos = 0;
   while(ruleReplaceVars[pos])
     {
-    for(std::vector<std::string>::iterator i = enabledLanguages.begin();   
-        i != enabledLanguages.end(); ++i)   
-      { 
+    for(std::vector<std::string>::iterator i = enabledLanguages.begin();
+        i != enabledLanguages.end(); ++i)
+      {
       const char* lang = i->c_str();
       std::string actualReplace = ruleReplaceVars[pos];
       // If this is the compiler then look for the extra variable
-      // _COMPILER_ARG1 which must be the first argument to the compiler 
+      // _COMPILER_ARG1 which must be the first argument to the compiler
       const char* compilerArg1 = 0;
       if(actualReplace == "CMAKE_${LANG}_COMPILER")
         {
@@ -1038,7 +1038,7 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
         }
       if(actualReplace == variable)
         {
-        std::string replace = 
+        std::string replace =
           this->Makefile->GetSafeDefinition(variable.c_str());
         // if the variable is not a FLAG then treat it like a path
         if(variable.find("_FLAG") == variable.npos)
@@ -1062,7 +1062,7 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
 }
 
 
-void 
+void
 cmLocalGenerator::ExpandRuleVariables(std::string& s,
                                       const RuleVariables& replaceValues)
 {
@@ -1213,7 +1213,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang,
 
   std::string flagVar = "CMAKE_INCLUDE_FLAG_";
   flagVar += lang;
-  const char* includeFlag = 
+  const char* includeFlag =
     this->Makefile->GetSafeDefinition(flagVar.c_str());
   flagVar = "CMAKE_INCLUDE_FLAG_SEP_";
   flagVar += lang;
@@ -1223,7 +1223,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang,
     {
     quotePaths = true;
     }
-  bool repeatFlag = true; 
+  bool repeatFlag = true;
   // should the include flag be repeated like ie. -IA -IB
   if(!sep)
     {
@@ -1354,15 +1354,15 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
     this->Makefile->GetDefinition("VTK_SOURCE_DIR");
   if(vtkSourceDir)
     {
-    const char* vtk_major = 
+    const char* vtk_major =
       this->Makefile->GetDefinition("VTK_MAJOR_VERSION");
-    const char* vtk_minor = 
+    const char* vtk_minor =
       this->Makefile->GetDefinition("VTK_MINOR_VERSION");
     vtk_major = vtk_major? vtk_major : "4";
     vtk_minor = vtk_minor? vtk_minor : "4";
     int vmajor = 0;
     int vminor = 0;
-    if(sscanf(vtk_major, "%d", &vmajor) && 
+    if(sscanf(vtk_major, "%d", &vmajor) &&
        sscanf(vtk_minor, "%d", &vminor) && vmajor == 4 && vminor <= 4)
       {
       includeSourceDir = true;
@@ -1403,7 +1403,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
     }
 
   // Get the project-specified include directories.
-  std::vector<std::string>& includes = 
+  std::vector<std::string>& includes =
     this->Makefile->GetIncludeDirectories();
 
   // Support putting all the in-project include directories first if
@@ -1446,17 +1446,17 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
                                  std::string& linkFlags,
                                  cmTarget& target)
 {
-  std::string buildType =  
+  std::string buildType =
     this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
-  buildType = cmSystemTools::UpperCase(buildType); 
-  const char* libraryLinkVariable = 
+  buildType = cmSystemTools::UpperCase(buildType);
+  const char* libraryLinkVariable =
     "CMAKE_SHARED_LINKER_FLAGS"; // default to shared library
-  
+
   switch(target.GetType())
     {
-    case cmTarget::STATIC_LIBRARY: 
+    case cmTarget::STATIC_LIBRARY:
       {
-      const char* targetLinkFlags = 
+      const char* targetLinkFlags =
         target.GetProperty("STATIC_LIBRARY_FLAGS");
       if(targetLinkFlags)
         {
@@ -1475,11 +1475,11 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
           }
         }
       }
-      break; 
+      break;
     case cmTarget::MODULE_LIBRARY:
       libraryLinkVariable = "CMAKE_MODULE_LINKER_FLAGS";
     case cmTarget::SHARED_LIBRARY:
-      { 
+      {
       linkFlags = this->Makefile->GetSafeDefinition(libraryLinkVariable);
       linkFlags += " ";
       if(!buildType.empty())
@@ -1489,8 +1489,8 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
         build += buildType;
         linkFlags += this->Makefile->GetSafeDefinition(build.c_str());
         linkFlags += " ";
-        }  
-      if(this->Makefile->IsOn("WIN32") && 
+        }
+      if(this->Makefile->IsOn("WIN32") &&
          !(this->Makefile->IsOn("CYGWIN") || this->Makefile->IsOn("MINGW")))
         {
         const std::vector<cmSourceFile*>& sources = target.GetSourceFiles();
@@ -1500,14 +1500,14 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
           cmSourceFile* sf = *i;
           if(sf->GetExtension() == "def")
             {
-            linkFlags += 
+            linkFlags +=
               this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG");
             linkFlags += this->Convert(sf->GetFullPath().c_str(),
                                        START_OUTPUT, SHELL);
             linkFlags += " ";
             }
           }
-        } 
+        }
       const char* targetLinkFlags = target.GetProperty("LINK_FLAGS");
       if(targetLinkFlags)
         {
@@ -1520,11 +1520,11 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
         configLinkFlags += buildType;
         targetLinkFlags = target.GetProperty(configLinkFlags.c_str());
         if(targetLinkFlags)
-          { 
+          {
           linkFlags += targetLinkFlags;
           linkFlags += " ";
           }
-        }  
+        }
       cmOStringStream linklibsStr;
       this->OutputLinkLibraries(linklibsStr, target, false);
       linkLibs = linklibsStr.str();
@@ -1532,7 +1532,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
       break;
     case cmTarget::EXECUTABLE:
       {
-      linkFlags += 
+      linkFlags +=
         this->Makefile->GetSafeDefinition("CMAKE_EXE_LINKER_FLAGS");
       linkFlags += " ";
       if(!buildType.empty())
@@ -1541,7 +1541,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
         build += buildType;
         linkFlags += this->Makefile->GetSafeDefinition(build.c_str());
         linkFlags += " ";
-        } 
+        }
       const char* linkLanguage = target.GetLinkerLanguage();
       if(!linkLanguage)
         {
@@ -1566,7 +1566,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
       if(cmSystemTools::IsOn
          (this->Makefile->GetDefinition("BUILD_SHARED_LIBS")))
         {
-        std::string sFlagVar = std::string("CMAKE_SHARED_BUILD_") 
+        std::string sFlagVar = std::string("CMAKE_SHARED_BUILD_")
           + linkLanguage + std::string("_FLAGS");
         linkFlags += this->Makefile->GetSafeDefinition(sFlagVar.c_str());
         linkFlags += " ";
@@ -1579,7 +1579,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
         }
       else
         {
-        linkFlags +=  
+        linkFlags +=
           this->Makefile->GetSafeDefinition("CMAKE_CREATE_CONSOLE_EXE");
         linkFlags += " ";
         }
@@ -1595,13 +1595,13 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
         configLinkFlags += buildType;
         targetLinkFlags = target.GetProperty(configLinkFlags.c_str());
         if(targetLinkFlags)
-          { 
+          {
           linkFlags += targetLinkFlags;
           linkFlags += " ";
           }
         }
       }
-      break; 
+      break;
     default:
       break;
     }
@@ -1661,9 +1661,9 @@ void cmLocalGenerator::OutputLinkLibraries(std::ostream& fout,
 
   const char* linkLanguage = cli.GetLinkLanguage();
 
-  std::string libPathFlag = 
+  std::string libPathFlag =
     this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_FLAG");
-  std::string libPathTerminator = 
+  std::string libPathTerminator =
     this->Makefile->GetSafeDefinition("CMAKE_LIBRARY_PATH_TERMINATOR");
 
   // Flags to link an executable to shared libraries.
@@ -1786,11 +1786,11 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
     {
     std::vector<std::string> archs;
     target->GetAppleArchs(config, archs);
-    const char* sysroot = 
+    const char* sysroot =
       this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT");
-    const char* sysrootDefault = 
+    const char* sysrootDefault =
       this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT_DEFAULT");
-    const char* deploymentTarget = 
+    const char* deploymentTarget =
       this->Makefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET");
     std::string isysrootVar = std::string("CMAKE_") + lang + "_HAS_ISYSROOT";
     bool hasIsysroot = this->Makefile->IsOn(isysrootVar.c_str());
@@ -1876,7 +1876,7 @@ bool cmLocalGenerator::GetRealDependency(const char* inName,
     if(cmSystemTools::FileIsFullPath(inName))
       {
       std::string tLocation;
-      if(target->GetType() >= cmTarget::EXECUTABLE && 
+      if(target->GetType() >= cmTarget::EXECUTABLE &&
          target->GetType() <= cmTarget::MODULE_LIBRARY)
         {
         tLocation = target->GetLocation(config);
@@ -2904,7 +2904,7 @@ std::string cmLocalGenerator::EscapeForShell(const char* str, bool makeVars,
   else
     {
     cmsysSystem_Shell_GetArgumentForUnix(str, &arg[0], flags);
-    }  
+    }
   return std::string(&arg[0]);
 }
 
@@ -2976,9 +2976,9 @@ cmLocalGenerator::GetTargetDirectory(cmTarget const&) const
 
 
 //----------------------------------------------------------------------------
-void 
+void
 cmLocalGenerator::GetTargetObjectFileDirectories(cmTarget* ,
-                                                 std::vector<std::string>& 
+                                                 std::vector<std::string>&
                                                  )
 {
   cmSystemTools::Error("GetTargetObjectFileDirectories"

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

Summary of changes:
 Source/cmBootstrapCommands.cxx           |    4 +-
 Source/cmLocalGenerator.cxx              |  146 +++++++++++++++---------------
 Source/cmLocalUnixMakefileGenerator3.cxx |    1 +
 3 files changed, 76 insertions(+), 75 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list