[Cmake-commits] CMake branch, next, updated. v2.8.6-2050-g3bb3ae8

Stephen Kelly steveire at gmail.com
Sun Nov 27 18:19:45 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  3bb3ae85f5a565827916aea82b8b0a04a7351e6a (commit)
       via  585b06314ec85e5ada78951ef5be696163f07494 (commit)
       via  5c64568dc6c9e9e72916675ceca67cc965a6a647 (commit)
       via  550f341c3dbebdfb5ad8fd6953dc80e8e41d0d7f (commit)
       via  9a82600c9522504872daae091011fcef8c06a993 (commit)
       via  d465fb99cdaeedda8eed5893071df3260bc451f0 (commit)
       via  66f44dcdf4ba725735d6e2023b79bbed4033c728 (commit)
       via  d63af6df7cceaa2c727490001b1ab0382b6c899c (commit)
       via  27e6ea9d2a28bf53fe284b08bfd441b57af64f7a (commit)
      from  a3860c3931afde8695a962b7c9eb89bbd0827a25 (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=3bb3ae85f5a565827916aea82b8b0a04a7351e6a
commit 3bb3ae85f5a565827916aea82b8b0a04a7351e6a
Merge: a3860c3 585b063
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Nov 27 18:19:43 2011 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Nov 27 18:19:43 2011 -0500

    Merge topic 'target-include-directories' into next
    
    585b063 Hack to workaround caching of flags per directory.
    5c64568 Extract and use the INCLUDE_DIRECTORIES target properties.
    550f341 Exit the loop when we have determined the language.
    9a82600 Fix typos arguement -> argument.
    d465fb9 Trim trailing whitespace.
    66f44dc KWSys Nightly Date Stamp
    d63af6d KWSys Nightly Date Stamp
    27e6ea9 KWSys Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=585b06314ec85e5ada78951ef5be696163f07494
commit 585b06314ec85e5ada78951ef5be696163f07494
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 28 00:09:54 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..5f7f948 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1207,7 +1207,9 @@ const char* cmLocalGenerator::GetIncludeFlags(const std::vector<std::string> &in
   key += forResponseFile? "@" : "";
   if(this->LanguageToIncludeFlags.count(key))
     {
-    return this->LanguageToIncludeFlags[key].c_str();
+      // Introduced to cmLocalUnixMakefileGenerator in 692ba48c4e5762b370f2999e902b8bd677c77161
+      // It seems to just be memoization. Can it be removed?
+//     return this->LanguageToIncludeFlags[key].c_str();
     }
 
   cmOStringStream includeFlags;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c64568dc6c9e9e72916675ceca67cc965a6a647
commit 5c64568dc6c9e9e72916675ceca67cc965a6a647
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Nov 5 16:17:49 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Nov 28 00:09:54 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 dad0353..d6bd255 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1238,6 +1238,12 @@ void cmTarget::SetMakefile(cmMakefile* mf)
   // Save the backtrace of target construction.
   this->Makefile->GetBacktrace(this->Internal->Backtrace);
 
+  // Initialize the list of include directories
+  std::vector<std::string> makefileIncludes =
+    this->Makefile->GetIncludeDirectories();
+  this->IncludeDirectories.insert(this->IncludeDirectories.end(),
+    makefileIncludes.begin(), makefileIncludes.end());
+
   // Record current policies for later use.
   this->PolicyStatusCMP0003 =
     this->Makefile->GetPolicyStatus(cmPolicies::CMP0003);
@@ -2275,6 +2281,22 @@ void cmTarget::SetProperty(const char* prop, const char* value)
     return;
     }
 
+  if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
+    {
+    std::vector<std::string> newIncludes;
+    cmSystemTools::ExpandListArgument(value, newIncludes);
+    this->IncludeDirectories = newIncludes;
+    return;
+    }
+  if(strncmp(prop,"INCLUDE_DIRECTORIES_", 20) == 0)
+    {
+    std::string configName = prop + 20;
+    std::vector<std::string> newIncludes;
+    cmSystemTools::ExpandListArgument(value, newIncludes);
+    this->ConfigDirectories[configName] = newIncludes;
+    return;
+    }
+
   this->Properties.SetProperty(prop, value, cmProperty::TARGET);
   this->MaybeInvalidatePropertyCache(prop);
 }
@@ -2287,6 +2309,26 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
     {
     return;
     }
+
+  if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
+    {
+    std::vector<std::string> newIncludes;
+    cmSystemTools::ExpandListArgument(value, newIncludes);
+    this->IncludeDirectories.insert(this->IncludeDirectories.end(),
+                                    newIncludes.begin(), newIncludes.end());
+    return;
+    }
+  if(strncmp(prop,"INCLUDE_DIRECTORIES_", 20) == 0)
+    {
+    std::string configName = prop + 20;
+    std::vector<std::string> newIncludes;
+    cmSystemTools::ExpandListArgument(value, newIncludes);
+    this->ConfigDirectories[configName].insert(
+                                    this->ConfigDirectories[configName].end(),
+                                    newIncludes.begin(), newIncludes.end());
+    return;
+    }
+
   this->Properties.AppendProperty(prop, value, cmProperty::TARGET, asString);
   this->MaybeInvalidatePropertyCache(prop);
 }
@@ -2688,6 +2730,45 @@ const char *cmTarget::GetProperty(const char* prop,
     this->SetProperty("SOURCES", ss.str().c_str());
     }
 
