[Cmake-commits] CMake branch, next, updated. v3.0.0-4316-gc77871b

Ben Boeckel ben.boeckel at kitware.com
Wed Jul 16 17:29:19 EDT 2014


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

The branch, next has been updated
       via  c77871bb8b938d98420f4e7cd833cc38b58fd748 (commit)
       via  d0671f81c00adc4c75dd498daa8120717dcec8ec (commit)
       via  16daa081b0214a0e135397d1dbb8dd515e4adff8 (commit)
       via  52f88e5386b5a5382a547baaf118f95950e54b18 (commit)
       via  fef60ce66937d89bab4a27e9f86330de337e1dac (commit)
       via  5a121dddb8a25bff44b95d56859a03032ca1b250 (commit)
       via  ea0b15689dc24b248993505caadec04c0a5a5d9f (commit)
       via  99672f236bf0c6e6a7ebaf39efb1b6b3de3e41f3 (commit)
       via  b035f02dd4ccbdc5e3907b174b2385e0ee641f48 (commit)
       via  104f3232a97243ad3c2b0f072ccb70ce59626208 (commit)
       via  87abdb835d5c484495b02e7bbaeba6e95254ba23 (commit)
       via  4cfa918a9ae983274a7995ca89fb46fdf570b00c (commit)
       via  85242b7df63a8097c5672c3053873aec371b6af7 (commit)
      from  f9ce1282dc89482386760133abc34143c04edd1d (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=c77871bb8b938d98420f4e7cd833cc38b58fd748
commit c77871bb8b938d98420f4e7cd833cc38b58fd748
Merge: f9ce128 d0671f8
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Wed Jul 16 17:29:18 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jul 16 17:29:18 2014 -0400

    Merge topic 'dev/target-fastpaths' into next
    
    d0671f81 cmTarget: use a hash_map for cmTargets typedef
    16daa081 cmTarget: help the optimizer a bit
    52f88e53 cmTarget: use hash_set for sets of strings
    fef60ce6 genex: Allow genex caching of config genex on single-config generators
    5a121ddd cmTarget: Allow caching of empty genex expansions
    ea0b1568 cmTarget: Only copy GenEx expansions when necessary
    99672f23 cmTarget: Don't set properties on custom targets
    b035f02d cmTarget: Use static strings for special property names
    104f3232 cmTarget: Sort special property checks
    87abdb83 cmTarget: Fast path for regular properties
    4cfa918a cmTarget: Factor out common code
    85242b7d cmTarget: Use else/if trees rather than an if tree


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d0671f81c00adc4c75dd498daa8120717dcec8ec
commit d0671f81c00adc4c75dd498daa8120717dcec8ec
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Jun 10 13:07:24 2014 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Jul 16 17:29:06 2014 -0400

    cmTarget: use a hash_map for cmTargets typedef

diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 4005443..9064eec 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -18,6 +18,9 @@
 #include "cmListFileCache.h"
 
 #include <cmsys/auto_ptr.hxx>
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+#include <cmsys/hash_map.hxx>
+#endif
 
 #define CM_FOR_EACH_TARGET_POLICY(F) \
   F(CMP0003) \
@@ -831,7 +834,11 @@ private:
   mutable bool LinkImplementationLanguageIsContextDependent;
 };
 
+#ifdef CMAKE_BUILD_WITH_CMAKE
+typedef cmsys::hash_map<std::string,cmTarget> cmTargets;
+#else
 typedef std::map<std::string,cmTarget> cmTargets;
+#endif
 
 class cmTargetSet: public std::set<std::string> {};
 class cmTargetManifest: public std::map<std::string, cmTargetSet> {};

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=16daa081b0214a0e135397d1dbb8dd515e4adff8
commit 16daa081b0214a0e135397d1dbb8dd515e4adff8
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Jun 10 13:07:12 2014 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Jul 16 17:29:05 2014 -0400

    cmTarget: help the optimizer a bit

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9f3fbb3..47ca8dd 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -224,7 +224,7 @@ public:
 cmLinkImplItem cmTargetInternals::TargetPropertyEntry::NoLinkImplItem;
 
 //----------------------------------------------------------------------------
