[Cmake-commits] CMake branch, next, updated. v3.4.0-rc1-552-g0a462a9

Stephen Kelly steveire at gmail.com
Wed Oct 14 18:00:07 EDT 2015


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  0a462a9684f3138b712dc7738f160b479ce08f84 (commit)
       via  462621e43b9b64aa1013348a48a63755bf066aab (commit)
       via  c934e2991a88af8b459075f093eb649607be029d (commit)
       via  64c5cef21853511f8c33a5a8fe49222b8cb88f58 (commit)
       via  9abf040d536b6adf1a06269cc1dbf90117b85c48 (commit)
       via  305beb6f88e699ccc5efdb198b45e6089afd038d (commit)
       via  664c328b02211a9e3273845cfd029203f1fe397f (commit)
       via  df52be7fd5704ac652b9795be41ac5107dc9819c (commit)
       via  4c266d709f232b336f8f06f1bb36a3fee45809d3 (commit)
       via  1304be33b367820dca449c753ac502afb059f611 (commit)
      from  af9ba74bf9451f2c89601ad24f88e36e7808e148 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a462a9684f3138b712dc7738f160b479ce08f84
commit 0a462a9684f3138b712dc7738f160b479ce08f84
Merge: af9ba74 462621e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 14 18:00:04 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Oct 14 18:00:04 2015 -0400

    Merge topic 'clean-up-cmTarget' into next
    
    462621e4 cmState: Move GetTargetTypeName from cmTarget.
    c934e299 Remove now-obsolete casts.
    64c5cef2 cmGeneratorTarget: Use enum for GetType.
    9abf040d cmState: Move TargetType enum from cmTarget.
    305beb6f cmTarget: Move link type enum out.
    664c328b cmTarget: Move ImportInfoMap out of internal class.
    df52be7f cmTarget: Move backtrace member out of internal class.
    4c266d70 cmTarget: Remove unneeded constructors.
    1304be33 Generators: Use GetType from the cmGeneratorTarget.


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=462621e43b9b64aa1013348a48a63755bf066aab
commit 462621e43b9b64aa1013348a48a63755bf066aab
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 8 00:26:50 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 14 23:59:10 2015 +0200

    cmState: Move GetTargetTypeName from cmTarget.

diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 138e630..f6de2ab 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -554,8 +554,7 @@ cmComputeTargetDepends
 
     // Describe the depender.
     e << "  \"" << depender->GetName() << "\" of type "
-      << cmTarget::GetTargetTypeName(
-           depender->GetType()) << "\n";
+      << cmState::GetTargetTypeName(depender->GetType()) << "\n";
 
     // List its dependencies that are inside the component.
     EdgeList const& nl = this->InitialGraph[i];
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index de3f992..5bb0f99 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -107,7 +107,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
             this->Makefile->IssueMessage(cmake::FATAL_ERROR,
               "Only libraries may be used as try_compile or try_run IMPORTED "
               "LINK_LIBRARIES.  Got " + std::string(tgt->GetName()) + " of "
-              "type " + tgt->GetTargetTypeName(tgt->GetType()) + ".");
+              "type " + cmState::GetTargetTypeName(tgt->GetType()) + ".");
             return -1;
           }
         if (tgt->IsImported())
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index f5c5191..ba42591 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1965,7 +1965,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
     std::string msg = "cmTarget::GetCompileInfo called for ";
     msg += this->GetName();
     msg += " which has type ";
-    msg += cmTarget::GetTargetTypeName(this->GetType());
+    msg += cmState::GetTargetTypeName(this->GetType());
     this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
     return 0;
     }
@@ -4697,7 +4697,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
     std::string msg = "cmGeneratorTarget::GetOutputInfo called for ";
     msg += this->GetName();
     msg += " which has type ";
-    msg += cmTarget::GetTargetTypeName(this->GetType());
+    msg += cmState::GetTargetTypeName(this->GetType());
     this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
     return 0;
     }
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 2a12f2b..5e0ea8b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -760,7 +760,7 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
       }
     if(variable == "TARGET_TYPE")
       {
-      return cmTarget::GetTargetTypeName(replaceValues.CMTarget->GetType());
+      return cmState::GetTargetTypeName(replaceValues.CMTarget->GetType());
       }
     }
   if(replaceValues.Output)
@@ -2134,7 +2134,7 @@ void cmLocalGenerator
     w <<
       cmPolicies::GetPolicyWarning(cmPolicies::CMP0063) << "\n"
       "Target \"" << target->GetName() << "\" of "
-      "type \"" << cmTarget::GetTargetTypeName(target->GetType()) << "\" "
+      "type \"" << cmState::GetTargetTypeName(target->GetType()) << "\" "
       "has the following visibility properties set for " << lang << ":\n" <<
       warnCMP0063 <<
       "For compatibility CMake is not honoring them for this target.";
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8f656b4..a1f143a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1426,7 +1426,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
         {
         std::ostringstream e;
         e << "Target \"" << lib << "\" of type "
-          << cmTarget::GetTargetTypeName(tgt->GetType())
+          << cmState::GetTargetTypeName(tgt->GetType())
           << " may not be linked into another target.  "
           << "One may link only to STATIC or SHARED libraries, or "
           << "to executables with the ENABLE_EXPORTS property set.";
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index c5dfe2d..066c64e 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -103,7 +103,7 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules()
   cmGlobalNinjaGenerator::WriteDivider(this->GetRulesFileStream());
   this->GetRulesFileStream()
     << "# Rules for each languages for "
-    << cmTarget::GetTargetTypeName(this->GetGeneratorTarget()->GetType())
+    << cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType())
     << " target "
     << this->GetTargetName()
     << "\n\n";
@@ -156,8 +156,7 @@ cmNinjaNormalTargetGenerator
 {
   return this->TargetLinkLanguage
     + "_"
-    + cmTarget::GetTargetTypeName(
-        this->GetGeneratorTarget()->GetType())
+    + cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType())
     + "_LINKER__"
     + cmGlobalNinjaGenerator::EncodeRuleName(this->GetTarget()->GetName())
     ;
@@ -446,7 +445,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
   const cmState::TargetType targetType = target.GetType();
   this->GetBuildFileStream()
     << "# Link build statements for "
-    << cmTarget::GetTargetTypeName(targetType)
+    << cmState::GetTargetTypeName(targetType)
     << " target "
     << this->GetTargetName()
     << "\n\n";
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 0d6afff..63c1490 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -480,8 +480,7 @@ cmNinjaTargetGenerator
   cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream());
   this->GetBuildFileStream()
     << "# Object build statements for "
-    << cmTarget::GetTargetTypeName(
-         this->GetGeneratorTarget()->GetType())
+    << cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType())
     << " target "
     << this->GetTargetName()
     << "\n\n";
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 825204c..c491c7d 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -101,6 +101,33 @@ cmState::~cmState()
   cmDeleteAll(this->Commands);
 }
 
+const char* cmState::GetTargetTypeName(cmState::TargetType targetType)
+{
+  switch( targetType )
+    {
+      case cmState::STATIC_LIBRARY:
+        return "STATIC_LIBRARY";
+      case cmState::MODULE_LIBRARY:
+        return "MODULE_LIBRARY";
+      case cmState::SHARED_LIBRARY:
+        return "SHARED_LIBRARY";
+      case cmState::OBJECT_LIBRARY:
+        return "OBJECT_LIBRARY";
+      case cmState::EXECUTABLE:
+        return "EXECUTABLE";
+      case cmState::UTILITY:
+        return "UTILITY";
+      case cmState::GLOBAL_TARGET:
+        return "GLOBAL_TARGET";
+      case cmState::INTERFACE_LIBRARY:
+        return "INTERFACE_LIBRARY";
+      case cmState::UNKNOWN_LIBRARY:
+        return "UNKNOWN_LIBRARY";
+    }
+  assert(0 && "Unexpected target type");
+  return 0;
+}
+
 const char* cmCacheEntryTypes[] =
 { "BOOL",
   "PATH",
diff --git a/Source/cmState.h b/Source/cmState.h
index 0fe4812..7d1fc80 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -187,6 +187,8 @@ public:
                     INTERFACE_LIBRARY,
                     UNKNOWN_LIBRARY};
 
+  static const char* GetTargetTypeName(cmState::TargetType targetType);
+
   Snapshot CreateBaseSnapshot();
   Snapshot
   CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot,
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index eeced8d..fecdc45 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -33,33 +33,6 @@
 #define UNORDERED_SET std::set
 #endif
 