+  if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
+    {
+    cmOStringStream str;
+    for (std::vector<std::string>::const_iterator
+         it = this->IncludeDirectories.begin();
+         it != this->IncludeDirectories.end();
+         ++ it )
+      {
+      if ( it != this->IncludeDirectories.begin())
+        {
+        str << ";";
+        }
+      str << it->c_str();
+      }
+    std::string output = str.str();
+    return output.c_str();
+    }
+  if(strncmp(prop,"INCLUDE_DIRECTORIES_", 20) == 0)
+    {
+    std::string configName = prop + 20;
+    std::vector<std::string> ConfigIncludeDirectories =
+                                this->ConfigDirectories[configName];
+
+    cmOStringStream str;
+    for (std::vector<std::string>::const_iterator
+         it = ConfigIncludeDirectories.begin();
+         it != ConfigIncludeDirectories.end();
+         ++ it )
+      {
+      if ( it != ConfigIncludeDirectories.begin())
+        {
+        str << ";";
+        }
+      str << it->c_str();
+      }
+    std::string output = str.str();
+    return output.c_str();
+    }
+
   // the type property returns what type the target is
   if (!strcmp(prop,"TYPE"))
     {
@@ -4628,6 +4709,33 @@ cmTarget::GetLinkInformation(const char* config)
   return i->second;
 }
 
+void cmTarget::GetIncludeDirectories(std::vector<std::string> &includes, const char* config)
+{
+  std::vector<std::string> targetIncludes;
+
+  targetIncludes.insert(targetIncludes.end(), this->IncludeDirectories.begin(), this->IncludeDirectories.end());
+
+  std::string configName = cmSystemTools::UpperCase(config);
+  std::vector<std::string> configIncludes = this->ConfigDirectories[configName];
+  targetIncludes.insert(targetIncludes.end(), configIncludes.begin(), configIncludes.end());
+
+  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..2306c71 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.
@@ -558,6 +560,8 @@ private:
   LinkLibraryVectorType OriginalLinkLibraries;
   bool DLLPlatform;
   bool IsImportedTarget;
+  std::vector<std::string> IncludeDirectories;
+  std::map<cmStdString, std::vector<std::string> > ConfigDirectories;
 
   // Cache target output paths for each configuration.
   struct OutputInfo;
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());
     }
diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt
index 60b8c22..60f5e5e 100644
--- a/Tests/IncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/CMakeLists.txt
@@ -45,3 +45,5 @@ else()
   set_target_properties(IncludeDirectories
     PROPERTIES COMPILE_FLAGS "-ITarProp")
 endif()
+
+add_subdirectory(TargetIncludeDirectories)
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
new file mode 100644
index 0000000..834b308
--- /dev/null
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
@@ -0,0 +1,26 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(TargetIncludeDirectories)
+
+macro(create_header _name)
+  file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_name}")
+  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_name}/${_name}.h"
+  "//${_name}.h
+  ")
+endmacro()
+
+create_header(bar)
+create_header(bat)
+create_header(foo)
+create_header(baz)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+include_directories("${CMAKE_CURRENT_BINARY_DIR}/bar")
+
+add_executable(TargetIncludeDirectories main.cpp)
+set_target_properties(TargetIncludeDirectories PROPERTIES INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/bat")
+set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/foo")
+
+include_directories("${CMAKE_CURRENT_BINARY_DIR}/baz")
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
new file mode 100644
index 0000000..8aa3532
--- /dev/null
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
@@ -0,0 +1,10 @@
+
+#include "bar.h"
+#include "bat.h"
+#include "foo.h"
+#include "baz.h"
+
+int main(int, char**)
+{
+  return 0;
+}

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

    Exit the loop when we have determined the language.

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 4e4f1d9..f603d0e 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=9a82600c9522504872daae091011fcef8c06a993
commit 9a82600c9522504872daae091011fcef8c06a993
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Nov 10 01:28:01 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Nov 28 00:09:54 2011 +0100

    Fix typos arguement -> argument.

diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 641c89f..2137340 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -30,8 +30,8 @@ class cmSystemTools: public cmsys::SystemTools
 public:
   typedef cmsys::SystemTools Superclass;
 
-  /** Expand out any arguements in the vector that have ; separated
-   *  strings into multiple arguements.  A new vector is created
+  /** Expand out any arguments in the vector that have ; separated
+   *  strings into multiple arguments.  A new vector is created
    *  containing the expanded versions of all arguments in argsIn.
    */
   static void ExpandList(std::vector<std::string> const& argsIn,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d465fb99cdaeedda8eed5893071df3260bc451f0
commit d465fb99cdaeedda8eed5893071df3260bc451f0
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Nov 5 16:17:05 2011 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Nov 28 00:09:54 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/cmLocalGenerator.cxx                        |   18 ++--
 Source/cmLocalGenerator.h                          |    4 +-
 Source/cmMakefileTargetGenerator.cxx               |    9 ++-
 Source/cmSystemTools.h                             |    4 +-
 Source/cmTarget.cxx                                |  108 ++++++++++++++++++++
 Source/cmTarget.h                                  |    4 +
 Source/cmake.cxx                                   |    5 +-
 Source/kwsys/kwsysDateStamp.cmake                  |    2 +-
 Tests/IncludeDirectories/CMakeLists.txt            |    2 +
 .../TargetIncludeDirectories/CMakeLists.txt        |   26 +++++
 .../TargetIncludeDirectories/main.cpp              |   10 ++
 11 files changed, 177 insertions(+), 15 deletions(-)
 create mode 100644 Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
 create mode 100644 Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list