-void deleteAndClear(
+static void deleteAndClear(
       std::vector<cmTargetInternals::TargetPropertyEntry*> &entries)
 {
   for (std::vector<cmTargetInternals::TargetPropertyEntry*>::const_iterator
@@ -238,7 +238,7 @@ void deleteAndClear(
 }
 
 //----------------------------------------------------------------------------
-void deleteAndClear(
+static void deleteAndClear(
   std::map<std::string,
           std::vector<cmTargetInternals::TargetPropertyEntry*> > &entries)
 {
@@ -2299,7 +2299,7 @@ static void processCompileOptionsInternal(cmTarget const* tgt,
     for(std::vector<std::string>::iterator
           li = entryOptions->begin(); li != entryOptions->end(); ++li)
       {
-      std::string opt = *li;
+      std::string const& opt = *li;
 
       if(uniqueOptions.insert(opt).second)
         {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52f88e5386b5a5382a547baaf118f95950e54b18
commit 52f88e5386b5a5382a547baaf118f95950e54b18
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Jun 10 10:29:16 2014 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Jul 16 17:29:05 2014 -0400

    cmTarget: use hash_set for sets of strings
    
    20% (!) performance improvement with Make's generate step on Slicer.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b93a1b0..9f3fbb3 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -25,6 +25,12 @@
 #include <stdlib.h> // required for atof
 #include <assert.h>
 #include <errno.h>
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+#include <cmsys/hash_set.hxx>
+#define UNORDERED_SET cmsys::hash_set
+#else
+#define UNORDERED_SET std::set
+#endif
 
 const char* cmTarget::GetTargetTypeName(TargetType targetType)
 {
@@ -642,7 +648,7 @@ bool cmTarget::IsBundleOnApple() const
 static bool processSources(cmTarget const* tgt,
       const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
       std::vector<std::string> &srcs,
-      std::set<std::string> &uniqueSrcs,
+      UNORDERED_SET<std::string> &uniqueSrcs,
       cmGeneratorExpressionDAGChecker *dagChecker,
       std::string const& config, bool debugSources)
 {
@@ -784,7 +790,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
   cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
                                              "SOURCES", 0, 0);
 
-  std::set<std::string> uniqueSrcs;
+  UNORDERED_SET<std::string> uniqueSrcs;
   bool contextDependentDirectSources = processSources(this,
                  this->Internal->SourceEntries,
                  files,
@@ -1298,7 +1304,7 @@ void cmTarget::GetTllSignatureTraces(cmOStringStream &s,
                         = (sig == cmTarget::KeywordTLLSignature ? "keyword"
                                                                 : "plain");
     s << "The uses of the " << sigString << " signature are here:\n";
-    std::set<std::string> emitted;
+    UNORDERED_SET<std::string> emitted;
     for(std::vector<cmListFileBacktrace>::iterator it = sigs.begin();
         it != sigs.end(); ++it)
       {
@@ -1717,22 +1723,20 @@ static bool whiteListedInterfaceProperty(const std::string& prop)
     {
     return true;
     }
-  static const char* builtIns[] = {
-    // ###: This must remain sorted. It is processed with a binary search.
-    "COMPATIBLE_INTERFACE_BOOL",
-    "COMPATIBLE_INTERFACE_NUMBER_MAX",
-    "COMPATIBLE_INTERFACE_NUMBER_MIN",
-    "COMPATIBLE_INTERFACE_STRING",
-    "EXPORT_NAME",
-    "IMPORTED",
-    "NAME",
-    "TYPE"
-  };
+  static UNORDERED_SET<std::string> builtIns;
+  if (builtIns.empty())
+    {
+    builtIns.insert("COMPATIBLE_INTERFACE_BOOL");
+    builtIns.insert("COMPATIBLE_INTERFACE_NUMBER_MAX");
+    builtIns.insert("COMPATIBLE_INTERFACE_NUMBER_MIN");
+    builtIns.insert("COMPATIBLE_INTERFACE_STRING");
+    builtIns.insert("EXPORT_NAME");
+    builtIns.insert("IMPORTED");
+    builtIns.insert("NAME");
+    builtIns.insert("TYPE");
+    }
 
-  if (std::binary_search(cmArrayBegin(builtIns),
-                         cmArrayEnd(builtIns),
-                         prop.c_str(),
-                         cmStrCmp(prop)))
+  if (builtIns.count(prop))
     {
     return true;
     }
@@ -2017,7 +2021,7 @@ void cmTarget::InsertCompileDefinition(const cmValueWithOrigin &entry)
 static void processIncludeDirectories(cmTarget const* tgt,
       const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
       std::vector<std::string> &includes,
-      std::set<std::string> &uniqueIncludes,
+      UNORDERED_SET<std::string> &uniqueIncludes,
       cmGeneratorExpressionDAGChecker *dagChecker,
       const std::string& config, bool debugIncludes)
 {
@@ -2166,7 +2170,7 @@ std::vector<std::string>
 cmTarget::GetIncludeDirectories(const std::string& config) const
 {
   std::vector<std::string> includes;
-  std::set<std::string> uniqueIncludes;
+  UNORDERED_SET<std::string> uniqueIncludes;
 
   cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
                                              "INCLUDE_DIRECTORIES", 0, 0);
@@ -2258,7 +2262,7 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
 static void processCompileOptionsInternal(cmTarget const* tgt,
       const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
       std::vector<std::string> &options,
-      std::set<std::string> &uniqueOptions,
+      UNORDERED_SET<std::string> &uniqueOptions,
       cmGeneratorExpressionDAGChecker *dagChecker,
       const std::string& config, bool debugOptions, const char *logName)
 {
@@ -2321,7 +2325,7 @@ static void processCompileOptionsInternal(cmTarget const* tgt,
 static void processCompileOptions(cmTarget const* tgt,
       const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
       std::vector<std::string> &options,
-      std::set<std::string> &uniqueOptions,
+      UNORDERED_SET<std::string> &uniqueOptions,
       cmGeneratorExpressionDAGChecker *dagChecker,
       const std::string& config, bool debugOptions)
 {
@@ -2358,7 +2362,7 @@ void cmTarget::GetAutoUicOptions(std::vector<std::string> &result,
 void cmTarget::GetCompileOptions(std::vector<std::string> &result,
                                  const std::string& config) const
 {
-  std::set<std::string> uniqueOptions;
+  UNORDERED_SET<std::string> uniqueOptions;
 
   cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
                                              "COMPILE_OPTIONS", 0, 0);
@@ -2419,7 +2423,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
 static void processCompileDefinitions(cmTarget const* tgt,
       const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
       std::vector<std::string> &options,
-      std::set<std::string> &uniqueOptions,
+      UNORDERED_SET<std::string> &uniqueOptions,
       cmGeneratorExpressionDAGChecker *dagChecker,
       const std::string& config, bool debugOptions)
 {
@@ -2432,7 +2436,7 @@ static void processCompileDefinitions(cmTarget const* tgt,
 void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
                                             const std::string& config) const
 {
-  std::set<std::string> uniqueOptions;
+  UNORDERED_SET<std::string> uniqueOptions;
 
   cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
                                              "COMPILE_DEFINITIONS", 0, 0);
@@ -2530,7 +2534,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
 static void processCompileFeatures(cmTarget const* tgt,
       const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
       std::vector<std::string> &options,
-      std::set<std::string> &uniqueOptions,
+      UNORDERED_SET<std::string> &uniqueOptions,
       cmGeneratorExpressionDAGChecker *dagChecker,
       const std::string& config, bool debugOptions)
 {
@@ -2542,7 +2546,7 @@ static void processCompileFeatures(cmTarget const* tgt,
 void cmTarget::GetCompileFeatures(std::vector<std::string> &result,
                                   const std::string& config) const
 {
-  std::set<std::string> uniqueFeatures;
+  UNORDERED_SET<std::string> uniqueFeatures;
 
   cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
                                              "COMPILE_FEATURES",
@@ -3082,7 +3086,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
                                    cmProperty::TARGET);
       }
     // Support "<CONFIG>_LOCATION".
-    if(cmHasLiteralSuffix(prop, "_LOCATION"))
+    else if(cmHasLiteralSuffix(prop, "_LOCATION"))
       {
       std::string configName(prop.c_str(), prop.size() - 9);
       if(configName != "IMPORTED")
@@ -3097,7 +3101,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
         }
       }
     }
-  static std::set<std::string> specialProps;
+  static UNORDERED_SET<std::string> specialProps;
 #define MAKE_STATIC_PROP(PROP) \
   static const std::string prop##PROP = #PROP
   MAKE_STATIC_PROP(LINK_LIBRARIES);
@@ -3323,7 +3327,7 @@ class cmTargetCollectLinkLanguages
 public:
   cmTargetCollectLinkLanguages(cmTarget const* target,
                                const std::string& config,
-                               std::set<std::string>& languages,
+                               UNORDERED_SET<std::string>& languages,
                                cmTarget const* head):
     Config(config), Languages(languages), HeadTarget(head),
     Makefile(target->GetMakefile()), Target(target)
@@ -3393,7 +3397,7 @@ public:
     }
 private:
   std::string Config;
-  std::set<std::string>& Languages;
+  UNORDERED_SET<std::string>& Languages;
   cmTarget const* HeadTarget;
   cmMakefile* Makefile;
   const cmTarget* Target;
@@ -3430,7 +3434,7 @@ class cmTargetSelectLinker
   cmTarget const* Target;
   cmMakefile* Makefile;
   cmGlobalGenerator* GG;
-  std::set<std::string> Preferred;
+  UNORDERED_SET<std::string> Preferred;
 public:
   cmTargetSelectLinker(cmTarget const* target): Preference(0), Target(target)
     {
@@ -3462,7 +3466,7 @@ public:
       e << "Target " << this->Target->GetName()
         << " contains multiple languages with the highest linker preference"
         << " (" << this->Preference << "):\n";
-      for(std::set<std::string>::const_iterator
+      for(UNORDERED_SET<std::string>::const_iterator
             li = this->Preferred.begin(); li != this->Preferred.end(); ++li)
         {
         e << "  " << *li << "\n";
@@ -3481,7 +3485,7 @@ void cmTarget::ComputeLinkClosure(const std::string& config,
                                   LinkClosure& lc) const
 {
   // Get languages built in this target.
-  std::set<std::string> languages;
+  UNORDERED_SET<std::string> languages;
   LinkImplementation const* impl = this->GetLinkImplementation(config);
   for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
       li != impl->Languages.end(); ++li)
@@ -3499,7 +3503,7 @@ void cmTarget::ComputeLinkClosure(const std::string& config,
     }
 
   // Store the transitive closure of languages.
-  for(std::set<std::string>::const_iterator li = languages.begin();
+  for(UNORDERED_SET<std::string>::const_iterator li = languages.begin();
       li != languages.end(); ++li)
     {
     lc.Languages.push_back(*li);
@@ -3527,7 +3531,7 @@ void cmTarget::ComputeLinkClosure(const std::string& config,
       }
 
     // Now consider languages that propagate from linked targets.
-    for(std::set<std::string>::const_iterator sit = languages.begin();
+    for(UNORDERED_SET<std::string>::const_iterator sit = languages.begin();
         sit != languages.end(); ++sit)
       {
       std::string propagates = "CMAKE_"+*sit+"_LINKER_PREFERENCE_PROPAGATES";
@@ -6261,7 +6265,7 @@ void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget,
       {
       // Shared libraries may have runtime implementation dependencies
       // on other shared libraries that are not in the interface.
-      std::set<std::string> emitted;
+      UNORDERED_SET<std::string> emitted;
       for(std::vector<cmLinkItem>::const_iterator
           li = iface.Libraries.begin(); li != iface.Libraries.end(); ++li)
         {
@@ -6835,6 +6839,7 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
 
   if (!prop.empty())
     {
+    // Use a std::set to keep the error message sorted.
     std::set<std::string> props;
     std::set<std::string>::const_iterator i = emittedBools.find(prop);
     if (i != emittedBools.end())

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fef60ce66937d89bab4a27e9f86330de337e1dac
commit fef60ce66937d89bab4a27e9f86330de337e1dac
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Wed Apr 30 15:41:40 2014 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Jul 16 17:29:05 2014 -0400

    genex: Allow genex caching of config genex on single-config generators
    
    The single-config generators do not make $<CONFIGURATION> and $<CONFIG>
    generator expressions context-sensitive.

diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 3b83cd3..2581355 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -15,6 +15,7 @@
 #include "cmGeneratorExpressionParser.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 #include "cmGeneratorExpression.h"
+#include "cmGlobalGenerator.h"
 #include "cmLocalGenerator.h"
 #include "cmSourceFile.h"
 
@@ -688,7 +689,11 @@ static const struct ConfigurationNode : public cmGeneratorExpressionNode
                        const GeneratorExpressionContent *,
                        cmGeneratorExpressionDAGChecker *) const
   {
-    context->HadContextSensitiveCondition = true;
+    if (context->Makefile->GetLocalGenerator()->
+                           GetGlobalGenerator()->IsMultiConfig())
+      {
+      context->HadContextSensitiveCondition = true;
+      }
     return context->Config;
   }
 } configurationNode;
@@ -716,7 +721,11 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
                   "Expression syntax not recognized.");
       return std::string();
       }
-    context->HadContextSensitiveCondition = true;
+    if (context->Makefile->GetLocalGenerator()->
+                           GetGlobalGenerator()->IsMultiConfig())
+      {
+      context->HadContextSensitiveCondition = true;
+      }
     if (context->Config.empty())
       {
       return parameters.front().empty() ? "1" : "0";
diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
index fa76f24..57c52e3 100644
--- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
@@ -9,7 +9,11 @@ run_cmake(RelativePathInInterface)
 run_cmake(ImportedTarget)
 run_cmake(RelativePathInGenex)
 run_cmake(CMP0021)
-run_cmake(install_config)
+if (CMAKE_CONFIGURATION_TYPES)
+  # $<CONFIGURATION> is only context-dependent in multi-config
+  # generators.
+  run_cmake(install_config)
+endif ()
 run_cmake(incomplete-genex)
 run_cmake(export-NOWARN)
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5a121dddb8a25bff44b95d56859a03032ca1b250
commit 5a121dddb8a25bff44b95d56859a03032ca1b250
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Wed Apr 30 15:41:19 2014 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Jul 16 17:29:05 2014 -0400

    cmTarget: Allow caching of empty genex expansions

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 25b37f8..b93a1b0 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -176,10 +176,11 @@ public:
   public:
     TargetPropertyEntry(cmsys::auto_ptr<cmCompiledGeneratorExpression> cge,
                         cmLinkImplItem const& item = NoLinkImplItem)
-      : ge(cge), LinkImplItem(item)
+      : ge(cge), Cached(false), LinkImplItem(item)
     {}
     const cmsys::auto_ptr<cmCompiledGeneratorExpression> ge;
     std::vector<std::string> CachedEntries;
+    bool Cached;
     cmLinkImplItem const& LinkImplItem;
   };
   std::vector<TargetPropertyEntry*> IncludeDirectoriesEntries;
@@ -2269,7 +2270,7 @@ static void processCompileOptionsInternal(cmTarget const* tgt,
     std::vector<std::string>& entriesRef = (*it)->CachedEntries;
     std::vector<std::string> localEntries;
     std::vector<std::string>* entryOptions = &entriesRef;
-    if(entryOptions->empty())
+    if(!(*it)->Cached)
       {
       cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
                                                 config,
@@ -2282,6 +2283,7 @@ static void processCompileOptionsInternal(cmTarget const* tgt,
         {
         // Cache the result.
         *entryOptions = localEntries;
+        (*it)->Cached = true;
         }
       else
         {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea0b15689dc24b248993505caadec04c0a5a5d9f
commit ea0b15689dc24b248993505caadec04c0a5a5d9f
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Feb 10 01:24:42 2014 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Jul 16 17:29:05 2014 -0400

    cmTarget: Only copy GenEx expansions when necessary

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 2d53ad2..25b37f8 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2266,25 +2266,32 @@ static void processCompileOptionsInternal(cmTarget const* tgt,
   for (std::vector<cmTargetInternals::TargetPropertyEntry*>::const_iterator
       it = entries.begin(), end = entries.end(); it != end; ++it)
     {
-    bool cacheOptions = false;
-    std::vector<std::string> entryOptions = (*it)->CachedEntries;
-    if(entryOptions.empty())
+    std::vector<std::string>& entriesRef = (*it)->CachedEntries;
+    std::vector<std::string> localEntries;
+    std::vector<std::string>* entryOptions = &entriesRef;
+    if(entryOptions->empty())
       {
       cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
                                                 config,
                                                 false,
                                                 tgt,
                                                 dagChecker),
-                                      entryOptions);
+                                      localEntries);
       if (mf->IsGeneratingBuildSystem()
           && !(*it)->ge->GetHadContextSensitiveCondition())
         {
-        cacheOptions = true;
+        // Cache the result.
+        *entryOptions = localEntries;
+        }
+      else
+        {
+        // Use the context-sensitive results here.
+        entryOptions = &localEntries;
         }
       }
     std::string usedOptions;
     for(std::vector<std::string>::iterator
-          li = entryOptions.begin(); li != entryOptions.end(); ++li)
+          li = entryOptions->begin(); li != entryOptions->end(); ++li)
       {
       std::string opt = *li;
 
@@ -2297,10 +2304,6 @@ static void processCompileOptionsInternal(cmTarget const* tgt,
           }
         }
       }
-    if (cacheOptions)
-      {
-      (*it)->CachedEntries = entryOptions;
-      }
     if (!usedOptions.empty())
       {
       mf->GetCMakeInstance()->IssueMessage(cmake::LOG,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=99672f236bf0c6e6a7ebaf39efb1b6b3de3e41f3
commit 99672f236bf0c6e6a7ebaf39efb1b6b3de3e41f3
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Wed Mar 12 14:05:52 2014 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Jul 16 17:29:05 2014 -0400

    cmTarget: Don't set properties on custom targets
    
    Properties are not required on custom targets.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 6d5df81..2d53ad2 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -328,7 +328,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
   this->IsApple = this->Makefile->IsOn("APPLE");
 
   // Setup default property values.
-  if (this->GetType() != INTERFACE_LIBRARY)
+  if (this->GetType() != INTERFACE_LIBRARY && this->GetType() != UTILITY)
     {
     this->SetPropertyDefault("INSTALL_NAME_DIR", 0);
     this->SetPropertyDefault("INSTALL_RPATH", "");
@@ -369,41 +369,44 @@ void cmTarget::SetMakefile(cmMakefile* mf)
   mf->GetConfigurations(configNames);
 
   // Setup per-configuration property default values.
-  const char* configProps[] = {
-    "ARCHIVE_OUTPUT_DIRECTORY_",
-    "LIBRARY_OUTPUT_DIRECTORY_",
-    "RUNTIME_OUTPUT_DIRECTORY_",
-    "PDB_OUTPUT_DIRECTORY_",
-    "COMPILE_PDB_OUTPUT_DIRECTORY_",
-    "MAP_IMPORTED_CONFIG_",
-    0};
-  for(std::vector<std::string>::iterator ci = configNames.begin();
-      ci != configNames.end(); ++ci)
-    {
-    std::string configUpper = cmSystemTools::UpperCase(*ci);
-    for(const char** p = configProps; *p; ++p)
-      {
-      if (this->TargetTypeValue == INTERFACE_LIBRARY
-          && strcmp(*p, "MAP_IMPORTED_CONFIG_") != 0)
+  if (this->GetType() != UTILITY)
+    {
+    const char* configProps[] = {
+      "ARCHIVE_OUTPUT_DIRECTORY_",
+      "LIBRARY_OUTPUT_DIRECTORY_",
+      "RUNTIME_OUTPUT_DIRECTORY_",
+      "PDB_OUTPUT_DIRECTORY_",
+      "COMPILE_PDB_OUTPUT_DIRECTORY_",
+      "MAP_IMPORTED_CONFIG_",
+      0};
+    for(std::vector<std::string>::iterator ci = configNames.begin();
+        ci != configNames.end(); ++ci)
+      {
+      std::string configUpper = cmSystemTools::UpperCase(*ci);
+      for(const char** p = configProps; *p; ++p)
         {
-        continue;
+        if (this->TargetTypeValue == INTERFACE_LIBRARY
+            && strcmp(*p, "MAP_IMPORTED_CONFIG_") != 0)
+          {
+          continue;
+          }
+        std::string property = *p;
+        property += configUpper;
+        this->SetPropertyDefault(property, 0);
         }
-      std::string property = *p;
-      property += configUpper;
-      this->SetPropertyDefault(property, 0);
-      }
 
-    // Initialize per-configuration name postfix property from the
-    // variable only for non-executable targets.  This preserves
-    // compatibility with previous CMake versions in which executables
-    // did not support this variable.  Projects may still specify the
-    // property directly.
-    if(this->TargetTypeValue != cmTarget::EXECUTABLE
-        && this->TargetTypeValue != cmTarget::INTERFACE_LIBRARY)
-      {
-      std::string property = cmSystemTools::UpperCase(*ci);
-      property += "_POSTFIX";
-      this->SetPropertyDefault(property, 0);
+      // Initialize per-configuration name postfix property from the
+      // variable only for non-executable targets.  This preserves
+      // compatibility with previous CMake versions in which executables
+      // did not support this variable.  Projects may still specify the
+      // property directly.
+      if(this->TargetTypeValue != cmTarget::EXECUTABLE
+          && this->TargetTypeValue != cmTarget::INTERFACE_LIBRARY)
+        {
+        std::string property = cmSystemTools::UpperCase(*ci);
+        property += "_POSTFIX";
+        this->SetPropertyDefault(property, 0);
+        }
       }
     }
 
@@ -442,7 +445,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
       }
     }
 
-  if (this->GetType() != INTERFACE_LIBRARY)
+  if (this->GetType() != INTERFACE_LIBRARY && this->GetType() != UTILITY)
     {
     this->SetPropertyDefault("C_VISIBILITY_PRESET", 0);
     this->SetPropertyDefault("CXX_VISIBILITY_PRESET", 0);
@@ -454,7 +457,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
     {
     this->SetProperty("POSITION_INDEPENDENT_CODE", "True");
     }
-  if (this->GetType() != INTERFACE_LIBRARY)
+  if (this->GetType() != INTERFACE_LIBRARY && this->GetType() != UTILITY)
     {
     this->SetPropertyDefault("POSITION_INDEPENDENT_CODE", 0);
     }
@@ -476,8 +479,11 @@ void cmTarget::SetMakefile(cmMakefile* mf)
     this->PolicyStatusCMP0022 = cmPolicies::NEW;
     }
 
-  this->SetPropertyDefault("JOB_POOL_COMPILE", 0);
-  this->SetPropertyDefault("JOB_POOL_LINK", 0);
+  if (this->GetType() != INTERFACE_LIBRARY && this->GetType() != UTILITY)
+    {
+    this->SetPropertyDefault("JOB_POOL_COMPILE", 0);
+    this->SetPropertyDefault("JOB_POOL_LINK", 0);
+    }
 }
 
 //----------------------------------------------------------------------------

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b035f02dd4ccbdc5e3907b174b2385e0ee641f48
commit b035f02dd4ccbdc5e3907b174b2385e0ee641f48
Author:     Ben Boeckel <mathstuf at gmail.com>
AuthorDate: Sat Feb 8 12:12:27 2014 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Jul 16 17:29:04 2014 -0400

    cmTarget: Use static strings for special property names
    
    The function is called enough that the std::string/cstr comparisons are
    expensive from the strlen. Cache the strings for faster comparisons.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 2ed1f6d..6d5df81 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3037,7 +3037,8 @@ const char *cmTarget::GetProperty(const std::string& prop,
      this->GetType() == cmTarget::MODULE_LIBRARY ||
      this->GetType() == cmTarget::UNKNOWN_LIBRARY)
     {
-    if(prop == "LOCATION")
+    static const std::string propLOCATION = "LOCATION";
+    if(prop == propLOCATION)
       {
       if (!this->HandleLocationPropertyPolicy(context))
         {
@@ -3053,12 +3054,12 @@ const char *cmTarget::GetProperty(const std::string& prop,
       // cannot take into account the per-configuration name of the
       // target because the configuration type may not be known at
       // CMake time.
-      this->Properties.SetProperty("LOCATION", this->GetLocationForBuild(),
+      this->Properties.SetProperty(propLOCATION, this->GetLocationForBuild(),
                                    cmProperty::TARGET);
       }
 
     // Support "LOCATION_<CONFIG>".
-    if(cmHasLiteralPrefix(prop, "LOCATION_"))
+    else if(cmHasLiteralPrefix(prop, "LOCATION_"))
       {
       if (!this->HandleLocationPropertyPolicy(context))
         {
@@ -3086,21 +3087,33 @@ const char *cmTarget::GetProperty(const std::string& prop,
       }
     }
   static std::set<std::string> specialProps;
+#define MAKE_STATIC_PROP(PROP) \
+  static const std::string prop##PROP = #PROP
+  MAKE_STATIC_PROP(LINK_LIBRARIES);
+  MAKE_STATIC_PROP(TYPE);
+  MAKE_STATIC_PROP(INCLUDE_DIRECTORIES);
+  MAKE_STATIC_PROP(COMPILE_FEATURES);
+  MAKE_STATIC_PROP(COMPILE_OPTIONS);
+  MAKE_STATIC_PROP(COMPILE_DEFINITIONS);
+  MAKE_STATIC_PROP(IMPORTED);
+  MAKE_STATIC_PROP(NAME);
+  MAKE_STATIC_PROP(SOURCES);
+#undef MAKE_STATIC_PROP
   if(specialProps.empty())
     {
-    specialProps.insert("INCLUDE_DIRECTORIES");
-    specialProps.insert("COMPILE_FEATURES");
-    specialProps.insert("COMPILE_OPTIONS");
-    specialProps.insert("COMPILE_DEFINITIONS");
-    specialProps.insert("LINK_LIBRARIES");
-    specialProps.insert("IMPORTED");
-    specialProps.insert("NAME");
-    specialProps.insert("SOURCES");
-    specialProps.insert("TYPE");
+    specialProps.insert(propLINK_LIBRARIES);
+    specialProps.insert(propTYPE);
+    specialProps.insert(propINCLUDE_DIRECTORIES);
+    specialProps.insert(propCOMPILE_FEATURES);
+    specialProps.insert(propCOMPILE_OPTIONS);
+    specialProps.insert(propCOMPILE_DEFINITIONS);
+    specialProps.insert(propIMPORTED);
+    specialProps.insert(propNAME);
+    specialProps.insert(propSOURCES);
     }
   if(specialProps.count(prop))
     {
-    if(prop == "LINK_LIBRARIES")
+    if(prop == propLINK_LIBRARIES)
       {
       if (this->Internal->LinkImplementationPropertyEntries.empty())
         {
@@ -3122,11 +3135,11 @@ const char *cmTarget::GetProperty(const std::string& prop,
       return output.c_str();
       }
     // the type property returns what type the target is
-    else if (prop == "TYPE")
+    else if (prop == propTYPE)
       {
       return cmTarget::GetTargetTypeName(this->GetType());
       }
-    else if(prop == "INCLUDE_DIRECTORIES")
+    else if(prop == propINCLUDE_DIRECTORIES)
       {
       if (this->Internal->IncludeDirectoriesEntries.empty())
         {
@@ -3137,7 +3150,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       MakePropertyList(output, this->Internal->IncludeDirectoriesEntries);
       return output.c_str();
       }
-    else if(prop == "COMPILE_FEATURES")
+    else if(prop == propCOMPILE_FEATURES)
       {
       if (this->Internal->CompileFeaturesEntries.empty())
         {
@@ -3148,7 +3161,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       MakePropertyList(output, this->Internal->CompileFeaturesEntries);
       return output.c_str();
       }
-    else if(prop == "COMPILE_OPTIONS")
+    else if(prop == propCOMPILE_OPTIONS)
       {
       if (this->Internal->CompileOptionsEntries.empty())
         {
@@ -3159,7 +3172,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       MakePropertyList(output, this->Internal->CompileOptionsEntries);
       return output.c_str();
       }
-    else if(prop == "COMPILE_DEFINITIONS")
+    else if(prop == propCOMPILE_DEFINITIONS)
       {
       if (this->Internal->CompileDefinitionsEntries.empty())
         {
@@ -3170,15 +3183,15 @@ const char *cmTarget::GetProperty(const std::string& prop,
       MakePropertyList(output, this->Internal->CompileDefinitionsEntries);
       return output.c_str();
       }
-    else if (prop == "IMPORTED")
+    else if (prop == propIMPORTED)
       {
       return this->IsImported()?"TRUE":"FALSE";
       }
-    else if (prop == "NAME")
+    else if (prop == propNAME)
       {
       return this->GetName().c_str();
       }
-    else if(prop == "SOURCES")
+    else if(prop == propSOURCES)
       {
       if (this->Internal->SourceEntries.empty())
         {
@@ -4795,12 +4808,13 @@ bool cmTarget::IsNullImpliedByLinkLibraries(const std::string &p) const
 
 //----------------------------------------------------------------------------
 template<typename PropertyType>
-PropertyType getTypedProperty(cmTarget const* tgt, const char *prop,
+PropertyType getTypedProperty(cmTarget const* tgt, const std::string& prop,
                               PropertyType *);
 
 //----------------------------------------------------------------------------
 template<>
-bool getTypedProperty<bool>(cmTarget const* tgt, const char *prop, bool *)
+bool getTypedProperty<bool>(cmTarget const* tgt, const std::string& prop,
+                            bool *)
 {
   return tgt->GetPropertyAsBool(prop);
 }
@@ -4808,7 +4822,7 @@ bool getTypedProperty<bool>(cmTarget const* tgt, const char *prop, bool *)
 //----------------------------------------------------------------------------
 template<>
 const char *getTypedProperty<const char *>(cmTarget const* tgt,
-                                           const char *prop,
+                                           const std::string& prop,
                                            const char **)
 {
   return tgt->GetProperty(prop);
@@ -5083,6 +5097,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
     report += "\" property not set.\n";
     }
 
+  std::string interfaceProperty = "INTERFACE_" + p;
   for(std::vector<cmTarget const*>::const_iterator li =
       deps.begin();
       li != deps.end(); ++li)
@@ -5096,11 +5111,11 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
     cmTarget const* theTarget = *li;
 
     const bool ifaceIsSet = theTarget->GetProperties()
-                            .find("INTERFACE_" + p)
+                            .find(interfaceProperty)
                             != theTarget->GetProperties().end();
     PropertyType ifacePropContent =
                     getTypedProperty<PropertyType>(theTarget,
-                              ("INTERFACE_" + p).c_str(), 0);
+                              interfaceProperty.c_str(), 0);
 
     std::string reportEntry;
     if (ifaceIsSet)
@@ -6167,7 +6182,7 @@ cmTargetInternals::ComputeLinkInterfaceLibraries(
       // Compare the link implementation fallback link interface to the
       // preferred new link interface property and warn if different.
       std::vector<cmLinkItem> ifaceLibs;
-      std::string newProp = "INTERFACE_LINK_LIBRARIES";
+      if(const char* newExplicitLibraries = this->GetProperty(newProp))
       if(const char* newExplicitLibraries = thisTarget->GetProperty(newProp))
         {
         thisTarget->ExpandLinkItems(newProp, newExplicitLibraries, config,
@@ -6752,9 +6767,13 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
   const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
 
   std::set<std::string> emittedBools;
+  static std::string strBool = "COMPATIBLE_INTERFACE_BOOL";
   std::set<std::string> emittedStrings;
+  static std::string strString = "COMPATIBLE_INTERFACE_STRING";
   std::set<std::string> emittedMinNumbers;
+  static std::string strNumMin = "COMPATIBLE_INTERFACE_NUMBER_MIN";
   std::set<std::string> emittedMaxNumbers;
+  static std::string strNumMax = "COMPATIBLE_INTERFACE_NUMBER_MAX";
 
   for(cmComputeLinkInformation::ItemVector::const_iterator li =
       deps.begin();
@@ -6766,14 +6785,14 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
       }
 
     checkPropertyConsistency<bool>(this, li->Target,
-                                std::string("COMPATIBLE_INTERFACE_BOOL"),
+                                strBool,
                                 emittedBools, config, BoolType, 0);
     if (cmSystemTools::GetErrorOccuredFlag())
       {
       return;
       }
     checkPropertyConsistency<const char *>(this, li->Target,
-                                std::string("COMPATIBLE_INTERFACE_STRING"),
+                                strString,
                                 emittedStrings, config,
                                 StringType, 0);
     if (cmSystemTools::GetErrorOccuredFlag())
@@ -6781,7 +6800,7 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
       return;
       }
     checkPropertyConsistency<const char *>(this, li->Target,
-                                std::string("COMPATIBLE_INTERFACE_NUMBER_MIN"),
+                                strNumMin,
                                 emittedMinNumbers, config,
                                 NumberMinType, 0);
     if (cmSystemTools::GetErrorOccuredFlag())
@@ -6789,7 +6808,7 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
       return;
       }
     checkPropertyConsistency<const char *>(this, li->Target,
-                                std::string("COMPATIBLE_INTERFACE_NUMBER_MAX"),
+                                strNumMax,
                                 emittedMaxNumbers, config,
                                 NumberMaxType, 0);
     if (cmSystemTools::GetErrorOccuredFlag())
@@ -6809,22 +6828,22 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
     std::set<std::string>::const_iterator i = emittedBools.find(prop);
     if (i != emittedBools.end())
       {
-      props.insert("COMPATIBLE_INTERFACE_BOOL");
+      props.insert(strBool);
       }
     i = emittedStrings.find(prop);
     if (i != emittedStrings.end())
       {
-      props.insert("COMPATIBLE_INTERFACE_STRING");
+      props.insert(strString);
       }
     i = emittedMinNumbers.find(prop);
     if (i != emittedMinNumbers.end())
       {
-      props.insert("COMPATIBLE_INTERFACE_NUMBER_MIN");
+      props.insert(strNumMin);
       }
     i = emittedMaxNumbers.find(prop);
     if (i != emittedMaxNumbers.end())
       {
-      props.insert("COMPATIBLE_INTERFACE_NUMBER_MAX");
+      props.insert(strNumMax);
       }
 
     std::string propsString = *props.begin();

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=104f3232a97243ad3c2b0f072ccb70ce59626208
commit 104f3232a97243ad3c2b0f072ccb70ce59626208
Author:     Ben Boeckel <mathstuf at gmail.com>
AuthorDate: Sat Feb 8 12:11:32 2014 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Jul 16 17:28:32 2014 -0400

    cmTarget: Sort special property checks
    
    The LINK_LIBRARIES property is by *far* the most popular. Move it to the
    top. TYPE is second, but with more generator expression usage, that may
    change in the future.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0b4ea5e..2ed1f6d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3100,26 +3100,41 @@ const char *cmTarget::GetProperty(const std::string& prop,
     }
   if(specialProps.count(prop))
     {
-    if(prop == "INCLUDE_DIRECTORIES")
+    if(prop == "LINK_LIBRARIES")
       {
-      if (this->Internal->IncludeDirectoriesEntries.empty())
+      if (this->Internal->LinkImplementationPropertyEntries.empty())
         {
         return 0;
         }
 
       static std::string output;
-      MakePropertyList(output, this->Internal->IncludeDirectoriesEntries);
+      output = "";
+      std::string sep;
+      for (std::vector<cmValueWithOrigin>::const_iterator
+          it = this->Internal->LinkImplementationPropertyEntries.begin(),
+          end = this->Internal->LinkImplementationPropertyEntries.end();
+          it != end; ++it)
+        {
+        output += sep;
+        output += it->Value;
+        sep = ";";
+        }
       return output.c_str();
       }
-    else if(prop == "COMPILE_OPTIONS")
+    // the type property returns what type the target is
+    else if (prop == "TYPE")
       {
-      if (this->Internal->CompileOptionsEntries.empty())
+      return cmTarget::GetTargetTypeName(this->GetType());
+      }
+    else if(prop == "INCLUDE_DIRECTORIES")
+      {
+      if (this->Internal->IncludeDirectoriesEntries.empty())
         {
         return 0;
         }
 
       static std::string output;
-      MakePropertyList(output, this->Internal->CompileOptionsEntries);
+      MakePropertyList(output, this->Internal->IncludeDirectoriesEntries);
       return output.c_str();
       }
     else if(prop == "COMPILE_FEATURES")
@@ -3133,36 +3148,26 @@ const char *cmTarget::GetProperty(const std::string& prop,
       MakePropertyList(output, this->Internal->CompileFeaturesEntries);
       return output.c_str();
       }
-    else if(prop == "COMPILE_DEFINITIONS")
+    else if(prop == "COMPILE_OPTIONS")
       {
-      if (this->Internal->CompileDefinitionsEntries.empty())
+      if (this->Internal->CompileOptionsEntries.empty())
         {
         return 0;
         }
 
       static std::string output;
-      MakePropertyList(output, this->Internal->CompileDefinitionsEntries);
+      MakePropertyList(output, this->Internal->CompileOptionsEntries);
       return output.c_str();
       }
-    else if(prop == "LINK_LIBRARIES")
+    else if(prop == "COMPILE_DEFINITIONS")
       {
-      if (this->Internal->LinkImplementationPropertyEntries.empty())
+      if (this->Internal->CompileDefinitionsEntries.empty())
         {
         return 0;
         }
 
       static std::string output;
-      output = "";
-      std::string sep;
-      for (std::vector<cmValueWithOrigin>::const_iterator
-          it = this->Internal->LinkImplementationPropertyEntries.begin(),
-          end = this->Internal->LinkImplementationPropertyEntries.end();
-          it != end; ++it)
-        {
-        output += sep;
-        output += it->Value;
-        sep = ";";
-        }
+      MakePropertyList(output, this->Internal->CompileDefinitionsEntries);
       return output.c_str();
       }
     else if (prop == "IMPORTED")
@@ -3270,11 +3275,6 @@ const char *cmTarget::GetProperty(const std::string& prop,
       this->Properties.SetProperty("SOURCES", ss.str().c_str(),
                                    cmProperty::TARGET);
       }
-    // the type property returns what type the target is
-    else if (prop == "TYPE")
-      {
-      return cmTarget::GetTargetTypeName(this->GetType());
-      }
     }
 
   bool chain = false;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=87abdb835d5c484495b02e7bbaeba6e95254ba23
commit 87abdb835d5c484495b02e7bbaeba6e95254ba23
Author:     Ben Boeckel <mathstuf at gmail.com>
AuthorDate: Sat Feb 8 05:27:45 2014 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Jul 16 17:28:32 2014 -0400

    cmTarget: Fast path for regular properties

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 8be14f3..0b4ea5e 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3085,180 +3085,196 @@ const char *cmTarget::GetProperty(const std::string& prop,
         }
       }
     }
-  if(prop == "INCLUDE_DIRECTORIES")
+  static std::set<std::string> specialProps;
+  if(specialProps.empty())
     {
-    if (this->Internal->IncludeDirectoriesEntries.empty())
-      {
-      return 0;
-      }
-
-    static std::string output;
-    MakePropertyList(output, this->Internal->IncludeDirectoriesEntries);
-    return output.c_str();
+    specialProps.insert("INCLUDE_DIRECTORIES");
+    specialProps.insert("COMPILE_FEATURES");
+    specialProps.insert("COMPILE_OPTIONS");
+    specialProps.insert("COMPILE_DEFINITIONS");
+    specialProps.insert("LINK_LIBRARIES");
+    specialProps.insert("IMPORTED");
+    specialProps.insert("NAME");
+    specialProps.insert("SOURCES");
+    specialProps.insert("TYPE");
     }
-  else if(prop == "COMPILE_OPTIONS")
+  if(specialProps.count(prop))
     {
-    if (this->Internal->CompileOptionsEntries.empty())
+    if(prop == "INCLUDE_DIRECTORIES")
       {
-      return 0;
-      }
+      if (this->Internal->IncludeDirectoriesEntries.empty())
+        {
+        return 0;
+        }
 
-    static std::string output;
-    MakePropertyList(output, this->Internal->CompileOptionsEntries);
-    return output.c_str();
-    }
-  else if(prop == "COMPILE_FEATURES")
-    {
-    if (this->Internal->CompileFeaturesEntries.empty())
-      {
-      return 0;
+      static std::string output;
+      MakePropertyList(output, this->Internal->IncludeDirectoriesEntries);
+      return output.c_str();
       }
-
-    static std::string output;
-    MakePropertyList(output, this->Internal->CompileFeaturesEntries);
-    return output.c_str();
-    }
-  else if(prop == "COMPILE_DEFINITIONS")
-    {
-    if (this->Internal->CompileDefinitionsEntries.empty())
+    else if(prop == "COMPILE_OPTIONS")
       {
-      return 0;
+      if (this->Internal->CompileOptionsEntries.empty())
+        {
+        return 0;
+        }
+
+      static std::string output;
+      MakePropertyList(output, this->Internal->CompileOptionsEntries);
+      return output.c_str();
       }
+    else if(prop == "COMPILE_FEATURES")
+      {
+      if (this->Internal->CompileFeaturesEntries.empty())
+        {
+        return 0;
+        }
 
-    static std::string output;
-    MakePropertyList(output, this->Internal->CompileDefinitionsEntries);
-    return output.c_str();
-    }
-  else if(prop == "LINK_LIBRARIES")
-    {
-    if (this->Internal->LinkImplementationPropertyEntries.empty())
+      static std::string output;
+      MakePropertyList(output, this->Internal->CompileFeaturesEntries);
+      return output.c_str();
+      }
+    else if(prop == "COMPILE_DEFINITIONS")
       {
-      return 0;
+      if (this->Internal->CompileDefinitionsEntries.empty())
+        {
+        return 0;
+        }
+
+      static std::string output;
+      MakePropertyList(output, this->Internal->CompileDefinitionsEntries);
+      return output.c_str();
       }
+    else if(prop == "LINK_LIBRARIES")
+      {
+      if (this->Internal->LinkImplementationPropertyEntries.empty())
+        {
+        return 0;
+        }
 
-    static std::string output;
-    output = "";
-    std::string sep;
-    for (std::vector<cmValueWithOrigin>::const_iterator
-        it = this->Internal->LinkImplementationPropertyEntries.begin(),
-        end = this->Internal->LinkImplementationPropertyEntries.end();
-        it != end; ++it)
+      static std::string output;
+      output = "";
+      std::string sep;
+      for (std::vector<cmValueWithOrigin>::const_iterator
+          it = this->Internal->LinkImplementationPropertyEntries.begin(),
+          end = this->Internal->LinkImplementationPropertyEntries.end();
+          it != end; ++it)
+        {
+        output += sep;
+        output += it->Value;
+        sep = ";";
+        }
+      return output.c_str();
+      }
+    else if (prop == "IMPORTED")
       {
-      output += sep;
-      output += it->Value;
-      sep = ";";
+      return this->IsImported()?"TRUE":"FALSE";
       }
-    return output.c_str();
-    }
-  else if (prop == "IMPORTED")
-    {
-    return this->IsImported()?"TRUE":"FALSE";
-    }
-  else if (prop == "NAME")
-    {
-    return this->GetName().c_str();
-    }
-  else if(prop == "SOURCES")
-    {
-    if (this->Internal->SourceEntries.empty())
+    else if (prop == "NAME")
       {
-      return 0;
+      return this->GetName().c_str();
       }
-
-    cmOStringStream ss;
-    const char* sep = "";
-    typedef cmTargetInternals::TargetPropertyEntry
-                                TargetPropertyEntry;
-    for(std::vector<TargetPropertyEntry*>::const_iterator
-          i = this->Internal->SourceEntries.begin();
-        i != this->Internal->SourceEntries.end(); ++i)
+    else if(prop == "SOURCES")
       {
-      std::string entry = (*i)->ge->GetInput();
+      if (this->Internal->SourceEntries.empty())
+        {
+        return 0;
+        }
 
-      std::vector<std::string> files;
-      cmSystemTools::ExpandListArgument(entry, files);
-      for (std::vector<std::string>::const_iterator
-          li = files.begin(); li != files.end(); ++li)
+      cmOStringStream ss;
+      const char* sep = "";
+      typedef cmTargetInternals::TargetPropertyEntry
+                                  TargetPropertyEntry;
+      for(std::vector<TargetPropertyEntry*>::const_iterator
+            i = this->Internal->SourceEntries.begin();
+          i != this->Internal->SourceEntries.end(); ++i)
         {
-        if(cmHasLiteralPrefix(*li, "$<TARGET_OBJECTS:") &&
-            (*li)[li->size() - 1] == '>')
-          {
-          std::string objLibName = li->substr(17, li->size()-18);
+        std::string entry = (*i)->ge->GetInput();
 
-          if (cmGeneratorExpression::Find(objLibName) != std::string::npos)
+        std::vector<std::string> files;
+        cmSystemTools::ExpandListArgument(entry, files);
+        for (std::vector<std::string>::const_iterator
+            li = files.begin(); li != files.end(); ++li)
+          {
+          if(cmHasLiteralPrefix(*li, "$<TARGET_OBJECTS:") &&
+              (*li)[li->size() - 1] == '>')
             {
-            ss << sep;
-            sep = ";";
-            ss << *li;
-            continue;
-            }
+            std::string objLibName = li->substr(17, li->size()-18);
 
-          bool addContent = false;
-          bool noMessage = true;
-          cmOStringStream e;
-          cmake::MessageType messageType = cmake::AUTHOR_WARNING;
-          switch(context->GetPolicyStatus(cmPolicies::CMP0051))
-            {
-            case cmPolicies::WARN:
-              e << (this->Makefile->GetPolicies()
-                    ->GetPolicyWarning(cmPolicies::CMP0051)) << "\n";
-              noMessage = false;
-            case cmPolicies::OLD:
-              break;
-            case cmPolicies::REQUIRED_ALWAYS:
-            case cmPolicies::REQUIRED_IF_USED:
-            case cmPolicies::NEW:
-              addContent = true;
-            }
-          if (!noMessage)
-            {
-            e << "Target \"" << this->Name << "\" contains $<TARGET_OBJECTS> "
-            "generator expression in its sources list.  This content was not "
-            "previously part of the SOURCES property when that property was "
-            "read at configure time.  Code reading that property needs to be "
-            "adapted to ignore the generator expression using the "
-            "string(GENEX_STRIP) command.";
-            context->IssueMessage(messageType, e.str());
+            if (cmGeneratorExpression::Find(objLibName) != std::string::npos)
+              {
+              ss << sep;
+              sep = ";";
+              ss << *li;
+              continue;
+              }
+
+            bool addContent = false;
+            bool noMessage = true;
+            cmOStringStream e;
+            cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+            switch(context->GetPolicyStatus(cmPolicies::CMP0051))
+              {
+              case cmPolicies::WARN:
+                e << (this->Makefile->GetPolicies()
+                      ->GetPolicyWarning(cmPolicies::CMP0051)) << "\n";
+                noMessage = false;
+              case cmPolicies::OLD:
+                break;
+              case cmPolicies::REQUIRED_ALWAYS:
+              case cmPolicies::REQUIRED_IF_USED:
+              case cmPolicies::NEW:
+                addContent = true;
+              }
+            if (!noMessage)
+              {
+              e << "Target \"" << this->Name << "\" contains $<TARGET_OBJECTS> "
+              "generator expression in its sources list.  This content was not "
+              "previously part of the SOURCES property when that property was "
+              "read at configure time.  Code reading that property needs to be "
+              "adapted to ignore the generator expression using the "
+              "string(GENEX_STRIP) command.";
+              context->IssueMessage(messageType, e.str());
+              }
+            if (addContent)
+              {
+              ss << sep;
+              sep = ";";
+              ss << *li;
+              }
             }
-          if (addContent)
+          else if (cmGeneratorExpression::Find(*li) == std::string::npos)
             {
             ss << sep;
             sep = ";";
             ss << *li;
             }
-          }
-        else if (cmGeneratorExpression::Find(*li) == std::string::npos)
-          {
-          ss << sep;
-          sep = ";";
-          ss << *li;
-          }
-        else
-          {
-          cmSourceFile *sf = this->Makefile->GetOrCreateSource(*li);
-          // Construct what is known about this source file location.
-          cmSourceFileLocation const& location = sf->GetLocation();
-          std::string sname = location.GetDirectory();
-          if(!sname.empty())
+          else
             {
-            sname += "/";
-            }
-          sname += location.GetName();
+            cmSourceFile *sf = this->Makefile->GetOrCreateSource(*li);
+            // Construct what is known about this source file location.
+            cmSourceFileLocation const& location = sf->GetLocation();
+            std::string sname = location.GetDirectory();
+            if(!sname.empty())
+              {
+              sname += "/";
+              }
+            sname += location.GetName();
 
-          ss << sep;
-          sep = ";";
-          // Append this list entry.
-          ss << sname;
+            ss << sep;
+            sep = ";";
+            // Append this list entry.
+            ss << sname;
+            }
           }
         }
+      this->Properties.SetProperty("SOURCES", ss.str().c_str(),
+                                   cmProperty::TARGET);
+      }
+    // the type property returns what type the target is
+    else if (prop == "TYPE")
+      {
+      return cmTarget::GetTargetTypeName(this->GetType());
       }
-    this->Properties.SetProperty("SOURCES", ss.str().c_str(),
-                                 cmProperty::TARGET);
-    }
-  // the type property returns what type the target is
-  else if (prop == "TYPE")
-    {
-    return cmTarget::GetTargetTypeName(this->GetType());
     }
 
   bool chain = false;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4cfa918a9ae983274a7995ca89fb46fdf570b00c
commit 4cfa918a9ae983274a7995ca89fb46fdf570b00c
Author:     Ben Boeckel <mathstuf at gmail.com>
AuthorDate: Sat Feb 8 05:27:24 2014 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Jul 16 17:28:32 2014 -0400

    cmTarget: Factor out common code

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 641ac41..8be14f3 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2994,6 +2994,22 @@ bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const
 }
 
 //----------------------------------------------------------------------------
+static void MakePropertyList(std::string& output,
+    std::vector<cmTargetInternals::TargetPropertyEntry*> const& values)
+{
+  output = "";
+  std::string sep;
+  for (std::vector<cmTargetInternals::TargetPropertyEntry*>::const_iterator
+       it = values.begin(), end = values.end();
+       it != end; ++it)
+    {
+    output += sep;
+    output += (*it)->ge->GetInput();
+    sep = ";";
+    }
+}
+
+//----------------------------------------------------------------------------
 const char *cmTarget::GetProperty(const std::string& prop) const
 {
   return this->GetProperty(prop, this->Makefile);
@@ -3077,19 +3093,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       }
 
     static std::string output;
-    output = "";
-    std::string sep;
-    typedef cmTargetInternals::TargetPropertyEntry
-                                TargetPropertyEntry;
-    for (std::vector<TargetPropertyEntry*>::const_iterator
-        it = this->Internal->IncludeDirectoriesEntries.begin(),
-        end = this->Internal->IncludeDirectoriesEntries.end();
-        it != end; ++it)
-      {
-      output += sep;
-      output += (*it)->ge->GetInput();
-      sep = ";";
-      }
+    MakePropertyList(output, this->Internal->IncludeDirectoriesEntries);
     return output.c_str();
     }
   else if(prop == "COMPILE_OPTIONS")
@@ -3100,19 +3104,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       }
 
     static std::string output;
-    output = "";
-    std::string sep;
-    typedef cmTargetInternals::TargetPropertyEntry
-                                TargetPropertyEntry;
-    for (std::vector<TargetPropertyEntry*>::const_iterator
-        it = this->Internal->CompileOptionsEntries.begin(),
-        end = this->Internal->CompileOptionsEntries.end();
-        it != end; ++it)
-      {
-      output += sep;
-      output += (*it)->ge->GetInput();
-      sep = ";";
-      }
+    MakePropertyList(output, this->Internal->CompileOptionsEntries);
     return output.c_str();
     }
   else if(prop == "COMPILE_FEATURES")
@@ -3123,19 +3115,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       }
 
     static std::string output;
-    output = "";
-    std::string sep;
-    typedef cmTargetInternals::TargetPropertyEntry
-                                TargetPropertyEntry;
-    for (std::vector<TargetPropertyEntry*>::const_iterator
-        it = this->Internal->CompileFeaturesEntries.begin(),
-        end = this->Internal->CompileFeaturesEntries.end();
-        it != end; ++it)
-      {
-      output += sep;
-      output += (*it)->ge->GetInput();
-      sep = ";";
-      }
+    MakePropertyList(output, this->Internal->CompileFeaturesEntries);
     return output.c_str();
     }
   else if(prop == "COMPILE_DEFINITIONS")
@@ -3146,19 +3126,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       }
 
     static std::string output;
-    output = "";
-    std::string sep;
-    typedef cmTargetInternals::TargetPropertyEntry
-                                TargetPropertyEntry;
-    for (std::vector<TargetPropertyEntry*>::const_iterator
-        it = this->Internal->CompileDefinitionsEntries.begin(),
-        end = this->Internal->CompileDefinitionsEntries.end();
-        it != end; ++it)
-      {
-      output += sep;
-      output += (*it)->ge->GetInput();
-      sep = ";";
-      }
+    MakePropertyList(output, this->Internal->CompileDefinitionsEntries);
     return output.c_str();
     }
   else if(prop == "LINK_LIBRARIES")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85242b7df63a8097c5672c3053873aec371b6af7
commit 85242b7df63a8097c5672c3053873aec371b6af7
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Feb 3 16:09:16 2014 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Jul 16 17:28:32 2014 -0400

    cmTarget: Use else/if trees rather than an if tree
    
    Skips lots of unnecessary string comparisons.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b4688c4..641ac41 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1750,15 +1750,14 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
     return;
     }
-
-  if (prop == "NAME")
+  else if (prop == "NAME")
     {
     cmOStringStream e;
     e << "NAME property is read-only\n";
     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
     return;
     }
-  if(prop == "INCLUDE_DIRECTORIES")
+  else if(prop == "INCLUDE_DIRECTORIES")
     {
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
     cmGeneratorExpression ge(&lfbt);
@@ -1766,9 +1765,8 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
     cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
     this->Internal->IncludeDirectoriesEntries.push_back(
                           new cmTargetInternals::TargetPropertyEntry(cge));
-    return;
     }
-  if(prop == "COMPILE_OPTIONS")
+  else if(prop == "COMPILE_OPTIONS")
     {
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
     cmGeneratorExpression ge(&lfbt);
@@ -1776,9 +1774,8 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
     cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
     this->Internal->CompileOptionsEntries.push_back(
                           new cmTargetInternals::TargetPropertyEntry(cge));
-    return;
     }
-  if(prop == "COMPILE_FEATURES")
+  else if(prop == "COMPILE_FEATURES")
     {
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
     cmGeneratorExpression ge(&lfbt);
@@ -1786,9 +1783,8 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
     cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
     this->Internal->CompileFeaturesEntries.push_back(
                           new cmTargetInternals::TargetPropertyEntry(cge));
-    return;
     }
-  if(prop == "COMPILE_DEFINITIONS")
+  else if(prop == "COMPILE_DEFINITIONS")
     {
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
     cmGeneratorExpression ge(&lfbt);
@@ -1796,25 +1792,22 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
     cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
     this->Internal->CompileDefinitionsEntries.push_back(
                           new cmTargetInternals::TargetPropertyEntry(cge));
-    return;
     }
-  if(prop == "EXPORT_NAME" && this->IsImported())
+  else if(prop == "EXPORT_NAME" && this->IsImported())
     {
     cmOStringStream e;
     e << "EXPORT_NAME property can't be set on imported targets (\""
           << this->Name << "\")\n";
     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
-    return;
     }
-  if (prop == "LINK_LIBRARIES")
+  else if (prop == "LINK_LIBRARIES")
     {
     this->Internal->LinkImplementationPropertyEntries.clear();
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
     cmValueWithOrigin entry(value, lfbt);
     this->Internal->LinkImplementationPropertyEntries.push_back(entry);
-    return;
     }
-  if (prop == "SOURCES")
+  else if (prop == "SOURCES")
     {
     if(this->IsImported())
       {
@@ -1831,10 +1824,12 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
     cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
     this->Internal->SourceEntries.push_back(
                           new cmTargetInternals::TargetPropertyEntry(cge));
-    return;
     }
-  this->Properties.SetProperty(prop, value, cmProperty::TARGET);
-  this->MaybeInvalidatePropertyCache(prop);
+  else
+    {
+    this->Properties.SetProperty(prop, value, cmProperty::TARGET);
+    this->MaybeInvalidatePropertyCache(prop);
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -1850,61 +1845,55 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
     return;
     }
-  if (prop == "NAME")
+  else if (prop == "NAME")
     {
     cmOStringStream e;
     e << "NAME property is read-only\n";
     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
     return;
     }
-  if(prop == "INCLUDE_DIRECTORIES")
+  else if(prop == "INCLUDE_DIRECTORIES")
     {
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
     cmGeneratorExpression ge(&lfbt);
     this->Internal->IncludeDirectoriesEntries.push_back(
               new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
-    return;
     }
-  if(prop == "COMPILE_OPTIONS")
+  else if(prop == "COMPILE_OPTIONS")
     {
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
     cmGeneratorExpression ge(&lfbt);
     this->Internal->CompileOptionsEntries.push_back(
               new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
-    return;
     }
-  if(prop == "COMPILE_FEATURES")
+  else if(prop == "COMPILE_FEATURES")
     {
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
     cmGeneratorExpression ge(&lfbt);
     this->Internal->CompileFeaturesEntries.push_back(
               new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
-    return;
     }
-  if(prop == "COMPILE_DEFINITIONS")
+  else if(prop == "COMPILE_DEFINITIONS")
     {
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
     cmGeneratorExpression ge(&lfbt);
     this->Internal->CompileDefinitionsEntries.push_back(
               new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
-    return;
     }
-  if(prop == "EXPORT_NAME" && this->IsImported())
+  else if(prop == "EXPORT_NAME" && this->IsImported())
     {
     cmOStringStream e;
     e << "EXPORT_NAME property can't be set on imported targets (\""
           << this->Name << "\")\n";
     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
-    return;
     }
-  if (prop == "LINK_LIBRARIES")
+  else if (prop == "LINK_LIBRARIES")
     {
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
     cmValueWithOrigin entry(value, lfbt);
     this->Internal->LinkImplementationPropertyEntries.push_back(entry);
-    return;
     }
-  if (prop == "SOURCES")
+  else if (prop == "SOURCES")
     {
     if(this->IsImported())
       {
@@ -1920,10 +1909,12 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
       cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
       this->Internal->SourceEntries.push_back(
                             new cmTargetInternals::TargetPropertyEntry(cge));
-    return;
     }
-  this->Properties.AppendProperty(prop, value, cmProperty::TARGET, asString);
-  this->MaybeInvalidatePropertyCache(prop);
+  else
+    {
+    this->Properties.AppendProperty(prop, value, cmProperty::TARGET, asString);
+    this->MaybeInvalidatePropertyCache(prop);
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -3022,11 +3013,6 @@ const char *cmTarget::GetProperty(const std::string& prop,
     return 0;
     }
 
-  if (prop == "NAME")
-    {
-    return this->GetName().c_str();
-    }
-
   // Watch for special "computed" properties that are dependent on
   // other properties or variables.  Always recompute them.
   if(this->GetType() == cmTarget::EXECUTABLE ||
@@ -3106,7 +3092,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       }
     return output.c_str();
     }
-  if(prop == "COMPILE_OPTIONS")
+  else if(prop == "COMPILE_OPTIONS")
     {
     if (this->Internal->CompileOptionsEntries.empty())
       {
@@ -3129,7 +3115,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       }
     return output.c_str();
     }
-  if(prop == "COMPILE_FEATURES")
+  else if(prop == "COMPILE_FEATURES")
     {
     if (this->Internal->CompileFeaturesEntries.empty())
       {
@@ -3152,7 +3138,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       }
     return output.c_str();
     }
-  if(prop == "COMPILE_DEFINITIONS")
+  else if(prop == "COMPILE_DEFINITIONS")
     {
     if (this->Internal->CompileDefinitionsEntries.empty())
       {
@@ -3175,7 +3161,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       }
     return output.c_str();
     }
-  if(prop == "LINK_LIBRARIES")
+  else if(prop == "LINK_LIBRARIES")
     {
     if (this->Internal->LinkImplementationPropertyEntries.empty())
       {
@@ -3196,13 +3182,15 @@ const char *cmTarget::GetProperty(const std::string& prop,
       }
     return output.c_str();
     }
-
-  if (prop == "IMPORTED")
+  else if (prop == "IMPORTED")
     {
     return this->IsImported()?"TRUE":"FALSE";
     }
-
-  if(prop == "SOURCES")
+  else if (prop == "NAME")
+    {
+    return this->GetName().c_str();
+    }
+  else if(prop == "SOURCES")
     {
     if (this->Internal->SourceEntries.empty())
       {
@@ -3299,12 +3287,12 @@ const char *cmTarget::GetProperty(const std::string& prop,
     this->Properties.SetProperty("SOURCES", ss.str().c_str(),
                                  cmProperty::TARGET);
     }
-
   // the type property returns what type the target is
-  if (prop == "TYPE")
+  else if (prop == "TYPE")
     {
     return cmTarget::GetTargetTypeName(this->GetType());
     }
+
   bool chain = false;
   const char *retVal =
     this->Properties.GetPropertyValue(prop, cmProperty::TARGET, chain);

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

Summary of changes:
 Source/cmGeneratorExpressionEvaluator.cxx          |   13 +-
 Source/cmTarget.cxx                                |  665 ++++++++++----------
 Source/cmTarget.h                                  |    7 +
 .../include_directories/RunCMakeTest.cmake         |    6 +-
 4 files changed, 359 insertions(+), 332 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list