-const char* cmTarget::GetTargetTypeName(cmState::TargetType targetType)
-{
-  switch( targetType )
-    {
-      case cmState::STATIC_LIBRARY:
-        return "STATIC_LIBRARY";
-      case cmState::MODULE_LIBRARY:
-        return "MODULE_LIBRARY";
-      case cmState::SHARED_LIBRARY:
-        return "SHARED_LIBRARY";
-      case cmState::OBJECT_LIBRARY:
-        return "OBJECT_LIBRARY";
-      case cmState::EXECUTABLE:
-        return "EXECUTABLE";
-      case cmState::UTILITY:
-        return "UTILITY";
-      case cmState::GLOBAL_TARGET:
-        return "GLOBAL_TARGET";
-      case cmState::INTERFACE_LIBRARY:
-        return "INTERFACE_LIBRARY";
-      case cmState::UNKNOWN_LIBRARY:
-        return "UNKNOWN_LIBRARY";
-    }
-  assert(0 && "Unexpected target type");
-  return 0;
-}
-
 //----------------------------------------------------------------------------
 class cmTargetInternals
 {
@@ -1892,7 +1865,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
     // the type property returns what type the target is
     else if (prop == propTYPE)
       {
-      return cmTarget::GetTargetTypeName(this->GetType());
+      return cmState::GetTargetTypeName(this->GetType());
       }
     else if(prop == propINCLUDE_DIRECTORIES)
       {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index e5646f6..c0b9e09 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -77,7 +77,6 @@ class cmTarget
 {
 public:
   cmTarget();
-  static const char* GetTargetTypeName(cmState::TargetType targetType);
   enum CustomCommandType { PRE_BUILD, PRE_LINK, POST_BUILD };
 
   /**

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c934e2991a88af8b459075f093eb649607be029d
commit c934e2991a88af8b459075f093eb649607be029d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 14 23:44:21 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 14 23:58:51 2015 +0200

    Remove now-obsolete casts.

diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 05fc800..138e630 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -555,7 +555,7 @@ cmComputeTargetDepends
     // Describe the depender.
     e << "  \"" << depender->GetName() << "\" of type "
       << cmTarget::GetTargetTypeName(
-           (cmState::TargetType)depender->GetType()) << "\n";
+           depender->GetType()) << "\n";
 
     // List its dependencies that are inside the component.
     EdgeList const& nl = this->InitialGraph[i];
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index aa6f54b..e3253da 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1632,7 +1632,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
       return std::string();
       }
 
-    cmState::TargetType targetType = (cmState::TargetType)target->GetType();
+    cmState::TargetType targetType = target->GetType();
 
     if(targetType != cmState::SHARED_LIBRARY &&
        targetType != cmState::MODULE_LIBRARY &&
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index dc02734..f5c5191 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1965,7 +1965,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
     std::string msg = "cmTarget::GetCompileInfo called for ";
     msg += this->GetName();
     msg += " which has type ";
-    msg += cmTarget::GetTargetTypeName((cmState::TargetType)this->GetType());
+    msg += cmTarget::GetTargetTypeName(this->GetType());
     this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
     return 0;
     }
@@ -4697,7 +4697,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
     std::string msg = "cmGeneratorTarget::GetOutputInfo called for ";
     msg += this->GetName();
     msg += " which has type ";
-    msg += cmTarget::GetTargetTypeName(cmState::TargetType(this->GetType()));
+    msg += cmTarget::GetTargetTypeName(this->GetType());
     this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
     return 0;
     }
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 66b6fc7..2f08165 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -94,8 +94,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
   std::vector<std::string> filesFrom;
   std::vector<std::string> filesTo;
   std::string literal_args;
-  cmState::TargetType targetType =
-      static_cast<cmState::TargetType>(this->Target->GetType());
+  cmState::TargetType targetType = this->Target->GetType();
   cmInstallType type = cmInstallType();
   switch(targetType)
     {
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index b5648fe..c5dfe2d 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -157,7 +157,7 @@ cmNinjaNormalTargetGenerator
   return this->TargetLinkLanguage
     + "_"
     + cmTarget::GetTargetTypeName(
-        (cmState::TargetType)this->GetGeneratorTarget()->GetType())
+        this->GetGeneratorTarget()->GetType())
     + "_LINKER__"
     + cmGlobalNinjaGenerator::EncodeRuleName(this->GetTarget()->GetName())
     ;
@@ -168,7 +168,7 @@ cmNinjaNormalTargetGenerator
 ::WriteLinkRule(bool useResponseFile)
 {
   cmState::TargetType targetType =
-      (cmState::TargetType)this->GetGeneratorTarget()->GetType();
+      this->GetGeneratorTarget()->GetType();
   std::string ruleName = this->LanguageLinkerRule();
 
   // Select whether to use a response file for objects.
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 1028196..0d6afff 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -481,7 +481,7 @@ cmNinjaTargetGenerator
   this->GetBuildFileStream()
     << "# Object build statements for "
     << cmTarget::GetTargetTypeName(
-         (cmState::TargetType)this->GetGeneratorTarget()->GetType())
+         this->GetGeneratorTarget()->GetType())
     << " target "
     << this->GetTargetName()
     << "\n\n";
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 218756d..bbb0126 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1743,8 +1743,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
 
 void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
 {
-  cmState::TargetType ttype =
-      (cmState::TargetType)this->GeneratorTarget->GetType();
+  cmState::TargetType ttype = this->GeneratorTarget->GetType();
   if(ttype > cmState::GLOBAL_TARGET)
     {
     return;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=64c5cef21853511f8c33a5a8fe49222b8cb88f58
commit 64c5cef21853511f8c33a5a8fe49222b8cb88f58
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 8 00:23:34 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 14 23:56:01 2015 +0200

    cmGeneratorTarget: Use enum for GetType.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index dce2091..dc02734 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -323,7 +323,7 @@ cmLocalGenerator* cmGeneratorTarget::GetLocalGenerator() const
 }
 
 //----------------------------------------------------------------------------
-int cmGeneratorTarget::GetType() const
+cmState::TargetType cmGeneratorTarget::GetType() const
 {
   return this->Target->GetType();
 }
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 258c556..05a7d4d 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -41,7 +41,7 @@ public:
   cmComputeLinkInformation*
     GetLinkInformation(const std::string& config) const;
 
-  int GetType() const;
+  cmState::TargetType GetType() const;
   std::string GetName() const;
   const char *GetProperty(const std::string& prop) const;
   bool GetPropertyAsBool(const std::string& prop) const;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9abf040d536b6adf1a06269cc1dbf90117b85c48
commit 9abf040d536b6adf1a06269cc1dbf90117b85c48
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 8 00:21:51 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 14 23:55:57 2015 +0200

    cmState: Move TargetType enum from cmTarget.
    
    Mostly automated:
    
     values=( "EXECUTABLE" "STATIC_LIBRARY" "SHARED_LIBRARY" "MODULE_LIBRARY" "OBJECT_LIBRARY" "UTILITY" "GLOBAL_TARGET" "INTERFACE_LIBRARY" "UNKNOWN_LIBRARY" "TargetType")
     for i in "${values[@]}"; do     git grep -l cmTarget::$i | xargs sed -i "s|cmTarget::$i|cmState::$i|g"; done

diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx
index d15fc1e..47f6592 100644
--- a/Source/cmAddExecutableCommand.cxx
+++ b/Source/cmAddExecutableCommand.cxx
@@ -174,8 +174,8 @@ bool cmAddExecutableCommand
       this->SetError(e.str());
       return false;
       }
-    cmTarget::TargetType type = aliasedTarget->GetType();
-    if(type != cmTarget::EXECUTABLE)
+    cmState::TargetType type = aliasedTarget->GetType();
+    if(type != cmState::EXECUTABLE)
       {
       std::ostringstream e;
       e << "cannot create ALIAS target \"" << exename
@@ -210,7 +210,7 @@ bool cmAddExecutableCommand
       }
 
     // Create the imported target.
-    this->Makefile->AddImportedTarget(exename, cmTarget::EXECUTABLE,
+    this->Makefile->AddImportedTarget(exename, cmState::EXECUTABLE,
                                       importGlobal);
     return true;
     }
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index a844cf1..e0adee3 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -25,10 +25,10 @@ bool cmAddLibraryCommand
     }
   // Library type defaults to value of BUILD_SHARED_LIBS, if it exists,
   // otherwise it defaults to static library.
-  cmTarget::TargetType type = cmTarget::SHARED_LIBRARY;
+  cmState::TargetType type = cmState::SHARED_LIBRARY;
   if (cmSystemTools::IsOff(this->Makefile->GetDefinition("BUILD_SHARED_LIBS")))
     {
-    type = cmTarget::STATIC_LIBRARY;
+    type = cmState::STATIC_LIBRARY;
     }
   bool excludeFromAll = false;
   bool importTarget = false;
@@ -50,7 +50,7 @@ bool cmAddLibraryCommand
     std::string libType = *s;
     if(libType == "STATIC")
       {
-      if (type == cmTarget::INTERFACE_LIBRARY)
+      if (type == cmState::INTERFACE_LIBRARY)
         {
         std::ostringstream e;
         e << "INTERFACE library specified with conflicting STATIC type.";
@@ -58,12 +58,12 @@ bool cmAddLibraryCommand
         return false;
         }
       ++s;
-      type = cmTarget::STATIC_LIBRARY;
+      type = cmState::STATIC_LIBRARY;
       haveSpecifiedType = true;
       }
     else if(libType == "SHARED")
       {
-      if (type == cmTarget::INTERFACE_LIBRARY)
+      if (type == cmState::INTERFACE_LIBRARY)
         {
         std::ostringstream e;
         e << "INTERFACE library specified with conflicting SHARED type.";
@@ -71,12 +71,12 @@ bool cmAddLibraryCommand
         return false;
         }
       ++s;
-      type = cmTarget::SHARED_LIBRARY;
+      type = cmState::SHARED_LIBRARY;
       haveSpecifiedType = true;
       }
     else if(libType == "MODULE")
       {
-      if (type == cmTarget::INTERFACE_LIBRARY)
+      if (type == cmState::INTERFACE_LIBRARY)
         {
         std::ostringstream e;
         e << "INTERFACE library specified with conflicting MODULE type.";
@@ -84,12 +84,12 @@ bool cmAddLibraryCommand
         return false;
         }
       ++s;
-      type = cmTarget::MODULE_LIBRARY;
+      type = cmState::MODULE_LIBRARY;
       haveSpecifiedType = true;
       }
     else if(libType == "OBJECT")
       {
-      if (type == cmTarget::INTERFACE_LIBRARY)
+      if (type == cmState::INTERFACE_LIBRARY)
         {
         std::ostringstream e;
         e << "INTERFACE library specified with conflicting OBJECT type.";
@@ -97,12 +97,12 @@ bool cmAddLibraryCommand
         return false;
         }
       ++s;
-      type = cmTarget::OBJECT_LIBRARY;
+      type = cmState::OBJECT_LIBRARY;
       haveSpecifiedType = true;
       }
     else if(libType == "UNKNOWN")
       {
-      if (type == cmTarget::INTERFACE_LIBRARY)
+      if (type == cmState::INTERFACE_LIBRARY)
         {
         std::ostringstream e;
         e << "INTERFACE library specified with conflicting UNKNOWN type.";
@@ -110,12 +110,12 @@ bool cmAddLibraryCommand
         return false;
         }
       ++s;
-      type = cmTarget::UNKNOWN_LIBRARY;
+      type = cmState::UNKNOWN_LIBRARY;
       haveSpecifiedType = true;
       }
     else if(libType == "ALIAS")
       {
-      if (type == cmTarget::INTERFACE_LIBRARY)
+      if (type == cmState::INTERFACE_LIBRARY)
         {
         std::ostringstream e;
         e << "INTERFACE library specified with conflicting ALIAS type.";
@@ -149,12 +149,12 @@ bool cmAddLibraryCommand
         return false;
         }
       ++s;
-      type = cmTarget::INTERFACE_LIBRARY;
+      type = cmState::INTERFACE_LIBRARY;
       haveSpecifiedType = true;
       }
     else if(*s == "EXCLUDE_FROM_ALL")
       {
-      if (type == cmTarget::INTERFACE_LIBRARY)
+      if (type == cmState::INTERFACE_LIBRARY)
         {
         std::ostringstream e;
         e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL.";
@@ -174,7 +174,7 @@ bool cmAddLibraryCommand
       ++s;
       importGlobal = true;
       }
-    else if(type == cmTarget::INTERFACE_LIBRARY && *s == "GLOBAL")
+    else if(type == cmState::INTERFACE_LIBRARY && *s == "GLOBAL")
       {
       std::ostringstream e;
       e << "GLOBAL option may only be used with IMPORTED libraries.";
@@ -187,7 +187,7 @@ bool cmAddLibraryCommand
       }
     }
 
-  if (type == cmTarget::INTERFACE_LIBRARY)
+  if (type == cmState::INTERFACE_LIBRARY)
     {
     if (s != args.end())
       {
@@ -220,7 +220,7 @@ bool cmAddLibraryCommand
     switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037))
       {
       case cmPolicies::WARN:
-        if(type != cmTarget::INTERFACE_LIBRARY)
+        if(type != cmState::INTERFACE_LIBRARY)
           {
           e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0037) << "\n";
           issueMessage = true;
@@ -293,12 +293,12 @@ bool cmAddLibraryCommand
       this->SetError(e.str());
       return false;
       }
-    cmTarget::TargetType aliasedType = aliasedTarget->GetType();
-    if(aliasedType != cmTarget::SHARED_LIBRARY
-        && aliasedType != cmTarget::STATIC_LIBRARY
-        && aliasedType != cmTarget::MODULE_LIBRARY
-        && aliasedType != cmTarget::OBJECT_LIBRARY
-        && aliasedType != cmTarget::INTERFACE_LIBRARY)
+    cmState::TargetType aliasedType = aliasedTarget->GetType();
+    if(aliasedType != cmState::SHARED_LIBRARY
+        && aliasedType != cmState::STATIC_LIBRARY
+        && aliasedType != cmState::MODULE_LIBRARY
+        && aliasedType != cmState::OBJECT_LIBRARY
+        && aliasedType != cmState::INTERFACE_LIBRARY)
       {
       std::ostringstream e;
       e << "cannot create ALIAS target \"" << libName
@@ -328,19 +328,19 @@ bool cmAddLibraryCommand
     CMAKE_${LANG}_CREATE_SHARED_LIBRARY is defined and if not default to
     STATIC. But at this point we know only the name of the target, but not
     yet its linker language. */
-  if ((type == cmTarget::SHARED_LIBRARY ||
-       type == cmTarget::MODULE_LIBRARY) &&
+  if ((type == cmState::SHARED_LIBRARY ||
+       type == cmState::MODULE_LIBRARY) &&
        (this->Makefile->GetState()->GetGlobalPropertyAsBool(
                                       "TARGET_SUPPORTS_SHARED_LIBS") == false))
     {
     std::ostringstream w;
     w <<
       "ADD_LIBRARY called with " <<
-      (type==cmTarget::SHARED_LIBRARY ? "SHARED" : "MODULE") <<
+      (type==cmState::SHARED_LIBRARY ? "SHARED" : "MODULE") <<
       " option but the target platform does not support dynamic linking. "
       "Building a STATIC library instead. This may lead to problems.";
     this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
-    type = cmTarget::STATIC_LIBRARY;
+    type = cmState::STATIC_LIBRARY;
     }
 
   // Handle imported target creation.
@@ -352,7 +352,7 @@ bool cmAddLibraryCommand
       this->SetError("called with IMPORTED argument but no library type.");
       return false;
       }
-    if(type == cmTarget::OBJECT_LIBRARY)
+    if(type == cmState::OBJECT_LIBRARY)
       {
       this->Makefile->IssueMessage(
         cmake::FATAL_ERROR,
@@ -360,7 +360,7 @@ bool cmAddLibraryCommand
         );
       return true;
       }
-    if(type == cmTarget::INTERFACE_LIBRARY)
+    if(type == cmState::INTERFACE_LIBRARY)
       {
       if (!cmGeneratorExpression::IsValidTargetName(libName))
         {
@@ -387,7 +387,7 @@ bool cmAddLibraryCommand
     }
 
   // A non-imported target may not have UNKNOWN type.
-  if(type == cmTarget::UNKNOWN_LIBRARY)
+  if(type == cmState::UNKNOWN_LIBRARY)
     {
     this->Makefile->IssueMessage(
       cmake::FATAL_ERROR,
@@ -408,7 +408,7 @@ bool cmAddLibraryCommand
 
   std::vector<std::string> srclists;
 
-  if(type == cmTarget::INTERFACE_LIBRARY)
+  if(type == cmState::INTERFACE_LIBRARY)
     {
     if (!cmGeneratorExpression::IsValidTargetName(libName)
         || libName.find("::") != std::string::npos)
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index e439182..fb78446 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -395,7 +395,7 @@ void CCONV cmAddLibrary(void *arg, const char *libname, int shared,
     srcs2.push_back(srcs[i]);
     }
   mf->AddLibrary(libname,
-                 (shared? cmTarget::SHARED_LIBRARY : cmTarget::STATIC_LIBRARY),
+                 (shared? cmState::SHARED_LIBRARY : cmState::STATIC_LIBRARY),
                   srcs2);
 }
 
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index f901414..fe7299e 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -396,7 +396,7 @@ cmCommonTargetGenerator::GetLinkedTargetDirectories() const
                 // We can ignore the INTERFACE_LIBRARY items because
                 // Target->GetLinkInformation already processed their
                 // link interface and they don't have any output themselves.
-                && linkee->GetType() != cmTarget::INTERFACE_LIBRARY
+                && linkee->GetType() != cmState::INTERFACE_LIBRARY
                 && emitted.insert(linkee).second)
         {
         cmLocalGenerator* lg = linkee->GetLocalGenerator();
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 742651a..465db92 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -270,7 +270,7 @@ cmComputeLinkDepends::Compute()
     LinkEntry const& e = this->EntryList[i];
     cmGeneratorTarget const* t = e.Target;
     // Entries that we know the linker will re-use do not need to be repeated.
-    bool uniquify = t && t->GetType() == cmTarget::SHARED_LIBRARY;
+    bool uniquify = t && t->GetType() == cmState::SHARED_LIBRARY;
     if(!uniquify || emmitted.insert(i).second)
       {
       this->FinalLinkEntries.push_back(e);
@@ -367,7 +367,7 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe)
        entry.Target->GetLinkInterface(this->Config, this->Target))
       {
       const bool isIface =
-                      entry.Target->GetType() == cmTarget::INTERFACE_LIBRARY;
+                      entry.Target->GetType() == cmState::INTERFACE_LIBRARY;
       // This target provides its own link interface information.
       this->AddLinkEntries(depender_index, iface->Libraries);
 
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 5c252df..7bdc555 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -290,7 +290,7 @@ cmComputeLinkInformation
   // the program that will load it.
   this->LoaderFlag = 0;
   if(!this->UseImportLibrary &&
-     this->Target->GetType() == cmTarget::MODULE_LIBRARY)
+     this->Target->GetType() == cmState::MODULE_LIBRARY)
     {
     std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_";
     loader_flag_var += this->LinkLanguage;
@@ -308,10 +308,10 @@ cmComputeLinkInformation
 
   // Get options needed to specify RPATHs.
   this->RuntimeUseChrpath = false;
-  if(this->Target->GetType() != cmTarget::STATIC_LIBRARY)
+  if(this->Target->GetType() != cmState::STATIC_LIBRARY)
     {
     const char* tType =
-      ((this->Target->GetType() == cmTarget::EXECUTABLE)?
+      ((this->Target->GetType() == cmState::EXECUTABLE)?
        "EXECUTABLE" : "SHARED_LIBRARY");
     std::string rtVar = "CMAKE_";
     rtVar += tType;
@@ -480,10 +480,10 @@ cmComputeLinkInformation::GetSharedLibrariesLinked()
 bool cmComputeLinkInformation::Compute()
 {
   // Skip targets that do not link.
-  if(!(this->Target->GetType() == cmTarget::EXECUTABLE ||
-       this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
-       this->Target->GetType() == cmTarget::MODULE_LIBRARY ||
-       this->Target->GetType() == cmTarget::STATIC_LIBRARY))
+  if(!(this->Target->GetType() == cmState::EXECUTABLE ||
+       this->Target->GetType() == cmState::SHARED_LIBRARY ||
+       this->Target->GetType() == cmState::MODULE_LIBRARY ||
+       this->Target->GetType() == cmState::STATIC_LIBRARY))
     {
     return false;
     }
@@ -544,7 +544,7 @@ bool cmComputeLinkInformation::Compute()
       cmGeneratorTarget const* tgt = *i;
       bool implib =
         (this->UseImportLibrary &&
-         (tgt->GetType() == cmTarget::SHARED_LIBRARY));
+         (tgt->GetType() == cmState::SHARED_LIBRARY));
       std::string lib = tgt->GetFullPath(this->Config , implib, true);
       this->OldLinkDirItems.push_back(lib);
       }
@@ -660,7 +660,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
       this->Items.push_back(Item(linkItem, true, tgt));
       this->Depends.push_back(exe);
       }
-    else if(tgt->GetType() == cmTarget::INTERFACE_LIBRARY)
+    else if(tgt->GetType() == cmState::INTERFACE_LIBRARY)
       {
       // Add the interface library as an item so it can be considered as part
       // of COMPATIBLE_INTERFACE_ enforcement.  The generators will ignore
@@ -672,12 +672,12 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
       // Decide whether to use an import library.
       bool implib =
         (this->UseImportLibrary &&
-         (impexe || tgt->GetType() == cmTarget::SHARED_LIBRARY));
+         (impexe || tgt->GetType() == cmState::SHARED_LIBRARY));
 
       // Pass the full path to the target file.
       std::string lib = tgt->GetFullPath(config, implib, true);
       if(!this->LinkDependsNoShared ||
-         tgt->GetType() != cmTarget::SHARED_LIBRARY)
+         tgt->GetType() != cmState::SHARED_LIBRARY)
         {
         this->Depends.push_back(lib);
         }
@@ -728,7 +728,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
     {
     // The target will provide a full path.  Make sure it is a shared
     // library.
-    if(tgt->GetType() != cmTarget::SHARED_LIBRARY)
+    if(tgt->GetType() != cmState::SHARED_LIBRARY)
       {
       return;
       }
@@ -818,9 +818,9 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
   const char* target_type_str = 0;
   switch(this->Target->GetType())
     {
-    case cmTarget::EXECUTABLE:     target_type_str = "EXE"; break;
-    case cmTarget::SHARED_LIBRARY: target_type_str = "SHARED_LIBRARY"; break;
-    case cmTarget::MODULE_LIBRARY: target_type_str = "SHARED_MODULE"; break;
+    case cmState::EXECUTABLE:     target_type_str = "EXE"; break;
+    case cmState::SHARED_LIBRARY: target_type_str = "SHARED_LIBRARY"; break;
+    case cmState::MODULE_LIBRARY: target_type_str = "SHARED_MODULE"; break;
     default: break;
     }
   if(target_type_str)
@@ -1084,13 +1084,13 @@ void cmComputeLinkInformation::AddTargetItem(std::string const& item,
   // shared and static libraries but static-mode can handle only
   // static libraries.  If a previous user item changed the link type
   // to static we need to make sure it is back to shared.
-  if(target->GetType() != cmTarget::STATIC_LIBRARY)
+  if(target->GetType() != cmState::STATIC_LIBRARY)
     {
     this->SetCurrentLinkType(LinkShared);
     }
 
   // Keep track of shared library targets linked.
-  if(target->GetType() == cmTarget::SHARED_LIBRARY)
+  if(target->GetType() == cmState::SHARED_LIBRARY)
     {
     this->SharedLibrariesLinked.insert(target);
     }
@@ -1790,14 +1790,14 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath,
 
   // Libraries with unknown type must be handled using just the file
   // on disk.
-  if(target->GetType() == cmTarget::UNKNOWN_LIBRARY)
+  if(target->GetType() == cmState::UNKNOWN_LIBRARY)
     {
     this->AddLibraryRuntimeInfo(fullPath);
     return;
     }
 
   // Skip targets that are not shared libraries (modules cannot be linked).
-  if(target->GetType() != cmTarget::SHARED_LIBRARY)
+  if(target->GetType() != cmState::SHARED_LIBRARY)
     {
     return;
     }
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 4094bf0..05fc800 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -207,7 +207,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
 {
   // Get the depender.
   cmGeneratorTarget const* depender = this->Targets[depender_index];
-  if (depender->GetType() == cmTarget::INTERFACE_LIBRARY)
+  if (depender->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return;
     }
@@ -236,10 +236,10 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
       std::string objLib = (*oi)->GetObjectLibrary();
       if (!objLib.empty() && emitted.insert(objLib).second)
         {
-        if(depender->GetType() != cmTarget::EXECUTABLE &&
-            depender->GetType() != cmTarget::STATIC_LIBRARY &&
-            depender->GetType() != cmTarget::SHARED_LIBRARY &&
-            depender->GetType() != cmTarget::MODULE_LIBRARY)
+        if(depender->GetType() != cmState::EXECUTABLE &&
+            depender->GetType() != cmState::STATIC_LIBRARY &&
+            depender->GetType() != cmState::SHARED_LIBRARY &&
+            depender->GetType() != cmState::MODULE_LIBRARY)
           {
           this->GlobalGenerator->GetCMakeInstance()
             ->IssueMessage(cmake::FATAL_ERROR,
@@ -324,7 +324,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
   // name conflict between an external library and an executable
   // within the project.
   if(dependee &&
-     dependee->GetType() == cmTarget::EXECUTABLE &&
+     dependee->GetType() == cmState::EXECUTABLE &&
      !dependee->Target->IsExecutableWithExports())
     {
     dependee = 0;
@@ -357,7 +357,7 @@ void cmComputeTargetDepends::AddTargetDepend(
   cmGeneratorTarget const* dependee = dependee_name.Target;
 
   if(!dependee && !linking &&
-    (depender->GetType() != cmTarget::GLOBAL_TARGET))
+    (depender->GetType() != cmState::GLOBAL_TARGET))
     {
     cmake::MessageType messageType = cmake::AUTHOR_WARNING;
     bool issueMessage = false;
@@ -400,7 +400,7 @@ void cmComputeTargetDepends::AddTargetDepend(
   // name conflict between an external library and an executable
   // within the project.
   if(linking && dependee &&
-     dependee->GetType() == cmTarget::EXECUTABLE &&
+     dependee->GetType() == cmState::EXECUTABLE &&
      !dependee->Target->IsExecutableWithExports())
     {
     dependee = 0;
@@ -418,7 +418,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
                                              bool linking)
 {
   if(dependee->Target->IsImported() ||
-     dependee->GetType() == cmTarget::INTERFACE_LIBRARY)
+     dependee->GetType() == cmState::INTERFACE_LIBRARY)
     {
     // Skip IMPORTED and INTERFACE targets but follow their utility
     // dependencies.
@@ -523,7 +523,7 @@ cmComputeTargetDepends
     // Make sure the component is all STATIC_LIBRARY targets.
     for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
       {
-      if(this->Targets[*ni]->GetType() != cmTarget::STATIC_LIBRARY)
+      if(this->Targets[*ni]->GetType() != cmState::STATIC_LIBRARY)
         {
         this->ComplainAboutBadComponent(ccg, c);
         return false;
@@ -555,7 +555,7 @@ cmComputeTargetDepends
     // Describe the depender.
     e << "  \"" << depender->GetName() << "\" of type "
       << cmTarget::GetTargetTypeName(
-           (cmTarget::TargetType)depender->GetType()) << "\n";
+           (cmState::TargetType)depender->GetType()) << "\n";
 
     // List its dependencies that are inside the component.
     EdgeList const& nl = this->InitialGraph[i];
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 3d9c4bf..de3f992 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -93,12 +93,12 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
         {
         switch(tgt->GetType())
           {
-          case cmTarget::SHARED_LIBRARY:
-          case cmTarget::STATIC_LIBRARY:
-          case cmTarget::INTERFACE_LIBRARY:
-          case cmTarget::UNKNOWN_LIBRARY:
+          case cmState::SHARED_LIBRARY:
+          case cmState::STATIC_LIBRARY:
+          case cmState::INTERFACE_LIBRARY:
+          case cmState::UNKNOWN_LIBRARY:
             break;
-          case cmTarget::EXECUTABLE:
+          case cmState::EXECUTABLE:
             if (tgt->IsExecutableWithExports())
               {
               break;
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 618f09f..8f7b480 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -44,7 +44,7 @@ std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
   std::string const& argv0 = this->CC.GetCommandLines()[c][0];
   cmGeneratorTarget* target =
       this->LG->FindGeneratorTargetToUse(argv0);
-  if(target && target->GetType() == cmTarget::EXECUTABLE &&
+  if(target && target->GetType() == cmState::EXECUTABLE &&
      (target->Target->IsImported()
       || !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")))
     {
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 6c3cccd..2d74b97 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -59,7 +59,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
                          this->LG->GetMakefile()->GetBacktrace());
       return false;
       }
-    if (te->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if (te->GetType() == cmState::INTERFACE_LIBRARY)
       {
       this->GenerateRequiredCMakeVersion(os, "3.0.0");
       }
@@ -146,14 +146,14 @@ cmExportBuildFileGenerator
     cmGeneratorTarget* target = *tei;
     ImportPropertyMap properties;
 
-    if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
+    if (target->GetType() != cmState::INTERFACE_LIBRARY)
       {
       this->SetImportLocationProperty(config, suffix, target, properties);
       }
     if(!properties.empty())
       {
       // Get the rest of the target details.
-      if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
+      if (target->GetType() != cmState::INTERFACE_LIBRARY)
         {
         this->SetImportDetailProperties(config, suffix,
                                         target,
@@ -216,7 +216,7 @@ cmExportBuildFileGenerator
 
   // Add the import library for windows DLLs.
   if(dll_platform &&
-     (target->GetType() == cmTarget::SHARED_LIBRARY ||
+     (target->GetType() == cmState::SHARED_LIBRARY ||
       target->Target->IsExecutableWithExports()) &&
      mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"))
     {
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index c2d9cc4..4eec66a 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -168,7 +168,7 @@ bool cmExportCommand
 
       if(cmTarget* target = gg->FindTarget(*currentTarget))
         {
-        if(target->GetType() == cmTarget::OBJECT_LIBRARY)
+        if(target->GetType() == cmState::OBJECT_LIBRARY)
           {
           std::ostringstream e;
           e << "given OBJECT library \"" << *currentTarget
@@ -176,7 +176,7 @@ bool cmExportCommand
           this->SetError(e.str());
           return false;
           }
-        if (target->GetType() == cmTarget::UTILITY)
+        if (target->GetType() == cmState::UTILITY)
           {
           this->SetError("given custom target \"" + *currentTarget
                          + "\" which may not be exported.");
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index d6440ac..6127626 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -597,7 +597,7 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
   getPropertyContents(gtarget, "COMPATIBLE_INTERFACE_NUMBER_MAX",
                       ifaceProperties);
 
-  if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
+  if (target->GetType() != cmState::INTERFACE_LIBRARY)
     {
     getCompatibleInterfaceProperties(gtarget, ifaceProperties, "");
 
@@ -885,8 +885,8 @@ cmExportFileGenerator
   cmMakefile* mf = target->Makefile;
 
   // Add the soname for unix shared libraries.
-  if(target->GetType() == cmTarget::SHARED_LIBRARY ||
-     target->GetType() == cmTarget::MODULE_LIBRARY)
+  if(target->GetType() == cmState::SHARED_LIBRARY ||
+     target->GetType() == cmState::MODULE_LIBRARY)
     {
     // Check whether this is a DLL platform.
     bool dll_platform =
@@ -1059,22 +1059,22 @@ cmExportFileGenerator
   os << "# Create imported target " << targetName << "\n";
   switch(target->GetType())
     {
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
       os << "add_executable(" << targetName << " IMPORTED)\n";
       break;
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::STATIC_LIBRARY:
       os << "add_library(" << targetName << " STATIC IMPORTED)\n";
       break;
-    case cmTarget::SHARED_LIBRARY:
+    case cmState::SHARED_LIBRARY:
       os << "add_library(" << targetName << " SHARED IMPORTED)\n";
       break;
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       os << "add_library(" << targetName << " MODULE IMPORTED)\n";
       break;
-    case cmTarget::UNKNOWN_LIBRARY:
+    case cmState::UNKNOWN_LIBRARY:
       os << "add_library(" << targetName << " UNKNOWN IMPORTED)\n";
       break;
-    case cmTarget::INTERFACE_LIBRARY:
+    case cmState::INTERFACE_LIBRARY:
       os << "add_library(" << targetName << " INTERFACE IMPORTED)\n";
       break;
     default:  // should never happen
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 7ffab0c..5a51442 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -134,7 +134,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
     cmTarget* te = (*tei)->Target;
 
     requiresConfigFiles = requiresConfigFiles
-                              || te->GetType() != cmTarget::INTERFACE_LIBRARY;
+                              || te->GetType() != cmState::INTERFACE_LIBRARY;
 
     this->GenerateImportTargetCode(os, te);
 
@@ -180,7 +180,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
         require2_8_12 = true;
         }
       }
-    if (te->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if (te->GetType() == cmState::INTERFACE_LIBRARY)
       {
       require3_0_0 = true;
       }
@@ -337,7 +337,7 @@ cmExportInstallFileGenerator
     {
     // Collect import properties for this target.
     cmTargetExport const* te = *tei;
-    if (te->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if (te->Target->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx
index 0ef2ea5..21d961f 100644
--- a/Source/cmExportLibraryDependenciesCommand.cxx
+++ b/Source/cmExportLibraryDependenciesCommand.cxx
@@ -96,8 +96,8 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
       cmTarget const& target = l->second;
 
       // Skip non-library targets.
-      if(target.GetType() < cmTarget::STATIC_LIBRARY
-         || target.GetType() > cmTarget::MODULE_LIBRARY)
+      if(target.GetType() < cmState::STATIC_LIBRARY
+         || target.GetType() > cmState::MODULE_LIBRARY)
         {
         continue;
         }
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index f8dbe31..70fca2e 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -73,7 +73,7 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
   cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
 
   cmTarget dummyHead;
-  dummyHead.SetType(cmTarget::EXECUTABLE, "try_compile_dummy_exe");
+  dummyHead.SetType(cmState::EXECUTABLE, "try_compile_dummy_exe");
   dummyHead.SetMakefile(tgt->GetMakefile());
 
   cmGeneratorTarget* gtgt =
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 0406644..5775602 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -326,7 +326,7 @@ void cmExtraCodeBlocksGenerator
       {
       switch(ti->second.GetType())
         {
-        case cmTarget::GLOBAL_TARGET:
+        case cmState::GLOBAL_TARGET:
           {
           // Only add the global targets from CMAKE_BINARY_DIR,
           // not from the subdirs
@@ -338,7 +338,7 @@ void cmExtraCodeBlocksGenerator
             }
           }
           break;
-        case cmTarget::UTILITY:
+        case cmState::UTILITY:
           // Add all utility targets, except the Nightly/Continuous/
           // Experimental-"sub"targets as e.g. NightlyStart
           if (((ti->first.find("Nightly")==0)   &&(ti->first!="Nightly"))
@@ -352,11 +352,11 @@ void cmExtraCodeBlocksGenerator
           this->AppendTarget(fout, ti->first, 0,
                                  make.c_str(), *lg, compiler.c_str());
           break;
-        case cmTarget::EXECUTABLE:
-        case cmTarget::STATIC_LIBRARY:
-        case cmTarget::SHARED_LIBRARY:
-        case cmTarget::MODULE_LIBRARY:
-        case cmTarget::OBJECT_LIBRARY:
+        case cmState::EXECUTABLE:
+        case cmState::STATIC_LIBRARY:
+        case cmState::SHARED_LIBRARY:
+        case cmState::MODULE_LIBRARY:
+        case cmState::OBJECT_LIBRARY:
           {
           this->AppendTarget(fout, ti->first, &ti->second,
                              make.c_str(), *lg, compiler.c_str());
@@ -392,12 +392,12 @@ void cmExtraCodeBlocksGenerator
       {
       switch(ti->second.GetType())
         {
-        case cmTarget::EXECUTABLE:
-        case cmTarget::STATIC_LIBRARY:
-        case cmTarget::SHARED_LIBRARY:
-        case cmTarget::MODULE_LIBRARY:
-        case cmTarget::OBJECT_LIBRARY:
-        case cmTarget::UTILITY: // can have sources since 2.6.3
+        case cmState::EXECUTABLE:
+        case cmState::STATIC_LIBRARY:
+        case cmState::SHARED_LIBRARY:
+        case cmState::MODULE_LIBRARY:
+        case cmState::OBJECT_LIBRARY:
+        case cmState::UTILITY: // can have sources since 2.6.3
           {
           std::vector<cmSourceFile*> sources;
           cmGeneratorTarget* gt =
@@ -561,7 +561,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
     {
     int cbTargetType = this->GetCBTargetType(target);
     std::string workingDir = lg->GetCurrentBinaryDirectory();
-    if ( target->GetType()==cmTarget::EXECUTABLE)
+    if ( target->GetType()==cmState::EXECUTABLE)
       {
       // Determine the directory where the executable target is created, and
       // set the working directory to this dir.
@@ -584,7 +584,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
 
     std::string buildType = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
     std::string location;
-    if ( target->GetType()==cmTarget::OBJECT_LIBRARY)
+    if ( target->GetType()==cmState::OBJECT_LIBRARY)
       {
       location = this->CreateDummyTargetFile(const_cast<cmLocalGenerator*>(lg),
                                              target);
@@ -724,7 +724,7 @@ std::string cmExtraCodeBlocksGenerator::GetCBCompilerId(const cmMakefile* mf)
 // Translate the cmake target type into the CodeBlocks target type id
 int cmExtraCodeBlocksGenerator::GetCBTargetType(cmTarget* target)
 {
-  if ( target->GetType()==cmTarget::EXECUTABLE)
+  if ( target->GetType()==cmState::EXECUTABLE)
     {
     if ((target->GetPropertyAsBool("WIN32_EXECUTABLE"))
         || (target->GetPropertyAsBool("MACOSX_BUNDLE")))
@@ -736,13 +736,13 @@ int cmExtraCodeBlocksGenerator::GetCBTargetType(cmTarget* target)
       return 1;
       }
     }
-  else if (( target->GetType()==cmTarget::STATIC_LIBRARY)
-        || (target->GetType()==cmTarget::OBJECT_LIBRARY))
+  else if (( target->GetType()==cmState::STATIC_LIBRARY)
+        || (target->GetType()==cmState::OBJECT_LIBRARY))
     {
     return 2;
     }
-  else if ((target->GetType()==cmTarget::SHARED_LIBRARY)
-           || (target->GetType()==cmTarget::MODULE_LIBRARY))
+  else if ((target->GetType()==cmState::SHARED_LIBRARY)
+           || (target->GetType()==cmState::MODULE_LIBRARY))
     {
     return 3;
     }
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 31dbf3d..10f33be 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -162,22 +162,22 @@ void cmExtraCodeLiteGenerator
 
       switch(ti->second.GetType())
         {
-        case cmTarget::EXECUTABLE:
+        case cmState::EXECUTABLE:
           {
           projectType = "Executable";
           }
         break;
-        case cmTarget::STATIC_LIBRARY:
+        case cmState::STATIC_LIBRARY:
           {
           projectType = "Static Library";
           }
         break;
-        case cmTarget::SHARED_LIBRARY:
+        case cmState::SHARED_LIBRARY:
           {
           projectType = "Dynamic Library";
           }
         break;
-        case cmTarget::MODULE_LIBRARY:
+        case cmState::MODULE_LIBRARY:
           {
           projectType = "Dynamic Library";
           }
@@ -188,10 +188,10 @@ void cmExtraCodeLiteGenerator
 
       switch(ti->second.GetType())
         {
-        case cmTarget::EXECUTABLE:
-        case cmTarget::STATIC_LIBRARY:
-        case cmTarget::SHARED_LIBRARY:
-        case cmTarget::MODULE_LIBRARY:
+        case cmState::EXECUTABLE:
+        case cmState::STATIC_LIBRARY:
+        case cmState::SHARED_LIBRARY:
+        case cmState::MODULE_LIBRARY:
           {
           std::vector<cmSourceFile*> sources;
           cmGeneratorTarget* gt =
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index b7aeb02..463e732 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -544,13 +544,13 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
       linkName2 += "/";
       switch(ti->second.GetType())
         {
-        case cmTarget::EXECUTABLE:
-        case cmTarget::STATIC_LIBRARY:
-        case cmTarget::SHARED_LIBRARY:
-        case cmTarget::MODULE_LIBRARY:
-        case cmTarget::OBJECT_LIBRARY:
+        case cmState::EXECUTABLE:
+        case cmState::STATIC_LIBRARY:
+        case cmState::SHARED_LIBRARY:
+        case cmState::MODULE_LIBRARY:
+        case cmState::OBJECT_LIBRARY:
           {
-          const char* prefix = (ti->second.GetType()==cmTarget::EXECUTABLE ?
+          const char* prefix = (ti->second.GetType()==cmState::EXECUTABLE ?
                                                           "[exe] " : "[lib] ");
           linkName2 += prefix;
           linkName2 += ti->first;
@@ -1046,7 +1046,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
       {
       switch(ti->second.GetType())
         {
-        case cmTarget::GLOBAL_TARGET:
+        case cmState::GLOBAL_TARGET:
           {
           // Only add the global targets from CMAKE_BINARY_DIR,
           // not from the subdirs
@@ -1056,7 +1056,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
            }
          }
          break;
-       case cmTarget::UTILITY:
+       case cmState::UTILITY:
          // Add all utility targets, except the Nightly/Continuous/
          // Experimental-"sub"targets as e.g. NightlyStart
          if (((ti->first.find("Nightly")==0)   &&(ti->first!="Nightly"))
@@ -1069,13 +1069,13 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
 
          this->AppendTarget(fout, ti->first, make, makeArgs, subdir, ": ");
          break;
-       case cmTarget::EXECUTABLE:
-       case cmTarget::STATIC_LIBRARY:
-       case cmTarget::SHARED_LIBRARY:
-       case cmTarget::MODULE_LIBRARY:
-       case cmTarget::OBJECT_LIBRARY:
+       case cmState::EXECUTABLE:
+       case cmState::STATIC_LIBRARY:
+       case cmState::SHARED_LIBRARY:
+       case cmState::MODULE_LIBRARY:
+       case cmState::OBJECT_LIBRARY:
          {
-         const char* prefix = (ti->second.GetType()==cmTarget::EXECUTABLE ?
+         const char* prefix = (ti->second.GetType()==cmState::EXECUTABLE ?
                                                           "[exe] " : "[lib] ");
          this->AppendTarget(fout, ti->first, make, makeArgs, subdir, prefix);
          std::string fastTarget = ti->first;
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
index fe77026..dc6421b 100644
--- a/Source/cmExtraKateGenerator.cxx
+++ b/Source/cmExtraKateGenerator.cxx
@@ -128,7 +128,7 @@ cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg,
       {
       switch(ti->second.GetType())
         {
-        case cmTarget::GLOBAL_TARGET:
+        case cmState::GLOBAL_TARGET:
           {
           bool insertTarget = false;
           // Only add the global targets from CMAKE_BINARY_DIR,
@@ -159,7 +159,7 @@ cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg,
             }
         }
         break;
-        case cmTarget::UTILITY:
+        case cmState::UTILITY:
           // Add all utility targets, except the Nightly/Continuous/
           // Experimental-"sub"targets as e.g. NightlyStart
           if (((ti->first.find("Nightly")==0)   &&(ti->first!="Nightly"))
@@ -173,11 +173,11 @@ cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg,
             this->AppendTarget(fout, ti->first, make, makeArgs,
                                currentDir, homeOutputDir);
           break;
-        case cmTarget::EXECUTABLE:
-        case cmTarget::STATIC_LIBRARY:
-        case cmTarget::SHARED_LIBRARY:
-        case cmTarget::MODULE_LIBRARY:
-        case cmTarget::OBJECT_LIBRARY:
+        case cmState::EXECUTABLE:
+        case cmState::STATIC_LIBRARY:
+        case cmState::SHARED_LIBRARY:
+        case cmState::MODULE_LIBRARY:
+        case cmState::OBJECT_LIBRARY:
         {
           this->AppendTarget(fout, ti->first, make, makeArgs,
                              currentDir, homeOutputDir);
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index b8ec0f9..d1599c4 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -168,7 +168,7 @@ void cmExtraSublimeTextGenerator::
       {
       switch(ti->second.GetType())
         {
-        case cmTarget::GLOBAL_TARGET:
+        case cmState::GLOBAL_TARGET:
           {
           // Only add the global targets from CMAKE_BINARY_DIR,
           // not from the subdirs
@@ -181,7 +181,7 @@ void cmExtraSublimeTextGenerator::
             }
           }
           break;
-        case cmTarget::UTILITY:
+        case cmState::UTILITY:
           // Add all utility targets, except the Nightly/Continuous/
           // Experimental-"sub"targets as e.g. NightlyStart
           if (((ti->first.find("Nightly")==0)   &&(ti->first!="Nightly"))
@@ -196,11 +196,11 @@ void cmExtraSublimeTextGenerator::
                              make.c_str(), makefile, compiler.c_str(),
                              sourceFileFlags, false);
           break;
-        case cmTarget::EXECUTABLE:
-        case cmTarget::STATIC_LIBRARY:
-        case cmTarget::SHARED_LIBRARY:
-        case cmTarget::MODULE_LIBRARY:
-        case cmTarget::OBJECT_LIBRARY:
+        case cmState::EXECUTABLE:
+        case cmState::STATIC_LIBRARY:
+        case cmState::SHARED_LIBRARY:
+        case cmState::MODULE_LIBRARY:
+        case cmState::OBJECT_LIBRARY:
           {
           this->AppendTarget(fout, ti->first, *lg, &ti->second,
                              make.c_str(), makefile, compiler.c_str(),
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 9958672..aa6f54b 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1144,7 +1144,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
     if (!prop)
       {
       if (target->IsImported()
-          || target->GetType() == cmTarget::INTERFACE_LIBRARY)
+          || target->GetType() == cmState::INTERFACE_LIBRARY)
         {
         return linkedTargetsContent;
         }
@@ -1284,7 +1284,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
       reportError(context, content->GetOriginalExpression(), e.str());
       return std::string();
       }
-    if (gt->GetType() != cmTarget::OBJECT_LIBRARY)
+    if (gt->GetType() != cmState::OBJECT_LIBRARY)
       {
       std::ostringstream e;
       e << "Objects of target \"" << tgtName
@@ -1592,7 +1592,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactSonameTag>
                     "for DLL target platforms.");
       return std::string();
       }
-    if(target->GetType() != cmTarget::SHARED_LIBRARY)
+    if(target->GetType() != cmState::SHARED_LIBRARY)
       {
       ::reportError(context, content->GetOriginalExpression(),
                     "TARGET_SONAME_FILE is allowed only for "
@@ -1632,11 +1632,11 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
       return std::string();
       }
 
-    cmTarget::TargetType targetType = (cmTarget::TargetType)target->GetType();
+    cmState::TargetType targetType = (cmState::TargetType)target->GetType();
 
-    if(targetType != cmTarget::SHARED_LIBRARY &&
-       targetType != cmTarget::MODULE_LIBRARY &&
-       targetType != cmTarget::EXECUTABLE)
+    if(targetType != cmState::SHARED_LIBRARY &&
+       targetType != cmState::MODULE_LIBRARY &&
+       targetType != cmState::EXECUTABLE)
       {
       ::reportError(context, content->GetOriginalExpression(),
                     "TARGET_PDB_FILE is allowed only for "
@@ -1746,8 +1746,8 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
                     "No target \"" + name + "\"");
       return std::string();
       }
-    if(target->GetType() >= cmTarget::OBJECT_LIBRARY &&
-      target->GetType() != cmTarget::UNKNOWN_LIBRARY)
+    if(target->GetType() >= cmState::OBJECT_LIBRARY &&
+      target->GetType() != cmState::UNKNOWN_LIBRARY)
       {
       ::reportError(context, content->GetOriginalExpression(),
                   "Target \"" + name + "\" is not an executable or library.");
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 8c9251b..dce2091 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -155,7 +155,7 @@ struct TagVisitor
     : Data(data), Target(target),
     GlobalGenerator(target->GetLocalGenerator()->GetGlobalGenerator()),
     Header(CM_HEADER_REGEX),
-    IsObjLib(target->GetType() == cmTarget::OBJECT_LIBRARY)
+    IsObjLib(target->GetType() == cmState::OBJECT_LIBRARY)
   {
   }
 
@@ -172,7 +172,7 @@ struct TagVisitor
       {
       DoAccept<IsSameTag<Tag, CustomCommandsTag>::Result>::Do(this->Data, sf);
       }
-    else if(this->Target->GetType() == cmTarget::UTILITY)
+    else if(this->Target->GetType() == cmState::UTILITY)
       {
       DoAccept<IsSameTag<Tag, ExtraSourcesTag>::Result>::Do(this->Data, sf);
       }
@@ -345,7 +345,7 @@ const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const
 {
   switch(this->GetType())
     {
-    case cmTarget::SHARED_LIBRARY:
+    case cmState::SHARED_LIBRARY:
       if(this->Target->IsDLLPlatform())
         {
         if(implib)
@@ -365,10 +365,10 @@ const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const
         // library targets.
         return "LIBRARY";
         }
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::STATIC_LIBRARY:
       // Static libraries are always treated as archive targets.
       return "ARCHIVE";
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       if(implib)
         {
         // Module libraries are always treated as library targets.
@@ -379,7 +379,7 @@ const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const
         // Module import libraries are treated as archive targets.
         return "LIBRARY";
         }
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
       if(implib)
         {
         // Executable import libraries are treated as archive targets.
@@ -852,7 +852,7 @@ const char* cmGeneratorTarget::GetLocationForBuild() const
 bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
                                               const std::string& config) const
 {
-  assert(this->GetType() != cmTarget::INTERFACE_LIBRARY);
+  assert(this->GetType() != cmState::INTERFACE_LIBRARY);
   std::string config_upper;
   if(!config.empty())
     {
@@ -1042,7 +1042,7 @@ static bool processSources(cmGeneratorTarget const* tgt,
 void cmGeneratorTarget::GetSourceFiles(std::vector<std::string> &files,
                               const std::string& config) const
 {
-  assert(this->GetType() != cmTarget::INTERFACE_LIBRARY);
+  assert(this->GetType() != cmState::INTERFACE_LIBRARY);
 
   if (!this->Makefile->GetGlobalGenerator()->GetConfigureDoneCMP0026())
     {
@@ -1221,7 +1221,7 @@ bool cmGeneratorTarget::HasSOName(const std::string& config) const
 {
   // soname is supported only for shared libraries and modules,
   // and then only when the platform supports an soname flag.
-  return ((this->GetType() == cmTarget::SHARED_LIBRARY) &&
+  return ((this->GetType() == cmState::SHARED_LIBRARY) &&
           !this->GetPropertyAsBool("NO_SONAME") &&
           this->Makefile->GetSONameFlag(this->GetLinkerLanguage(config)));
 }
@@ -1232,9 +1232,9 @@ cmGeneratorTarget::NeedRelinkBeforeInstall(const std::string& config) const
 {
   // Only executables and shared libraries can have an rpath and may
   // need relinking.
-  if(this->GetType() != cmTarget::EXECUTABLE &&
-     this->GetType() != cmTarget::SHARED_LIBRARY &&
-     this->GetType() != cmTarget::MODULE_LIBRARY)
+  if(this->GetType() != cmState::EXECUTABLE &&
+     this->GetType() != cmState::SHARED_LIBRARY &&
+     this->GetType() != cmState::MODULE_LIBRARY)
     {
     return false;
     }
@@ -1296,9 +1296,9 @@ cmGeneratorTarget::NeedRelinkBeforeInstall(const std::string& config) const
 bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const
 {
   // Only certain target types have an rpath.
-  if(!(this->GetType() == cmTarget::SHARED_LIBRARY ||
-       this->GetType() == cmTarget::MODULE_LIBRARY ||
-       this->GetType() == cmTarget::EXECUTABLE))
+  if(!(this->GetType() == cmState::SHARED_LIBRARY ||
+       this->GetType() == cmState::MODULE_LIBRARY ||
+       this->GetType() == cmState::EXECUTABLE))
     {
     return false;
     }
@@ -1363,7 +1363,7 @@ bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const
 bool cmGeneratorTarget::IsImportedSharedLibWithoutSOName(
                                           const std::string& config) const
 {
-  if(this->IsImported() && this->GetType() == cmTarget::SHARED_LIBRARY)
+  if(this->IsImported() && this->GetType() == cmState::SHARED_LIBRARY)
     {
     if(cmTarget::ImportInfo const* info = this->Target->GetImportInfo(config))
       {
@@ -1382,7 +1382,7 @@ bool cmGeneratorTarget::HasMacOSXRpathInstallNameDir(
 
   if(!this->IsImported())
     {
-    if(this->GetType() != cmTarget::SHARED_LIBRARY)
+    if(this->GetType() != cmState::SHARED_LIBRARY)
       {
       return false;
       }
@@ -1960,12 +1960,12 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
     return 0;
     }
 
-  if(this->GetType() > cmTarget::OBJECT_LIBRARY)
+  if(this->GetType() > cmState::OBJECT_LIBRARY)
     {
     std::string msg = "cmTarget::GetCompileInfo called for ";
     msg += this->GetName();
     msg += " which has type ";
-    msg += cmTarget::GetTargetTypeName((cmTarget::TargetType)this->GetType());
+    msg += cmTarget::GetTargetTypeName((cmState::TargetType)this->GetType());
     this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
     return 0;
     }
@@ -2155,7 +2155,7 @@ cmTargetTraceDependencies
   this->CurrentEntry = 0;
 
   // Queue all the source files already specified for the target.
-  if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
+  if (target->GetType() != cmState::INTERFACE_LIBRARY)
     {
     std::vector<std::string> configs;
     this->Makefile->GetConfigurations(configs);
@@ -2313,8 +2313,8 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
     // the fact that the name matched a target was just a coincidence.
     if(cmSystemTools::FileIsFullPath(dep.c_str()))
       {
-      if(t->GetType() >= cmTarget::EXECUTABLE &&
-         t->GetType() <= cmTarget::MODULE_LIBRARY)
+      if(t->GetType() >= cmState::EXECUTABLE &&
+         t->GetType() <= cmState::MODULE_LIBRARY)
         {
         // This is really only for compatibility so we do not need to
         // worry about configuration names and output names.
@@ -2362,7 +2362,7 @@ cmTargetTraceDependencies
     // Check for a target with this name.
     if(cmTarget* t = this->Makefile->FindTargetToUse(command))
       {
-      if(t->GetType() == cmTarget::EXECUTABLE)
+      if(t->GetType() == cmState::EXECUTABLE)
         {
         // The command refers to an executable target built in
         // this project.  Add the target-level dependency to make
@@ -2450,7 +2450,7 @@ void cmGeneratorTarget::TraceDependencies()
   // would find nothing anyway, but when building CMake itself the "install"
   // target command ends up referencing the "cmake" target but we do not
   // really want the dependency because "install" depend on "all" anyway.
-  if(this->GetType() == cmTarget::GLOBAL_TARGET)
+  if(this->GetType() == cmState::GLOBAL_TARGET)
     {
     return;
     }
@@ -2498,7 +2498,7 @@ cmGeneratorTarget::GetCreateRuleVariable(std::string const& lang,
 {
   switch(this->GetType())
     {
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::STATIC_LIBRARY:
       {
       std::string var = "CMAKE_" + lang + "_CREATE_STATIC_LIBRARY";
       if(this->GetFeatureAsBool(
@@ -2512,11 +2512,11 @@ cmGeneratorTarget::GetCreateRuleVariable(std::string const& lang,
         }
       return var;
       }
-    case cmTarget::SHARED_LIBRARY:
+    case cmState::SHARED_LIBRARY:
       return "CMAKE_" + lang + "_CREATE_SHARED_LIBRARY";
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       return "CMAKE_" + lang + "_CREATE_SHARED_MODULE";
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
       return "CMAKE_" + lang + "_LINK_EXECUTABLE";
     default:
       break;
@@ -3041,13 +3041,13 @@ void cmGeneratorTarget::ComputeTargetManifest(
   std::string realName;
   std::string impName;
   std::string pdbName;
-  if(this->GetType() == cmTarget::EXECUTABLE)
+  if(this->GetType() == cmState::EXECUTABLE)
     {
     this->GetExecutableNames(name, realName, impName, pdbName, config);
     }
-  else if(this->GetType() == cmTarget::STATIC_LIBRARY ||
-          this->GetType() == cmTarget::SHARED_LIBRARY ||
-          this->GetType() == cmTarget::MODULE_LIBRARY)
+  else if(this->GetType() == cmState::STATIC_LIBRARY ||
+          this->GetType() == cmState::SHARED_LIBRARY ||
+          this->GetType() == cmState::MODULE_LIBRARY)
     {
     this->GetLibraryNames(name, soName, realName, impName, pdbName,
                                   config);
@@ -3155,7 +3155,7 @@ cmGeneratorTarget::NormalGetRealName(const std::string& config) const
     this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
     }
 
-  if(this->GetType() == cmTarget::EXECUTABLE)
+  if(this->GetType() == cmState::EXECUTABLE)
     {
     // Compute the real name that will be built.
     std::string name;
@@ -3255,8 +3255,8 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name,
   }
 
   // The import library name.
-  if(this->GetType() == cmTarget::SHARED_LIBRARY ||
-     this->GetType() == cmTarget::MODULE_LIBRARY)
+  if(this->GetType() == cmState::SHARED_LIBRARY ||
+     this->GetType() == cmState::MODULE_LIBRARY)
     {
     impName = this->GetFullNameInternal(config, true);
     }
@@ -3294,7 +3294,7 @@ void cmGeneratorTarget::GetExecutableNames(std::string& name,
 #else
   // Check for executable version properties.
   const char* version = this->GetProperty("VERSION");
-  if(this->GetType() != cmTarget::EXECUTABLE || this->Makefile->IsOn("XCODE"))
+  if(this->GetType() != cmState::EXECUTABLE || this->Makefile->IsOn("XCODE"))
     {
     version = 0;
     }
@@ -3350,10 +3350,10 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
                                             std::string& outSuffix) const
 {
   // Use just the target name for non-main target types.
-  if(this->GetType() != cmTarget::STATIC_LIBRARY &&
-     this->GetType() != cmTarget::SHARED_LIBRARY &&
-     this->GetType() != cmTarget::MODULE_LIBRARY &&
-     this->GetType() != cmTarget::EXECUTABLE)
+  if(this->GetType() != cmState::STATIC_LIBRARY &&
+     this->GetType() != cmState::SHARED_LIBRARY &&
+     this->GetType() != cmState::MODULE_LIBRARY &&
+     this->GetType() != cmState::EXECUTABLE)
     {
     outPrefix = "";
     outBase = this->GetName();
@@ -3374,9 +3374,9 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
 
   // The implib option is only allowed for shared libraries, module
   // libraries, and executables.
-  if(this->GetType() != cmTarget::SHARED_LIBRARY &&
-     this->GetType() != cmTarget::MODULE_LIBRARY &&
-     this->GetType() != cmTarget::EXECUTABLE)
+  if(this->GetType() != cmState::SHARED_LIBRARY &&
+     this->GetType() != cmState::MODULE_LIBRARY &&
+     this->GetType() != cmState::EXECUTABLE)
     {
     implib = false;
     }
@@ -3462,7 +3462,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
   // Name shared libraries with their version number on some platforms.
   if(const char* soversion = this->GetProperty("SOVERSION"))
     {
-    if(this->GetType() == cmTarget::SHARED_LIBRARY && !implib &&
+    if(this->GetType() == cmState::SHARED_LIBRARY && !implib &&
        this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION"))
       {
       outBase += "-";
@@ -3657,8 +3657,8 @@ cmGeneratorTarget::GetCompatibleInterfaces(std::string const& config) const
 bool cmGeneratorTarget::IsLinkInterfaceDependentBoolProperty(
     const std::string &p, const std::string& config) const
 {
-  if (this->GetType() == cmTarget::OBJECT_LIBRARY
-      || this->GetType() == cmTarget::INTERFACE_LIBRARY)
+  if (this->GetType() == cmState::OBJECT_LIBRARY
+      || this->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return false;
     }
@@ -3669,8 +3669,8 @@ bool cmGeneratorTarget::IsLinkInterfaceDependentBoolProperty(
 bool cmGeneratorTarget::IsLinkInterfaceDependentStringProperty(
     const std::string &p, const std::string& config) const
 {
-  if (this->GetType() == cmTarget::OBJECT_LIBRARY
-      || this->GetType() == cmTarget::INTERFACE_LIBRARY)
+  if (this->GetType() == cmState::OBJECT_LIBRARY
+      || this->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return false;
     }
@@ -3681,8 +3681,8 @@ bool cmGeneratorTarget::IsLinkInterfaceDependentStringProperty(
 bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMinProperty(
     const std::string &p, const std::string& config) const
 {
-  if (this->GetType() == cmTarget::OBJECT_LIBRARY
-      || this->GetType() == cmTarget::INTERFACE_LIBRARY)
+  if (this->GetType() == cmState::OBJECT_LIBRARY
+      || this->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return false;
     }
@@ -3693,8 +3693,8 @@ bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMinProperty(
 bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMaxProperty(
     const std::string &p, const std::string& config) const
 {
-  if (this->GetType() == cmTarget::OBJECT_LIBRARY
-      || this->GetType() == cmTarget::INTERFACE_LIBRARY)
+  if (this->GetType() == cmState::OBJECT_LIBRARY
+      || this->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return false;
     }
@@ -4474,7 +4474,7 @@ cmGeneratorTarget::GetLinkInterface(const std::string& config,
 
   // Link interfaces are not supported for executables that do not
   // export symbols.
-  if(this->GetType() == cmTarget::EXECUTABLE &&
+  if(this->GetType() == cmState::EXECUTABLE &&
      !this->Target->IsExecutableWithExports())
     {
     return 0;
@@ -4517,9 +4517,9 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
 {
   if(iface.ExplicitLibraries)
     {
-    if(this->GetType() == cmTarget::SHARED_LIBRARY
-        || this->GetType() == cmTarget::STATIC_LIBRARY
-        || this->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if(this->GetType() == cmState::SHARED_LIBRARY
+        || this->GetType() == cmState::STATIC_LIBRARY
+        || this->GetType() == cmState::INTERFACE_LIBRARY)
       {
       // Shared libraries may have runtime implementation dependencies
       // on other shared libraries that are not in the interface.
@@ -4529,7 +4529,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
         {
         emitted.insert(*li);
         }
-      if (this->GetType() != cmTarget::INTERFACE_LIBRARY)
+      if (this->GetType() != cmState::INTERFACE_LIBRARY)
         {
         cmLinkImplementation const* impl =
             this->GetLinkImplementation(config);
@@ -4541,7 +4541,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
             if(li->Target)
               {
               // This is a runtime dependency on another shared library.
-              if(li->Target->GetType() == cmTarget::SHARED_LIBRARY)
+              if(li->Target->GetType() == cmState::SHARED_LIBRARY)
                 {
                 iface.SharedDeps.push_back(*li);
                 }
@@ -4579,7 +4579,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
       }
     }
 
-  if(this->GetType() == cmTarget::STATIC_LIBRARY)
+  if(this->GetType() == cmState::STATIC_LIBRARY)
     {
     // Construct the property name suffix for this configuration.
     std::string suffix = "_";
@@ -4623,7 +4623,7 @@ cmGeneratorTarget::GetLinkInterfaceLibraries(const std::string& config,
 
   // Link interfaces are not supported for executables that do not
   // export symbols.
-  if(this->GetType() == cmTarget::EXECUTABLE &&
+  if(this->GetType() == cmState::EXECUTABLE &&
      !this->Target->IsExecutableWithExports())
     {
     return 0;
@@ -4697,7 +4697,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
     std::string msg = "cmGeneratorTarget::GetOutputInfo called for ";
     msg += this->GetName();
     msg += " which has type ";
-    msg += cmTarget::GetTargetTypeName(cmTarget::TargetType(this->GetType()));
+    msg += cmTarget::GetTargetTypeName(cmState::TargetType(this->GetType()));
     this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
     return 0;
     }
@@ -4797,14 +4797,14 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
       conf = "";
       }
     }
-  else if(this->GetType() == cmTarget::EXECUTABLE)
+  else if(this->GetType() == cmState::EXECUTABLE)
     {
     // Lookup the output path for executables.
     out = this->Makefile->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH");
     }
-  else if(this->GetType() == cmTarget::STATIC_LIBRARY ||
-          this->GetType() == cmTarget::SHARED_LIBRARY ||
-          this->GetType() == cmTarget::MODULE_LIBRARY)
+  else if(this->GetType() == cmState::STATIC_LIBRARY ||
+          this->GetType() == cmState::SHARED_LIBRARY ||
+          this->GetType() == cmState::MODULE_LIBRARY)
     {
     // Lookup the output path for libraries.
     out = this->Makefile->GetSafeDefinition("LIBRARY_OUTPUT_PATH");
@@ -4934,7 +4934,7 @@ cmGeneratorTarget::ComputeLinkInterfaceLibraries(
     linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
     explicitLibraries = this->GetProperty(linkIfaceProp);
     }
-  else if(this->GetType() == cmTarget::SHARED_LIBRARY ||
+  else if(this->GetType() == cmState::SHARED_LIBRARY ||
           this->Target->IsExecutableWithExports())
     {
     // CMP0022 OLD behavior is to use LINK_INTERFACE_LIBRARIES if set on a
@@ -4982,8 +4982,8 @@ cmGeneratorTarget::ComputeLinkInterfaceLibraries(
   // There is no implicit link interface for executables or modules
   // so if none was explicitly set then there is no link interface.
   if(!explicitLibraries &&
-     (this->GetType() == cmTarget::EXECUTABLE ||
-      (this->GetType() == cmTarget::MODULE_LIBRARY)))
+     (this->GetType() == cmState::EXECUTABLE ||
+      (this->GetType() == cmState::MODULE_LIBRARY)))
     {
     return;
     }
@@ -5445,13 +5445,13 @@ cmGeneratorTarget::FindTargetToLink(std::string const& name) const
   // Skip targets that will not really be linked.  This is probably a
   // name conflict between an external library and an executable
   // within the project.
-  if(tgt && tgt->GetType() == cmTarget::EXECUTABLE &&
+  if(tgt && tgt->GetType() == cmState::EXECUTABLE &&
      !tgt->IsExecutableWithExports())
     {
     tgt = 0;
     }
 
-  if(tgt && tgt->GetType() == cmTarget::OBJECT_LIBRARY)
+  if(tgt && tgt->GetType() == cmState::OBJECT_LIBRARY)
     {
     std::ostringstream e;
     e << "Target \"" << this->GetName() << "\" links to "
@@ -5509,7 +5509,7 @@ bool cmGeneratorTarget::GetImplibGNUtoMS(std::string const& gnuName,
 bool cmGeneratorTarget::HasImportLibrary() const
 {
   return (this->Target->IsDLLPlatform() &&
-          (this->GetType() == cmTarget::SHARED_LIBRARY ||
+          (this->GetType() == cmState::SHARED_LIBRARY ||
            this->Target->IsExecutableWithExports()));
 }
 
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 6469294..d6cbf75 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -148,7 +148,7 @@ void cmGhsMultiTargetGenerator::Generate()
     this->WriteCompilerFlags(config, language);
     this->WriteCompilerDefinitions(config, language);
     this->WriteIncludes(config, language);
-    if (this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
+    if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
       {
       this->WriteTargetLinkLibraries();
       }
@@ -191,7 +191,7 @@ GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag(
     {
     output = GhsMultiGpj::INTERGRITY_APPLICATION;
     }
-  else if (target->GetType() == cmTarget::STATIC_LIBRARY)
+  else if (target->GetType() == cmState::STATIC_LIBRARY)
     {
     output = GhsMultiGpj::LIBRARY;
     }
@@ -215,13 +215,13 @@ void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string &config,
   std::string outputDir(this->GetOutputDirectory(config));
   std::string outputFilename(this->GetOutputFilename(config));
 
-  if (this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY)
+  if (this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY)
     {
     *this->GetFolderBuildStreams() << "    {optgroup=GhsCommonOptions} -o \""
                                    << outputDir << outputFilename << ".a\""
                                    << std::endl;
     }
-  else if (this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
+  else if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
     {
     if (notKernel && !this->IsTargetGroup())
       {
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index e8be2d6..338f496 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1444,15 +1444,15 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
     for(cmTargets::iterator ti = targets.begin();
         ti != targets.end(); ++ti)
       {
-      if (ti->second.GetType() == cmTarget::GLOBAL_TARGET)
+      if (ti->second.GetType() == cmState::GLOBAL_TARGET)
         {
         continue;
         }
-      if(ti->second.GetType() != cmTarget::EXECUTABLE &&
-         ti->second.GetType() != cmTarget::STATIC_LIBRARY &&
-         ti->second.GetType() != cmTarget::SHARED_LIBRARY &&
-         ti->second.GetType() != cmTarget::MODULE_LIBRARY &&
-         ti->second.GetType() != cmTarget::OBJECT_LIBRARY)
+      if(ti->second.GetType() != cmState::EXECUTABLE &&
+         ti->second.GetType() != cmState::STATIC_LIBRARY &&
+         ti->second.GetType() != cmState::SHARED_LIBRARY &&
+         ti->second.GetType() != cmState::MODULE_LIBRARY &&
+         ti->second.GetType() != cmState::OBJECT_LIBRARY)
         {
         continue;
         }
@@ -1510,14 +1510,14 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
         ti != targets.end(); ++ti)
       {
       cmTarget* t = &ti->second;
-      if (t->GetType() == cmTarget::GLOBAL_TARGET)
+      if (t->GetType() == cmState::GLOBAL_TARGET)
         {
         continue;
         }
 
       t->AppendBuildInterfaceIncludes();
 
-      if (t->GetType() == cmTarget::INTERFACE_LIBRARY)
+      if (t->GetType() == cmState::INTERFACE_LIBRARY)
         {
         continue;
         }
@@ -1650,7 +1650,7 @@ void cmGlobalGenerator::CheckTargetProperties()
     for (cmTargets::iterator l = targets.begin();
          l != targets.end(); l++)
       {
-      if (l->second.GetType() == cmTarget::INTERFACE_LIBRARY)
+      if (l->second.GetType() == cmState::INTERFACE_LIBRARY)
         {
         continue;
         }
@@ -2058,7 +2058,7 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
 bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
                                    cmGeneratorTarget* target) const
 {
-  if(target->GetType() == cmTarget::INTERFACE_LIBRARY
+  if(target->GetType() == cmState::INTERFACE_LIBRARY
       || target->GetPropertyAsBool("EXCLUDE_FROM_ALL"))
     {
     // This target is excluded from its directory.
@@ -2519,7 +2519,7 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(
 {
   // Package
   cmTarget target;
-  target.SetType(cmTarget::GLOBAL_TARGET, name);
+  target.SetType(cmState::GLOBAL_TARGET, name);
   target.SetProperty("EXCLUDE_FROM_ALL","TRUE");
 
   std::vector<std::string> no_outputs;
@@ -2701,7 +2701,7 @@ void cmGlobalGenerator::GetTargetSets(TargetDependSet& projectTargets,
 //----------------------------------------------------------------------------
 bool cmGlobalGenerator::IsRootOnlyTarget(cmTarget* target) const
 {
-  return (target->GetType() == cmTarget::GLOBAL_TARGET ||
+  return (target->GetType() == cmState::GLOBAL_TARGET ||
           target->GetName() == this->GetAllTargetName());
 }
 
@@ -2915,7 +2915,7 @@ void cmGlobalGenerator::WriteSummary()
   for(TargetMap::const_iterator ti =
         this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti)
     {
-    if ((ti->second)->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if ((ti->second)->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index ed36634..4eec3fb 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -72,7 +72,7 @@ void cmGlobalKdevelopGenerator::Generate()
       for (cmGeneratorTargetsType::const_iterator ti = targets.begin();
            ti != targets.end(); ti++)
         {
-        if (ti->second->GetType()==cmTarget::EXECUTABLE)
+        if (ti->second->GetType()==cmState::EXECUTABLE)
           {
           executable = ti->second->GetLocation("");
           break;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 32e6077..064feae 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -926,18 +926,18 @@ cmGlobalNinjaGenerator
   bool realname = target->IsFrameworkOnApple();
 
   switch (target->GetType()) {
-  case cmTarget::EXECUTABLE:
-  case cmTarget::SHARED_LIBRARY:
-  case cmTarget::STATIC_LIBRARY:
-  case cmTarget::MODULE_LIBRARY:
+  case cmState::EXECUTABLE:
+  case cmState::SHARED_LIBRARY:
+  case cmState::STATIC_LIBRARY:
+  case cmState::MODULE_LIBRARY:
     {
     cmGeneratorTarget *gtgt = this->GetGeneratorTarget(target);
     outputs.push_back(this->ConvertToNinjaPath(
       gtgt->GetFullPath(configName, false, realname)));
     break;
     }
-  case cmTarget::OBJECT_LIBRARY:
-  case cmTarget::UTILITY: {
+  case cmState::OBJECT_LIBRARY:
+  case cmState::UTILITY: {
     std::string path = this->ConvertToNinjaPath(
       target->GetMakefile()->GetCurrentBinaryDirectory());
     if (path.empty() || path == ".")
@@ -950,7 +950,7 @@ cmGlobalNinjaGenerator
     break;
   }
 
-  case cmTarget::GLOBAL_TARGET:
+  case cmState::GLOBAL_TARGET:
     // Always use the target in HOME instead of an unused duplicate in a
     // subdirectory.
     outputs.push_back(target->GetName());
@@ -965,7 +965,7 @@ void
 cmGlobalNinjaGenerator
 ::AppendTargetDepends(cmTarget const* target, cmNinjaDeps& outputs)
 {
-  if (target->GetType() == cmTarget::GLOBAL_TARGET) {
+  if (target->GetType() == cmState::GLOBAL_TARGET) {
     // Global targets only depend on other utilities, which may not appear in
     // the TargetDepends set (e.g. "all").
     std::set<std::string> const& utils = target->GetUtilities();
@@ -976,7 +976,7 @@ cmGlobalNinjaGenerator
     for (cmTargetDependSet::const_iterator i = targetDeps.begin();
          i != targetDeps.end(); ++i)
       {
-      if ((*i)->GetType() == cmTarget::INTERFACE_LIBRARY)
+      if ((*i)->GetType() == cmState::INTERFACE_LIBRARY)
         {
         continue;
         }
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index d6f6490..4674fcd 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -428,12 +428,12 @@ void cmGlobalUnixMakefileGenerator3
     for (cmTargets::iterator l = lg->GetMakefile()->GetTargets().begin();
          l != lg->GetMakefile()->GetTargets().end(); l++)
       {
-      if((l->second.GetType() == cmTarget::EXECUTABLE) ||
-         (l->second.GetType() == cmTarget::STATIC_LIBRARY) ||
-         (l->second.GetType() == cmTarget::SHARED_LIBRARY) ||
-         (l->second.GetType() == cmTarget::MODULE_LIBRARY) ||
-         (l->second.GetType() == cmTarget::OBJECT_LIBRARY) ||
-         (l->second.GetType() == cmTarget::UTILITY))
+      if((l->second.GetType() == cmState::EXECUTABLE) ||
+         (l->second.GetType() == cmState::STATIC_LIBRARY) ||
+         (l->second.GetType() == cmState::SHARED_LIBRARY) ||
+         (l->second.GetType() == cmState::MODULE_LIBRARY) ||
+         (l->second.GetType() == cmState::OBJECT_LIBRARY) ||
+         (l->second.GetType() == cmState::UTILITY))
         {
         std::string tname = lg->GetRelativeTargetDirectory(l->second);
         tname += "/DependInfo.cmake";
@@ -467,12 +467,12 @@ cmGlobalUnixMakefileGenerator3
     {
     cmGeneratorTarget* gtarget = l->second;
     int type = gtarget->GetType();
-    if((type == cmTarget::EXECUTABLE) ||
-       (type == cmTarget::STATIC_LIBRARY) ||
-       (type == cmTarget::SHARED_LIBRARY) ||
-       (type == cmTarget::MODULE_LIBRARY) ||
-       (type == cmTarget::OBJECT_LIBRARY) ||
-       (type == cmTarget::UTILITY))
+    if((type == cmState::EXECUTABLE) ||
+       (type == cmState::STATIC_LIBRARY) ||
+       (type == cmState::SHARED_LIBRARY) ||
+       (type == cmState::MODULE_LIBRARY) ||
+       (type == cmState::OBJECT_LIBRARY) ||
+       (type == cmState::UTILITY))
       {
       if(gtarget->Target->IsImported())
         {
@@ -645,12 +645,12 @@ cmGlobalUnixMakefileGenerator3
          emitted.insert(name).second &&
          // Handle user targets here.  Global targets are handled in
          // the local generator on a per-directory basis.
-         ((type == cmTarget::EXECUTABLE) ||
-          (type == cmTarget::STATIC_LIBRARY) ||
-          (type == cmTarget::SHARED_LIBRARY) ||
-          (type == cmTarget::MODULE_LIBRARY) ||
-          (type == cmTarget::OBJECT_LIBRARY) ||
-          (type == cmTarget::UTILITY)))
+         ((type == cmState::EXECUTABLE) ||
+          (type == cmState::STATIC_LIBRARY) ||
+          (type == cmState::SHARED_LIBRARY) ||
+          (type == cmState::MODULE_LIBRARY) ||
+          (type == cmState::OBJECT_LIBRARY) ||
+          (type == cmState::UTILITY)))
         {
         // Add a rule to build the target by name.
         lg->WriteDivider(ruleFileStream);
@@ -741,12 +741,12 @@ cmGlobalUnixMakefileGenerator3
     int type = gtarget->GetType();
     std::string name = gtarget->GetName();
     if (!name.empty()
-     && (  (type == cmTarget::EXECUTABLE)
-        || (type == cmTarget::STATIC_LIBRARY)
-        || (type == cmTarget::SHARED_LIBRARY)
-        || (type == cmTarget::MODULE_LIBRARY)
-        || (type == cmTarget::OBJECT_LIBRARY)
-        || (type == cmTarget::UTILITY)))
+     && (  (type == cmState::EXECUTABLE)
+        || (type == cmState::STATIC_LIBRARY)
+        || (type == cmState::SHARED_LIBRARY)
+        || (type == cmState::MODULE_LIBRARY)
+        || (type == cmState::OBJECT_LIBRARY)
+        || (type == cmState::UTILITY)))
       {
       std::string makefileName;
       // Add a rule to build the target by name.
@@ -937,7 +937,7 @@ void cmGlobalUnixMakefileGenerator3::InitializeProgressMarks()
 
       cmLocalGenerator* tlg = gt->GetLocalGenerator();
 
-      if(gt->GetType() == cmTarget::INTERFACE_LIBRARY
+      if(gt->GetType() == cmState::INTERFACE_LIBRARY
           || gt->GetPropertyAsBool("EXCLUDE_FROM_ALL"))
         {
         continue;
@@ -984,7 +984,7 @@ cmGlobalUnixMakefileGenerator3
     for(TargetDependSet::const_iterator di = depends.begin();
         di != depends.end(); ++di)
       {
-      if ((*di)->GetType() == cmTarget::INTERFACE_LIBRARY)
+      if ((*di)->GetType() == cmState::INTERFACE_LIBRARY)
         {
         continue;
         }
@@ -1060,7 +1060,7 @@ cmGlobalUnixMakefileGenerator3
     {
     // Create the target-level dependency.
     cmGeneratorTarget const* dep = *i;
-    if (dep->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if (dep->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -1105,14 +1105,14 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
       for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t)
         {
         cmTarget const& target = t->second;
-        cmTarget::TargetType type = target.GetType();
-        if((type == cmTarget::EXECUTABLE) ||
-           (type == cmTarget::STATIC_LIBRARY) ||
-           (type == cmTarget::SHARED_LIBRARY) ||
-           (type == cmTarget::MODULE_LIBRARY) ||
-           (type == cmTarget::OBJECT_LIBRARY) ||
-           (type == cmTarget::GLOBAL_TARGET) ||
-           (type == cmTarget::UTILITY))
+        cmState::TargetType type = target.GetType();
+        if((type == cmState::EXECUTABLE) ||
+           (type == cmState::STATIC_LIBRARY) ||
+           (type == cmState::SHARED_LIBRARY) ||
+           (type == cmState::MODULE_LIBRARY) ||
+           (type == cmState::OBJECT_LIBRARY) ||
+           (type == cmState::GLOBAL_TARGET) ||
+           (type == cmState::UTILITY))
           {
           std::string name = target.GetName();
           if(emittedTargets.insert(name).second)
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx
index 419bf8a..b9b4fff 100644
--- a/Source/cmGlobalVisualStudio11Generator.cxx
+++ b/Source/cmGlobalVisualStudio11Generator.cxx
@@ -278,10 +278,10 @@ cmGlobalVisualStudio11Generator::GetInstalledWindowsCESDKs()
 
 //----------------------------------------------------------------------------
 bool
-cmGlobalVisualStudio11Generator::NeedsDeploy(cmTarget::TargetType type) const
+cmGlobalVisualStudio11Generator::NeedsDeploy(cmState::TargetType type) const
 {
-  if((type == cmTarget::EXECUTABLE ||
-      type == cmTarget::SHARED_LIBRARY) &&
+  if((type == cmState::EXECUTABLE ||
+      type == cmState::SHARED_LIBRARY) &&
      (this->SystemIsWindowsPhone ||
       this->SystemIsWindowsStore))
     {
diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h
index 9499d80..f3f6b2b 100644
--- a/Source/cmGlobalVisualStudio11Generator.h
+++ b/Source/cmGlobalVisualStudio11Generator.h
@@ -48,7 +48,7 @@ protected:
   static std::set<std::string> GetInstalledWindowsCESDKs();
 
   /** Return true if the configuration needs to be deployed */
-  virtual bool NeedsDeploy(cmTarget::TargetType type) const;
+  virtual bool NeedsDeploy(cmState::TargetType type) const;
 private:
   class Factory;
   friend class Factory;
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index d5e9417..12eccf9 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -224,7 +224,7 @@ void cmGlobalVisualStudio6Generator
       tt != orderedProjectTargets.end(); ++tt)
     {
     cmTarget const* target = (*tt)->Target;
-    if(target->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if(target->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index b913afc..9bb37ce 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -272,7 +272,7 @@ void cmGlobalVisualStudio71Generator
 // executables to the libraries it uses are also done here
 void cmGlobalVisualStudio71Generator
 ::WriteProjectConfigurations(
-  std::ostream& fout, const std::string& name, cmTarget::TargetType,
+  std::ostream& fout, const std::string& name, cmState::TargetType,
   std::vector<std::string> const& configs,
   const std::set<std::string>& configsPartOfDefaultBuild,
   std::string const& platformMapping)
diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h
index fbb9ecc..7f88e34 100644
--- a/Source/cmGlobalVisualStudio71Generator.h
+++ b/Source/cmGlobalVisualStudio71Generator.h
@@ -64,7 +64,7 @@ protected:
                            const std::string& name, const char* path,
                            cmTarget const& t);
   virtual void WriteProjectConfigurations(
-    std::ostream& fout, const std::string& name, cmTarget::TargetType type,
+    std::ostream& fout, const std::string& name, cmState::TargetType type,
     std::vector<std::string> const& configs,
     const std::set<std::string>& configsPartOfDefaultBuild,
     const std::string& platformMapping = "");
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 8651e2f..1909f21 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -402,7 +402,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations(
         projectTargets.begin(); tt != projectTargets.end(); ++tt)
     {
     cmTarget const* target = (*tt)->Target;
-    if(target->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if(target->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -442,7 +442,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
         projectTargets.begin(); tt != projectTargets.end(); ++tt)
     {
     cmTarget const* target = (*tt)->Target;
-    if(target->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if(target->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -536,7 +536,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends(
         projectTargets.begin(); tt != projectTargets.end(); ++tt)
     {
     cmTarget const* target = (*tt)->Target;
-    if(target->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if(target->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -762,7 +762,7 @@ cmGlobalVisualStudio7Generator
 // executables to the libraries it uses are also done here
 void cmGlobalVisualStudio7Generator
 ::WriteProjectConfigurations(
-  std::ostream& fout, const std::string& name, cmTarget::TargetType,
+  std::ostream& fout, const std::string& name, cmState::TargetType,
   std::vector<std::string> const& configs,
   const std::set<std::string>& configsPartOfDefaultBuild,
   const std::string& platformMapping)
@@ -1002,7 +1002,7 @@ cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
   // if it is a utilitiy target then only make it part of the
   // default build if another target depends on it
   int type = target->GetType();
-  if (type == cmTarget::GLOBAL_TARGET)
+  if (type == cmState::GLOBAL_TARGET)
     {
     // check if INSTALL target is part of default build
     if(target->GetName() == "INSTALL")
@@ -1025,7 +1025,7 @@ cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
       }
     return activeConfigs;
     }
-  if(type == cmTarget::UTILITY && !this->IsDependedOn(projectTargets, target))
+  if(type == cmState::UTILITY && !this->IsDependedOn(projectTargets, target))
     {
     return activeConfigs;
     }
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 35575d1..4ef0990 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -128,7 +128,7 @@ protected:
                            const std::string& name, const char* path,
                            cmTarget const&t);
   virtual void WriteProjectConfigurations(
-    std::ostream& fout, const std::string& name, cmTarget::TargetType type,
+    std::ostream& fout, const std::string& name, cmState::TargetType type,
     std::vector<std::string> const& configs,
     const std::set<std::string>& configsPartOfDefaultBuild,
     const std::string& platformMapping = "");
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 8cb7d24..0c41964 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -386,7 +386,7 @@ cmGlobalVisualStudio8Generator
 void
 cmGlobalVisualStudio8Generator
 ::WriteProjectConfigurations(
-  std::ostream& fout, const std::string& name, cmTarget::TargetType type,
+  std::ostream& fout, const std::string& name, cmState::TargetType type,
   std::vector<std::string> const& configs,
   const std::set<std::string>& configsPartOfDefaultBuild,
   std::string const& platformMapping)
@@ -423,10 +423,10 @@ cmGlobalVisualStudio8Generator
 
 //----------------------------------------------------------------------------
 bool
-cmGlobalVisualStudio8Generator::NeedsDeploy(cmTarget::TargetType type) const
+cmGlobalVisualStudio8Generator::NeedsDeploy(cmState::TargetType type) const
 {
-  bool needsDeploy = (type == cmTarget::EXECUTABLE ||
-                      type == cmTarget::SHARED_LIBRARY);
+  bool needsDeploy = (type == cmState::EXECUTABLE ||
+                      type == cmState::SHARED_LIBRARY);
   return this->TargetsWindowsCE() && needsDeploy;
 }
 
@@ -448,7 +448,7 @@ void cmGlobalVisualStudio8Generator::WriteProjectDepends(
   for(OrderedTargetDependSet::const_iterator i = depends.begin();
       i != depends.end(); ++i)
     {
-    if((*i)->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if((*i)->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -468,7 +468,7 @@ bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies(
     {
     if(cmTarget* depTarget = this->FindTarget(ui->c_str()))
       {
-      if(depTarget->GetType() != cmTarget::INTERFACE_LIBRARY
+      if(depTarget->GetType() != cmState::INTERFACE_LIBRARY
           && depTarget->GetProperty("EXTERNAL_MSPROJECT"))
         {
         // This utility dependency names an external .vcproj target.
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index 9d6c64f..60c63d1 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -77,14 +77,14 @@ protected:
   bool AddCheckTarget();
 
   /** Return true if the configuration needs to be deployed */
-  virtual bool NeedsDeploy(cmTarget::TargetType type) const;
+  virtual bool NeedsDeploy(cmState::TargetType type) const;
 
   static cmIDEFlagTable const* GetExtraFlagTableVS8();
   virtual void WriteSLNHeader(std::ostream& fout);
   virtual void WriteSolutionConfigurations(
     std::ostream& fout, std::vector<std::string> const& configs);
   virtual void WriteProjectConfigurations(
-    std::ostream& fout, const std::string& name, cmTarget::TargetType type,
+    std::ostream& fout, const std::string& name, cmState::TargetType type,
     std::vector<std::string> const& configs,
     const std::set<std::string>& configsPartOfDefaultBuild,
     const std::string& platformMapping = "");
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index fa9c606..a57cef1 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -112,7 +112,7 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
         for(cmGeneratorTargetsType::iterator t = targets.begin();
             t != targets.end(); ++t)
           {
-          if (t->second->GetType() == cmTarget::GLOBAL_TARGET
+          if (t->second->GetType() == cmState::GLOBAL_TARGET
               || t->first->IsImported())
             {
             continue;
@@ -337,12 +337,12 @@ cmGlobalVisualStudioGenerator::GetTargetLinkClosure(cmTarget* target)
 void cmGlobalVisualStudioGenerator::FollowLinkDepends(
   cmTarget const* target, std::set<cmTarget const*>& linked)
 {
-  if(target->GetType() == cmTarget::INTERFACE_LIBRARY)
+  if(target->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return;
     }
   if(linked.insert(target).second &&
-     target->GetType() == cmTarget::STATIC_LIBRARY)
+     target->GetType() == cmState::STATIC_LIBRARY)
     {
     // Static library targets do not list their link dependencies so
     // we must follow them transitively now.
@@ -387,7 +387,7 @@ bool cmGlobalVisualStudioGenerator::ComputeTargetDepends()
 //----------------------------------------------------------------------------
 static bool VSLinkable(cmTarget const* t)
 {
-  return t->IsLinkable() || t->GetType() == cmTarget::OBJECT_LIBRARY;
+  return t->IsLinkable() || t->GetType() == cmState::OBJECT_LIBRARY;
 }
 
 //----------------------------------------------------------------------------
@@ -417,10 +417,10 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target)
   // leaving them out for the static library itself but following them
   // transitively for other targets.
 
-  bool allowLinkable = (target.GetType() != cmTarget::STATIC_LIBRARY &&
-                        target.GetType() != cmTarget::SHARED_LIBRARY &&
-                        target.GetType() != cmTarget::MODULE_LIBRARY &&
-                        target.GetType() != cmTarget::EXECUTABLE);
+  bool allowLinkable = (target.GetType() != cmState::STATIC_LIBRARY &&
+                        target.GetType() != cmState::SHARED_LIBRARY &&
+                        target.GetType() != cmState::MODULE_LIBRARY &&
+                        target.GetType() != cmState::EXECUTABLE);
 
   cmGeneratorTarget* gt = this->GetGeneratorTarget(&target);
   TargetDependSet const& depends = this->GetTargetDirectDepends(gt);
@@ -429,7 +429,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target)
   // Static libraries cannot depend on their link implementation
   // due to behavior (2), but they do not really need to.
   std::set<cmTarget const*> linkDepends;
-  if(target.GetType() != cmTarget::STATIC_LIBRARY)
+  if(target.GetType() != cmState::STATIC_LIBRARY)
     {
     for(TargetDependSet::const_iterator di = depends.begin();
         di != depends.end(); ++di)
@@ -457,7 +457,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target)
   // Collect all targets linked by this target so we can avoid
   // intermediate targets below.
   TargetSet linked;
-  if(target.GetType() != cmTarget::STATIC_LIBRARY)
+  if(target.GetType() != cmState::STATIC_LIBRARY)
     {
     linked = this->GetTargetLinkClosure(&target);
     }
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 6291796..bc05aea 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -513,7 +513,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
       {
       cmTarget& target = l->second;
 
-      if (target.GetType() == cmTarget::GLOBAL_TARGET)
+      if (target.GetType() == cmState::GLOBAL_TARGET)
         {
         continue;
         }
@@ -528,12 +528,12 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
       // this will make sure that when the next target is built
       // things are up-to-date
       if(!makeHelper.empty() &&
-         (target.GetType() == cmTarget::EXECUTABLE ||
+         (target.GetType() == cmState::EXECUTABLE ||
 // Nope - no post-build for OBJECT_LIRBRARY
-//          target.GetType() == cmTarget::OBJECT_LIBRARY ||
-          target.GetType() == cmTarget::STATIC_LIBRARY ||
-          target.GetType() == cmTarget::SHARED_LIBRARY ||
-          target.GetType() == cmTarget::MODULE_LIBRARY))
+//          target.GetType() == cmState::OBJECT_LIBRARY ||
+          target.GetType() == cmState::STATIC_LIBRARY ||
+          target.GetType() == cmState::SHARED_LIBRARY ||
+          target.GetType() == cmState::MODULE_LIBRARY))
         {
         makeHelper[makeHelper.size()-1] = // fill placeholder
           this->PostBuildMakeTarget(target.GetName(), "$(CONFIGURATION)");
@@ -549,7 +549,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
                                                     dir.c_str());
         }
 
-      if(target.GetType() != cmTarget::INTERFACE_LIBRARY
+      if(target.GetType() != cmState::INTERFACE_LIBRARY
           && !target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
         {
         allbuild->AddUtility(target.GetName());
@@ -1100,13 +1100,13 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
       continue;
       }
 
-    if(cmtarget.GetType() == cmTarget::INTERFACE_LIBRARY)
+    if(cmtarget.GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
 
-    if(cmtarget.GetType() == cmTarget::UTILITY ||
-       cmtarget.GetType() == cmTarget::GLOBAL_TARGET)
+    if(cmtarget.GetType() == cmState::UTILITY ||
+       cmtarget.GetType() == cmState::GLOBAL_TARGET)
       {
       cmXCodeObject* t = this->CreateUtilityTarget(cmtarget);
       if (!t)
@@ -1366,9 +1366,9 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguages()
 void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
 {
   // This matters only for targets that link.
-  if(cmtarget.GetType() != cmTarget::EXECUTABLE &&
-     cmtarget.GetType() != cmTarget::SHARED_LIBRARY &&
-     cmtarget.GetType() != cmTarget::MODULE_LIBRARY)
+  if(cmtarget.GetType() != cmState::EXECUTABLE &&
+     cmtarget.GetType() != cmState::SHARED_LIBRARY &&
+     cmtarget.GetType() != cmState::MODULE_LIBRARY)
     {
     return;
     }
@@ -1467,7 +1467,7 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
   std::vector<cmCustomCommand> postbuild
     = cmtarget.GetPostBuildCommands();
 
-  if(cmtarget.GetType() == cmTarget::SHARED_LIBRARY &&
+  if(cmtarget.GetType() == cmState::SHARED_LIBRARY &&
     !cmtarget.IsFrameworkOnApple())
     {
     cmCustomCommandLines cmd;
@@ -1786,17 +1786,17 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
                                                 cmXCodeObject* buildSettings,
                                                 const std::string& configName)
 {
-  if(target.GetType() == cmTarget::INTERFACE_LIBRARY)
+  if(target.GetType() == cmState::INTERFACE_LIBRARY)
     {
     return;
     }
 
   std::string defFlags;
-  bool shared = ((target.GetType() == cmTarget::SHARED_LIBRARY) ||
-                 (target.GetType() == cmTarget::MODULE_LIBRARY));
-  bool binary = ((target.GetType() == cmTarget::OBJECT_LIBRARY) ||
-                 (target.GetType() == cmTarget::STATIC_LIBRARY) ||
-                 (target.GetType() == cmTarget::EXECUTABLE) ||
+  bool shared = ((target.GetType() == cmState::SHARED_LIBRARY) ||
+                 (target.GetType() == cmState::MODULE_LIBRARY));
+  bool binary = ((target.GetType() == cmState::OBJECT_LIBRARY) ||
+                 (target.GetType() == cmState::STATIC_LIBRARY) ||
+                 (target.GetType() == cmState::EXECUTABLE) ||
                  shared);
 
   // Compute the compilation flags for each language.
@@ -1858,15 +1858,15 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 
   std::string extraLinkOptionsVar;
   std::string extraLinkOptions;
-  if(target.GetType() == cmTarget::EXECUTABLE)
+  if(target.GetType() == cmState::EXECUTABLE)
     {
     extraLinkOptionsVar = "CMAKE_EXE_LINKER_FLAGS";
     }
-  else if(target.GetType() == cmTarget::SHARED_LIBRARY)
+  else if(target.GetType() == cmState::SHARED_LIBRARY)
     {
     extraLinkOptionsVar = "CMAKE_SHARED_LINKER_FLAGS";
     }
-  else if(target.GetType() == cmTarget::MODULE_LIBRARY)
+  else if(target.GetType() == cmState::MODULE_LIBRARY)
     {
     extraLinkOptionsVar = "CMAKE_MODULE_LINKER_FLAGS";
     }
@@ -1878,8 +1878,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
                                configName);
     }
 
-  if(target.GetType() == cmTarget::OBJECT_LIBRARY ||
-     target.GetType() == cmTarget::STATIC_LIBRARY)
+  if(target.GetType() == cmState::OBJECT_LIBRARY ||
+     target.GetType() == cmState::STATIC_LIBRARY)
     {
     this->CurrentLocalGenerator
       ->GetStaticLibraryFlags(extraLinkOptions,
@@ -1969,10 +1969,10 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 
   // Set attributes to specify the proper name for the target.
   std::string pndir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
-  if(target.GetType() == cmTarget::STATIC_LIBRARY ||
-     target.GetType() == cmTarget::SHARED_LIBRARY ||
-     target.GetType() == cmTarget::MODULE_LIBRARY ||
-     target.GetType() == cmTarget::EXECUTABLE)
+  if(target.GetType() == cmState::STATIC_LIBRARY ||
+     target.GetType() == cmState::SHARED_LIBRARY ||
+     target.GetType() == cmState::MODULE_LIBRARY ||
+     target.GetType() == cmState::EXECUTABLE)
     {
     if(this->XcodeVersion >= 21)
       {
@@ -2000,7 +2000,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     buildSettings->AddAttribute("EXECUTABLE_SUFFIX",
                                 this->CreateString(pnsuffix.c_str()));
     }
-  else if(target.GetType() == cmTarget::OBJECT_LIBRARY)
+  else if(target.GetType() == cmState::OBJECT_LIBRARY)
     {
     pnprefix = "lib";
     pnbase = target.GetName();
@@ -2031,15 +2031,15 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
   // Handle settings for each target type.
   switch(target.GetType())
     {
-    case cmTarget::OBJECT_LIBRARY:
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::OBJECT_LIBRARY:
+    case cmState::STATIC_LIBRARY:
     {
     buildSettings->AddAttribute("LIBRARY_STYLE",
                                 this->CreateString("STATIC"));
     break;
     }
 
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::MODULE_LIBRARY:
     {
     buildSettings->AddAttribute("LIBRARY_STYLE",
                                 this->CreateString("BUNDLE"));
@@ -2098,7 +2098,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
       }
     break;
     }
-    case cmTarget::SHARED_LIBRARY:
+    case cmState::SHARED_LIBRARY:
     {
     if(target.GetPropertyAsBool("FRAMEWORK"))
       {
@@ -2135,7 +2135,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
                                 this->CreateString("DYNAMIC"));
     break;
     }
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
     {
     // Add the flags to create an executable.
     std::string createFlags =
@@ -2327,7 +2327,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 
   // Create the INSTALL_PATH attribute.
   std::string install_name_dir;
-  if(target.GetType() == cmTarget::SHARED_LIBRARY)
+  if(target.GetType() == cmState::SHARED_LIBRARY)
     {
     // Get the install_name directory for the build tree.
     install_name_dir = gtgt->GetInstallNameDirForBuildTree(configName);
@@ -2415,7 +2415,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     }
 
   // Runtime version information.
-  if(target.GetType() == cmTarget::SHARED_LIBRARY)
+  if(target.GetType() == cmState::SHARED_LIBRARY)
     {
     int major;
     int minor;
@@ -2550,7 +2550,7 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
   this->XCodeObjectMap[&cmtarget] = target;
 
   // Add source files without build rules for editing convenience.
-  if(cmtarget.GetType() == cmTarget::UTILITY)
+  if(cmtarget.GetType() == cmState::UTILITY)
     {
     std::vector<cmSourceFile*> sources;
     cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
@@ -2627,8 +2627,8 @@ const char*
 cmGlobalXCodeGenerator::GetTargetLinkFlagsVar(cmTarget const& cmtarget) const
 {
   if(this->XcodeVersion >= 60 &&
-     (cmtarget.GetType() == cmTarget::STATIC_LIBRARY ||
-      cmtarget.GetType() == cmTarget::OBJECT_LIBRARY))
+     (cmtarget.GetType() == cmState::STATIC_LIBRARY ||
+      cmtarget.GetType() == cmState::OBJECT_LIBRARY))
     {
     return "OTHER_LIBTOOLFLAGS";
     }
@@ -2643,10 +2643,10 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(cmTarget& cmtarget)
 {
   switch(cmtarget.GetType())
     {
-    case cmTarget::OBJECT_LIBRARY:
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::OBJECT_LIBRARY:
+    case cmState::STATIC_LIBRARY:
       return "archive.ar";
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       if (cmtarget.IsXCTestOnApple())
         return "wrapper.cfbundle";
       else if (cmtarget.IsCFBundleOnApple())
@@ -2654,10 +2654,10 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(cmTarget& cmtarget)
       else
         return ((this->XcodeVersion >= 22)?
               "compiled.mach-o.executable" : "compiled.mach-o.dylib");
-    case cmTarget::SHARED_LIBRARY:
+    case cmState::SHARED_LIBRARY:
       return (cmtarget.GetPropertyAsBool("FRAMEWORK")?
               "wrapper.framework" : "compiled.mach-o.dylib");
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
       return "compiled.mach-o.executable";
     default: break;
     }
@@ -2669,10 +2669,10 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(cmTarget& cmtarget)
 {
   switch(cmtarget.GetType())
     {
-    case cmTarget::OBJECT_LIBRARY:
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::OBJECT_LIBRARY:
+    case cmState::STATIC_LIBRARY:
       return "com.apple.product-type.library.static";
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       if (cmtarget.IsXCTestOnApple())
         return "com.apple.product-type.bundle.unit-test";
       else if (cmtarget.IsCFBundleOnApple())
@@ -2681,11 +2681,11 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(cmTarget& cmtarget)
         return ((this->XcodeVersion >= 22)?
                 "com.apple.product-type.tool" :
                 "com.apple.product-type.library.dynamic");
-    case cmTarget::SHARED_LIBRARY:
+    case cmState::SHARED_LIBRARY:
       return (cmtarget.GetPropertyAsBool("FRAMEWORK")?
               "com.apple.product-type.framework" :
               "com.apple.product-type.library.dynamic");
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
       return (cmtarget.GetPropertyAsBool("MACOSX_BUNDLE")?
               "com.apple.product-type.application" :
               "com.apple.product-type.tool");
@@ -2699,7 +2699,7 @@ cmXCodeObject*
 cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
                                           cmXCodeObject* buildPhases)
 {
-  if(cmtarget.GetType() == cmTarget::INTERFACE_LIBRARY)
+  if(cmtarget.GetType() == cmState::INTERFACE_LIBRARY)
     {
     return 0;
     }
@@ -2734,7 +2734,7 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
     fileRef->AddAttribute("explicitFileType", this->CreateString(fileType));
     }
   std::string fullName;
-  if(cmtarget.GetType() == cmTarget::OBJECT_LIBRARY)
+  if(cmtarget.GetType() == cmState::OBJECT_LIBRARY)
     {
     fullName = "lib";
     fullName += cmtarget.GetName();
@@ -2909,7 +2909,7 @@ void cmGlobalXCodeGenerator
 ::AddDependAndLinkInformation(cmXCodeObject* target)
 {
   cmTarget* cmtarget = target->GetTarget();
-  if(cmtarget->GetType() == cmTarget::INTERFACE_LIBRARY)
+  if(cmtarget->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return;
     }
@@ -2958,8 +2958,8 @@ void cmGlobalXCodeGenerator
       }
 
     // Skip link information for object libraries.
-    if(cmtarget->GetType() == cmTarget::OBJECT_LIBRARY ||
-       cmtarget->GetType() == cmTarget::STATIC_LIBRARY)
+    if(cmtarget->GetType() == cmState::OBJECT_LIBRARY ||
+       cmtarget->GetType() == cmState::STATIC_LIBRARY)
       {
       continue;
       }
@@ -3024,7 +3024,7 @@ void cmGlobalXCodeGenerator
         linkLibs += this->XCodeEscapePath(li->Value.c_str());
         }
       else if (!li->Target
-          || li->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
+          || li->Target->GetType() != cmState::INTERFACE_LIBRARY)
         {
         linkLibs += li->Value;
         }
@@ -3063,11 +3063,11 @@ bool cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
       // end up with (empty anyhow) ALL_BUILD and XCODE_DEPEND_HELPER source
       // groups:
       //
-      if(cmtarget.GetType() == cmTarget::GLOBAL_TARGET)
+      if(cmtarget.GetType() == cmState::GLOBAL_TARGET)
         {
         continue;
         }
-      if(cmtarget.GetType() == cmTarget::INTERFACE_LIBRARY)
+      if(cmtarget.GetType() == cmState::INTERFACE_LIBRARY)
         {
         continue;
         }
@@ -3624,21 +3624,21 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
       cmTarget* t =target->GetTarget();
       cmGeneratorTarget *gt = this->GetGeneratorTarget(t);
 
-      if(t->GetType() == cmTarget::EXECUTABLE ||
+      if(t->GetType() == cmState::EXECUTABLE ||
 // Nope - no post-build for OBJECT_LIRBRARY
-//         t->GetType() == cmTarget::OBJECT_LIBRARY ||
-         t->GetType() == cmTarget::STATIC_LIBRARY ||
-         t->GetType() == cmTarget::SHARED_LIBRARY ||
-         t->GetType() == cmTarget::MODULE_LIBRARY)
+//         t->GetType() == cmState::OBJECT_LIBRARY ||
+         t->GetType() == cmState::STATIC_LIBRARY ||
+         t->GetType() == cmState::SHARED_LIBRARY ||
+         t->GetType() == cmState::MODULE_LIBRARY)
         {
         // Declare an entry point for the target post-build phase.
         makefileStream << this->PostBuildMakeTarget(t->GetName(), *ct)
                        << ":\n";
         }
 
-      if(t->GetType() == cmTarget::EXECUTABLE ||
-         t->GetType() == cmTarget::SHARED_LIBRARY ||
-         t->GetType() == cmTarget::MODULE_LIBRARY)
+      if(t->GetType() == cmState::EXECUTABLE ||
+         t->GetType() == cmState::SHARED_LIBRARY ||
+         t->GetType() == cmState::MODULE_LIBRARY)
         {
         std::string tfull = gt->GetFullPath(configName);
         std::string trel = this->ConvertToRelativeForMake(tfull.c_str());
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index b3cf91e..cc36c62 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -26,13 +26,13 @@ static const char* getShapeForTarget(const cmTarget* target)
 
   switch ( target->GetType() )
     {
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
       return "house";
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::STATIC_LIBRARY:
       return "diamond";
-    case cmTarget::SHARED_LIBRARY:
+    case cmState::SHARED_LIBRARY:
       return "polygon";
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       return "octagon";
     default:
       break;
@@ -582,18 +582,18 @@ bool cmGraphVizWriter::IgnoreThisTarget(const std::string& name)
 }
 
 
-bool cmGraphVizWriter::GenerateForTargetType(cmTarget::TargetType targetType)
+bool cmGraphVizWriter::GenerateForTargetType(cmState::TargetType targetType)
                                                                           const
 {
   switch (targetType)
   {
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
       return this->GenerateForExecutables;
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::STATIC_LIBRARY:
       return this->GenerateForStaticLibs;
-    case cmTarget::SHARED_LIBRARY:
+    case cmState::SHARED_LIBRARY:
       return this->GenerateForSharedLibs;
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       return this->GenerateForModuleLibs;
     default:
       break;
diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h
index 64de684..0a20e6e 100644
--- a/Source/cmGraphVizWriter.h
+++ b/Source/cmGraphVizWriter.h
@@ -62,7 +62,7 @@ protected:
 
   bool IgnoreThisTarget(const std::string& name);
 
-  bool GenerateForTargetType(cmTarget::TargetType targetType) const;
+  bool GenerateForTargetType(cmState::TargetType targetType) const;
 
   std::string GraphType;
   std::string GraphName;
diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx
index 1e7258a..c64d128 100644
--- a/Source/cmIncludeExternalMSProjectCommand.cxx
+++ b/Source/cmIncludeExternalMSProjectCommand.cxx
@@ -77,7 +77,7 @@ bool cmIncludeExternalMSProjectCommand
       }
 
     // Create a target instance for this utility.
-    cmTarget* target=this->Makefile->AddNewTarget(cmTarget::UTILITY,
+    cmTarget* target=this->Makefile->AddNewTarget(cmState::UTILITY,
                                                   utility_name.c_str());
 
     target->SetProperty("GENERATOR_FILE_NAME", utility_name.c_str());
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 333c2ff..c22edf3 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -383,12 +383,12 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
     if(cmTarget* target=this->Makefile->FindTarget(*targetIt))
       {
       // Found the target.  Check its type.
-      if(target->GetType() != cmTarget::EXECUTABLE &&
-         target->GetType() != cmTarget::STATIC_LIBRARY &&
-         target->GetType() != cmTarget::SHARED_LIBRARY &&
-         target->GetType() != cmTarget::MODULE_LIBRARY &&
-         target->GetType() != cmTarget::OBJECT_LIBRARY &&
-         target->GetType() != cmTarget::INTERFACE_LIBRARY)
+      if(target->GetType() != cmState::EXECUTABLE &&
+         target->GetType() != cmState::STATIC_LIBRARY &&
+         target->GetType() != cmState::SHARED_LIBRARY &&
+         target->GetType() != cmState::MODULE_LIBRARY &&
+         target->GetType() != cmState::OBJECT_LIBRARY &&
+         target->GetType() != cmState::INTERFACE_LIBRARY)
         {
         std::ostringstream e;
         e << "TARGETS given target \"" << (*targetIt)
@@ -396,7 +396,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
         this->SetError(e.str());
         return false;
         }
-      else if(target->GetType() == cmTarget::OBJECT_LIBRARY)
+      else if(target->GetType() == cmState::OBJECT_LIBRARY)
         {
         std::ostringstream e;
         e << "TARGETS given OBJECT library \"" << (*targetIt)
@@ -449,7 +449,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
 
     switch(target.GetType())
       {
-      case cmTarget::SHARED_LIBRARY:
+      case cmState::SHARED_LIBRARY:
         {
         // Shared libraries are handled differently on DLL and non-DLL
         // platforms.  All windows platforms are DLL platforms including
@@ -532,7 +532,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
           }
         }
         break;
-      case cmTarget::STATIC_LIBRARY:
+      case cmState::STATIC_LIBRARY:
         {
         // Static libraries use ARCHIVE properties.
         if (!archiveArgs.GetDestination().empty())
@@ -550,7 +550,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
           }
         }
         break;
-      case cmTarget::MODULE_LIBRARY:
+      case cmState::MODULE_LIBRARY:
         {
         // Modules use LIBRARY properties.
         if (!libraryArgs.GetDestination().empty())
@@ -571,7 +571,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
           }
         }
         break;
-      case cmTarget::EXECUTABLE:
+      case cmState::EXECUTABLE:
         {
         if(target.IsAppBundleOnApple())
           {
@@ -635,7 +635,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
           }
         }
         break;
-      case cmTarget::INTERFACE_LIBRARY:
+      case cmState::INTERFACE_LIBRARY:
           // Nothing to do. An INTERFACE_LIBRARY can be installed, but the
           // only effect of that is to make it exportable. It installs no
           // other files itself.
@@ -654,7 +654,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
     bool createInstallGeneratorsForTargetFileSets = true;
 
     if(target.IsFrameworkOnApple()
-        || target.GetType() == cmTarget::INTERFACE_LIBRARY)
+        || target.GetType() == cmState::INTERFACE_LIBRARY)
       {
       createInstallGeneratorsForTargetFileSets = false;
       }
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index a3d2927..66b6fc7 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -94,29 +94,29 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
   std::vector<std::string> filesFrom;
   std::vector<std::string> filesTo;
   std::string literal_args;
-  cmTarget::TargetType targetType =
-      static_cast<cmTarget::TargetType>(this->Target->GetType());
+  cmState::TargetType targetType =
+      static_cast<cmState::TargetType>(this->Target->GetType());
   cmInstallType type = cmInstallType();
   switch(targetType)
     {
-    case cmTarget::EXECUTABLE: type = cmInstallType_EXECUTABLE; break;
-    case cmTarget::STATIC_LIBRARY: type = cmInstallType_STATIC_LIBRARY; break;
-    case cmTarget::SHARED_LIBRARY: type = cmInstallType_SHARED_LIBRARY; break;
-    case cmTarget::MODULE_LIBRARY: type = cmInstallType_MODULE_LIBRARY; break;
-    case cmTarget::INTERFACE_LIBRARY:
+    case cmState::EXECUTABLE: type = cmInstallType_EXECUTABLE; break;
+    case cmState::STATIC_LIBRARY: type = cmInstallType_STATIC_LIBRARY; break;
+    case cmState::SHARED_LIBRARY: type = cmInstallType_SHARED_LIBRARY; break;
+    case cmState::MODULE_LIBRARY: type = cmInstallType_MODULE_LIBRARY; break;
+    case cmState::INTERFACE_LIBRARY:
       // Not reachable. We never create a cmInstallTargetGenerator for
       // an INTERFACE_LIBRARY.
       assert(0 && "INTERFACE_LIBRARY targets have no installable outputs.");
       break;
-    case cmTarget::OBJECT_LIBRARY:
-    case cmTarget::UTILITY:
-    case cmTarget::GLOBAL_TARGET:
-    case cmTarget::UNKNOWN_LIBRARY:
+    case cmState::OBJECT_LIBRARY:
+    case cmState::UTILITY:
+    case cmState::GLOBAL_TARGET:
+    case cmState::UNKNOWN_LIBRARY:
       this->Target->Target->GetMakefile()->IssueMessage(cmake::INTERNAL_ERROR,
         "cmInstallTargetGenerator created with non-installable target.");
       return;
     }
-  if(targetType == cmTarget::EXECUTABLE)
+  if(targetType == cmState::EXECUTABLE)
     {
     // There is a bug in cmInstallCommand if this fails.
     assert(this->NamelinkMode == NamelinkModeNone);
@@ -375,7 +375,7 @@ cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target,
   cmGeneratorTarget *gtgt = target->GetMakefile()
                                   ->GetGlobalGenerator()
                                   ->GetGeneratorTarget(target);
-  if(target->GetType() == cmTarget::EXECUTABLE)
+  if(target->GetType() == cmState::EXECUTABLE)
     {
     std::string targetName;
     std::string targetNameReal;
@@ -542,9 +542,9 @@ cmInstallTargetGenerator
                           std::string const& toDestDirPath)
 {
   if(this->ImportLibrary ||
-     !(this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
-       this->Target->GetType() == cmTarget::MODULE_LIBRARY ||
-       this->Target->GetType() == cmTarget::EXECUTABLE))
+     !(this->Target->GetType() == cmState::SHARED_LIBRARY ||
+       this->Target->GetType() == cmState::MODULE_LIBRARY ||
+       this->Target->GetType() == cmState::EXECUTABLE))
     {
     return;
     }
@@ -602,7 +602,7 @@ cmInstallTargetGenerator
 
   // Edit the install_name of the target itself if necessary.
   std::string new_id;
-  if(this->Target->GetType() == cmTarget::SHARED_LIBRARY)
+  if(this->Target->GetType() == cmState::SHARED_LIBRARY)
     {
     std::string for_build =
       this->Target->GetInstallNameDirForBuildTree(config);
@@ -813,7 +813,7 @@ cmInstallTargetGenerator::AddStripRule(std::ostream& os,
 
   // don't strip static and import libraries, because it removes the only
   // symbol table they have so you can't link to them anymore
-  if(this->Target->GetType()==cmTarget::STATIC_LIBRARY || this->ImportLibrary)
+  if(this->Target->GetType()==cmState::STATIC_LIBRARY || this->ImportLibrary)
     {
     return;
     }
@@ -844,7 +844,7 @@ cmInstallTargetGenerator::AddRanlibRule(std::ostream& os,
                                         const std::string& toDestDirPath)
 {
   // Static libraries need ranlib on this platform.
-  if(this->Target->GetType() != cmTarget::STATIC_LIBRARY)
+  if(this->Target->GetType() != cmState::STATIC_LIBRARY)
     {
     return;
     }
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 7cf0ad0..2a12f2b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -137,7 +137,7 @@ void cmLocalGenerator::TraceDependencies()
       t != targets.end(); ++t)
     {
     if (t->second->Target->IsImported()
-        || t->second->GetType() == cmTarget::INTERFACE_LIBRARY)
+        || t->second->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -472,7 +472,7 @@ void cmLocalGenerator::ComputeTargetManifest()
       t != targets.end(); ++t)
     {
     cmGeneratorTarget& target = *t->second;
-    if (target.GetType() == cmTarget::INTERFACE_LIBRARY)
+    if (target.GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -1347,12 +1347,12 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
 
   switch(target->GetType())
     {
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::STATIC_LIBRARY:
       this->GetStaticLibraryFlags(linkFlags, buildType, target->Target);
       break;
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       libraryLinkVariable = "CMAKE_MODULE_LINKER_FLAGS";
-    case cmTarget::SHARED_LIBRARY:
+    case cmState::SHARED_LIBRARY:
       {
       linkFlags = this->Makefile->GetSafeDefinition(libraryLinkVariable);
       linkFlags += " ";
@@ -1404,7 +1404,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
                                 *target, false, false, useWatcomQuote);
       }
       break;
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
       {
       linkFlags +=
         this->Makefile->GetSafeDefinition("CMAKE_EXE_LINKER_FLAGS");
@@ -1549,7 +1549,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
     this->Makefile->GetSafeDefinition("CMAKE_LIBRARY_PATH_TERMINATOR");
 
   // Flags to link an executable to shared libraries.
-  if (tgt.GetType() == cmTarget::EXECUTABLE &&
+  if (tgt.GetType() == cmState::EXECUTABLE &&
       this->StateSnapshot.GetState()->
         GetGlobalPropertyAsBool("TARGET_SUPPORTS_SHARED_LIBS"))
     {
@@ -1631,7 +1631,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
   ItemVector const& items = cli.GetItems();
   for(ItemVector::const_iterator li = items.begin(); li != items.end(); ++li)
     {
-    if(li->Target && li->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if(li->Target && li->Target->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -1817,8 +1817,8 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
     if(cmSystemTools::FileIsFullPath(inName.c_str()))
       {
       std::string tLocation;
-      if(target->GetType() >= cmTarget::EXECUTABLE &&
-         target->GetType() <= cmTarget::MODULE_LIBRARY)
+      if(target->GetType() >= cmState::EXECUTABLE &&
+         target->GetType() <= cmState::MODULE_LIBRARY)
         {
         tLocation = target->GetLocation(config);
         tLocation = cmSystemTools::GetFilenamePath(tLocation);
@@ -1838,23 +1838,23 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
       }
     switch (target->GetType())
       {
-      case cmTarget::EXECUTABLE:
-      case cmTarget::STATIC_LIBRARY:
-      case cmTarget::SHARED_LIBRARY:
-      case cmTarget::MODULE_LIBRARY:
-      case cmTarget::UNKNOWN_LIBRARY:
+      case cmState::EXECUTABLE:
+      case cmState::STATIC_LIBRARY:
+      case cmState::SHARED_LIBRARY:
+      case cmState::MODULE_LIBRARY:
+      case cmState::UNKNOWN_LIBRARY:
         dep = target->GetLocation(config);
         return true;
-      case cmTarget::OBJECT_LIBRARY:
+      case cmState::OBJECT_LIBRARY:
         // An object library has no single file on which to depend.
         // This was listed to get the target-level dependency.
         return false;
-      case cmTarget::INTERFACE_LIBRARY:
+      case cmState::INTERFACE_LIBRARY:
         // An interface library has no file on which to depend.
         // This was listed to get the target-level dependency.
         return false;
-      case cmTarget::UTILITY:
-      case cmTarget::GLOBAL_TARGET:
+      case cmState::UTILITY:
+      case cmState::GLOBAL_TARGET:
         // A utility target has no file on which to depend.  This was listed
         // only to get the target-level dependency.
         return false;
@@ -2104,8 +2104,8 @@ void cmLocalGenerator
 
   std::string warnCMP0063;
   std::string *pWarnCMP0063 = 0;
-  if (target->GetType() != cmTarget::SHARED_LIBRARY &&
-      target->GetType() != cmTarget::MODULE_LIBRARY &&
+  if (target->GetType() != cmState::SHARED_LIBRARY &&
+      target->GetType() != cmState::MODULE_LIBRARY &&
       !target->IsExecutableWithExports())
     {
     switch (target->GetPolicyStatusCMP0063())
@@ -2151,8 +2151,8 @@ void cmLocalGenerator::AddCMP0018Flags(std::string &flags,
 {
   int targetType = target->GetType();
 
-  bool shared = ((targetType == cmTarget::SHARED_LIBRARY) ||
-                  (targetType == cmTarget::MODULE_LIBRARY));
+  bool shared = ((targetType == cmState::SHARED_LIBRARY) ||
+                  (targetType == cmState::MODULE_LIBRARY));
 
   if (this->GetShouldUseOldFlags(shared, lang))
     {
@@ -2160,7 +2160,7 @@ void cmLocalGenerator::AddCMP0018Flags(std::string &flags,
     }
   else
     {
-    if (target->GetType() == cmTarget::OBJECT_LIBRARY)
+    if (target->GetType() == cmState::OBJECT_LIBRARY)
       {
       if (target->GetPropertyAsBool("POSITION_INDEPENDENT_CODE"))
         {
@@ -2234,7 +2234,7 @@ void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags,
 {
   const char* picFlags = 0;
 
-  if(targetType == cmTarget::EXECUTABLE)
+  if(targetType == cmState::EXECUTABLE)
     {
     std::string flagsVar = "CMAKE_";
     flagsVar += lang;
@@ -2512,7 +2512,7 @@ cmLocalGenerator
   cmTargets& tgts = this->Makefile->GetTargets();
   for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l)
     {
-    if (l->second.GetType() == cmTarget::INTERFACE_LIBRARY)
+    if (l->second.GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -2540,9 +2540,9 @@ cmLocalGenerator
       // Generate the proper install generator for this target type.
       switch(l->second.GetType())
         {
-        case cmTarget::EXECUTABLE:
-        case cmTarget::STATIC_LIBRARY:
-        case cmTarget::MODULE_LIBRARY:
+        case cmState::EXECUTABLE:
+        case cmState::STATIC_LIBRARY:
+        case cmState::MODULE_LIBRARY:
           {
           // Use a target install generator.
           cmInstallTargetGeneratorLocal
@@ -2550,7 +2550,7 @@ cmLocalGenerator
           g.Generate(os, config, configurationTypes);
           }
           break;
-        case cmTarget::SHARED_LIBRARY:
+        case cmState::SHARED_LIBRARY:
           {
 #if defined(_WIN32) || defined(__CYGWIN__)
           // Special code to handle DLL.  Install the import library
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index 195a1e0..2535d2f 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -31,7 +31,7 @@ void cmLocalGhsMultiGenerator::Generate()
   for (cmGeneratorTargetsType::iterator l = tgts.begin(); l != tgts.end();
        ++l)
     {
-    if (l->second->GetType() == cmTarget::INTERFACE_LIBRARY
+    if (l->second->GetType() == cmState::INTERFACE_LIBRARY
         || l->second->Target->IsImported())
       {
       continue;
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 8f7a66f..47c712c 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -77,7 +77,7 @@ void cmLocalNinjaGenerator::Generate()
   for(cmGeneratorTargetsType::iterator t = targets.begin();
       t != targets.end(); ++t)
     {
-    if (t->second->GetType() == cmTarget::INTERFACE_LIBRARY
+    if (t->second->GetType() == cmState::INTERFACE_LIBRARY
         || t->second->Target->IsImported())
       {
       continue;
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index e4533cc..5a10d05 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -119,7 +119,7 @@ void cmLocalUnixMakefileGenerator3::Generate()
   for(cmGeneratorTargetsType::iterator t = targets.begin();
       t != targets.end(); ++t)
     {
-    if (t->second->GetType() == cmTarget::INTERFACE_LIBRARY
+    if (t->second->GetType() == cmState::INTERFACE_LIBRARY
         || t->second->Target->IsImported())
       {
       continue;
@@ -180,7 +180,7 @@ GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles)
       ti != targets.end(); ++ti)
     {
     cmGeneratorTarget* gt = ti->second;
-    if (gt->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if (gt->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -423,12 +423,12 @@ void cmLocalUnixMakefileGenerator3
   for(cmGeneratorTargetsType::iterator t = targets.begin();
       t != targets.end(); ++t)
     {
-    if((t->second->GetType() == cmTarget::EXECUTABLE) ||
-       (t->second->GetType() == cmTarget::STATIC_LIBRARY) ||
-       (t->second->GetType() == cmTarget::SHARED_LIBRARY) ||
-       (t->second->GetType() == cmTarget::MODULE_LIBRARY) ||
-       (t->second->GetType() == cmTarget::OBJECT_LIBRARY) ||
-       (t->second->GetType() == cmTarget::UTILITY))
+    if((t->second->GetType() == cmState::EXECUTABLE) ||
+       (t->second->GetType() == cmState::STATIC_LIBRARY) ||
+       (t->second->GetType() == cmState::SHARED_LIBRARY) ||
+       (t->second->GetType() == cmState::MODULE_LIBRARY) ||
+       (t->second->GetType() == cmState::OBJECT_LIBRARY) ||
+       (t->second->GetType() == cmState::UTILITY))
       {
       if (t->second->Target->IsImported())
         {
@@ -1774,7 +1774,7 @@ void cmLocalUnixMakefileGenerator3
   cmTargets::iterator glIt;
   for ( glIt = targets->begin(); glIt != targets->end(); ++ glIt )
     {
-    if ( glIt->second.GetType() == cmTarget::GLOBAL_TARGET )
+    if ( glIt->second.GetType() == cmState::GLOBAL_TARGET )
       {
       std::string targetString = "Special rule for the target " + glIt->first;
       std::vector<std::string> commands;
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index b043b00..63fc283 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -77,7 +77,7 @@ void cmLocalVisualStudio10Generator::Generate()
   cmTargets &tgts = this->Makefile->GetTargets();
   for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l)
     {
-    if(l->second.GetType() == cmTarget::INTERFACE_LIBRARY)
+    if(l->second.GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index c620baf..48639a8 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -86,8 +86,8 @@ void cmLocalVisualStudio6Generator::AddCMakeListsRules()
   for(cmTargets::iterator l = tgts.begin();
       l != tgts.end(); l++)
     {
-    if (l->second.GetType() == cmTarget::INTERFACE_LIBRARY
-        || l->second.GetType() == cmTarget::GLOBAL_TARGET)
+    if (l->second.GetType() == cmState::INTERFACE_LIBRARY
+        || l->second.GetType() == cmState::GLOBAL_TARGET)
       {
       continue;
       }
@@ -132,22 +132,22 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
     {
     switch(l->second.GetType())
       {
-      case cmTarget::STATIC_LIBRARY:
-      case cmTarget::OBJECT_LIBRARY:
+      case cmState::STATIC_LIBRARY:
+      case cmState::OBJECT_LIBRARY:
         this->SetBuildType(STATIC_LIBRARY, l->first.c_str(), l->second);
         break;
-      case cmTarget::SHARED_LIBRARY:
-      case cmTarget::MODULE_LIBRARY:
+      case cmState::SHARED_LIBRARY:
+      case cmState::MODULE_LIBRARY:
         this->SetBuildType(DLL, l->first.c_str(), l->second);
         break;
-      case cmTarget::EXECUTABLE:
+      case cmState::EXECUTABLE:
         this->SetBuildType(EXECUTABLE,l->first.c_str(), l->second);
         break;
-      case cmTarget::UTILITY:
-      case cmTarget::GLOBAL_TARGET:
+      case cmState::UTILITY:
+      case cmState::GLOBAL_TARGET:
         this->SetBuildType(UTILITY, l->first.c_str(), l->second);
         break;
-      case cmTarget::INTERFACE_LIBRARY:
+      case cmState::INTERFACE_LIBRARY:
         continue;
       default:
         cmSystemTools::Error("Bad target type: ", l->first.c_str());
@@ -263,8 +263,8 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
   // special care for dependencies.  The first rule must depend on all
   // the dependencies of all the rules.  The later rules must each
   // depend only on the previous rule.
-  if ((target.GetType() == cmTarget::UTILITY ||
-      target.GetType() == cmTarget::GLOBAL_TARGET) &&
+  if ((target.GetType() == cmState::UTILITY ||
+      target.GetType() == cmState::GLOBAL_TARGET) &&
       (!target.GetPreBuildCommands().empty() ||
        !target.GetPostBuildCommands().empty()))
     {
@@ -482,8 +482,8 @@ void cmLocalVisualStudio6Generator
       cmSystemTools::ExpandListArgument(dependsValue, depends);
       }
     if (GetVS6TargetName(source) != libName ||
-      target.GetType() == cmTarget::UTILITY ||
-      target.GetType() == cmTarget::GLOBAL_TARGET)
+      target.GetType() == cmState::UTILITY ||
+      target.GetType() == cmState::GLOBAL_TARGET)
       {
       fout << "# Begin Source File\n\n";
 
@@ -804,7 +804,7 @@ cmLocalVisualStudio6Generator::MaybeCreateOutputDir(cmTarget& target,
 
   // VS6 forgets to create the output directory for archives if it
   // differs from the intermediate directory.
-  if(target.GetType() != cmTarget::STATIC_LIBRARY) { return pcc; }
+  if(target.GetType() != cmState::STATIC_LIBRARY) { return pcc; }
 
   cmGeneratorTarget* gt =
     this->GlobalGenerator->GetGeneratorTarget(&target);
@@ -835,7 +835,7 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target,
                                               const std::string& configName,
                                               const std::string& /* libName */)
 {
-  if (target.GetType() >= cmTarget::UTILITY )
+  if (target.GetType() >= cmState::UTILITY )
     {
     return "";
     }
@@ -948,8 +948,8 @@ void cmLocalVisualStudio6Generator
                  const std::string& libName, cmTarget &target,
                  std::vector<cmSourceGroup> &)
 {
-  bool targetBuilds = (target.GetType() >= cmTarget::EXECUTABLE &&
-                       target.GetType() <= cmTarget::MODULE_LIBRARY);
+  bool targetBuilds = (target.GetType() >= cmState::EXECUTABLE &&
+                       target.GetType() <= cmState::MODULE_LIBRARY);
 #ifdef CM_USE_OLD_VS6
   // Lookup the library and executable output directories.
   std::string libPath;
@@ -1108,12 +1108,12 @@ void cmLocalVisualStudio6Generator
     // add libraries to executables and dlls (but never include
     // a library in a library, bad recursion)
     // NEVER LINK STATIC LIBRARIES TO OTHER STATIC LIBRARIES
-    if ((target.GetType() != cmTarget::SHARED_LIBRARY
-         && target.GetType() != cmTarget::STATIC_LIBRARY
-         && target.GetType() != cmTarget::MODULE_LIBRARY) ||
-        (target.GetType()==cmTarget::SHARED_LIBRARY
+    if ((target.GetType() != cmState::SHARED_LIBRARY
+         && target.GetType() != cmState::STATIC_LIBRARY
+         && target.GetType() != cmState::MODULE_LIBRARY) ||
+        (target.GetType()==cmState::SHARED_LIBRARY
          && libName != GetVS6TargetName(j->first)) ||
-        (target.GetType()==cmTarget::MODULE_LIBRARY
+        (target.GetType()==cmState::MODULE_LIBRARY
          && libName != GetVS6TargetName(j->first)))
       {
       // Compute the proper name to use to link this library.
@@ -1195,7 +1195,7 @@ void cmLocalVisualStudio6Generator
   std::string extraLinkOptionsRelease;
   std::string extraLinkOptionsMinSizeRel;
   std::string extraLinkOptionsRelWithDebInfo;
-  if(target.GetType() == cmTarget::EXECUTABLE)
+  if(target.GetType() == cmState::EXECUTABLE)
     {
     extraLinkOptions = this->Makefile->
       GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS");
@@ -1208,7 +1208,7 @@ void cmLocalVisualStudio6Generator
     extraLinkOptionsRelWithDebInfo = this->Makefile->
       GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO");
     }
-  if(target.GetType() == cmTarget::SHARED_LIBRARY)
+  if(target.GetType() == cmState::SHARED_LIBRARY)
     {
     extraLinkOptions = this->Makefile->
       GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS");
@@ -1221,7 +1221,7 @@ void cmLocalVisualStudio6Generator
     extraLinkOptionsRelWithDebInfo = this->Makefile->
       GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO");
     }
-  if(target.GetType() == cmTarget::MODULE_LIBRARY)
+  if(target.GetType() == cmState::MODULE_LIBRARY)
     {
     extraLinkOptions = this->Makefile->
       GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS");
@@ -1313,9 +1313,9 @@ void cmLocalVisualStudio6Generator
 
   // Compute version number information.
   std::string targetVersionFlag;
-  if(target.GetType() == cmTarget::EXECUTABLE ||
-     target.GetType() == cmTarget::SHARED_LIBRARY ||
-     target.GetType() == cmTarget::MODULE_LIBRARY)
+  if(target.GetType() == cmState::EXECUTABLE ||
+     target.GetType() == cmState::SHARED_LIBRARY ||
+     target.GetType() == cmState::MODULE_LIBRARY)
     {
     int major;
     int minor;
@@ -1332,10 +1332,10 @@ void cmLocalVisualStudio6Generator
   std::string outputNameRelease = outputName;
   std::string outputNameMinSizeRel = outputName;
   std::string outputNameRelWithDebInfo = outputName;
-  if(target.GetType() == cmTarget::EXECUTABLE ||
-     target.GetType() == cmTarget::STATIC_LIBRARY ||
-     target.GetType() == cmTarget::SHARED_LIBRARY ||
-     target.GetType() == cmTarget::MODULE_LIBRARY)
+  if(target.GetType() == cmState::EXECUTABLE ||
+     target.GetType() == cmState::STATIC_LIBRARY ||
+     target.GetType() == cmState::SHARED_LIBRARY ||
+     target.GetType() == cmState::MODULE_LIBRARY)
     {
     outputName = gt->GetFullName();
     outputNameDebug = gt->GetFullName("Debug");
@@ -1343,7 +1343,7 @@ void cmLocalVisualStudio6Generator
     outputNameMinSizeRel = gt->GetFullName("MinSizeRel");
     outputNameRelWithDebInfo = gt->GetFullName("RelWithDebInfo");
     }
-  else if(target.GetType() == cmTarget::OBJECT_LIBRARY)
+  else if(target.GetType() == cmState::OBJECT_LIBRARY)
     {
     outputName = target.GetName();
     outputName += ".lib";
@@ -1359,10 +1359,10 @@ void cmLocalVisualStudio6Generator
   std::string outputDirRelease;
   std::string outputDirMinSizeRel;
   std::string outputDirRelWithDebInfo;
-  if(target.GetType() == cmTarget::EXECUTABLE ||
-     target.GetType() == cmTarget::STATIC_LIBRARY ||
-     target.GetType() == cmTarget::SHARED_LIBRARY ||
-     target.GetType() == cmTarget::MODULE_LIBRARY)
+  if(target.GetType() == cmState::EXECUTABLE ||
+     target.GetType() == cmState::STATIC_LIBRARY ||
+     target.GetType() == cmState::SHARED_LIBRARY ||
+     target.GetType() == cmState::MODULE_LIBRARY)
     {
 #ifdef CM_USE_OLD_VS6
     outputDirOld =
@@ -1382,7 +1382,7 @@ void cmLocalVisualStudio6Generator
         removeQuotes(this->ConvertToOutputFormat(
                  gt->GetDirectory("RelWithDebInfo").c_str(), SHELL));
     }
-  else if(target.GetType() == cmTarget::OBJECT_LIBRARY)
+  else if(target.GetType() == cmState::OBJECT_LIBRARY)
     {
     std::string outputDir = cmake::GetCMakeFilesDirectoryPostSlash();
     outputDirDebug = outputDir + "Debug";
@@ -1396,9 +1396,9 @@ void cmLocalVisualStudio6Generator
   std::string optionsRelease;
   std::string optionsMinSizeRel;
   std::string optionsRelWithDebInfo;
-  if(target.GetType() == cmTarget::EXECUTABLE ||
-     target.GetType() == cmTarget::SHARED_LIBRARY ||
-     target.GetType() == cmTarget::MODULE_LIBRARY)
+  if(target.GetType() == cmState::EXECUTABLE ||
+     target.GetType() == cmState::SHARED_LIBRARY ||
+     target.GetType() == cmState::MODULE_LIBRARY)
     {
     extraLinkOptionsDebug =
       extraLinkOptions + " " + extraLinkOptionsDebug;
@@ -1424,9 +1424,9 @@ void cmLocalVisualStudio6Generator
   std::string targetImplibFlagRelease;
   std::string targetImplibFlagMinSizeRel;
   std::string targetImplibFlagRelWithDebInfo;
-  if(target.GetType() == cmTarget::SHARED_LIBRARY ||
-     target.GetType() == cmTarget::MODULE_LIBRARY ||
-     target.GetType() == cmTarget::EXECUTABLE)
+  if(target.GetType() == cmState::SHARED_LIBRARY ||
+     target.GetType() == cmState::MODULE_LIBRARY ||
+     target.GetType() == cmState::EXECUTABLE)
     {
     std::string fullPathImpDebug = gt->GetDirectory("Debug", true);
     std::string fullPathImpRelease = gt->GetDirectory("Release", true);
@@ -1494,7 +1494,7 @@ void cmLocalVisualStudio6Generator
   std::string staticLibOptionsRelease;
   std::string staticLibOptionsMinSizeRel;
   std::string staticLibOptionsRelWithDebInfo;
-  if(target.GetType() == cmTarget::STATIC_LIBRARY )
+  if(target.GetType() == cmState::STATIC_LIBRARY )
     {
     const char *libflagsGlobal =
       this->Makefile->GetSafeDefinition("CMAKE_STATIC_LINKER_FLAGS");
@@ -1567,8 +1567,8 @@ void cmLocalVisualStudio6Generator
                                  libnameExports.c_str());
     cmSystemTools::ReplaceString(line, "CMAKE_MFC_FLAG",
                                  mfcFlag);
-    if(target.GetType() == cmTarget::STATIC_LIBRARY ||
-       target.GetType() == cmTarget::OBJECT_LIBRARY)
+    if(target.GetType() == cmState::STATIC_LIBRARY ||
+       target.GetType() == cmState::OBJECT_LIBRARY)
       {
       cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS_DEBUG",
                                    staticLibOptionsDebug.c_str());
@@ -1674,7 +1674,7 @@ void cmLocalVisualStudio6Generator
                     (exePath.c_str(), SHELL)).c_str());
 #endif
 
-    if(targetBuilds || target.GetType() == cmTarget::OBJECT_LIBRARY)
+    if(targetBuilds || target.GetType() == cmState::OBJECT_LIBRARY)
       {
       cmSystemTools::ReplaceString(line, "OUTPUT_DIRECTORY_DEBUG",
                                    outputDirDebug.c_str());
@@ -1698,8 +1698,8 @@ void cmLocalVisualStudio6Generator
       = this->Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX");
     cmSystemTools::ReplaceString(line, "DEBUG_POSTFIX",
                                  debugPostfix?debugPostfix:"");
-    if(target.GetType() >= cmTarget::EXECUTABLE &&
-       target.GetType() <= cmTarget::OBJECT_LIBRARY)
+    if(target.GetType() >= cmState::EXECUTABLE &&
+       target.GetType() <= cmState::OBJECT_LIBRARY)
       {
       // store flags for each configuration
       std::string flags = " ";
@@ -1899,7 +1899,7 @@ void cmLocalVisualStudio6Generator
         this->ConvertToOutputFormat(l->Value.c_str(), SHELL);
       }
     else if (!l->Target
-        || l->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
+        || l->Target->GetType() != cmState::INTERFACE_LIBRARY)
       {
       options += l->Value;
       }
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 82b18c6..e891c33 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -71,7 +71,7 @@ void cmLocalVisualStudio7Generator::AddHelperCommands()
 
   for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++)
     {
-    if(l->second.GetType() == cmTarget::INTERFACE_LIBRARY)
+    if(l->second.GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -106,7 +106,7 @@ void cmLocalVisualStudio7Generator::AddCMakeListsRules()
       // Add the rule to targets that need it.
       for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l)
         {
-        if (l->second.GetType() == cmTarget::GLOBAL_TARGET)
+        if (l->second.GetType() == cmState::GLOBAL_TARGET)
           {
           continue;
           }
@@ -131,7 +131,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
       l != tgts.end(); l++)
     {
     cmTarget& tgt = l->second;
-    if(tgt.GetType() == cmTarget::GLOBAL_TARGET)
+    if(tgt.GetType() == cmState::GLOBAL_TARGET)
       {
       std::vector<std::string> no_depends;
       cmCustomCommandLine force_command;
@@ -182,7 +182,7 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles()
   for(cmTargets::iterator l = tgts.begin();
       l != tgts.end(); l++)
     {
-    if(l->second.GetType() == cmTarget::INTERFACE_LIBRARY)
+    if(l->second.GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -672,22 +672,22 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
 
   switch(target.GetType())
     {
-    case cmTarget::OBJECT_LIBRARY:
+    case cmState::OBJECT_LIBRARY:
       targetBuilds = false; // no manifest tool for object library
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::STATIC_LIBRARY:
       projectType = "typeStaticLibrary";
       configType = "4";
       break;
-    case cmTarget::SHARED_LIBRARY:
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::SHARED_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       projectType = "typeDynamicLibrary";
       configType = "2";
       break;
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
       configType = "1";
       break;
-    case cmTarget::UTILITY:
-    case cmTarget::GLOBAL_TARGET:
+    case cmState::UTILITY:
+    case cmState::GLOBAL_TARGET:
       configType = "10";
     default:
       targetBuilds = false;
@@ -788,10 +788,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   intermediateDir += "/";
   intermediateDir += configName;
 
-  if (target.GetType() < cmTarget::UTILITY)
+  if (target.GetType() < cmState::UTILITY)
     {
     std::string const& outDir =
-      target.GetType() == cmTarget::OBJECT_LIBRARY?
+      target.GetType() == cmState::OBJECT_LIBRARY?
       intermediateDir : gt->GetDirectory(configName);
     fout << "\t\t\tOutputDirectory=\""
          << this->ConvertToXMLOutputPathSingle(outDir.c_str()) << "\"\n";
@@ -882,7 +882,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   targetOptions.OutputFlagMap(fout, "\t\t\t\t");
   targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX");
   fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n";
-  if(target.GetType() <= cmTarget::OBJECT_LIBRARY)
+  if(target.GetType() <= cmState::OBJECT_LIBRARY)
     {
     // Specify the compiler program database file if configured.
     std::string pdb = gt->GetCompilePDBPath(configName);
@@ -1045,21 +1045,21 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator);
   std::string temp;
   std::string extraLinkOptions;
-  if(target.GetType() == cmTarget::EXECUTABLE)
+  if(target.GetType() == cmState::EXECUTABLE)
     {
     extraLinkOptions =
       this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS")
       + std::string(" ")
       + GetBuildTypeLinkerFlags("CMAKE_EXE_LINKER_FLAGS", configName);
     }
-  if(target.GetType() == cmTarget::SHARED_LIBRARY)
+  if(target.GetType() == cmState::SHARED_LIBRARY)
     {
     extraLinkOptions =
       this->Makefile->GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS")
       + std::string(" ")
       + GetBuildTypeLinkerFlags("CMAKE_SHARED_LINKER_FLAGS", configName);
     }
-  if(target.GetType() == cmTarget::MODULE_LIBRARY)
+  if(target.GetType() == cmState::MODULE_LIBRARY)
     {
     extraLinkOptions =
       this->Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS")
@@ -1099,7 +1099,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
   cmGeneratorTarget* gt =
     this->GlobalGenerator->GetGeneratorTarget(&target);
 
-  if (target.GetType() == cmTarget::SHARED_LIBRARY &&
+  if (target.GetType() == cmState::SHARED_LIBRARY &&
       this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
     if (target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
@@ -1109,9 +1109,9 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     }
   switch(target.GetType())
     {
-    case cmTarget::UNKNOWN_LIBRARY:
+    case cmState::UNKNOWN_LIBRARY:
       break;
-    case cmTarget::OBJECT_LIBRARY:
+    case cmState::OBJECT_LIBRARY:
       {
       std::string libpath = this->GetTargetDirectory(target);
       libpath += "/";
@@ -1127,7 +1127,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
            << this->ConvertToXMLOutputPathSingle(libpath.c_str()) << "\"/>\n";
       break;
       }
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::STATIC_LIBRARY:
     {
     std::string targetNameFull = gt->GetFullName(configName);
     std::string libpath = gt->GetDirectory(configName);
@@ -1161,8 +1161,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
          << this->ConvertToXMLOutputPathSingle(libpath.c_str()) << "\"/>\n";
     break;
     }
-    case cmTarget::SHARED_LIBRARY:
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::SHARED_LIBRARY:
+    case cmState::MODULE_LIBRARY:
     {
     std::string targetName;
     std::string targetNameSO;
@@ -1260,7 +1260,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     fout << "/>\n";
     }
     break;
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
     {
     std::string targetName;
     std::string targetNameFull;
@@ -1374,9 +1374,9 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
          << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"/>\n";
     break;
     }
-    case cmTarget::UTILITY:
-    case cmTarget::GLOBAL_TARGET:
-    case cmTarget::INTERFACE_LIBRARY:
+    case cmState::UTILITY:
+    case cmState::GLOBAL_TARGET:
+    case cmState::INTERFACE_LIBRARY:
       break;
     }
 }
@@ -1408,7 +1408,7 @@ cmLocalVisualStudio7GeneratorInternals
       fout << lg->ConvertToXMLOutputPath(rel.c_str()) << " ";
       }
     else if (!l->Target
-        || l->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
+        || l->Target->GetType() != cmState::INTERFACE_LIBRARY)
       {
       fout << l->Value << " ";
       }
@@ -1775,8 +1775,8 @@ bool cmLocalVisualStudio7Generator
     std::string source = (*sf)->GetFullPath();
     FCInfo fcinfo(this, target, *(*sf), configs);
 
-    if (source != libName || target.GetType() == cmTarget::UTILITY ||
-      target.GetType() == cmTarget::GLOBAL_TARGET )
+    if (source != libName || target.GetType() == cmState::UTILITY ||
+      target.GetType() == cmState::GLOBAL_TARGET )
       {
       fout << "\t\t\t<File\n";
       std::string d = this->ConvertToXMLOutputPathSingle(source.c_str());
@@ -2026,7 +2026,7 @@ void cmLocalVisualStudio7Generator
                     cmTarget &target,
                     const std::string& /*libName*/)
 {
-  if (target.GetType() > cmTarget::GLOBAL_TARGET)
+  if (target.GetType() > cmState::GLOBAL_TARGET)
     {
     return;
     }
@@ -2043,7 +2043,7 @@ void cmLocalVisualStudio7Generator
   tool = this->FortranProject? "VFPreLinkEventTool":"VCPreLinkEventTool";
   event.Start(tool);
   bool addedPrelink = false;
-  if (target.GetType() == cmTarget::SHARED_LIBRARY &&
+  if (target.GetType() == cmState::SHARED_LIBRARY &&
       this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
     if (target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
@@ -2124,30 +2124,30 @@ cmLocalVisualStudio7Generator
   const char* projectType = 0;
   switch(target.GetType())
     {
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::STATIC_LIBRARY:
       projectType = "typeStaticLibrary";
       if(keyword)
         {
         keyword = "Static Library";
         }
       break;
-    case cmTarget::SHARED_LIBRARY:
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::SHARED_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       projectType = "typeDynamicLibrary";
       if(!keyword)
         {
         keyword = "Dll";
         }
       break;
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
       if(!keyword)
         {
         keyword = "Console Application";
         }
       projectType = 0;
       break;
-    case cmTarget::UTILITY:
-    case cmTarget::GLOBAL_TARGET:
+    case cmState::UTILITY:
+    case cmState::GLOBAL_TARGET:
     default:
       break;
     }
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index c830a82..2f44fb7 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -89,8 +89,8 @@ cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target,
   // If an executable exports symbols then VS wants to create an
   // import library but forgets to create the output directory.
   // The Intel Fortran plugin always forgets to the directory.
-  if(target.GetType() != cmTarget::EXECUTABLE &&
-     !(isFortran && target.GetType() == cmTarget::SHARED_LIBRARY))
+  if(target.GetType() != cmState::EXECUTABLE &&
+     !(isFortran && target.GetType() == cmState::SHARED_LIBRARY))
     { return pcc; }
   cmGeneratorTarget* gt =
       this->GetGlobalGenerator()->GetGeneratorTarget(&target);
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d62c5c4..8f656b4 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -759,7 +759,7 @@ void cmMakefile::ConfigureFinalPass()
   for (cmTargets::iterator l = this->Targets.begin();
        l != this->Targets.end(); l++)
     {
-    if (l->second.GetType() == cmTarget::INTERFACE_LIBRARY)
+    if (l->second.GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -810,7 +810,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target,
       return;
     }
 
-  if(ti->second.GetType() == cmTarget::OBJECT_LIBRARY)
+  if(ti->second.GetType() == cmState::OBJECT_LIBRARY)
     {
     std::ostringstream e;
     e << "Target \"" << target << "\" is an OBJECT library "
@@ -818,7 +818,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target,
     this->IssueMessage(cmake::FATAL_ERROR, e.str());
     return;
     }
-  if(ti->second.GetType() == cmTarget::INTERFACE_LIBRARY)
+  if(ti->second.GetType() == cmState::INTERFACE_LIBRARY)
     {
     std::ostringstream e;
     e << "Target \"" << target << "\" is an INTERFACE library "
@@ -1184,7 +1184,7 @@ cmMakefile::AddUtilityCommand(const std::string& utilityName,
                               bool uses_terminal)
 {
   // Create a target instance for this utility.
-  cmTarget* target = this->AddNewTarget(cmTarget::UTILITY, utilityName);
+  cmTarget* target = this->AddNewTarget(cmState::UTILITY, utilityName);
   if (excludeFromAll)
     {
     target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
@@ -1419,9 +1419,9 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
     if(tgt)
       {
       // if it is not a static or shared library then you can not link to it
-      if(!((tgt->GetType() == cmTarget::STATIC_LIBRARY) ||
-           (tgt->GetType() == cmTarget::SHARED_LIBRARY) ||
-           (tgt->GetType() == cmTarget::INTERFACE_LIBRARY) ||
+      if(!((tgt->GetType() == cmState::STATIC_LIBRARY) ||
+           (tgt->GetType() == cmState::SHARED_LIBRARY) ||
+           (tgt->GetType() == cmState::INTERFACE_LIBRARY) ||
            tgt->IsExecutableWithExports()))
         {
         std::ostringstream e;
@@ -2018,9 +2018,9 @@ void cmMakefile::AddGlobalLinkInformation(const std::string& name,
   // for these targets do not add anything
   switch(target.GetType())
     {
-    case cmTarget::UTILITY:
-    case cmTarget::GLOBAL_TARGET:
-    case cmTarget::INTERFACE_LIBRARY:
+    case cmState::UTILITY:
+    case cmState::GLOBAL_TARGET:
+    case cmState::INTERFACE_LIBRARY:
       return;
     default:;
     }
@@ -2057,20 +2057,20 @@ void cmMakefile::AddAlias(const std::string& lname, cmTarget *tgt)
 }
 
 cmTarget* cmMakefile::AddLibrary(const std::string& lname,
-                            cmTarget::TargetType type,
+                            cmState::TargetType type,
                             const std::vector<std::string> &srcs,
                             bool excludeFromAll)
 {
   // wrong type ? default to STATIC
-  if (    (type != cmTarget::STATIC_LIBRARY)
-       && (type != cmTarget::SHARED_LIBRARY)
-       && (type != cmTarget::MODULE_LIBRARY)
-       && (type != cmTarget::OBJECT_LIBRARY)
-       && (type != cmTarget::INTERFACE_LIBRARY))
+  if (    (type != cmState::STATIC_LIBRARY)
+       && (type != cmState::SHARED_LIBRARY)
+       && (type != cmState::MODULE_LIBRARY)
+       && (type != cmState::OBJECT_LIBRARY)
+       && (type != cmState::INTERFACE_LIBRARY))
     {
     this->IssueMessage(cmake::INTERNAL_ERROR,
                        "cmMakefile::AddLibrary given invalid target type.");
-    type = cmTarget::STATIC_LIBRARY;
+    type = cmState::STATIC_LIBRARY;
     }
 
   cmTarget* target = this->AddNewTarget(type, lname);
@@ -2091,7 +2091,7 @@ cmTarget* cmMakefile::AddExecutable(const char *exeName,
                                     const std::vector<std::string> &srcs,
                                     bool excludeFromAll)
 {
-  cmTarget* target = this->AddNewTarget(cmTarget::EXECUTABLE, exeName);
+  cmTarget* target = this->AddNewTarget(cmState::EXECUTABLE, exeName);
   if(excludeFromAll)
     {
     target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
@@ -2103,7 +2103,7 @@ cmTarget* cmMakefile::AddExecutable(const char *exeName,
 
 //----------------------------------------------------------------------------
 cmTarget*
-cmMakefile::AddNewTarget(cmTarget::TargetType type, const std::string& name)
+cmMakefile::AddNewTarget(cmState::TargetType type, const std::string& name)
 {
   cmTargets::iterator it =
     this->Targets.insert(cmTargets::value_type(name, cmTarget())).first;
@@ -2299,8 +2299,8 @@ void cmMakefile::ExpandVariablesCMP0019()
        l != this->Targets.end(); ++l)
     {
     cmTarget &t = l->second;
-    if (t.GetType() == cmTarget::INTERFACE_LIBRARY
-        || t.GetType() == cmTarget::GLOBAL_TARGET)
+    if (t.GetType() == cmState::INTERFACE_LIBRARY
+        || t.GetType() == cmState::GLOBAL_TARGET)
       {
       continue;
       }
@@ -4178,7 +4178,7 @@ void cmMakefile::RaiseScope(const std::string& var, const char *varDef)
 //----------------------------------------------------------------------------
 cmTarget*
 cmMakefile::AddImportedTarget(const std::string& name,
-                              cmTarget::TargetType type,
+                              cmState::TargetType type,
                               bool global)
 {
   // Create the target.
@@ -4279,7 +4279,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
       // The conflict is with a non-imported target.
       // Allow this if the user has requested support.
       cmake* cm = this->GetCMakeInstance();
-      if(isCustom && existing->GetType() == cmTarget::UTILITY &&
+      if(isCustom && existing->GetType() == cmState::UTILITY &&
          this != existing->GetMakefile() &&
          cm->GetState()
            ->GetGlobalPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS"))
@@ -4295,22 +4295,22 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
         << "The existing target is ";
       switch(existing->GetType())
         {
-        case cmTarget::EXECUTABLE:
+        case cmState::EXECUTABLE:
           e << "an executable ";
           break;
-        case cmTarget::STATIC_LIBRARY:
+        case cmState::STATIC_LIBRARY:
           e << "a static library ";
           break;
-        case cmTarget::SHARED_LIBRARY:
+        case cmState::SHARED_LIBRARY:
           e << "a shared library ";
           break;
-        case cmTarget::MODULE_LIBRARY:
+        case cmState::MODULE_LIBRARY:
           e << "a module library ";
           break;
-        case cmTarget::UTILITY:
+        case cmState::UTILITY:
           e << "a custom target ";
           break;
-        case cmTarget::INTERFACE_LIBRARY:
+        case cmState::INTERFACE_LIBRARY:
           e << "an interface library ";
           break;
         default: break;
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index d9d5a8a..4215b72 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -172,10 +172,10 @@ public:
 
   /** Create a new imported target with the name and type given.  */
   cmTarget* AddImportedTarget(const std::string& name,
-                              cmTarget::TargetType type,
+                              cmState::TargetType type,
                               bool global);
 
-  cmTarget* AddNewTarget(cmTarget::TargetType type, const std::string& name);
+  cmTarget* AddNewTarget(cmState::TargetType type, const std::string& name);
 
   /**
    * Add an executable to the build.
@@ -281,7 +281,7 @@ public:
   /**
    * Set the name of the library.
    */
-  cmTarget* AddLibrary(const std::string& libname, cmTarget::TargetType type,
+  cmTarget* AddLibrary(const std::string& libname, cmState::TargetType type,
                   const std::vector<std::string> &srcs,
                   bool excludeFromAll = false);
   void AddAlias(const std::string& libname, cmTarget *tgt);
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index cb19d9b..0b38656 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -26,7 +26,7 @@ cmMakefileLibraryTargetGenerator
   cmMakefileTargetGenerator(target)
 {
   this->CustomCommandDriver = OnDepends;
-  if (this->GeneratorTarget->GetType() != cmTarget::INTERFACE_LIBRARY)
+  if (this->GeneratorTarget->GetType() != cmState::INTERFACE_LIBRARY)
     {
     this->GeneratorTarget->GetLibraryNames(
       this->TargetNameOut, this->TargetNameSO, this->TargetNameReal,
@@ -64,10 +64,10 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
   // Write the rule for this target type.
   switch(this->GeneratorTarget->GetType())
     {
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::STATIC_LIBRARY:
       this->WriteStaticLibraryRules();
       break;
-    case cmTarget::SHARED_LIBRARY:
+    case cmState::SHARED_LIBRARY:
       this->WriteSharedLibraryRules(false);
       if(this->GeneratorTarget->NeedRelinkBeforeInstall(this->ConfigName))
         {
@@ -75,7 +75,7 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
         this->WriteSharedLibraryRules(true);
         }
       break;
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       this->WriteModuleLibraryRules(false);
       if(this->GeneratorTarget->NeedRelinkBeforeInstall(this->ConfigName))
         {
@@ -83,7 +83,7 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
         this->WriteModuleLibraryRules(true);
         }
       break;
-    case cmTarget::OBJECT_LIBRARY:
+    case cmState::OBJECT_LIBRARY:
       this->WriteObjectLibraryRules();
       break;
     default:
@@ -253,8 +253,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   this->LocalGenerator->AppendFlags(linkFlags, extraFlags);
 
   // Add OSX version flags, if any.
-  if(this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY ||
-     this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY ||
+     this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY)
     {
     this->AppendOSXVerFlag(linkFlags, linkLanguage, "COMPATIBILITY", true);
     this->AppendOSXVerFlag(linkFlags, linkLanguage, "CURRENT", false);
@@ -353,13 +353,13 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
     buildEcho += linkLanguage;
     switch(this->GeneratorTarget->GetType())
       {
-      case cmTarget::STATIC_LIBRARY:
+      case cmState::STATIC_LIBRARY:
         buildEcho += " static library ";
         break;
-      case cmTarget::SHARED_LIBRARY:
+      case cmState::SHARED_LIBRARY:
         buildEcho += " shared library ";
         break;
-      case cmTarget::MODULE_LIBRARY:
+      case cmState::MODULE_LIBRARY:
         if (this->Target->IsCFBundleOnApple())
             buildEcho += " CFBundle";
         buildEcho += " shared module ";
@@ -377,10 +377,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   const char* forbiddenFlagVar = 0;
   switch(this->GeneratorTarget->GetType())
     {
-    case cmTarget::SHARED_LIBRARY:
+    case cmState::SHARED_LIBRARY:
       forbiddenFlagVar = "_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS";
       break;
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       forbiddenFlagVar = "_CREATE_SHARED_MODULE_FORBIDDEN_FLAGS";
       break;
     default: break;
@@ -429,7 +429,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
 #ifdef _WIN32
   // There may be a manifest file for this target.  Add it to the
   // clean set just in case.
-  if(this->GeneratorTarget->GetType() != cmTarget::STATIC_LIBRARY)
+  if(this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY)
     {
     libCleanFiles.push_back(
       this->Convert((targetFullPath+".manifest").c_str(),
@@ -441,7 +441,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   std::vector<std::string> commands1;
   // Add a command to remove any existing files for this library.
   // for static libs only
-  if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY)
     {
     this->LocalGenerator->AppendCleanCommand(commands1, libCleanFiles,
                                              *this->Target, "target");
@@ -497,7 +497,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   std::vector<std::string> archiveAppendCommands;
   std::vector<std::string> archiveFinishCommands;
   std::string::size_type archiveCommandLimit = std::string::npos;
-  if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY)
     {
     haveStaticLibraryRule =
       this->Makefile->GetDefinition(linkRuleVar)? true:false;
@@ -552,7 +552,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
 
   // Collect up flags to link in needed libraries.
   std::string linkLibs;
-  if(this->GeneratorTarget->GetType() != cmTarget::STATIC_LIBRARY)
+  if(this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY)
     {
     this->CreateLinkLibs(linkLibs, relink, useResponseFileForLibs, depends,
                          useWatcomQuote);
@@ -566,7 +566,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
                           useWatcomQuote);
 
   // maybe create .def file from list of objects
-  if (this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY &&
+  if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY &&
       this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
     if(this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
@@ -667,7 +667,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
 
   // Compute the directory portion of the install_name setting.
   std::string install_name_dir;
-  if(this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY)
     {
     // Get the install_name directory for the build tree.
     install_name_dir =
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 9b0e5dd..f3c9b6d 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -68,16 +68,16 @@ cmMakefileTargetGenerator::New(cmGeneratorTarget *tgt)
 
   switch (tgt->GetType())
     {
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
       result = new cmMakefileExecutableTargetGenerator(tgt);
       break;
-    case cmTarget::STATIC_LIBRARY:
-    case cmTarget::SHARED_LIBRARY:
-    case cmTarget::MODULE_LIBRARY:
-    case cmTarget::OBJECT_LIBRARY:
+    case cmState::STATIC_LIBRARY:
+    case cmState::SHARED_LIBRARY:
+    case cmState::MODULE_LIBRARY:
+    case cmState::OBJECT_LIBRARY:
       result = new cmMakefileLibraryTargetGenerator(tgt);
       break;
-    case cmTarget::UTILITY:
+    case cmState::UTILITY:
       result = new cmMakefileUtilityTargetGenerator(tgt);
       break;
     default:
@@ -542,10 +542,10 @@ cmMakefileTargetGenerator
   std::string targetFullPathReal;
   std::string targetFullPathPDB;
   std::string targetFullPathCompilePDB;
-  if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE ||
-     this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY ||
-     this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY ||
-     this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmState::EXECUTABLE ||
+     this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY ||
+     this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY ||
+     this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY)
     {
     targetFullPathReal =
       this->GeneratorTarget->GetFullPath(this->ConfigName, false, true);
@@ -554,7 +554,7 @@ cmMakefileTargetGenerator
     targetFullPathPDB += "/";
     targetFullPathPDB += this->GeneratorTarget->GetPDBName(this->ConfigName);
     }
-  if(this->GeneratorTarget->GetType() <= cmTarget::OBJECT_LIBRARY)
+  if(this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY)
     {
     targetFullPathCompilePDB =
       this->GeneratorTarget->GetCompilePDBPath(this->ConfigName);
@@ -1445,7 +1445,7 @@ void cmMakefileTargetGenerator
 ::AppendTargetDepends(std::vector<std::string>& depends)
 {
   // Static libraries never depend on anything for linking.
-  if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY)
     {
     return;
     }
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 02e47bd..b5648fe 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -41,7 +41,7 @@ cmNinjaNormalTargetGenerator(cmGeneratorTarget* target)
   , TargetLinkLanguage("")
 {
   this->TargetLinkLanguage = target->GetLinkerLanguage(this->GetConfigName());
-  if (target->GetType() == cmTarget::EXECUTABLE)
+  if (target->GetType() == cmState::EXECUTABLE)
     this->GetGeneratorTarget()->GetExecutableNames(this->TargetNameOut,
                                this->TargetNameReal,
                                this->TargetNameImport,
@@ -55,7 +55,7 @@ cmNinjaNormalTargetGenerator(cmGeneratorTarget* target)
                             this->TargetNamePDB,
                             GetLocalGenerator()->GetConfigName());
 
-  if(target->GetType() != cmTarget::OBJECT_LIBRARY)
+  if(target->GetType() != cmState::OBJECT_LIBRARY)
     {
     // on Windows the output dir is already needed at compile time
     // ensure the directory exists (OutDir test)
@@ -87,7 +87,7 @@ void cmNinjaNormalTargetGenerator::Generate()
   // Write the build statements
   this->WriteObjectBuildStatements();
 
-  if(this->GetGeneratorTarget()->GetType() == cmTarget::OBJECT_LIBRARY)
+  if(this->GetGeneratorTarget()->GetType() == cmState::OBJECT_LIBRARY)
     {
     this->WriteObjectLibStatement();
     }
@@ -134,16 +134,16 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules()
 const char *cmNinjaNormalTargetGenerator::GetVisibleTypeName() const
 {
   switch (this->GetGeneratorTarget()->GetType()) {
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::STATIC_LIBRARY:
       return "static library";
-    case cmTarget::SHARED_LIBRARY:
+    case cmState::SHARED_LIBRARY:
       return "shared library";
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       if (this->GetTarget()->IsCFBundleOnApple())
         return "CFBundle shared module";
       else
         return "shared module";
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
       return "executable";
     default:
       return 0;
@@ -157,7 +157,7 @@ cmNinjaNormalTargetGenerator
   return this->TargetLinkLanguage
     + "_"
     + cmTarget::GetTargetTypeName(
-        (cmTarget::TargetType)this->GetGeneratorTarget()->GetType())
+        (cmState::TargetType)this->GetGeneratorTarget()->GetType())
     + "_LINKER__"
     + cmGlobalNinjaGenerator::EncodeRuleName(this->GetTarget()->GetName())
     ;
@@ -167,8 +167,8 @@ void
 cmNinjaNormalTargetGenerator
 ::WriteLinkRule(bool useResponseFile)
 {
-  cmTarget::TargetType targetType =
-      (cmTarget::TargetType)this->GetGeneratorTarget()->GetType();
+  cmState::TargetType targetType =
+      (cmState::TargetType)this->GetGeneratorTarget()->GetType();
   std::string ruleName = this->LanguageLinkerRule();
 
   // Select whether to use a response file for objects.
@@ -242,7 +242,7 @@ cmNinjaNormalTargetGenerator
     vars.Manifests = "$MANIFESTS";
 
     std::string langFlags;
-    if (targetType != cmTarget::EXECUTABLE)
+    if (targetType != cmState::EXECUTABLE)
       {
       langFlags += "$LANGUAGE_COMPILE_FLAGS $ARCH_FLAGS";
       vars.LanguageCompileFlags = langFlags.c_str();
@@ -285,7 +285,7 @@ cmNinjaNormalTargetGenerator
     std::string cmakeCommand =
       this->GetLocalGenerator()->ConvertToOutputFormat(
         cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
-    if (targetType == cmTarget::EXECUTABLE)
+    if (targetType == cmState::EXECUTABLE)
       this->GetGlobalGenerator()->AddRule("CMAKE_SYMLINK_EXECUTABLE",
                                           cmakeCommand +
                                           " -E cmake_symlink_executable"
@@ -333,7 +333,7 @@ cmNinjaNormalTargetGenerator
     }
   }
   switch (this->GetGeneratorTarget()->GetType()) {
-    case cmTarget::STATIC_LIBRARY: {
+    case cmState::STATIC_LIBRARY: {
       // We have archive link commands set. First, delete the existing archive.
       {
       std::string cmakeCommand =
@@ -358,9 +358,9 @@ cmNinjaNormalTargetGenerator
       }
       return linkCmds;
     }
-    case cmTarget::SHARED_LIBRARY:
-    case cmTarget::MODULE_LIBRARY:
-    case cmTarget::EXECUTABLE:
+    case cmState::SHARED_LIBRARY:
+    case cmState::MODULE_LIBRARY:
+    case cmState::EXECUTABLE:
       break;
     default:
       assert(0 && "Unexpected target type");
@@ -443,7 +443,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
 
   // Write comments.
   cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream());
-  const cmTarget::TargetType targetType = target.GetType();
+  const cmState::TargetType targetType = target.GetType();
   this->GetBuildFileStream()
     << "# Link build statements for "
     << cmTarget::GetTargetTypeName(targetType)
@@ -490,7 +490,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
                           &genTarget,
                           useWatcomQuote);
   if(this->GetMakefile()->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")
-     && target.GetType() == cmTarget::SHARED_LIBRARY)
+     && target.GetType() == cmState::SHARED_LIBRARY)
     {
     if(target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
       {
@@ -518,7 +518,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
   // Compute architecture specific link flags.  Yes, these go into a different
   // variable for executables, probably due to a mistake made when duplicating
   // code between the Makefile executable and library generators.
-  if (targetType == cmTarget::EXECUTABLE)
+  if (targetType == cmState::EXECUTABLE)
     {
     std::string t = vars["FLAGS"];
     localGen.AddArchitectureFlags(t, &genTarget, TargetLinkLanguage, cfgName);
@@ -538,7 +538,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
     {
     vars["SONAME_FLAG"] = mf->GetSONameFlag(this->TargetLinkLanguage);
     vars["SONAME"] = this->TargetNameSO;
-    if (targetType == cmTarget::SHARED_LIBRARY)
+    if (targetType == cmState::SHARED_LIBRARY)
       {
       std::string install_dir =
           this->GetGeneratorTarget()->GetInstallNameDirForBuildTree(cfgName);
@@ -626,7 +626,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
     }
 
   // maybe create .def file from list of objects
-  if (target.GetType() == cmTarget::SHARED_LIBRARY &&
+  if (target.GetType() == cmState::SHARED_LIBRARY &&
       this->GetMakefile()->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
     if(target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
@@ -734,7 +734,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
 
   if (targetOutput != targetOutputReal && !target.IsFrameworkOnApple())
     {
-    if (targetType == cmTarget::EXECUTABLE)
+    if (targetType == cmState::EXECUTABLE)
       {
       globalGen.WriteBuild(this->GetBuildFileStream(),
                             "Create executable symlink " + targetOutput,
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index ec90ba5..1028196 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -31,17 +31,17 @@ cmNinjaTargetGenerator::New(cmGeneratorTarget* target)
 {
   switch (target->GetType())
     {
-      case cmTarget::EXECUTABLE:
-      case cmTarget::SHARED_LIBRARY:
-      case cmTarget::STATIC_LIBRARY:
-      case cmTarget::MODULE_LIBRARY:
-      case cmTarget::OBJECT_LIBRARY:
+      case cmState::EXECUTABLE:
+      case cmState::SHARED_LIBRARY:
+      case cmState::STATIC_LIBRARY:
+      case cmState::MODULE_LIBRARY:
+      case cmState::OBJECT_LIBRARY:
         return new cmNinjaNormalTargetGenerator(target);
 
-      case cmTarget::UTILITY:
+      case cmState::UTILITY:
         return new cmNinjaUtilityTargetGenerator(target);;
 
-      case cmTarget::GLOBAL_TARGET: {
+      case cmState::GLOBAL_TARGET: {
         // We only want to process global targets that live in the home
         // (i.e. top-level) directory.  CMake creates copies of these targets
         // in every directory, which we don't need.
@@ -189,8 +189,8 @@ ComputeDefines(cmSourceFile const* source, const std::string& language)
 cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
 {
   // Static libraries never depend on other targets for linking.
-  if (this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY ||
-      this->GeneratorTarget->GetType() == cmTarget::OBJECT_LIBRARY)
+  if (this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY ||
+      this->GeneratorTarget->GetType() == cmState::OBJECT_LIBRARY)
     return cmNinjaDeps();
 
   cmComputeLinkInformation* cli =
@@ -283,16 +283,16 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
     {
     std::string pdbPath;
     std::string compilePdbPath;
-    if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE ||
-       this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY ||
-       this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY ||
-       this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY)
+    if(this->GeneratorTarget->GetType() == cmState::EXECUTABLE ||
+       this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY ||
+       this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY ||
+       this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY)
       {
       pdbPath = this->GeneratorTarget->GetPDBDirectory(this->GetConfigName());
       pdbPath += "/";
       pdbPath += this->GeneratorTarget->GetPDBName(this->GetConfigName());
       }
-    if(this->GeneratorTarget->GetType() <= cmTarget::OBJECT_LIBRARY)
+    if(this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY)
       {
       compilePdbPath =
               this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName());
@@ -481,7 +481,7 @@ cmNinjaTargetGenerator
   this->GetBuildFileStream()
     << "# Object build statements for "
     << cmTarget::GetTargetTypeName(
-         (cmTarget::TargetType)this->GetGeneratorTarget()->GetType())
+         (cmState::TargetType)this->GetGeneratorTarget()->GetType())
     << " target "
     << this->GetTargetName()
     << "\n\n";
diff --git a/Source/cmState.h b/Source/cmState.h
index f2c0c6f..0fe4812 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -181,6 +181,12 @@ public:
     friend class Snapshot;
   };
 
+  enum TargetType { EXECUTABLE, STATIC_LIBRARY,
+                    SHARED_LIBRARY, MODULE_LIBRARY,
+                    OBJECT_LIBRARY, UTILITY, GLOBAL_TARGET,
+                    INTERFACE_LIBRARY,
+                    UNKNOWN_LIBRARY};
+
   Snapshot CreateBaseSnapshot();
   Snapshot
   CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot,
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0128c78..eeced8d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -33,27 +33,27 @@
 #define UNORDERED_SET std::set
 #endif
 
-const char* cmTarget::GetTargetTypeName(TargetType targetType)
+const char* cmTarget::GetTargetTypeName(cmState::TargetType targetType)
 {
   switch( targetType )
     {
-      case cmTarget::STATIC_LIBRARY:
+      case cmState::STATIC_LIBRARY:
         return "STATIC_LIBRARY";
-      case cmTarget::MODULE_LIBRARY:
+      case cmState::MODULE_LIBRARY:
         return "MODULE_LIBRARY";
-      case cmTarget::SHARED_LIBRARY:
+      case cmState::SHARED_LIBRARY:
         return "SHARED_LIBRARY";
-      case cmTarget::OBJECT_LIBRARY:
+      case cmState::OBJECT_LIBRARY:
         return "OBJECT_LIBRARY";
-      case cmTarget::EXECUTABLE:
+      case cmState::EXECUTABLE:
         return "EXECUTABLE";
-      case cmTarget::UTILITY:
+      case cmState::UTILITY:
         return "UTILITY";
-      case cmTarget::GLOBAL_TARGET:
+      case cmState::GLOBAL_TARGET:
         return "GLOBAL_TARGET";
-      case cmTarget::INTERFACE_LIBRARY:
+      case cmState::INTERFACE_LIBRARY:
         return "INTERFACE_LIBRARY";
-      case cmTarget::UNKNOWN_LIBRARY:
+      case cmState::UNKNOWN_LIBRARY:
         return "UNKNOWN_LIBRARY";
     }
   assert(0 && "Unexpected target type");
@@ -93,13 +93,13 @@ cmTarget::cmTarget()
   this->BuildInterfaceIncludesAppended = false;
 }
 
-void cmTarget::SetType(TargetType type, const std::string& name)
+void cmTarget::SetType(cmState::TargetType type, const std::string& name)
 {
   this->Name = name;
   // only add dependency information for library targets
   this->TargetTypeValue = type;
-  if(this->TargetTypeValue >= STATIC_LIBRARY
-     && this->TargetTypeValue <= MODULE_LIBRARY)
+  if(this->TargetTypeValue >= cmState::STATIC_LIBRARY
+     && this->TargetTypeValue <= cmState::MODULE_LIBRARY)
     {
     this->RecordDependencies = true;
     }
@@ -129,7 +129,8 @@ void cmTarget::SetMakefile(cmMakefile* mf)
   this->IsApple = this->Makefile->IsOn("APPLE");
 
   // Setup default property values.
-  if (this->GetType() != INTERFACE_LIBRARY && this->GetType() != UTILITY)
+  if (this->GetType() != cmState::INTERFACE_LIBRARY
+      && this->GetType() != cmState::UTILITY)
     {
     this->SetPropertyDefault("ANDROID_API", 0);
     this->SetPropertyDefault("ANDROID_API_MIN", 0);
@@ -192,7 +193,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
   mf->GetConfigurations(configNames);
 
   // Setup per-configuration property default values.
-  if (this->GetType() != UTILITY)
+  if (this->GetType() != cmState::UTILITY)
     {
     const char* configProps[] = {
       "ARCHIVE_OUTPUT_DIRECTORY_",
@@ -208,7 +209,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
       std::string configUpper = cmSystemTools::UpperCase(*ci);
       for(const char** p = configProps; *p; ++p)
         {
-        if (this->TargetTypeValue == INTERFACE_LIBRARY
+        if (this->TargetTypeValue == cmState::INTERFACE_LIBRARY
             && strcmp(*p, "MAP_IMPORTED_CONFIG_") != 0)
           {
           continue;
@@ -223,8 +224,8 @@ void cmTarget::SetMakefile(cmMakefile* mf)
       // 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)
+      if(this->TargetTypeValue != cmState::EXECUTABLE
+          && this->TargetTypeValue != cmState::INTERFACE_LIBRARY)
         {
         std::string property = cmSystemTools::UpperCase(*ci);
         property += "_POSTFIX";
@@ -271,30 +272,32 @@ void cmTarget::SetMakefile(cmMakefile* mf)
           parentOptionsBts.begin(), parentOptionsBts.end());
     }
 
-  if (this->GetType() != INTERFACE_LIBRARY && this->GetType() != UTILITY)
+  if (this->GetType() != cmState::INTERFACE_LIBRARY
+      && this->GetType() != cmState::UTILITY)
     {
     this->SetPropertyDefault("C_VISIBILITY_PRESET", 0);
     this->SetPropertyDefault("CXX_VISIBILITY_PRESET", 0);
     this->SetPropertyDefault("VISIBILITY_INLINES_HIDDEN", 0);
     }
 
-  if(this->TargetTypeValue == cmTarget::EXECUTABLE)
+  if(this->TargetTypeValue == cmState::EXECUTABLE)
     {
     this->SetPropertyDefault("ANDROID_GUI", 0);
     this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", 0);
     this->SetPropertyDefault("ENABLE_EXPORTS", 0);
     }
-  if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY
-      || this->TargetTypeValue == cmTarget::MODULE_LIBRARY)
+  if(this->TargetTypeValue == cmState::SHARED_LIBRARY
+      || this->TargetTypeValue == cmState::MODULE_LIBRARY)
     {
     this->SetProperty("POSITION_INDEPENDENT_CODE", "True");
     }
-  if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY)
+  if(this->TargetTypeValue == cmState::SHARED_LIBRARY)
     {
     this->SetPropertyDefault("WINDOWS_EXPORT_ALL_SYMBOLS", 0);
     }
 
-  if (this->GetType() != INTERFACE_LIBRARY && this->GetType() != UTILITY)
+  if (this->GetType() != cmState::INTERFACE_LIBRARY
+      && this->GetType() != cmState::UTILITY)
     {
     this->SetPropertyDefault("POSITION_INDEPENDENT_CODE", 0);
     }
@@ -302,15 +305,16 @@ void cmTarget::SetMakefile(cmMakefile* mf)
   // Record current policies for later use.
   this->Makefile->RecordPolicies(this->PolicyMap);
 
-  if (this->TargetTypeValue == INTERFACE_LIBRARY)
+  if (this->TargetTypeValue == cmState::INTERFACE_LIBRARY)
     {
     // This policy is checked in a few conditions. The properties relevant
-    // to the policy are always ignored for INTERFACE_LIBRARY targets,
+    // to the policy are always ignored for cmState::INTERFACE_LIBRARY targets,
     // so ensure that the conditions don't lead to nonsense.
     this->PolicyMap.Set(cmPolicies::CMP0022, cmPolicies::NEW);
     }
 
-  if (this->GetType() != INTERFACE_LIBRARY && this->GetType() != UTILITY)
+  if (this->GetType() != cmState::INTERFACE_LIBRARY
+      && this->GetType() != cmState::UTILITY)
     {
     this->SetPropertyDefault("JOB_POOL_COMPILE", 0);
     this->SetPropertyDefault("JOB_POOL_LINK", 0);
@@ -363,18 +367,18 @@ cmListFileBacktrace const& cmTarget::GetBacktrace() const
 //----------------------------------------------------------------------------
 bool cmTarget::IsExecutableWithExports() const
 {
-  return (this->GetType() == cmTarget::EXECUTABLE &&
+  return (this->GetType() == cmState::EXECUTABLE &&
           this->GetPropertyAsBool("ENABLE_EXPORTS"));
 }
 
 //----------------------------------------------------------------------------
 bool cmTarget::IsLinkable() const
 {
-  return (this->GetType() == cmTarget::STATIC_LIBRARY ||
-          this->GetType() == cmTarget::SHARED_LIBRARY ||
-          this->GetType() == cmTarget::MODULE_LIBRARY ||
-          this->GetType() == cmTarget::UNKNOWN_LIBRARY ||
-          this->GetType() == cmTarget::INTERFACE_LIBRARY ||
+  return (this->GetType() == cmState::STATIC_LIBRARY ||
+          this->GetType() == cmState::SHARED_LIBRARY ||
+          this->GetType() == cmState::MODULE_LIBRARY ||
+          this->GetType() == cmState::UNKNOWN_LIBRARY ||
+          this->GetType() == cmState::INTERFACE_LIBRARY ||
           this->IsExecutableWithExports());
 }
 
@@ -382,14 +386,14 @@ bool cmTarget::IsLinkable() const
 bool cmTarget::HasImportLibrary() const
 {
   return (this->DLLPlatform &&
-          (this->GetType() == cmTarget::SHARED_LIBRARY ||
+          (this->GetType() == cmState::SHARED_LIBRARY ||
            this->IsExecutableWithExports()));
 }
 
 //----------------------------------------------------------------------------
 bool cmTarget::IsFrameworkOnApple() const
 {
-  return (this->GetType() == cmTarget::SHARED_LIBRARY &&
+  return (this->GetType() == cmState::SHARED_LIBRARY &&
           this->Makefile->IsOn("APPLE") &&
           this->GetPropertyAsBool("FRAMEWORK"));
 }
@@ -397,7 +401,7 @@ bool cmTarget::IsFrameworkOnApple() const
 //----------------------------------------------------------------------------
 bool cmTarget::IsAppBundleOnApple() const
 {
-  return (this->GetType() == cmTarget::EXECUTABLE &&
+  return (this->GetType() == cmState::EXECUTABLE &&
           this->Makefile->IsOn("APPLE") &&
           this->GetPropertyAsBool("MACOSX_BUNDLE"));
 }
@@ -405,7 +409,7 @@ bool cmTarget::IsAppBundleOnApple() const
 //----------------------------------------------------------------------------
 bool cmTarget::IsCFBundleOnApple() const
 {
-  return (this->GetType() == cmTarget::MODULE_LIBRARY &&
+  return (this->GetType() == cmState::MODULE_LIBRARY &&
           this->Makefile->IsOn("APPLE") &&
           this->GetPropertyAsBool("BUNDLE"));
 }
@@ -789,7 +793,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
   }
 
   if (cmGeneratorExpression::Find(lib) != std::string::npos
-      || (tgt && tgt->GetType() == INTERFACE_LIBRARY)
+      || (tgt && tgt->GetType() == cmState::INTERFACE_LIBRARY)
       || (target == lib ))
     {
     return;
@@ -1238,7 +1242,7 @@ static bool whiteListedInterfaceProperty(const std::string& prop)
 //----------------------------------------------------------------------------
 void cmTarget::SetProperty(const std::string& prop, const char* value)
 {
-  if (this->GetType() == INTERFACE_LIBRARY
+  if (this->GetType() == cmState::INTERFACE_LIBRARY
       && !whiteListedInterfaceProperty(prop))
     {
     std::ostringstream e;
@@ -1347,7 +1351,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
 void cmTarget::AppendProperty(const std::string& prop, const char* value,
                               bool asString)
 {
-  if (this->GetType() == INTERFACE_LIBRARY
+  if (this->GetType() == cmState::INTERFACE_LIBRARY
       && !whiteListedInterfaceProperty(prop))
     {
     std::ostringstream e;
@@ -1459,10 +1463,10 @@ std::string cmTarget::GetExportName() const
 //----------------------------------------------------------------------------
 void cmTarget::AppendBuildInterfaceIncludes()
 {
-  if(this->GetType() != cmTarget::SHARED_LIBRARY &&
-     this->GetType() != cmTarget::STATIC_LIBRARY &&
-     this->GetType() != cmTarget::MODULE_LIBRARY &&
-     this->GetType() != cmTarget::INTERFACE_LIBRARY &&
+  if(this->GetType() != cmState::SHARED_LIBRARY &&
+     this->GetType() != cmState::STATIC_LIBRARY &&
+     this->GetType() != cmState::MODULE_LIBRARY &&
+     this->GetType() != cmState::INTERFACE_LIBRARY &&
      !this->IsExecutableWithExports())
     {
     return;
@@ -1644,10 +1648,10 @@ void cmTarget::MarkAsImported()
 bool cmTarget::HaveWellDefinedOutputFiles() const
 {
   return
-    this->GetType() == cmTarget::STATIC_LIBRARY ||
-    this->GetType() == cmTarget::SHARED_LIBRARY ||
-    this->GetType() == cmTarget::MODULE_LIBRARY ||
-    this->GetType() == cmTarget::EXECUTABLE;
+    this->GetType() == cmState::STATIC_LIBRARY ||
+    this->GetType() == cmState::SHARED_LIBRARY ||
+    this->GetType() == cmState::MODULE_LIBRARY ||
+    this->GetType() == cmState::EXECUTABLE;
 }
 
 //----------------------------------------------------------------------------
@@ -1675,7 +1679,7 @@ void cmTarget::GetTargetVersion(bool soversion,
   minor = 0;
   patch = 0;
 
-  assert(this->GetType() != INTERFACE_LIBRARY);
+  assert(this->GetType() != cmState::INTERFACE_LIBRARY);
 
   // Look for a VERSION or SOVERSION property.
   const char* prop = soversion? "SOVERSION" : "VERSION";
@@ -1743,7 +1747,7 @@ const char *cmTarget::GetProperty(const std::string& prop) const
 const char *cmTarget::GetProperty(const std::string& prop,
                                   cmMakefile* context) const
 {
-  if (this->GetType() == INTERFACE_LIBRARY
+  if (this->GetType() == cmState::INTERFACE_LIBRARY
       && !whiteListedInterfaceProperty(prop))
     {
     std::ostringstream e;
@@ -1755,11 +1759,11 @@ const char *cmTarget::GetProperty(const std::string& prop,
 
   // Watch for special "computed" properties that are dependent on
   // other properties or variables.  Always recompute them.
-  if(this->GetType() == cmTarget::EXECUTABLE ||
-     this->GetType() == cmTarget::STATIC_LIBRARY ||
-     this->GetType() == cmTarget::SHARED_LIBRARY ||
-     this->GetType() == cmTarget::MODULE_LIBRARY ||
-     this->GetType() == cmTarget::UNKNOWN_LIBRARY)
+  if(this->GetType() == cmState::EXECUTABLE ||
+     this->GetType() == cmState::STATIC_LIBRARY ||
+     this->GetType() == cmState::SHARED_LIBRARY ||
+     this->GetType() == cmState::MODULE_LIBRARY ||
+     this->GetType() == cmState::UNKNOWN_LIBRARY)
     {
     static const std::string propLOCATION = "LOCATION";
     if(prop == propLOCATION)
@@ -2069,17 +2073,17 @@ const char* cmTarget::GetSuffixVariableInternal(bool implib) const
 {
   switch(this->GetType())
     {
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::STATIC_LIBRARY:
       return "CMAKE_STATIC_LIBRARY_SUFFIX";
-    case cmTarget::SHARED_LIBRARY:
+    case cmState::SHARED_LIBRARY:
       return (implib
               ? "CMAKE_IMPORT_LIBRARY_SUFFIX"
               : "CMAKE_SHARED_LIBRARY_SUFFIX");
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       return (implib
               ? "CMAKE_IMPORT_LIBRARY_SUFFIX"
               : "CMAKE_SHARED_MODULE_SUFFIX");
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
       return (implib
               ? "CMAKE_IMPORT_LIBRARY_SUFFIX"
                 // Android GUI application packages store the native
@@ -2098,17 +2102,17 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const
 {
   switch(this->GetType())
     {
-    case cmTarget::STATIC_LIBRARY:
+    case cmState::STATIC_LIBRARY:
       return "CMAKE_STATIC_LIBRARY_PREFIX";
-    case cmTarget::SHARED_LIBRARY:
+    case cmState::SHARED_LIBRARY:
       return (implib
               ? "CMAKE_IMPORT_LIBRARY_PREFIX"
               : "CMAKE_SHARED_LIBRARY_PREFIX");
-    case cmTarget::MODULE_LIBRARY:
+    case cmState::MODULE_LIBRARY:
       return (implib
               ? "CMAKE_IMPORT_LIBRARY_PREFIX"
               : "CMAKE_SHARED_MODULE_PREFIX");
-    case cmTarget::EXECUTABLE:
+    case cmState::EXECUTABLE:
       return (implib
               ? "CMAKE_IMPORT_LIBRARY_PREFIX"
                 // Android GUI application packages store the native
@@ -2184,7 +2188,7 @@ void cmTarget::SetPropertyDefault(const std::string& property,
 //----------------------------------------------------------------------------
 std::string cmTarget::GetFrameworkVersion() const
 {
-  assert(this->GetType() != INTERFACE_LIBRARY);
+  assert(this->GetType() != cmState::INTERFACE_LIBRARY);
 
   if(const char* fversion = this->GetProperty("FRAMEWORK_VERSION"))
     {
@@ -2204,8 +2208,8 @@ std::string cmTarget::GetFrameworkVersion() const
 const char* cmTarget::GetExportMacro() const
 {
   // Define the symbol for targets that export symbols.
-  if(this->GetType() == cmTarget::SHARED_LIBRARY ||
-     this->GetType() == cmTarget::MODULE_LIBRARY ||
+  if(this->GetType() == cmState::SHARED_LIBRARY ||
+     this->GetType() == cmState::MODULE_LIBRARY ||
      this->IsExecutableWithExports())
     {
     if(const char* custom_export_name = this->GetProperty("DEFINE_SYMBOL"))
@@ -2297,7 +2301,7 @@ cmTarget::GetImportInfo(const std::string& config) const
     i = this->ImportInfoMap.insert(entry).first;
     }
 
-  if(this->GetType() == INTERFACE_LIBRARY)
+  if(this->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return &i->second;
     }
@@ -2317,10 +2321,10 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
                                const char** imp,
                                std::string& suffix) const
 {
-  if (this->GetType() == INTERFACE_LIBRARY)
+  if (this->GetType() == cmState::INTERFACE_LIBRARY)
     {
     // This method attempts to find a config-specific LOCATION for the
-    // IMPORTED library. In the case of INTERFACE_LIBRARY, there is no
+    // IMPORTED library. In the case of cmState::INTERFACE_LIBRARY, there is no
     // LOCATION at all, so leaving *loc and *imp unchanged is the appropriate
     // and valid response.
     return true;
@@ -2467,7 +2471,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
   std::string linkProp = "INTERFACE_LINK_LIBRARIES";
   const char *propertyLibs = this->GetProperty(linkProp);
 
-  if (this->GetType() != INTERFACE_LIBRARY)
+  if (this->GetType() != cmState::INTERFACE_LIBRARY)
     {
     if(!propertyLibs)
       {
@@ -2488,7 +2492,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
     info.Libraries = propertyLibs;
     }
   }
-  if(this->GetType() == INTERFACE_LIBRARY)
+  if(this->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return;
     }
@@ -2516,7 +2520,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
     }
 
   // Get the soname.
-  if(this->GetType() == cmTarget::SHARED_LIBRARY)
+  if(this->GetType() == cmState::SHARED_LIBRARY)
     {
     std::string soProp = "IMPORTED_SONAME";
     soProp += suffix;
@@ -2531,7 +2535,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
     }
 
   // Get the "no-soname" mark.
-  if(this->GetType() == cmTarget::SHARED_LIBRARY)
+  if(this->GetType() == cmState::SHARED_LIBRARY)
     {
     std::string soProp = "IMPORTED_NO_SONAME";
     soProp += suffix;
@@ -2550,7 +2554,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
     {
     info.ImportLibrary = imp;
     }
-  else if(this->GetType() == cmTarget::SHARED_LIBRARY ||
+  else if(this->GetType() == cmState::SHARED_LIBRARY ||
           this->IsExecutableWithExports())
     {
     std::string impProp = "IMPORTED_IMPLIB";
@@ -2597,7 +2601,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
     }
 
   // Get the cyclic repetition count.
-  if(this->GetType() == cmTarget::STATIC_LIBRARY)
+  if(this->GetType() == cmState::STATIC_LIBRARY)
     {
     std::string linkProp = "IMPORTED_LINK_INTERFACE_MULTIPLICITY";
     linkProp += suffix;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index b0d5f4a..e5646f6 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -77,18 +77,13 @@ class cmTarget
 {
 public:
   cmTarget();
-  enum TargetType { EXECUTABLE, STATIC_LIBRARY,
-                    SHARED_LIBRARY, MODULE_LIBRARY,
-                    OBJECT_LIBRARY, UTILITY, GLOBAL_TARGET,
-                    INTERFACE_LIBRARY,
-                    UNKNOWN_LIBRARY};
-  static const char* GetTargetTypeName(TargetType targetType);
+  static const char* GetTargetTypeName(cmState::TargetType targetType);
   enum CustomCommandType { PRE_BUILD, PRE_LINK, POST_BUILD };
 
   /**
    * Return the type of target.
    */
-  TargetType GetType() const
+  cmState::TargetType GetType() const
     {
     return this->TargetTypeValue;
     }
@@ -96,7 +91,7 @@ public:
   /**
    * Set the target type
    */
-  void SetType(TargetType f, const std::string& name);
+  void SetType(cmState::TargetType f, const std::string& name);
 
   void MarkAsImported();
 
@@ -302,7 +297,7 @@ public:
     { return this->SystemIncludeDirectories; }
 
   bool LinkLanguagePropagatesToDependents() const
-  { return this->TargetTypeValue == STATIC_LIBRARY; }
+  { return this->TargetTypeValue == cmState::STATIC_LIBRARY; }
 
   cmStringRange GetIncludeDirectoriesEntries() const;
   cmBacktraceRange GetIncludeDirectoriesBacktraces() const;
@@ -420,7 +415,7 @@ private:
 #endif
   cmMakefile* Makefile;
   cmTargetInternalPointer Internal;
-  TargetType TargetTypeValue;
+  cmState::TargetType TargetTypeValue;
   bool HaveInstallRule;
   bool RecordDependencies;
   bool DLLPlatform;
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 1a1cf39..435346a 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -88,7 +88,7 @@ bool cmTargetLinkLibrariesCommand
     return true;
     }
 
-  if(this->Target->GetType() == cmTarget::OBJECT_LIBRARY)
+  if(this->Target->GetType() == cmState::OBJECT_LIBRARY)
     {
     std::ostringstream e;
     e << "Object library target \"" << args[0] << "\" "
@@ -98,7 +98,7 @@ bool cmTargetLinkLibrariesCommand
     return true;
     }
 
-  if (this->Target->GetType() == cmTarget::UTILITY)
+  if (this->Target->GetType() == cmState::UTILITY)
     {
     std::ostringstream e;
     const char *modal = 0;
@@ -352,7 +352,7 @@ bool
 cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
                                             cmTargetLinkLibraryType llt)
 {
-  if(this->Target->GetType() == cmTarget::INTERFACE_LIBRARY
+  if(this->Target->GetType() == cmState::INTERFACE_LIBRARY
       && this->CurrentProcessingState != ProcessingKeywordLinkInterface)
     {
     this->Makefile->IssueMessage(cmake::FATAL_ERROR,
@@ -428,7 +428,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
     else if(this->CurrentProcessingState != ProcessingKeywordPublicInterface
             && this->CurrentProcessingState != ProcessingPlainPublicInterface)
       {
-      if (this->Target->GetType() == cmTarget::STATIC_LIBRARY)
+      if (this->Target->GetType() == cmState::STATIC_LIBRARY)
         {
         std::string configLib = this->Target
                                      ->GetDebugGeneratorExpressions(lib, llt);
@@ -458,7 +458,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
     return true;
     }
 
-  if (this->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
+  if (this->Target->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return true;
     }
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index 4696de4..bfc19a4 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -44,12 +44,12 @@ bool cmTargetPropCommandBase
     this->HandleMissingTarget(args[0]);
     return false;
     }
-  if ((this->Target->GetType() != cmTarget::SHARED_LIBRARY)
-    && (this->Target->GetType() != cmTarget::STATIC_LIBRARY)
-    && (this->Target->GetType() != cmTarget::OBJECT_LIBRARY)
-    && (this->Target->GetType() != cmTarget::MODULE_LIBRARY)
-    && (this->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
-    && (this->Target->GetType() != cmTarget::EXECUTABLE))
+  if ((this->Target->GetType() != cmState::SHARED_LIBRARY)
+    && (this->Target->GetType() != cmState::STATIC_LIBRARY)
+    && (this->Target->GetType() != cmState::OBJECT_LIBRARY)
+    && (this->Target->GetType() != cmState::MODULE_LIBRARY)
+    && (this->Target->GetType() != cmState::INTERFACE_LIBRARY)
+    && (this->Target->GetType() != cmState::EXECUTABLE))
     {
     this->SetError("called with non-compilable target type");
     return false;
@@ -114,7 +114,7 @@ bool cmTargetPropCommandBase
     return false;
     }
 
-  if (this->Target->GetType() == cmTarget::INTERFACE_LIBRARY
+  if (this->Target->GetType() == cmState::INTERFACE_LIBRARY
       && scope != "INTERFACE")
     {
     this->SetError("may only be set INTERFACE properties on INTERFACE "
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 85fb405..d997596 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -90,7 +90,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
   std::string exe = command[0];
   cmGeneratorTarget* target =
       this->LG->FindGeneratorTargetToUse(exe);
-  if(target && target->GetType() == cmTarget::EXECUTABLE)
+  if(target && target->GetType() == cmState::EXECUTABLE)
     {
     // Use the target file on disk.
     exe = target->GetFullPath(config);
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 3ef5f2e..218756d 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -269,7 +269,7 @@ void cmVisualStudio10TargetGenerator::WriteString(const char* line,
 void cmVisualStudio10TargetGenerator::Generate()
 {
   // do not generate external ms projects
-  if(this->GeneratorTarget->GetType() == cmTarget::INTERFACE_LIBRARY
+  if(this->GeneratorTarget->GetType() == cmState::INTERFACE_LIBRARY
       || this->Target->GetProperty("EXTERNAL_MSPROJECT"))
     {
     return;
@@ -278,7 +278,7 @@ void cmVisualStudio10TargetGenerator::Generate()
   this->Target->SetProperty("GENERATOR_FILE_NAME",this->Name.c_str());
   this->Target->SetProperty("GENERATOR_FILE_NAME_EXT",
                             ".vcxproj");
-  if(this->GeneratorTarget->GetType() <= cmTarget::OBJECT_LIBRARY)
+  if(this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY)
     {
     if(!this->ComputeClOptions())
       {
@@ -361,7 +361,7 @@ void cmVisualStudio10TargetGenerator::Generate()
   (*this->BuildFileStream) <<  "{" << this->GUID << "}</ProjectGUID>\n";
 
   if(this->MSTools
-     && this->GeneratorTarget->GetType() <= cmTarget::GLOBAL_TARGET)
+     && this->GeneratorTarget->GetType() <= cmState::GLOBAL_TARGET)
     {
     this->WriteApplicationTypeSettings();
     this->VerifyNecessaryFiles();
@@ -669,15 +669,15 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
     std::string configType = "<ConfigurationType>";
     switch(this->GeneratorTarget->GetType())
       {
-      case cmTarget::SHARED_LIBRARY:
-      case cmTarget::MODULE_LIBRARY:
+      case cmState::SHARED_LIBRARY:
+      case cmState::MODULE_LIBRARY:
         configType += "DynamicLibrary";
         break;
-      case cmTarget::OBJECT_LIBRARY:
-      case cmTarget::STATIC_LIBRARY:
+      case cmState::OBJECT_LIBRARY:
+      case cmState::STATIC_LIBRARY:
         configType += "StaticLibrary";
         break;
-      case cmTarget::EXECUTABLE:
+      case cmState::EXECUTABLE:
         if(this->NsightTegra &&
            !this->Target->GetPropertyAsBool("ANDROID_GUI"))
           {
@@ -689,8 +689,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
           configType += "Application";
           }
         break;
-      case cmTarget::UTILITY:
-      case cmTarget::GLOBAL_TARGET:
+      case cmState::UTILITY:
+      case cmState::GLOBAL_TARGET:
         if(this->NsightTegra)
           {
           // Tegra-Android platform does not understand "Utility".
@@ -701,8 +701,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
           configType += "Utility";
           }
         break;
-      case cmTarget::UNKNOWN_LIBRARY:
-      case cmTarget::INTERFACE_LIBRARY:
+      case cmState::UNKNOWN_LIBRARY:
+      case cmState::INTERFACE_LIBRARY:
         break;
       }
     configType += "</ConfigurationType>\n";
@@ -744,7 +744,7 @@ void cmVisualStudio10TargetGenerator
   mfcLine += useOfMfcValue + "</UseOfMfc>\n";
   this->WriteString(mfcLine.c_str(), 2);
 
-  if((this->GeneratorTarget->GetType() <= cmTarget::OBJECT_LIBRARY &&
+  if((this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY &&
       this->ClOptions[config]->UsingUnicode()) ||
      this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
      this->GlobalGenerator->TargetsWindowsPhone() ||
@@ -753,7 +753,7 @@ void cmVisualStudio10TargetGenerator
     {
     this->WriteString("<CharacterSet>Unicode</CharacterSet>\n", 2);
     }
-  else if (this->GeneratorTarget->GetType() <= cmTarget::MODULE_LIBRARY &&
+  else if (this->GeneratorTarget->GetType() <= cmState::MODULE_LIBRARY &&
            this->ClOptions[config]->UsingSBCS())
     {
     this->WriteString("<CharacterSet>NotSet</CharacterSet>\n", 2);
@@ -1481,7 +1481,7 @@ void cmVisualStudio10TargetGenerator::WriteSources(
 
 void cmVisualStudio10TargetGenerator::WriteAllSources()
 {
-  if(this->GeneratorTarget->GetType() > cmTarget::UTILITY)
+  if(this->GeneratorTarget->GetType() > cmState::UTILITY)
     {
     return;
     }
@@ -1743,9 +1743,9 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
 
 void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
 {
-  cmTarget::TargetType ttype =
-      (cmTarget::TargetType)this->GeneratorTarget->GetType();
-  if(ttype > cmTarget::GLOBAL_TARGET)
+  cmState::TargetType ttype =
+      (cmState::TargetType)this->GeneratorTarget->GetType();
+  if(ttype > cmState::GLOBAL_TARGET)
     {
     return;
     }
@@ -1757,7 +1757,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
         config = this->Configurations.begin();
       config != this->Configurations.end(); ++config)
     {
-    if(ttype >= cmTarget::UTILITY)
+    if(ttype >= cmState::UTILITY)
       {
       this->WritePlatformConfigTag("IntDir", config->c_str(), 3);
       *this->BuildFileStream
@@ -1773,7 +1773,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
       intermediateDir += "/";
       std::string outDir;
       std::string targetNameFull;
-      if(ttype == cmTarget::OBJECT_LIBRARY)
+      if(ttype == cmState::OBJECT_LIBRARY)
         {
         outDir = intermediateDir;
         targetNameFull = this->Target->GetName();
@@ -1829,8 +1829,8 @@ OutputLinkIncremental(std::string const& configName)
     }
   // static libraries and things greater than modules do not need
   // to set this option
-  if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY
-     || this->GeneratorTarget->GetType() > cmTarget::MODULE_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY
+     || this->GeneratorTarget->GetType() > cmState::MODULE_LIBRARY)
     {
     return;
     }
@@ -1968,8 +1968,8 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
       {
       clOptions.AddFlag("CompileAsWinRT", "true");
       // For WinRT components, add the _WINRT_DLL define to produce a lib
-      if (this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY ||
-          this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY )
+      if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY ||
+          this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY )
         {
         clOptions.AddDefine("_WINRT_DLL");
         }
@@ -2177,8 +2177,8 @@ WriteMasmOptions(std::string const& configName,
 void
 cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
 {
-  if(this->GeneratorTarget->GetType() != cmTarget::STATIC_LIBRARY &&
-     this->GeneratorTarget->GetType() != cmTarget::OBJECT_LIBRARY)
+  if(this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY &&
+     this->GeneratorTarget->GetType() != cmState::OBJECT_LIBRARY)
     {
     return;
     }
@@ -2214,9 +2214,9 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
 void cmVisualStudio10TargetGenerator::WriteManifestOptions(
   std::string const& config)
 {
-  if (this->GeneratorTarget->GetType() != cmTarget::EXECUTABLE &&
-      this->GeneratorTarget->GetType() != cmTarget::SHARED_LIBRARY &&
-      this->GeneratorTarget->GetType() != cmTarget::MODULE_LIBRARY)
+  if (this->GeneratorTarget->GetType() != cmState::EXECUTABLE &&
+      this->GeneratorTarget->GetType() != cmState::SHARED_LIBRARY &&
+      this->GeneratorTarget->GetType() != cmState::MODULE_LIBRARY)
     {
     return;
     }
@@ -2382,9 +2382,9 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
 //----------------------------------------------------------------------------
 bool cmVisualStudio10TargetGenerator::ComputeLinkOptions()
 {
-  if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE ||
-     this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY ||
-     this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmState::EXECUTABLE ||
+     this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY ||
+     this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY)
     {
     for(std::vector<std::string>::const_iterator
           i = this->Configurations.begin();
@@ -2421,11 +2421,11 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
   std::string CONFIG = cmSystemTools::UpperCase(config);
 
   const char* linkType = "SHARED";
-  if(this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY)
     {
     linkType = "MODULE";
     }
-  if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
+  if(this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
     {
     linkType = "EXE";
     }
@@ -2508,7 +2508,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
   std::string targetNameFull;
   std::string targetNameImport;
   std::string targetNamePDB;
-  if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
+  if(this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
     {
     this->GeneratorTarget->GetExecutableNames(targetName, targetNameFull,
                                      targetNameImport, targetNamePDB,
@@ -2531,7 +2531,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
       if (this->GlobalGenerator->TargetsWindowsCE())
         {
         linkOptions.AddFlag("SubSystem", "WindowsCE");
-        if (this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
+        if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
           {
           if (this->ClOptions[config]->UsingUnicode())
             {
@@ -2553,7 +2553,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
       if (this->GlobalGenerator->TargetsWindowsCE())
         {
         linkOptions.AddFlag("SubSystem", "WindowsCE");
-        if (this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
+        if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
           {
           if (this->ClOptions[config]->UsingUnicode())
             {
@@ -2599,7 +2599,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
     // A Windows Runtime component uses internal .NET metadata,
     // so does not have an import library.
     if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") &&
-       this->GeneratorTarget->GetType() != cmTarget::EXECUTABLE)
+       this->GeneratorTarget->GetType() != cmState::EXECUTABLE)
       {
       linkOptions.AddFlag("GenerateWindowsMetadata", "true");
       }
@@ -2637,7 +2637,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
                            "%(IgnoreSpecificDefaultLibraries)");
     }
 
-  if (this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY &&
+  if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY &&
       this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
     if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
@@ -2654,8 +2654,8 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
 void
 cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& config)
 {
-  if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY
-     || this->GeneratorTarget->GetType() > cmTarget::MODULE_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY
+     || this->GeneratorTarget->GetType() > cmState::MODULE_LIBRARY)
     {
     return;
     }
@@ -2693,7 +2693,7 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
       libVec.push_back(path);
       }
     else if (!l->Target
-        || l->GeneratorTarget->GetType() != cmTarget::INTERFACE_LIBRARY)
+        || l->GeneratorTarget->GetType() != cmState::INTERFACE_LIBRARY)
       {
       libVec.push_back(l->Value);
       }
@@ -2765,7 +2765,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
     this->WritePlatformConfigTag("ItemDefinitionGroup", i->c_str(), 1);
     *this->BuildFileStream << "\n";
     //    output cl compile flags <ClCompile></ClCompile>
-    if(this->GeneratorTarget->GetType() <= cmTarget::OBJECT_LIBRARY)
+    if(this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY)
       {
       this->WriteClOptions(*i, includes);
       //    output rc compile flags <ResourceCompile></ResourceCompile>
@@ -2783,7 +2783,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
     //    output manifest flags  <Manifest></Manifest>
     this->WriteManifestOptions(*i);
     if(this->NsightTegra &&
-       this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE &&
+       this->GeneratorTarget->GetType() == cmState::EXECUTABLE &&
        this->Target->GetPropertyAsBool("ANDROID_GUI"))
       {
       this->WriteAntBuildOptions(*i);
@@ -2796,7 +2796,7 @@ void
 cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName)
 {
   bool addedPrelink = false;
-  if (this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY &&
+  if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY &&
       this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
     if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
@@ -2868,7 +2868,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
        i != depends.end(); ++i)
     {
     cmTarget const* dt = (*i)->Target;
-    if(dt->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if(dt->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -3004,7 +3004,7 @@ void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile()
 {
   if((this->GlobalGenerator->TargetsWindowsStore() ||
       this->GlobalGenerator->TargetsWindowsPhone())
-      && (cmTarget::EXECUTABLE == this->GeneratorTarget->GetType()))
+      && (cmState::EXECUTABLE == this->GeneratorTarget->GetType()))
     {
     std::string pfxFile;
     std::vector<cmSourceFile const*> certificates;
@@ -3133,7 +3133,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
       this->WriteString("<MinimumVisualStudioVersion>14.0"
         "</MinimumVisualStudioVersion>\n", 2);
 
-      if(this->GeneratorTarget->GetType() < cmTarget::UTILITY)
+      if(this->GeneratorTarget->GetType() < cmState::UTILITY)
         {
         isAppContainer = true;
         }
@@ -3147,7 +3147,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
       this->WriteString("<MinimumVisualStudioVersion>12.0"
                         "</MinimumVisualStudioVersion>\n", 2);
 
-      if (this->GeneratorTarget->GetType() < cmTarget::UTILITY)
+      if (this->GeneratorTarget->GetType() < cmState::UTILITY)
         {
         isAppContainer = true;
         }
@@ -3162,12 +3162,12 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
                         "</MinimumVisualStudioVersion>\n", 2);
 
       if (isWindowsStore
-          && this->GeneratorTarget->GetType() < cmTarget::UTILITY)
+          && this->GeneratorTarget->GetType() < cmState::UTILITY)
         {
         isAppContainer = true;
         }
       else if (isWindowsPhone &&
-               this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
+               this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
         {
         this->WriteString("<XapOutputs>true</XapOutputs>\n", 2);
         this->WriteString("<XapFilename>", 2);
@@ -3224,7 +3224,7 @@ void cmVisualStudio10TargetGenerator::VerifyNecessaryFiles()
 {
   // For Windows and Windows Phone executables, we will assume that if a
   // manifest is not present that we need to add all the necessary files
-  if (this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
+  if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
     {
     std::vector<cmSourceFile const*> manifestSources;
     this->GeneratorTarget->GetAppManifest(manifestSources, "");

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=305beb6f88e699ccc5efdb198b45e6089afd038d
commit 305beb6f88e699ccc5efdb198b45e6089afd038d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 10 13:56:36 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 14 23:54:12 2015 +0200

    cmTarget: Move link type enum out.
    
    Remove a reason for generate time code to depend on the cmTarget header/type.

diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 06eb3ec..e439182 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -373,13 +373,13 @@ void CCONV cmAddLinkLibraryForTarget(void *arg, const char *tgt,
   switch (libtype)
     {
     case CM_LIBRARY_GENERAL:
-      mf->AddLinkLibraryForTarget(tgt,value, cmTarget::GENERAL);
+      mf->AddLinkLibraryForTarget(tgt,value, GENERAL_LibraryType);
       break;
     case CM_LIBRARY_DEBUG:
-      mf->AddLinkLibraryForTarget(tgt,value, cmTarget::DEBUG);
+      mf->AddLinkLibraryForTarget(tgt,value, DEBUG_LibraryType);
       break;
     case CM_LIBRARY_OPTIMIZED:
-      mf->AddLinkLibraryForTarget(tgt,value, cmTarget::OPTIMIZED);
+      mf->AddLinkLibraryForTarget(tgt,value, OPTIMIZED_LibraryType);
       break;
     }
 }
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 22843f1..742651a 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -482,24 +482,24 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
 
   // Look for entries meant for this configuration.
   std::vector<cmLinkItem> actual_libs;
-  cmTarget::LinkLibraryType llt = cmTarget::GENERAL;
+  cmTargetLinkLibraryType llt = GENERAL_LibraryType;
   bool haveLLT = false;
   for(std::vector<std::string>::const_iterator di = deplist.begin();
       di != deplist.end(); ++di)
     {
     if(*di == "debug")
       {
-      llt = cmTarget::DEBUG;
+      llt = DEBUG_LibraryType;
       haveLLT = true;
       }
     else if(*di == "optimized")
       {
-      llt = cmTarget::OPTIMIZED;
+      llt = OPTIMIZED_LibraryType;
       haveLLT = true;
       }
     else if(*di == "general")
       {
-      llt = cmTarget::GENERAL;
+      llt = GENERAL_LibraryType;
       haveLLT = true;
       }
     else if(!di->empty())
@@ -517,17 +517,17 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
           {
           if(strcmp(val, "debug") == 0)
             {
-            llt = cmTarget::DEBUG;
+            llt = DEBUG_LibraryType;
             }
           else if(strcmp(val, "optimized") == 0)
             {
-            llt = cmTarget::OPTIMIZED;
+            llt = OPTIMIZED_LibraryType;
             }
           }
         }
 
       // If the library is meant for this link type then use it.
-      if(llt == cmTarget::GENERAL || llt == this->LinkType)
+      if(llt == GENERAL_LibraryType || llt == this->LinkType)
         {
         cmLinkItem item(*di, this->FindTargetToLink(depender_index, *di));
         actual_libs.push_back(item);
@@ -539,7 +539,7 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
         }
 
       // Reset the link type until another explicit type is given.
-      llt = cmTarget::GENERAL;
+      llt = GENERAL_LibraryType;
       haveLLT = false;
       }
     }
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index d9760aa..889fb08 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -155,7 +155,7 @@ private:
   void CheckWrongConfigItem(cmLinkItem const& item);
 
   int ComponentOrderId;
-  cmTarget::LinkLibraryType LinkType;
+  cmTargetLinkLibraryType LinkType;
   bool HasConfig;
   bool DebugMode;
   bool OldLinkDirMode;
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx
index fde8fb1..0ef2ea5 100644
--- a/Source/cmExportLibraryDependenciesCommand.cxx
+++ b/Source/cmExportLibraryDependenciesCommand.cxx
@@ -120,15 +120,15 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
         std::string ltValue;
         switch(li->second)
           {
-          case cmTarget::GENERAL:
+          case GENERAL_LibraryType:
             valueNew += "general;";
             ltValue = "general";
             break;
-          case cmTarget::DEBUG:
+          case DEBUG_LibraryType:
             valueNew += "debug;";
             ltValue = "debug";
             break;
-          case cmTarget::OPTIMIZED:
+          case OPTIMIZED_LibraryType:
             valueNew += "optimized;";
             ltValue = "optimized";
             break;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 1b8ad43..8c9251b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5416,13 +5416,13 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
                                 this->MaxLanguageStandards);
     }
 
-  cmTarget::LinkLibraryType linkType = this->Target->ComputeLinkType(config);
+  cmTargetLinkLibraryType linkType = this->Target->ComputeLinkType(config);
   cmTarget::LinkLibraryVectorType const& oldllibs =
     this->Target->GetOriginalLinkLibraries();
   for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin();
       li != oldllibs.end(); ++li)
     {
-    if(li->second != cmTarget::GENERAL && li->second != linkType)
+    if(li->second != GENERAL_LibraryType && li->second != linkType)
       {
       std::string name = this->Target->CheckCMP0004(li->first);
       if(name == this->GetName() || name.empty())
diff --git a/Source/cmLinkLibrariesCommand.cxx b/Source/cmLinkLibrariesCommand.cxx
index 996b538..eb3bfce 100644
--- a/Source/cmLinkLibrariesCommand.cxx
+++ b/Source/cmLinkLibrariesCommand.cxx
@@ -34,7 +34,7 @@ bool cmLinkLibrariesCommand
         return false;
         }
       this->Makefile->AddLinkLibrary(*i,
-                                 cmTarget::DEBUG);
+                                 DEBUG_LibraryType);
       }
     else if (*i == "optimized")
       {
@@ -46,7 +46,7 @@ bool cmLinkLibrariesCommand
         return false;
         }
       this->Makefile->AddLinkLibrary(*i,
-                                 cmTarget::OPTIMIZED);
+                                 OPTIMIZED_LibraryType);
       }
     else
       {
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 6ecd9a8..c620baf 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1145,7 +1145,7 @@ void cmLocalVisualStudio6Generator
       libDebug =
         this->ConvertToOutputFormat(libDebug.c_str(), SHELL);
 
-      if (j->second == cmTarget::GENERAL)
+      if (j->second == GENERAL_LibraryType)
         {
         libOptions += " ";
         libOptions += lib;
@@ -1156,7 +1156,7 @@ void cmLocalVisualStudio6Generator
         libMultiLineOptionsForDebug +=  libDebug;
         libMultiLineOptionsForDebug += "\n";
         }
-      if (j->second == cmTarget::DEBUG)
+      if (j->second == DEBUG_LibraryType)
         {
         libDebugOptions += " ";
         libDebugOptions += lib;
@@ -1165,7 +1165,7 @@ void cmLocalVisualStudio6Generator
         libMultiLineDebugOptions += libDebug;
         libMultiLineDebugOptions += "\n";
         }
-      if (j->second == cmTarget::OPTIMIZED)
+      if (j->second == OPTIMIZED_LibraryType)
         {
         libOptimizedOptions += " ";
         libOptimizedOptions += lib;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 045cca8..d62c5c4 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1400,7 +1400,7 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
 }
 
 void cmMakefile::AddLinkLibrary(const std::string& lib,
-                                cmTarget::LinkLibraryType llt)
+                                cmTargetLinkLibraryType llt)
 {
   cmTarget::LibraryID tmp;
   tmp.first = lib;
@@ -1410,7 +1410,7 @@ void cmMakefile::AddLinkLibrary(const std::string& lib,
 
 void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
                                          const std::string& lib,
-                                         cmTarget::LinkLibraryType llt)
+                                         cmTargetLinkLibraryType llt)
 {
   cmTargets::iterator i = this->Targets.find(target);
   if ( i != this->Targets.end())
@@ -1471,7 +1471,7 @@ void cmMakefile::AddLinkDirectoryForTarget(const std::string& target,
 
 void cmMakefile::AddLinkLibrary(const std::string& lib)
 {
-  this->AddLinkLibrary(lib,cmTarget::GENERAL);
+  this->AddLinkLibrary(lib,GENERAL_LibraryType);
 }
 
 void cmMakefile::InitializeFromParent(cmMakefile* parent)
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 99ed73d..d9d5a8a 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -219,9 +219,9 @@ public:
    * Add a link library to the build.
    */
   void AddLinkLibrary(const std::string&);
-  void AddLinkLibrary(const std::string&, cmTarget::LinkLibraryType type);
+  void AddLinkLibrary(const std::string&, cmTargetLinkLibraryType type);
   void AddLinkLibraryForTarget(const std::string& tgt, const std::string&,
-                               cmTarget::LinkLibraryType type);
+                               cmTargetLinkLibraryType type);
   void AddLinkDirectoryForTarget(const std::string& tgt, const std::string& d);
 
   /**
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index 468a589..dd8fa9c 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -123,4 +123,10 @@ static thisClass* SafeDownCast(cmObject *c) \
 } \
 class cmTypeMacro_UseTrailingSemicolon
 
+enum cmTargetLinkLibraryType {
+  GENERAL_LibraryType,
+  DEBUG_LibraryType,
+  OPTIMIZED_LibraryType
+};
+
 #endif
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 847a5c1..0128c78 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -632,13 +632,13 @@ const std::vector<std::string>& cmTarget::GetLinkDirectories() const
 }
 
 //----------------------------------------------------------------------------
-cmTarget::LinkLibraryType cmTarget::ComputeLinkType(
+cmTargetLinkLibraryType cmTarget::ComputeLinkType(
                                       const std::string& config) const
 {
   // No configuration is always optimized.
   if(config.empty())
     {
-    return cmTarget::OPTIMIZED;
+    return OPTIMIZED_LibraryType;
     }
 
   // Get the list of configurations considered to be DEBUG.
@@ -650,10 +650,10 @@ cmTarget::LinkLibraryType cmTarget::ComputeLinkType(
   if (std::find(debugConfigs.begin(), debugConfigs.end(), configUpper) !=
       debugConfigs.end())
     {
-    return cmTarget::DEBUG;
+    return DEBUG_LibraryType;
     }
   // The current configuration is not a debug configuration.
-  return cmTarget::OPTIMIZED;
+  return OPTIMIZED_LibraryType;
 }
 
 //----------------------------------------------------------------------------
@@ -693,9 +693,9 @@ bool cmTarget::NameResolvesToFramework(const std::string& libname) const
 
 //----------------------------------------------------------------------------
 std::string cmTarget::GetDebugGeneratorExpressions(const std::string &value,
-                                  cmTarget::LinkLibraryType llt) const
+                                  cmTargetLinkLibraryType llt) const
 {
-  if (llt == GENERAL)
+  if (llt == GENERAL_LibraryType)
     {
     return value;
     }
@@ -716,7 +716,7 @@ std::string cmTarget::GetDebugGeneratorExpressions(const std::string &value,
     configString = "$<OR:" + configString + ">";
     }
 
-  if (llt == OPTIMIZED)
+  if (llt == OPTIMIZED_LibraryType)
     {
     configString = "$<NOT:" + configString + ">";
     }
@@ -773,15 +773,16 @@ void cmTarget::GetTllSignatureTraces(std::ostringstream &s,
 void cmTarget::AddLinkLibrary(cmMakefile& mf,
                               const std::string& target,
                               const std::string& lib,
-                              LinkLibraryType llt)
+                              cmTargetLinkLibraryType llt)
 {
   cmTarget *tgt = this->Makefile->FindTargetToUse(lib);
   {
   const bool isNonImportedTarget = tgt && !tgt->IsImported();
 
-  const std::string libName = (isNonImportedTarget && llt != GENERAL)
-                                                        ? targetNameGenex(lib)
-                                                        : lib;
+  const std::string libName =
+      (isNonImportedTarget && llt != GENERAL_LibraryType)
+      ? targetNameGenex(lib)
+      : lib;
   this->AppendProperty("LINK_LIBRARIES",
                        this->GetDebugGeneratorExpressions(libName,
                                                           llt).c_str());
@@ -822,13 +823,13 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
       }
     switch (llt)
       {
-      case cmTarget::GENERAL:
+      case GENERAL_LibraryType:
         dependencies += "general";
         break;
-      case cmTarget::DEBUG:
+      case DEBUG_LibraryType:
         dependencies += "debug";
         break;
-      case cmTarget::OPTIMIZED:
+      case OPTIMIZED_LibraryType:
         dependencies += "optimized";
         break;
       }
@@ -1162,7 +1163,7 @@ void cmTarget::GatherDependenciesForVS6( const cmMakefile& mf,
 
     // Parse the dependency information, which is a set of
     // type, library pairs separated by ";". There is always a trailing ";".
-    cmTarget::LinkLibraryType llt = cmTarget::GENERAL;
+    cmTargetLinkLibraryType llt = GENERAL_LibraryType;
     std::string depline = deps;
     std::string::size_type start = 0;
     std::string::size_type end;
@@ -1174,22 +1175,22 @@ void cmTarget::GatherDependenciesForVS6( const cmMakefile& mf,
         {
         if (l == "debug")
           {
-          llt = cmTarget::DEBUG;
+          llt = DEBUG_LibraryType;
           }
         else if (l == "optimized")
           {
-          llt = cmTarget::OPTIMIZED;
+          llt = OPTIMIZED_LibraryType;
           }
         else if (l == "general")
           {
-          llt = cmTarget::GENERAL;
+          llt = GENERAL_LibraryType;
           }
         else
           {
           LibraryID lib2(l,llt);
           this->InsertDependencyForVS6( dep_map, lib, lib2);
           this->GatherDependenciesForVS6( mf, lib2, dep_map);
-          llt = cmTarget::GENERAL;
+          llt = GENERAL_LibraryType;
           }
         }
       start = end+1; // skip the ;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 97515a7..b0d5f4a 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -140,17 +140,15 @@ public:
   cmSourceFile* AddSourceCMP0049(const std::string& src);
   cmSourceFile* AddSource(const std::string& src);
 
-  enum LinkLibraryType {GENERAL, DEBUG, OPTIMIZED};
-
   //* how we identify a library, by name and type
-  typedef std::pair<std::string, LinkLibraryType> LibraryID;
+  typedef std::pair<std::string, cmTargetLinkLibraryType> LibraryID;
 
   typedef std::vector<LibraryID > LinkLibraryVectorType;
   const LinkLibraryVectorType &GetOriginalLinkLibraries() const
     {return this->OriginalLinkLibraries;}
 
   /** Compute the link type to use for the given configuration.  */
-  LinkLibraryType ComputeLinkType(const std::string& config) const;
+  cmTargetLinkLibraryType ComputeLinkType(const std::string& config) const;
 
   /**
    * Clear the dependency information recorded for this target, if any.
@@ -161,7 +159,7 @@ public:
   bool NameResolvesToFramework(const std::string& libname) const;
   void AddLinkLibrary(cmMakefile& mf,
                       const std::string& target, const std::string& lib,
-                      LinkLibraryType llt);
+                      cmTargetLinkLibraryType llt);
   enum TLLSignature {
     KeywordTLLSignature,
     PlainTLLSignature
@@ -297,7 +295,7 @@ public:
   void AppendBuildInterfaceIncludes();
 
   std::string GetDebugGeneratorExpressions(const std::string &value,
-                                  cmTarget::LinkLibraryType llt) const;
+                                  cmTargetLinkLibraryType llt) const;
 
   void AddSystemIncludeDirectories(const std::set<std::string> &incs);
   std::set<std::string> const & GetSystemIncludeDirectories() const
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index b57b921..1a1cf39 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -136,7 +136,7 @@ bool cmTargetLinkLibrariesCommand
     }
 
   // Keep track of link configuration specifiers.
-  cmTarget::LinkLibraryType llt = cmTarget::GENERAL;
+  cmTargetLinkLibraryType llt = GENERAL_LibraryType;
   bool haveLLT = false;
 
   // Start with primary linking and switch to link interface
@@ -242,27 +242,27 @@ bool cmTargetLinkLibrariesCommand
       {
       if(haveLLT)
         {
-        this->LinkLibraryTypeSpecifierWarning(llt, cmTarget::DEBUG);
+        this->LinkLibraryTypeSpecifierWarning(llt, DEBUG_LibraryType);
         }
-      llt = cmTarget::DEBUG;
+      llt = DEBUG_LibraryType;
       haveLLT = true;
       }
     else if(args[i] == "optimized")
       {
       if(haveLLT)
         {
-        this->LinkLibraryTypeSpecifierWarning(llt, cmTarget::OPTIMIZED);
+        this->LinkLibraryTypeSpecifierWarning(llt, OPTIMIZED_LibraryType);
         }
-      llt = cmTarget::OPTIMIZED;
+      llt = OPTIMIZED_LibraryType;
       haveLLT = true;
       }
     else if(args[i] == "general")
       {
       if(haveLLT)
         {
-        this->LinkLibraryTypeSpecifierWarning(llt, cmTarget::GENERAL);
+        this->LinkLibraryTypeSpecifierWarning(llt, GENERAL_LibraryType);
         }
-      llt = cmTarget::GENERAL;
+      llt = GENERAL_LibraryType;
       haveLLT = true;
       }
     else if(haveLLT)
@@ -282,7 +282,7 @@ bool cmTargetLinkLibrariesCommand
       // specifed that a library is both debug and optimized.  (this check is
       // only there for backwards compatibility when mixing projects built
       // with old versions of CMake and new)
-      llt = cmTarget::GENERAL;
+      llt = GENERAL_LibraryType;
       std::string linkType = args[0];
       linkType += "_LINK_TYPE";
       const char* linkTypeString =
@@ -291,11 +291,11 @@ bool cmTargetLinkLibrariesCommand
         {
         if(strcmp(linkTypeString, "debug") == 0)
           {
-          llt = cmTarget::DEBUG;
+          llt = DEBUG_LibraryType;
           }
         if(strcmp(linkTypeString, "optimized") == 0)
           {
-          llt = cmTarget::OPTIMIZED;
+          llt = OPTIMIZED_LibraryType;
           }
         }
       if (!this->HandleLibrary(args[i], llt))
@@ -350,7 +350,7 @@ cmTargetLinkLibrariesCommand
 //----------------------------------------------------------------------------
 bool
 cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
-                                            cmTarget::LinkLibraryType llt)
+                                            cmTargetLinkLibraryType llt)
 {
   if(this->Target->GetType() == cmTarget::INTERFACE_LIBRARY
       && this->CurrentProcessingState != ProcessingKeywordLinkInterface)
@@ -469,7 +469,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
   std::string prop;
 
   // Include this library in the link interface for the target.
-  if(llt == cmTarget::DEBUG || llt == cmTarget::GENERAL)
+  if(llt == DEBUG_LibraryType || llt == GENERAL_LibraryType)
     {
     // Put in the DEBUG configuration interfaces.
     for(std::vector<std::string>::const_iterator i = debugConfigs.begin();
@@ -480,7 +480,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
       this->Target->AppendProperty(prop, lib.c_str());
       }
     }
-  if(llt == cmTarget::OPTIMIZED || llt == cmTarget::GENERAL)
+  if(llt == OPTIMIZED_LibraryType || llt == GENERAL_LibraryType)
     {
     // Put in the non-DEBUG configuration interfaces.
     this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib.c_str());
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index 47dd8bd..f061e6d 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -62,7 +62,7 @@ private:
 
   ProcessingState CurrentProcessingState;
 
-  bool HandleLibrary(const std::string& lib, cmTarget::LinkLibraryType llt);
+  bool HandleLibrary(const std::string& lib, cmTargetLinkLibraryType llt);
 };
 
 
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 7d499de..7268241 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -477,7 +477,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
             ++libIt)
       {
       mf->AddLinkLibraryForTarget(targetName, *libIt,
-                                  cmTarget::GENERAL);
+                                  GENERAL_LibraryType);
       }
 
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=664c328b02211a9e3273845cfd029203f1fe397f
commit 664c328b02211a9e3273845cfd029203f1fe397f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 9 23:15:40 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 14 23:54:12 2015 +0200

    cmTarget: Move ImportInfoMap out of internal class.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 369e497..847a5c1 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -64,9 +64,6 @@ const char* cmTarget::GetTargetTypeName(TargetType targetType)
 class cmTargetInternals
 {
 public:
-  typedef std::map<std::string, cmTarget::ImportInfo> ImportInfoMapType;
-  ImportInfoMapType ImportInfoMap;
-
   std::vector<std::string> IncludeDirectoriesEntries;
   std::vector<cmListFileBacktrace> IncludeDirectoriesBacktraces;
   std::vector<std::string> CompileOptionsEntries;
@@ -1538,7 +1535,7 @@ void cmTarget::MaybeInvalidatePropertyCache(const std::string& prop)
   // Wipe out maps caching information affected by this property.
   if(this->IsImported() && cmHasLiteralPrefix(prop, "IMPORTED"))
     {
-    this->Internal->ImportInfoMap.clear();
+    this->ImportInfoMap.clear();
     }
 }
 
@@ -2288,16 +2285,15 @@ cmTarget::GetImportInfo(const std::string& config) const
     {
     config_upper = "NOCONFIG";
     }
-  typedef cmTargetInternals::ImportInfoMapType ImportInfoMapType;
 
   ImportInfoMapType::const_iterator i =
-    this->Internal->ImportInfoMap.find(config_upper);
-  if(i == this->Internal->ImportInfoMap.end())
+    this->ImportInfoMap.find(config_upper);
+  if(i == this->ImportInfoMap.end())
     {
     ImportInfo info;
     this->ComputeImportInfo(config_upper, info);
     ImportInfoMapType::value_type entry(config_upper, info);
-    i = this->Internal->ImportInfoMap.insert(entry).first;
+    i = this->ImportInfoMap.insert(entry).first;
     }
 
   if(this->GetType() == INTERFACE_LIBRARY)
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 03c4cbe..97515a7 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -449,6 +449,9 @@ private:
     std::string SharedDeps;
   };
 
+  typedef std::map<std::string, ImportInfo> ImportInfoMapType;
+  mutable ImportInfoMapType ImportInfoMap;
+
   ImportInfo const* GetImportInfo(const std::string& config) const;
   void ComputeImportInfo(std::string const& desired_config,
                          ImportInfo& info) const;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df52be7fd5704ac652b9795be41ac5107dc9819c
commit df52be7fd5704ac652b9795be41ac5107dc9819c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 10 13:20:09 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 14 23:54:12 2015 +0200

    cmTarget: Move backtrace member out of internal class.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index fd8ea3e..369e497 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -64,9 +64,6 @@ const char* cmTarget::GetTargetTypeName(TargetType targetType)
 class cmTargetInternals
 {
 public:
-  // The backtrace when the target was created.
-  cmListFileBacktrace Backtrace;
-
   typedef std::map<std::string, cmTarget::ImportInfo> ImportInfoMapType;
   ImportInfoMapType ImportInfoMap;
 
@@ -240,7 +237,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
     }
 
   // Save the backtrace of target construction.
-  this->Internal->Backtrace = this->Makefile->GetBacktrace();
+  this->Backtrace = this->Makefile->GetBacktrace();
 
   if (!this->IsImported())
     {
@@ -363,7 +360,7 @@ void cmTarget::FinishConfigure()
 //----------------------------------------------------------------------------
 cmListFileBacktrace const& cmTarget::GetBacktrace() const
 {
-  return this->Internal->Backtrace;
+  return this->Backtrace;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 01261ed..03c4cbe 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -471,6 +471,8 @@ private:
                             std::string const& suffix,
                             std::string const& name,
                             const char* version) const;
+
+  cmListFileBacktrace Backtrace;
 };
 
 #ifdef CMAKE_BUILD_WITH_CMAKE

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c266d709f232b336f8f06f1bb36a3fee45809d3
commit 4c266d709f232b336f8f06f1bb36a3fee45809d3
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 9 23:11:48 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 14 23:54:12 2015 +0200

    cmTarget: Remove unneeded constructors.
    
    The compiler generated ones are fine here.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b8beb5c..fd8ea3e 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -64,16 +64,6 @@ const char* cmTarget::GetTargetTypeName(TargetType targetType)
 class cmTargetInternals
 {
 public:
-  cmTargetInternals()
-    : Backtrace()
-    {
-    }
-  cmTargetInternals(cmTargetInternals const&)
-    : Backtrace()
-    {
-    }
-  ~cmTargetInternals();
-
   // The backtrace when the target was created.
   cmListFileBacktrace Backtrace;
 
@@ -95,11 +85,6 @@ public:
 };
 
 //----------------------------------------------------------------------------
-cmTargetInternals::~cmTargetInternals()
-{
-}
-
-//----------------------------------------------------------------------------
 cmTarget::cmTarget()
 {
   this->Makefile = 0;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1304be33b367820dca449c753ac502afb059f611
commit 1304be33b367820dca449c753ac502afb059f611
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 14 23:14:43 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 14 23:54:06 2015 +0200

    Generators: Use GetType from the cmGeneratorTarget.

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index bfa8c64..5c252df 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -290,7 +290,7 @@ cmComputeLinkInformation
   // the program that will load it.
   this->LoaderFlag = 0;
   if(!this->UseImportLibrary &&
-     this->Target->Target->GetType() == cmTarget::MODULE_LIBRARY)
+     this->Target->GetType() == cmTarget::MODULE_LIBRARY)
     {
     std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_";
     loader_flag_var += this->LinkLanguage;
@@ -308,10 +308,10 @@ cmComputeLinkInformation
 
   // Get options needed to specify RPATHs.
   this->RuntimeUseChrpath = false;
-  if(this->Target->Target->GetType() != cmTarget::STATIC_LIBRARY)
+  if(this->Target->GetType() != cmTarget::STATIC_LIBRARY)
     {
     const char* tType =
-      ((this->Target->Target->GetType() == cmTarget::EXECUTABLE)?
+      ((this->Target->GetType() == cmTarget::EXECUTABLE)?
        "EXECUTABLE" : "SHARED_LIBRARY");
     std::string rtVar = "CMAKE_";
     rtVar += tType;
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 8f3def2..4094bf0 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -554,7 +554,8 @@ cmComputeTargetDepends
 
     // Describe the depender.
     e << "  \"" << depender->GetName() << "\" of type "
-      << cmTarget::GetTargetTypeName(depender->Target->GetType()) << "\n";
+      << cmTarget::GetTargetTypeName(
+           (cmTarget::TargetType)depender->GetType()) << "\n";
 
     // List its dependencies that are inside the component.
     EdgeList const& nl = this->InitialGraph[i];
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index fe83b08..9958672 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1632,7 +1632,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
       return std::string();
       }
 
-    cmTarget::TargetType targetType = target->Target->GetType();
+    cmTarget::TargetType targetType = (cmTarget::TargetType)target->GetType();
 
     if(targetType != cmTarget::SHARED_LIBRARY &&
        targetType != cmTarget::MODULE_LIBRARY &&
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 6bebc2b..1b8ad43 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1965,7 +1965,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
     std::string msg = "cmTarget::GetCompileInfo called for ";
     msg += this->GetName();
     msg += " which has type ";
-    msg += cmTarget::GetTargetTypeName(this->Target->GetType());
+    msg += cmTarget::GetTargetTypeName((cmTarget::TargetType)this->GetType());
     this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
     return 0;
     }
@@ -2155,7 +2155,7 @@ cmTargetTraceDependencies
   this->CurrentEntry = 0;
 
   // Queue all the source files already specified for the target.
-  if (this->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
+  if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
     {
     std::vector<std::string> configs;
     this->Makefile->GetConfigurations(configs);
@@ -3657,8 +3657,8 @@ cmGeneratorTarget::GetCompatibleInterfaces(std::string const& config) const
 bool cmGeneratorTarget::IsLinkInterfaceDependentBoolProperty(
     const std::string &p, const std::string& config) const
 {
-  if (this->Target->GetType() == cmTarget::OBJECT_LIBRARY
-      || this->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
+  if (this->GetType() == cmTarget::OBJECT_LIBRARY
+      || this->GetType() == cmTarget::INTERFACE_LIBRARY)
     {
     return false;
     }
@@ -3669,8 +3669,8 @@ bool cmGeneratorTarget::IsLinkInterfaceDependentBoolProperty(
 bool cmGeneratorTarget::IsLinkInterfaceDependentStringProperty(
     const std::string &p, const std::string& config) const
 {
-  if (this->Target->GetType() == cmTarget::OBJECT_LIBRARY
-      || this->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
+  if (this->GetType() == cmTarget::OBJECT_LIBRARY
+      || this->GetType() == cmTarget::INTERFACE_LIBRARY)
     {
     return false;
     }
@@ -3681,8 +3681,8 @@ bool cmGeneratorTarget::IsLinkInterfaceDependentStringProperty(
 bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMinProperty(
     const std::string &p, const std::string& config) const
 {
-  if (this->Target->GetType() == cmTarget::OBJECT_LIBRARY
-      || this->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
+  if (this->GetType() == cmTarget::OBJECT_LIBRARY
+      || this->GetType() == cmTarget::INTERFACE_LIBRARY)
     {
     return false;
     }
@@ -3693,8 +3693,8 @@ bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMinProperty(
 bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMaxProperty(
     const std::string &p, const std::string& config) const
 {
-  if (this->Target->GetType() == cmTarget::OBJECT_LIBRARY
-      || this->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
+  if (this->GetType() == cmTarget::OBJECT_LIBRARY
+      || this->GetType() == cmTarget::INTERFACE_LIBRARY)
     {
     return false;
     }
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 79e3a4c..6469294 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -148,7 +148,7 @@ void cmGhsMultiTargetGenerator::Generate()
     this->WriteCompilerFlags(config, language);
     this->WriteCompilerDefinitions(config, language);
     this->WriteIncludes(config, language);
-    if (this->Target->GetType() == cmTarget::EXECUTABLE)
+    if (this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
       {
       this->WriteTargetLinkLibraries();
       }
@@ -215,13 +215,13 @@ void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string &config,
   std::string outputDir(this->GetOutputDirectory(config));
   std::string outputFilename(this->GetOutputFilename(config));
 
-  if (this->Target->GetType() == cmTarget::STATIC_LIBRARY)
+  if (this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY)
     {
     *this->GetFolderBuildStreams() << "    {optgroup=GhsCommonOptions} -o \""
                                    << outputDir << outputFilename << ".a\""
                                    << std::endl;
     }
-  else if (this->Target->GetType() == cmTarget::EXECUTABLE)
+  else if (this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
     {
     if (notKernel && !this->IsTargetGroup())
       {
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 3691b41..7cf0ad0 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -137,7 +137,7 @@ void cmLocalGenerator::TraceDependencies()
       t != targets.end(); ++t)
     {
     if (t->second->Target->IsImported()
-        || t->second->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
+        || t->second->GetType() == cmTarget::INTERFACE_LIBRARY)
       {
       continue;
       }
@@ -472,7 +472,7 @@ void cmLocalGenerator::ComputeTargetManifest()
       t != targets.end(); ++t)
     {
     cmGeneratorTarget& target = *t->second;
-    if (target.Target->GetType() == cmTarget::INTERFACE_LIBRARY)
+    if (target.GetType() == cmTarget::INTERFACE_LIBRARY)
       {
       continue;
       }
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index 721f239..195a1e0 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -31,7 +31,7 @@ void cmLocalGhsMultiGenerator::Generate()
   for (cmGeneratorTargetsType::iterator l = tgts.begin(); l != tgts.end();
        ++l)
     {
-    if (l->second->Target->GetType() == cmTarget::INTERFACE_LIBRARY
+    if (l->second->GetType() == cmTarget::INTERFACE_LIBRARY
         || l->second->Target->IsImported())
       {
       continue;
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 8d71469..8f7a66f 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -77,7 +77,7 @@ void cmLocalNinjaGenerator::Generate()
   for(cmGeneratorTargetsType::iterator t = targets.begin();
       t != targets.end(); ++t)
     {
-    if (t->second->Target->GetType() == cmTarget::INTERFACE_LIBRARY
+    if (t->second->GetType() == cmTarget::INTERFACE_LIBRARY
         || t->second->Target->IsImported())
       {
       continue;
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 91c7acd..e4533cc 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -119,7 +119,7 @@ void cmLocalUnixMakefileGenerator3::Generate()
   for(cmGeneratorTargetsType::iterator t = targets.begin();
       t != targets.end(); ++t)
     {
-    if (t->second->Target->GetType() == cmTarget::INTERFACE_LIBRARY
+    if (t->second->GetType() == cmTarget::INTERFACE_LIBRARY
         || t->second->Target->IsImported())
       {
       continue;
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 8b60a23..cb19d9b 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -26,7 +26,7 @@ cmMakefileLibraryTargetGenerator
   cmMakefileTargetGenerator(target)
 {
   this->CustomCommandDriver = OnDepends;
-  if (this->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
+  if (this->GeneratorTarget->GetType() != cmTarget::INTERFACE_LIBRARY)
     {
     this->GeneratorTarget->GetLibraryNames(
       this->TargetNameOut, this->TargetNameSO, this->TargetNameReal,
@@ -62,7 +62,7 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
 
   // write the link rules
   // Write the rule for this target type.
-  switch(this->Target->GetType())
+  switch(this->GeneratorTarget->GetType())
     {
     case cmTarget::STATIC_LIBRARY:
       this->WriteStaticLibraryRules();
@@ -253,8 +253,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   this->LocalGenerator->AppendFlags(linkFlags, extraFlags);
 
   // Add OSX version flags, if any.
-  if(this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
-     this->Target->GetType() == cmTarget::MODULE_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY ||
+     this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY)
     {
     this->AppendOSXVerFlag(linkFlags, linkLanguage, "COMPATIBILITY", true);
     this->AppendOSXVerFlag(linkFlags, linkLanguage, "CURRENT", false);
@@ -351,7 +351,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
     // Add the link message.
     std::string buildEcho = "Linking ";
     buildEcho += linkLanguage;
-    switch(this->Target->GetType())
+    switch(this->GeneratorTarget->GetType())
       {
       case cmTarget::STATIC_LIBRARY:
         buildEcho += " static library ";
@@ -375,7 +375,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
     }
 
   const char* forbiddenFlagVar = 0;
-  switch(this->Target->GetType())
+  switch(this->GeneratorTarget->GetType())
     {
     case cmTarget::SHARED_LIBRARY:
       forbiddenFlagVar = "_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS";
@@ -429,7 +429,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
 #ifdef _WIN32
   // There may be a manifest file for this target.  Add it to the
   // clean set just in case.
-  if(this->Target->GetType() != cmTarget::STATIC_LIBRARY)
+  if(this->GeneratorTarget->GetType() != cmTarget::STATIC_LIBRARY)
     {
     libCleanFiles.push_back(
       this->Convert((targetFullPath+".manifest").c_str(),
@@ -441,7 +441,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   std::vector<std::string> commands1;
   // Add a command to remove any existing files for this library.
   // for static libs only
-  if(this->Target->GetType() == cmTarget::STATIC_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY)
     {
     this->LocalGenerator->AppendCleanCommand(commands1, libCleanFiles,
                                              *this->Target, "target");
@@ -497,7 +497,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   std::vector<std::string> archiveAppendCommands;
   std::vector<std::string> archiveFinishCommands;
   std::string::size_type archiveCommandLimit = std::string::npos;
-  if(this->Target->GetType() == cmTarget::STATIC_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY)
     {
     haveStaticLibraryRule =
       this->Makefile->GetDefinition(linkRuleVar)? true:false;
@@ -552,7 +552,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
 
   // Collect up flags to link in needed libraries.
   std::string linkLibs;
-  if(this->Target->GetType() != cmTarget::STATIC_LIBRARY)
+  if(this->GeneratorTarget->GetType() != cmTarget::STATIC_LIBRARY)
     {
     this->CreateLinkLibs(linkLibs, relink, useResponseFileForLibs, depends,
                          useWatcomQuote);
@@ -566,7 +566,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
                           useWatcomQuote);
 
   // maybe create .def file from list of objects
-  if (this->Target->GetType() == cmTarget::SHARED_LIBRARY &&
+  if (this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY &&
       this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
     if(this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
@@ -667,7 +667,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
 
   // Compute the directory portion of the install_name setting.
   std::string install_name_dir;
-  if(this->Target->GetType() == cmTarget::SHARED_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY)
     {
     // Get the install_name directory for the build tree.
     install_name_dir =
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index abcda21..9b0e5dd 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -542,10 +542,10 @@ cmMakefileTargetGenerator
   std::string targetFullPathReal;
   std::string targetFullPathPDB;
   std::string targetFullPathCompilePDB;
-  if(this->Target->GetType() == cmTarget::EXECUTABLE ||
-     this->Target->GetType() == cmTarget::STATIC_LIBRARY ||
-     this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
-     this->Target->GetType() == cmTarget::MODULE_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE ||
+     this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY ||
+     this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY ||
+     this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY)
     {
     targetFullPathReal =
       this->GeneratorTarget->GetFullPath(this->ConfigName, false, true);
@@ -554,7 +554,7 @@ cmMakefileTargetGenerator
     targetFullPathPDB += "/";
     targetFullPathPDB += this->GeneratorTarget->GetPDBName(this->ConfigName);
     }
-  if(this->Target->GetType() <= cmTarget::OBJECT_LIBRARY)
+  if(this->GeneratorTarget->GetType() <= cmTarget::OBJECT_LIBRARY)
     {
     targetFullPathCompilePDB =
       this->GeneratorTarget->GetCompilePDBPath(this->ConfigName);
@@ -1445,7 +1445,7 @@ void cmMakefileTargetGenerator
 ::AppendTargetDepends(std::vector<std::string>& depends)
 {
   // Static libraries never depend on anything for linking.
-  if(this->Target->GetType() == cmTarget::STATIC_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY)
     {
     return;
     }
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index c64fe50..02e47bd 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -87,7 +87,7 @@ void cmNinjaNormalTargetGenerator::Generate()
   // Write the build statements
   this->WriteObjectBuildStatements();
 
-  if(this->GetTarget()->GetType() == cmTarget::OBJECT_LIBRARY)
+  if(this->GetGeneratorTarget()->GetType() == cmTarget::OBJECT_LIBRARY)
     {
     this->WriteObjectLibStatement();
     }
@@ -103,7 +103,7 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules()
   cmGlobalNinjaGenerator::WriteDivider(this->GetRulesFileStream());
   this->GetRulesFileStream()
     << "# Rules for each languages for "
-    << cmTarget::GetTargetTypeName(this->GetTarget()->GetType())
+    << cmTarget::GetTargetTypeName(this->GetGeneratorTarget()->GetType())
     << " target "
     << this->GetTargetName()
     << "\n\n";
@@ -133,7 +133,7 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules()
 
 const char *cmNinjaNormalTargetGenerator::GetVisibleTypeName() const
 {
-  switch (this->GetTarget()->GetType()) {
+  switch (this->GetGeneratorTarget()->GetType()) {
     case cmTarget::STATIC_LIBRARY:
       return "static library";
     case cmTarget::SHARED_LIBRARY:
@@ -156,7 +156,8 @@ cmNinjaNormalTargetGenerator
 {
   return this->TargetLinkLanguage
     + "_"
-    + cmTarget::GetTargetTypeName(this->GetTarget()->GetType())
+    + cmTarget::GetTargetTypeName(
+        (cmTarget::TargetType)this->GetGeneratorTarget()->GetType())
     + "_LINKER__"
     + cmGlobalNinjaGenerator::EncodeRuleName(this->GetTarget()->GetName())
     ;
@@ -166,7 +167,8 @@ void
 cmNinjaNormalTargetGenerator
 ::WriteLinkRule(bool useResponseFile)
 {
-  cmTarget::TargetType targetType = this->GetTarget()->GetType();
+  cmTarget::TargetType targetType =
+      (cmTarget::TargetType)this->GetGeneratorTarget()->GetType();
   std::string ruleName = this->LanguageLinkerRule();
 
   // Select whether to use a response file for objects.
@@ -330,7 +332,7 @@ cmNinjaNormalTargetGenerator
     return linkCmds;
     }
   }
-  switch (this->GetTarget()->GetType()) {
+  switch (this->GetGeneratorTarget()->GetType()) {
     case cmTarget::STATIC_LIBRARY: {
       // We have archive link commands set. First, delete the existing archive.
       {
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 4080d90..ec90ba5 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -189,8 +189,8 @@ ComputeDefines(cmSourceFile const* source, const std::string& language)
 cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
 {
   // Static libraries never depend on other targets for linking.
-  if (this->Target->GetType() == cmTarget::STATIC_LIBRARY ||
-      this->Target->GetType() == cmTarget::OBJECT_LIBRARY)
+  if (this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY ||
+      this->GeneratorTarget->GetType() == cmTarget::OBJECT_LIBRARY)
     return cmNinjaDeps();
 
   cmComputeLinkInformation* cli =
@@ -283,16 +283,16 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
     {
     std::string pdbPath;
     std::string compilePdbPath;
-    if(this->Target->GetType() == cmTarget::EXECUTABLE ||
-       this->Target->GetType() == cmTarget::STATIC_LIBRARY ||
-       this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
-       this->Target->GetType() == cmTarget::MODULE_LIBRARY)
+    if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE ||
+       this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY ||
+       this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY ||
+       this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY)
       {
       pdbPath = this->GeneratorTarget->GetPDBDirectory(this->GetConfigName());
       pdbPath += "/";
       pdbPath += this->GeneratorTarget->GetPDBName(this->GetConfigName());
       }
-    if(this->Target->GetType() <= cmTarget::OBJECT_LIBRARY)
+    if(this->GeneratorTarget->GetType() <= cmTarget::OBJECT_LIBRARY)
       {
       compilePdbPath =
               this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName());
@@ -480,7 +480,8 @@ cmNinjaTargetGenerator
   cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream());
   this->GetBuildFileStream()
     << "# Object build statements for "
-    << cmTarget::GetTargetTypeName(this->GetTarget()->GetType())
+    << cmTarget::GetTargetTypeName(
+         (cmTarget::TargetType)this->GetGeneratorTarget()->GetType())
     << " target "
     << this->GetTargetName()
     << "\n\n";
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index a2aada6..3ef5f2e 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -269,7 +269,7 @@ void cmVisualStudio10TargetGenerator::WriteString(const char* line,
 void cmVisualStudio10TargetGenerator::Generate()
 {
   // do not generate external ms projects
-  if(this->Target->GetType() == cmTarget::INTERFACE_LIBRARY
+  if(this->GeneratorTarget->GetType() == cmTarget::INTERFACE_LIBRARY
       || this->Target->GetProperty("EXTERNAL_MSPROJECT"))
     {
     return;
@@ -278,7 +278,7 @@ void cmVisualStudio10TargetGenerator::Generate()
   this->Target->SetProperty("GENERATOR_FILE_NAME",this->Name.c_str());
   this->Target->SetProperty("GENERATOR_FILE_NAME_EXT",
                             ".vcxproj");
-  if(this->Target->GetType() <= cmTarget::OBJECT_LIBRARY)
+  if(this->GeneratorTarget->GetType() <= cmTarget::OBJECT_LIBRARY)
     {
     if(!this->ComputeClOptions())
       {
@@ -360,7 +360,8 @@ void cmVisualStudio10TargetGenerator::Generate()
   this->WriteString("<ProjectGUID>", 2);
   (*this->BuildFileStream) <<  "{" << this->GUID << "}</ProjectGUID>\n";
 
-  if(this->MSTools && this->Target->GetType() <= cmTarget::GLOBAL_TARGET)
+  if(this->MSTools
+     && this->GeneratorTarget->GetType() <= cmTarget::GLOBAL_TARGET)
     {
     this->WriteApplicationTypeSettings();
     this->VerifyNecessaryFiles();
@@ -666,7 +667,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
                                  i->c_str(),
                                  1, " Label=\"Configuration\"", "\n");
     std::string configType = "<ConfigurationType>";
-    switch(this->Target->GetType())
+    switch(this->GeneratorTarget->GetType())
       {
       case cmTarget::SHARED_LIBRARY:
       case cmTarget::MODULE_LIBRARY:
@@ -743,7 +744,7 @@ void cmVisualStudio10TargetGenerator
   mfcLine += useOfMfcValue + "</UseOfMfc>\n";
   this->WriteString(mfcLine.c_str(), 2);
 
-  if((this->Target->GetType() <= cmTarget::OBJECT_LIBRARY &&
+  if((this->GeneratorTarget->GetType() <= cmTarget::OBJECT_LIBRARY &&
       this->ClOptions[config]->UsingUnicode()) ||
      this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
      this->GlobalGenerator->TargetsWindowsPhone() ||
@@ -752,7 +753,7 @@ void cmVisualStudio10TargetGenerator
     {
     this->WriteString("<CharacterSet>Unicode</CharacterSet>\n", 2);
     }
-  else if (this->Target->GetType() <= cmTarget::MODULE_LIBRARY &&
+  else if (this->GeneratorTarget->GetType() <= cmTarget::MODULE_LIBRARY &&
            this->ClOptions[config]->UsingSBCS())
     {
     this->WriteString("<CharacterSet>NotSet</CharacterSet>\n", 2);
@@ -1480,7 +1481,7 @@ void cmVisualStudio10TargetGenerator::WriteSources(
 
 void cmVisualStudio10TargetGenerator::WriteAllSources()
 {
-  if(this->Target->GetType() > cmTarget::UTILITY)
+  if(this->GeneratorTarget->GetType() > cmTarget::UTILITY)
     {
     return;
     }
@@ -1742,7 +1743,8 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
 
 void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
 {
-  cmTarget::TargetType ttype = this->Target->GetType();
+  cmTarget::TargetType ttype =
+      (cmTarget::TargetType)this->GeneratorTarget->GetType();
   if(ttype > cmTarget::GLOBAL_TARGET)
     {
     return;
@@ -1827,8 +1829,8 @@ OutputLinkIncremental(std::string const& configName)
     }
   // static libraries and things greater than modules do not need
   // to set this option
-  if(this->Target->GetType() == cmTarget::STATIC_LIBRARY
-     || this->Target->GetType() > cmTarget::MODULE_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY
+     || this->GeneratorTarget->GetType() > cmTarget::MODULE_LIBRARY)
     {
     return;
     }
@@ -1966,8 +1968,8 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
       {
       clOptions.AddFlag("CompileAsWinRT", "true");
       // For WinRT components, add the _WINRT_DLL define to produce a lib
-      if (this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
-          this->Target->GetType() == cmTarget::MODULE_LIBRARY )
+      if (this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY ||
+          this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY )
         {
         clOptions.AddDefine("_WINRT_DLL");
         }
@@ -2175,8 +2177,8 @@ WriteMasmOptions(std::string const& configName,
 void
 cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
 {
-  if(this->Target->GetType() != cmTarget::STATIC_LIBRARY &&
-     this->Target->GetType() != cmTarget::OBJECT_LIBRARY)
+  if(this->GeneratorTarget->GetType() != cmTarget::STATIC_LIBRARY &&
+     this->GeneratorTarget->GetType() != cmTarget::OBJECT_LIBRARY)
     {
     return;
     }
@@ -2212,9 +2214,9 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
 void cmVisualStudio10TargetGenerator::WriteManifestOptions(
   std::string const& config)
 {
-  if (this->Target->GetType() != cmTarget::EXECUTABLE &&
-      this->Target->GetType() != cmTarget::SHARED_LIBRARY &&
-      this->Target->GetType() != cmTarget::MODULE_LIBRARY)
+  if (this->GeneratorTarget->GetType() != cmTarget::EXECUTABLE &&
+      this->GeneratorTarget->GetType() != cmTarget::SHARED_LIBRARY &&
+      this->GeneratorTarget->GetType() != cmTarget::MODULE_LIBRARY)
     {
     return;
     }
@@ -2380,9 +2382,9 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
 //----------------------------------------------------------------------------
 bool cmVisualStudio10TargetGenerator::ComputeLinkOptions()
 {
-  if(this->Target->GetType() == cmTarget::EXECUTABLE ||
-     this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
-     this->Target->GetType() == cmTarget::MODULE_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE ||
+     this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY ||
+     this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY)
     {
     for(std::vector<std::string>::const_iterator
           i = this->Configurations.begin();
@@ -2419,11 +2421,11 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
   std::string CONFIG = cmSystemTools::UpperCase(config);
 
   const char* linkType = "SHARED";
-  if(this->Target->GetType() == cmTarget::MODULE_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY)
     {
     linkType = "MODULE";
     }
-  if(this->Target->GetType() == cmTarget::EXECUTABLE)
+  if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
     {
     linkType = "EXE";
     }
@@ -2506,7 +2508,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
   std::string targetNameFull;
   std::string targetNameImport;
   std::string targetNamePDB;
-  if(this->Target->GetType() == cmTarget::EXECUTABLE)
+  if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
     {
     this->GeneratorTarget->GetExecutableNames(targetName, targetNameFull,
                                      targetNameImport, targetNamePDB,
@@ -2529,7 +2531,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
       if (this->GlobalGenerator->TargetsWindowsCE())
         {
         linkOptions.AddFlag("SubSystem", "WindowsCE");
-        if (this->Target->GetType() == cmTarget::EXECUTABLE)
+        if (this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
           {
           if (this->ClOptions[config]->UsingUnicode())
             {
@@ -2551,7 +2553,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
       if (this->GlobalGenerator->TargetsWindowsCE())
         {
         linkOptions.AddFlag("SubSystem", "WindowsCE");
-        if (this->Target->GetType() == cmTarget::EXECUTABLE)
+        if (this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
           {
           if (this->ClOptions[config]->UsingUnicode())
             {
@@ -2597,7 +2599,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
     // A Windows Runtime component uses internal .NET metadata,
     // so does not have an import library.
     if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") &&
-       this->Target->GetType() != cmTarget::EXECUTABLE)
+       this->GeneratorTarget->GetType() != cmTarget::EXECUTABLE)
       {
       linkOptions.AddFlag("GenerateWindowsMetadata", "true");
       }
@@ -2635,7 +2637,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
                            "%(IgnoreSpecificDefaultLibraries)");
     }
 
-  if (this->Target->GetType() == cmTarget::SHARED_LIBRARY &&
+  if (this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY &&
       this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
     if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
@@ -2652,8 +2654,8 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
 void
 cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& config)
 {
-  if(this->Target->GetType() == cmTarget::STATIC_LIBRARY
-     || this->Target->GetType() > cmTarget::MODULE_LIBRARY)
+  if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY
+     || this->GeneratorTarget->GetType() > cmTarget::MODULE_LIBRARY)
     {
     return;
     }
@@ -2691,7 +2693,7 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
       libVec.push_back(path);
       }
     else if (!l->Target
-        || l->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
+        || l->GeneratorTarget->GetType() != cmTarget::INTERFACE_LIBRARY)
       {
       libVec.push_back(l->Value);
       }
@@ -2763,7 +2765,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
     this->WritePlatformConfigTag("ItemDefinitionGroup", i->c_str(), 1);
     *this->BuildFileStream << "\n";
     //    output cl compile flags <ClCompile></ClCompile>
-    if(this->Target->GetType() <= cmTarget::OBJECT_LIBRARY)
+    if(this->GeneratorTarget->GetType() <= cmTarget::OBJECT_LIBRARY)
       {
       this->WriteClOptions(*i, includes);
       //    output rc compile flags <ResourceCompile></ResourceCompile>
@@ -2781,7 +2783,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
     //    output manifest flags  <Manifest></Manifest>
     this->WriteManifestOptions(*i);
     if(this->NsightTegra &&
-       this->Target->GetType() == cmTarget::EXECUTABLE &&
+       this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE &&
        this->Target->GetPropertyAsBool("ANDROID_GUI"))
       {
       this->WriteAntBuildOptions(*i);
@@ -2794,7 +2796,7 @@ void
 cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName)
 {
   bool addedPrelink = false;
-  if (this->Target->GetType() == cmTarget::SHARED_LIBRARY &&
+  if (this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY &&
       this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
     if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
@@ -3002,7 +3004,7 @@ void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile()
 {
   if((this->GlobalGenerator->TargetsWindowsStore() ||
       this->GlobalGenerator->TargetsWindowsPhone())
-      && (cmTarget::EXECUTABLE == this->Target->GetType()))
+      && (cmTarget::EXECUTABLE == this->GeneratorTarget->GetType()))
     {
     std::string pfxFile;
     std::vector<cmSourceFile const*> certificates;
@@ -3131,7 +3133,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
       this->WriteString("<MinimumVisualStudioVersion>14.0"
         "</MinimumVisualStudioVersion>\n", 2);
 
-      if(this->Target->GetType() < cmTarget::UTILITY)
+      if(this->GeneratorTarget->GetType() < cmTarget::UTILITY)
         {
         isAppContainer = true;
         }
@@ -3145,7 +3147,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
       this->WriteString("<MinimumVisualStudioVersion>12.0"
                         "</MinimumVisualStudioVersion>\n", 2);
 
-      if (this->Target->GetType() < cmTarget::UTILITY)
+      if (this->GeneratorTarget->GetType() < cmTarget::UTILITY)
         {
         isAppContainer = true;
         }
@@ -3159,12 +3161,13 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
       this->WriteString("<MinimumVisualStudioVersion>11.0"
                         "</MinimumVisualStudioVersion>\n", 2);
 
-      if (isWindowsStore && this->Target->GetType() < cmTarget::UTILITY)
+      if (isWindowsStore
+          && this->GeneratorTarget->GetType() < cmTarget::UTILITY)
         {
         isAppContainer = true;
         }
       else if (isWindowsPhone &&
-               this->Target->GetType() == cmTarget::EXECUTABLE)
+               this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
         {
         this->WriteString("<XapOutputs>true</XapOutputs>\n", 2);
         this->WriteString("<XapFilename>", 2);
@@ -3221,7 +3224,7 @@ void cmVisualStudio10TargetGenerator::VerifyNecessaryFiles()
 {
   // For Windows and Windows Phone executables, we will assume that if a
   // manifest is not present that we need to add all the necessary files
-  if (this->Target->GetType() == cmTarget::EXECUTABLE)
+  if (this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE)
     {
     std::vector<cmSourceFile const*> manifestSources;
     this->GeneratorTarget->GetAppManifest(manifestSources, "");

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

Summary of changes:
 Source/cmAddExecutableCommand.cxx             |    6 +-
 Source/cmAddLibraryCommand.cxx                |   64 +++----
 Source/cmCPluginAPI.cxx                       |    8 +-
 Source/cmCommonTargetGenerator.cxx            |    2 +-
 Source/cmComputeLinkDepends.cxx               |   20 +--
 Source/cmComputeLinkDepends.h                 |    2 +-
 Source/cmComputeLinkInformation.cxx           |   38 ++--
 Source/cmComputeTargetDepends.cxx             |   22 +--
 Source/cmCoreTryCompile.cxx                   |   12 +-
 Source/cmCustomCommandGenerator.cxx           |    2 +-
 Source/cmExportBuildFileGenerator.cxx         |    8 +-
 Source/cmExportCommand.cxx                    |    4 +-
 Source/cmExportFileGenerator.cxx              |   18 +-
 Source/cmExportInstallFileGenerator.cxx       |    6 +-
 Source/cmExportLibraryDependenciesCommand.cxx |   10 +-
 Source/cmExportTryCompileFileGenerator.cxx    |    2 +-
 Source/cmExtraCodeBlocksGenerator.cxx         |   40 ++---
 Source/cmExtraCodeLiteGenerator.cxx           |   16 +-
 Source/cmExtraEclipseCDT4Generator.cxx        |   28 +--
 Source/cmExtraKateGenerator.cxx               |   14 +-
 Source/cmExtraSublimeTextGenerator.cxx        |   14 +-
 Source/cmGeneratorExpressionNode.cxx          |   18 +-
 Source/cmGeneratorTarget.cxx                  |  148 ++++++++--------
 Source/cmGeneratorTarget.h                    |    2 +-
 Source/cmGhsMultiTargetGenerator.cxx          |    8 +-
 Source/cmGlobalGenerator.cxx                  |   26 +--
 Source/cmGlobalKdevelopGenerator.cxx          |    2 +-
 Source/cmGlobalNinjaGenerator.cxx             |   18 +-
 Source/cmGlobalUnixMakefileGenerator3.cxx     |   70 ++++----
 Source/cmGlobalVisualStudio11Generator.cxx    |    6 +-
 Source/cmGlobalVisualStudio11Generator.h      |    2 +-
 Source/cmGlobalVisualStudio6Generator.cxx     |    2 +-
 Source/cmGlobalVisualStudio71Generator.cxx    |    2 +-
 Source/cmGlobalVisualStudio71Generator.h      |    2 +-
 Source/cmGlobalVisualStudio7Generator.cxx     |   12 +-
 Source/cmGlobalVisualStudio7Generator.h       |    2 +-
 Source/cmGlobalVisualStudio8Generator.cxx     |   12 +-
 Source/cmGlobalVisualStudio8Generator.h       |    4 +-
 Source/cmGlobalVisualStudioGenerator.cxx      |   20 +--
 Source/cmGlobalXCodeGenerator.cxx             |  132 +++++++-------
 Source/cmGraphVizWriter.cxx                   |   18 +-
 Source/cmGraphVizWriter.h                     |    2 +-
 Source/cmIncludeExternalMSProjectCommand.cxx  |    2 +-
 Source/cmInstallCommand.cxx                   |   26 +--
 Source/cmInstallTargetGenerator.cxx           |   37 ++--
 Source/cmLinkLibrariesCommand.cxx             |    4 +-
 Source/cmLocalGenerator.cxx                   |   64 +++----
 Source/cmLocalGhsMultiGenerator.cxx           |    2 +-
 Source/cmLocalNinjaGenerator.cxx              |    2 +-
 Source/cmLocalUnixMakefileGenerator3.cxx      |   18 +-
 Source/cmLocalVisualStudio10Generator.cxx     |    2 +-
 Source/cmLocalVisualStudio6Generator.cxx      |  110 ++++++------
 Source/cmLocalVisualStudio7Generator.cxx      |   76 ++++----
 Source/cmLocalVisualStudioGenerator.cxx       |    4 +-
 Source/cmMakefile.cxx                         |   66 +++----
 Source/cmMakefile.h                           |   10 +-
 Source/cmMakefileLibraryTargetGenerator.cxx   |   42 ++---
 Source/cmMakefileTargetGenerator.cxx          |   24 +--
 Source/cmNinjaNormalTargetGenerator.cxx       |   51 +++---
 Source/cmNinjaTargetGenerator.cxx             |   30 ++--
 Source/cmStandardIncludes.h                   |    6 +
 Source/cmState.cxx                            |   27 +++
 Source/cmState.h                              |    8 +
 Source/cmTarget.cxx                           |  236 ++++++++++---------------
 Source/cmTarget.h                             |   29 ++-
 Source/cmTargetLinkLibrariesCommand.cxx       |   36 ++--
 Source/cmTargetLinkLibrariesCommand.h         |    2 +-
 Source/cmTargetPropCommandBase.cxx            |   14 +-
 Source/cmTestGenerator.cxx                    |    2 +-
 Source/cmVisualStudio10TargetGenerator.cxx    |  106 +++++------
 Source/cmake.cxx                              |    2 +-
 71 files changed, 939 insertions(+), 943 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list