Commit eac15298 authored by Stephen Kelly's avatar Stephen Kelly

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
parent 482b3811
......@@ -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;
}
......
......@@ -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)
......
......@@ -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);
}
......
......@@ -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();
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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];
......
......@@ -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;
......
......@@ -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")))
{
......
......@@ -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"))
{
......
......@@ -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.");
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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 =
......
......@@ -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:
</