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
This commit is contained in:
Stephen Kelly 2015-10-08 00:21:51 +02:00
parent 482b3811e4
commit eac15298a8
64 changed files with 823 additions and 818 deletions

View File

@ -174,8 +174,8 @@ bool cmAddExecutableCommand
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
} }
cmTarget::TargetType type = aliasedTarget->GetType(); cmState::TargetType type = aliasedTarget->GetType();
if(type != cmTarget::EXECUTABLE) if(type != cmState::EXECUTABLE)
{ {
std::ostringstream e; std::ostringstream e;
e << "cannot create ALIAS target \"" << exename e << "cannot create ALIAS target \"" << exename
@ -210,7 +210,7 @@ bool cmAddExecutableCommand
} }
// Create the imported target. // Create the imported target.
this->Makefile->AddImportedTarget(exename, cmTarget::EXECUTABLE, this->Makefile->AddImportedTarget(exename, cmState::EXECUTABLE,
importGlobal); importGlobal);
return true; return true;
} }

View File

@ -25,10 +25,10 @@ bool cmAddLibraryCommand
} }
// Library type defaults to value of BUILD_SHARED_LIBS, if it exists, // Library type defaults to value of BUILD_SHARED_LIBS, if it exists,
// otherwise it defaults to static library. // 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"))) if (cmSystemTools::IsOff(this->Makefile->GetDefinition("BUILD_SHARED_LIBS")))
{ {
type = cmTarget::STATIC_LIBRARY; type = cmState::STATIC_LIBRARY;
} }
bool excludeFromAll = false; bool excludeFromAll = false;
bool importTarget = false; bool importTarget = false;
@ -50,7 +50,7 @@ bool cmAddLibraryCommand
std::string libType = *s; std::string libType = *s;
if(libType == "STATIC") if(libType == "STATIC")
{ {
if (type == cmTarget::INTERFACE_LIBRARY) if (type == cmState::INTERFACE_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "INTERFACE library specified with conflicting STATIC type."; e << "INTERFACE library specified with conflicting STATIC type.";
@ -58,12 +58,12 @@ bool cmAddLibraryCommand
return false; return false;
} }
++s; ++s;
type = cmTarget::STATIC_LIBRARY; type = cmState::STATIC_LIBRARY;
haveSpecifiedType = true; haveSpecifiedType = true;
} }
else if(libType == "SHARED") else if(libType == "SHARED")
{ {
if (type == cmTarget::INTERFACE_LIBRARY) if (type == cmState::INTERFACE_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "INTERFACE library specified with conflicting SHARED type."; e << "INTERFACE library specified with conflicting SHARED type.";
@ -71,12 +71,12 @@ bool cmAddLibraryCommand
return false; return false;
} }
++s; ++s;
type = cmTarget::SHARED_LIBRARY; type = cmState::SHARED_LIBRARY;
haveSpecifiedType = true; haveSpecifiedType = true;
} }
else if(libType == "MODULE") else if(libType == "MODULE")
{ {
if (type == cmTarget::INTERFACE_LIBRARY) if (type == cmState::INTERFACE_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "INTERFACE library specified with conflicting MODULE type."; e << "INTERFACE library specified with conflicting MODULE type.";
@ -84,12 +84,12 @@ bool cmAddLibraryCommand
return false; return false;
} }
++s; ++s;
type = cmTarget::MODULE_LIBRARY; type = cmState::MODULE_LIBRARY;
haveSpecifiedType = true; haveSpecifiedType = true;
} }
else if(libType == "OBJECT") else if(libType == "OBJECT")
{ {
if (type == cmTarget::INTERFACE_LIBRARY) if (type == cmState::INTERFACE_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "INTERFACE library specified with conflicting OBJECT type."; e << "INTERFACE library specified with conflicting OBJECT type.";
@ -97,12 +97,12 @@ bool cmAddLibraryCommand
return false; return false;
} }
++s; ++s;
type = cmTarget::OBJECT_LIBRARY; type = cmState::OBJECT_LIBRARY;
haveSpecifiedType = true; haveSpecifiedType = true;
} }
else if(libType == "UNKNOWN") else if(libType == "UNKNOWN")
{ {
if (type == cmTarget::INTERFACE_LIBRARY) if (type == cmState::INTERFACE_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "INTERFACE library specified with conflicting UNKNOWN type."; e << "INTERFACE library specified with conflicting UNKNOWN type.";
@ -110,12 +110,12 @@ bool cmAddLibraryCommand
return false; return false;
} }
++s; ++s;
type = cmTarget::UNKNOWN_LIBRARY; type = cmState::UNKNOWN_LIBRARY;
haveSpecifiedType = true; haveSpecifiedType = true;
} }
else if(libType == "ALIAS") else if(libType == "ALIAS")
{ {
if (type == cmTarget::INTERFACE_LIBRARY) if (type == cmState::INTERFACE_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "INTERFACE library specified with conflicting ALIAS type."; e << "INTERFACE library specified with conflicting ALIAS type.";
@ -149,12 +149,12 @@ bool cmAddLibraryCommand
return false; return false;
} }
++s; ++s;
type = cmTarget::INTERFACE_LIBRARY; type = cmState::INTERFACE_LIBRARY;
haveSpecifiedType = true; haveSpecifiedType = true;
} }
else if(*s == "EXCLUDE_FROM_ALL") else if(*s == "EXCLUDE_FROM_ALL")
{ {
if (type == cmTarget::INTERFACE_LIBRARY) if (type == cmState::INTERFACE_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL."; e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL.";
@ -174,7 +174,7 @@ bool cmAddLibraryCommand
++s; ++s;
importGlobal = true; importGlobal = true;
} }
else if(type == cmTarget::INTERFACE_LIBRARY && *s == "GLOBAL") else if(type == cmState::INTERFACE_LIBRARY && *s == "GLOBAL")
{ {
std::ostringstream e; std::ostringstream e;
e << "GLOBAL option may only be used with IMPORTED libraries."; 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()) if (s != args.end())
{ {
@ -220,7 +220,7 @@ bool cmAddLibraryCommand
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037))
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
if(type != cmTarget::INTERFACE_LIBRARY) if(type != cmState::INTERFACE_LIBRARY)
{ {
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0037) << "\n"; e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0037) << "\n";
issueMessage = true; issueMessage = true;
@ -293,12 +293,12 @@ bool cmAddLibraryCommand
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
} }
cmTarget::TargetType aliasedType = aliasedTarget->GetType(); cmState::TargetType aliasedType = aliasedTarget->GetType();
if(aliasedType != cmTarget::SHARED_LIBRARY if(aliasedType != cmState::SHARED_LIBRARY
&& aliasedType != cmTarget::STATIC_LIBRARY && aliasedType != cmState::STATIC_LIBRARY
&& aliasedType != cmTarget::MODULE_LIBRARY && aliasedType != cmState::MODULE_LIBRARY
&& aliasedType != cmTarget::OBJECT_LIBRARY && aliasedType != cmState::OBJECT_LIBRARY
&& aliasedType != cmTarget::INTERFACE_LIBRARY) && aliasedType != cmState::INTERFACE_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "cannot create ALIAS target \"" << libName e << "cannot create ALIAS target \"" << libName
@ -328,19 +328,19 @@ bool cmAddLibraryCommand
CMAKE_${LANG}_CREATE_SHARED_LIBRARY is defined and if not default to 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 STATIC. But at this point we know only the name of the target, but not
yet its linker language. */ yet its linker language. */
if ((type == cmTarget::SHARED_LIBRARY || if ((type == cmState::SHARED_LIBRARY ||
type == cmTarget::MODULE_LIBRARY) && type == cmState::MODULE_LIBRARY) &&
(this->Makefile->GetState()->GetGlobalPropertyAsBool( (this->Makefile->GetState()->GetGlobalPropertyAsBool(
"TARGET_SUPPORTS_SHARED_LIBS") == false)) "TARGET_SUPPORTS_SHARED_LIBS") == false))
{ {
std::ostringstream w; std::ostringstream w;
w << w <<
"ADD_LIBRARY called with " << "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. " " option but the target platform does not support dynamic linking. "
"Building a STATIC library instead. This may lead to problems."; "Building a STATIC library instead. This may lead to problems.";
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
type = cmTarget::STATIC_LIBRARY; type = cmState::STATIC_LIBRARY;
} }
// Handle imported target creation. // Handle imported target creation.
@ -352,7 +352,7 @@ bool cmAddLibraryCommand
this->SetError("called with IMPORTED argument but no library type."); this->SetError("called with IMPORTED argument but no library type.");
return false; return false;
} }
if(type == cmTarget::OBJECT_LIBRARY) if(type == cmState::OBJECT_LIBRARY)
{ {
this->Makefile->IssueMessage( this->Makefile->IssueMessage(
cmake::FATAL_ERROR, cmake::FATAL_ERROR,
@ -360,7 +360,7 @@ bool cmAddLibraryCommand
); );
return true; return true;
} }
if(type == cmTarget::INTERFACE_LIBRARY) if(type == cmState::INTERFACE_LIBRARY)
{ {
if (!cmGeneratorExpression::IsValidTargetName(libName)) if (!cmGeneratorExpression::IsValidTargetName(libName))
{ {
@ -387,7 +387,7 @@ bool cmAddLibraryCommand
} }
// A non-imported target may not have UNKNOWN type. // A non-imported target may not have UNKNOWN type.
if(type == cmTarget::UNKNOWN_LIBRARY) if(type == cmState::UNKNOWN_LIBRARY)
{ {
this->Makefile->IssueMessage( this->Makefile->IssueMessage(
cmake::FATAL_ERROR, cmake::FATAL_ERROR,
@ -408,7 +408,7 @@ bool cmAddLibraryCommand
std::vector<std::string> srclists; std::vector<std::string> srclists;
if(type == cmTarget::INTERFACE_LIBRARY) if(type == cmState::INTERFACE_LIBRARY)
{ {
if (!cmGeneratorExpression::IsValidTargetName(libName) if (!cmGeneratorExpression::IsValidTargetName(libName)
|| libName.find("::") != std::string::npos) || libName.find("::") != std::string::npos)

View File

@ -395,7 +395,7 @@ void CCONV cmAddLibrary(void *arg, const char *libname, int shared,
srcs2.push_back(srcs[i]); srcs2.push_back(srcs[i]);
} }
mf->AddLibrary(libname, mf->AddLibrary(libname,
(shared? cmTarget::SHARED_LIBRARY : cmTarget::STATIC_LIBRARY), (shared? cmState::SHARED_LIBRARY : cmState::STATIC_LIBRARY),
srcs2); srcs2);
} }

View File

@ -396,7 +396,7 @@ cmCommonTargetGenerator::GetLinkedTargetDirectories() const
// We can ignore the INTERFACE_LIBRARY items because // We can ignore the INTERFACE_LIBRARY items because
// Target->GetLinkInformation already processed their // Target->GetLinkInformation already processed their
// link interface and they don't have any output themselves. // link interface and they don't have any output themselves.
&& linkee->GetType() != cmTarget::INTERFACE_LIBRARY && linkee->GetType() != cmState::INTERFACE_LIBRARY
&& emitted.insert(linkee).second) && emitted.insert(linkee).second)
{ {
cmLocalGenerator* lg = linkee->GetLocalGenerator(); cmLocalGenerator* lg = linkee->GetLocalGenerator();

View File

@ -270,7 +270,7 @@ cmComputeLinkDepends::Compute()
LinkEntry const& e = this->EntryList[i]; LinkEntry const& e = this->EntryList[i];
cmGeneratorTarget const* t = e.Target; cmGeneratorTarget const* t = e.Target;
// Entries that we know the linker will re-use do not need to be repeated. // 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) if(!uniquify || emmitted.insert(i).second)
{ {
this->FinalLinkEntries.push_back(e); this->FinalLinkEntries.push_back(e);
@ -367,7 +367,7 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe)
entry.Target->GetLinkInterface(this->Config, this->Target)) entry.Target->GetLinkInterface(this->Config, this->Target))
{ {
const bool isIface = const bool isIface =
entry.Target->GetType() == cmTarget::INTERFACE_LIBRARY; entry.Target->GetType() == cmState::INTERFACE_LIBRARY;
// This target provides its own link interface information. // This target provides its own link interface information.
this->AddLinkEntries(depender_index, iface->Libraries); this->AddLinkEntries(depender_index, iface->Libraries);

View File

@ -290,7 +290,7 @@ cmComputeLinkInformation
// the program that will load it. // the program that will load it.
this->LoaderFlag = 0; this->LoaderFlag = 0;
if(!this->UseImportLibrary && if(!this->UseImportLibrary &&
this->Target->GetType() == cmTarget::MODULE_LIBRARY) this->Target->GetType() == cmState::MODULE_LIBRARY)
{ {
std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_"; std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_";
loader_flag_var += this->LinkLanguage; loader_flag_var += this->LinkLanguage;
@ -308,10 +308,10 @@ cmComputeLinkInformation
// Get options needed to specify RPATHs. // Get options needed to specify RPATHs.
this->RuntimeUseChrpath = false; this->RuntimeUseChrpath = false;
if(this->Target->GetType() != cmTarget::STATIC_LIBRARY) if(this->Target->GetType() != cmState::STATIC_LIBRARY)
{ {
const char* tType = const char* tType =
((this->Target->GetType() == cmTarget::EXECUTABLE)? ((this->Target->GetType() == cmState::EXECUTABLE)?
"EXECUTABLE" : "SHARED_LIBRARY"); "EXECUTABLE" : "SHARED_LIBRARY");
std::string rtVar = "CMAKE_"; std::string rtVar = "CMAKE_";
rtVar += tType; rtVar += tType;
@ -480,10 +480,10 @@ cmComputeLinkInformation::GetSharedLibrariesLinked()
bool cmComputeLinkInformation::Compute() bool cmComputeLinkInformation::Compute()
{ {
// Skip targets that do not link. // Skip targets that do not link.
if(!(this->Target->GetType() == cmTarget::EXECUTABLE || if(!(this->Target->GetType() == cmState::EXECUTABLE ||
this->Target->GetType() == cmTarget::SHARED_LIBRARY || this->Target->GetType() == cmState::SHARED_LIBRARY ||
this->Target->GetType() == cmTarget::MODULE_LIBRARY || this->Target->GetType() == cmState::MODULE_LIBRARY ||
this->Target->GetType() == cmTarget::STATIC_LIBRARY)) this->Target->GetType() == cmState::STATIC_LIBRARY))
{ {
return false; return false;
} }
@ -544,7 +544,7 @@ bool cmComputeLinkInformation::Compute()
cmGeneratorTarget const* tgt = *i; cmGeneratorTarget const* tgt = *i;
bool implib = bool implib =
(this->UseImportLibrary && (this->UseImportLibrary &&
(tgt->GetType() == cmTarget::SHARED_LIBRARY)); (tgt->GetType() == cmState::SHARED_LIBRARY));
std::string lib = tgt->GetFullPath(this->Config , implib, true); std::string lib = tgt->GetFullPath(this->Config , implib, true);
this->OldLinkDirItems.push_back(lib); 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->Items.push_back(Item(linkItem, true, tgt));
this->Depends.push_back(exe); 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 // Add the interface library as an item so it can be considered as part
// of COMPATIBLE_INTERFACE_ enforcement. The generators will ignore // 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. // Decide whether to use an import library.
bool implib = bool implib =
(this->UseImportLibrary && (this->UseImportLibrary &&
(impexe || tgt->GetType() == cmTarget::SHARED_LIBRARY)); (impexe || tgt->GetType() == cmState::SHARED_LIBRARY));
// Pass the full path to the target file. // Pass the full path to the target file.
std::string lib = tgt->GetFullPath(config, implib, true); std::string lib = tgt->GetFullPath(config, implib, true);
if(!this->LinkDependsNoShared || if(!this->LinkDependsNoShared ||
tgt->GetType() != cmTarget::SHARED_LIBRARY) tgt->GetType() != cmState::SHARED_LIBRARY)
{ {
this->Depends.push_back(lib); 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 // The target will provide a full path. Make sure it is a shared
// library. // library.
if(tgt->GetType() != cmTarget::SHARED_LIBRARY) if(tgt->GetType() != cmState::SHARED_LIBRARY)
{ {
return; return;
} }
@ -818,9 +818,9 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
const char* target_type_str = 0; const char* target_type_str = 0;
switch(this->Target->GetType()) switch(this->Target->GetType())
{ {
case cmTarget::EXECUTABLE: target_type_str = "EXE"; break; case cmState::EXECUTABLE: target_type_str = "EXE"; break;
case cmTarget::SHARED_LIBRARY: target_type_str = "SHARED_LIBRARY"; break; case cmState::SHARED_LIBRARY: target_type_str = "SHARED_LIBRARY"; break;
case cmTarget::MODULE_LIBRARY: target_type_str = "SHARED_MODULE"; break; case cmState::MODULE_LIBRARY: target_type_str = "SHARED_MODULE"; break;
default: break; default: break;
} }
if(target_type_str) 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 // shared and static libraries but static-mode can handle only
// static libraries. If a previous user item changed the link type // static libraries. If a previous user item changed the link type
// to static we need to make sure it is back to shared. // 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); this->SetCurrentLinkType(LinkShared);
} }
// Keep track of shared library targets linked. // Keep track of shared library targets linked.
if(target->GetType() == cmTarget::SHARED_LIBRARY) if(target->GetType() == cmState::SHARED_LIBRARY)
{ {
this->SharedLibrariesLinked.insert(target); 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 // Libraries with unknown type must be handled using just the file
// on disk. // on disk.
if(target->GetType() == cmTarget::UNKNOWN_LIBRARY) if(target->GetType() == cmState::UNKNOWN_LIBRARY)
{ {
this->AddLibraryRuntimeInfo(fullPath); this->AddLibraryRuntimeInfo(fullPath);
return; return;
} }
// Skip targets that are not shared libraries (modules cannot be linked). // Skip targets that are not shared libraries (modules cannot be linked).
if(target->GetType() != cmTarget::SHARED_LIBRARY) if(target->GetType() != cmState::SHARED_LIBRARY)
{ {
return; return;
} }

View File

@ -207,7 +207,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
{ {
// Get the depender. // Get the depender.
cmGeneratorTarget const* depender = this->Targets[depender_index]; cmGeneratorTarget const* depender = this->Targets[depender_index];
if (depender->GetType() == cmTarget::INTERFACE_LIBRARY) if (depender->GetType() == cmState::INTERFACE_LIBRARY)
{ {
return; return;
} }
@ -236,10 +236,10 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
std::string objLib = (*oi)->GetObjectLibrary(); std::string objLib = (*oi)->GetObjectLibrary();
if (!objLib.empty() && emitted.insert(objLib).second) if (!objLib.empty() && emitted.insert(objLib).second)
{ {
if(depender->GetType() != cmTarget::EXECUTABLE && if(depender->GetType() != cmState::EXECUTABLE &&
depender->GetType() != cmTarget::STATIC_LIBRARY && depender->GetType() != cmState::STATIC_LIBRARY &&
depender->GetType() != cmTarget::SHARED_LIBRARY && depender->GetType() != cmState::SHARED_LIBRARY &&
depender->GetType() != cmTarget::MODULE_LIBRARY) depender->GetType() != cmState::MODULE_LIBRARY)
{ {
this->GlobalGenerator->GetCMakeInstance() this->GlobalGenerator->GetCMakeInstance()
->IssueMessage(cmake::FATAL_ERROR, ->IssueMessage(cmake::FATAL_ERROR,
@ -324,7 +324,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
// name conflict between an external library and an executable // name conflict between an external library and an executable
// within the project. // within the project.
if(dependee && if(dependee &&
dependee->GetType() == cmTarget::EXECUTABLE && dependee->GetType() == cmState::EXECUTABLE &&
!dependee->Target->IsExecutableWithExports()) !dependee->Target->IsExecutableWithExports())
{ {
dependee = 0; dependee = 0;
@ -357,7 +357,7 @@ void cmComputeTargetDepends::AddTargetDepend(
cmGeneratorTarget const* dependee = dependee_name.Target; cmGeneratorTarget const* dependee = dependee_name.Target;
if(!dependee && !linking && if(!dependee && !linking &&
(depender->GetType() != cmTarget::GLOBAL_TARGET)) (depender->GetType() != cmState::GLOBAL_TARGET))
{ {
cmake::MessageType messageType = cmake::AUTHOR_WARNING; cmake::MessageType messageType = cmake::AUTHOR_WARNING;
bool issueMessage = false; bool issueMessage = false;
@ -400,7 +400,7 @@ void cmComputeTargetDepends::AddTargetDepend(
// name conflict between an external library and an executable // name conflict between an external library and an executable
// within the project. // within the project.
if(linking && dependee && if(linking && dependee &&
dependee->GetType() == cmTarget::EXECUTABLE && dependee->GetType() == cmState::EXECUTABLE &&
!dependee->Target->IsExecutableWithExports()) !dependee->Target->IsExecutableWithExports())
{ {
dependee = 0; dependee = 0;
@ -418,7 +418,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
bool linking) bool linking)
{ {
if(dependee->Target->IsImported() || if(dependee->Target->IsImported() ||
dependee->GetType() == cmTarget::INTERFACE_LIBRARY) dependee->GetType() == cmState::INTERFACE_LIBRARY)
{ {
// Skip IMPORTED and INTERFACE targets but follow their utility // Skip IMPORTED and INTERFACE targets but follow their utility
// dependencies. // dependencies.
@ -523,7 +523,7 @@ cmComputeTargetDepends
// Make sure the component is all STATIC_LIBRARY targets. // Make sure the component is all STATIC_LIBRARY targets.
for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) 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); this->ComplainAboutBadComponent(ccg, c);
return false; return false;
@ -555,7 +555,7 @@ cmComputeTargetDepends
// Describe the depender. // Describe the depender.
e << " \"" << depender->GetName() << "\" of type " e << " \"" << depender->GetName() << "\" of type "
<< cmTarget::GetTargetTypeName( << cmTarget::GetTargetTypeName(
(cmTarget::TargetType)depender->GetType()) << "\n"; (cmState::TargetType)depender->GetType()) << "\n";
// List its dependencies that are inside the component. // List its dependencies that are inside the component.
EdgeList const& nl = this->InitialGraph[i]; EdgeList const& nl = this->InitialGraph[i];

View File

@ -93,12 +93,12 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
{ {
switch(tgt->GetType()) switch(tgt->GetType())
{ {
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
case cmTarget::INTERFACE_LIBRARY: case cmState::INTERFACE_LIBRARY:
case cmTarget::UNKNOWN_LIBRARY: case cmState::UNKNOWN_LIBRARY:
break; break;
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
if (tgt->IsExecutableWithExports()) if (tgt->IsExecutableWithExports())
{ {
break; break;

View File

@ -44,7 +44,7 @@ std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
std::string const& argv0 = this->CC.GetCommandLines()[c][0]; std::string const& argv0 = this->CC.GetCommandLines()[c][0];
cmGeneratorTarget* target = cmGeneratorTarget* target =
this->LG->FindGeneratorTargetToUse(argv0); this->LG->FindGeneratorTargetToUse(argv0);
if(target && target->GetType() == cmTarget::EXECUTABLE && if(target && target->GetType() == cmState::EXECUTABLE &&
(target->Target->IsImported() (target->Target->IsImported()
|| !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING"))) || !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")))
{ {

View File

@ -59,7 +59,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
this->LG->GetMakefile()->GetBacktrace()); this->LG->GetMakefile()->GetBacktrace());
return false; return false;
} }
if (te->GetType() == cmTarget::INTERFACE_LIBRARY) if (te->GetType() == cmState::INTERFACE_LIBRARY)
{ {
this->GenerateRequiredCMakeVersion(os, "3.0.0"); this->GenerateRequiredCMakeVersion(os, "3.0.0");
} }
@ -146,14 +146,14 @@ cmExportBuildFileGenerator
cmGeneratorTarget* target = *tei; cmGeneratorTarget* target = *tei;
ImportPropertyMap properties; ImportPropertyMap properties;
if (target->GetType() != cmTarget::INTERFACE_LIBRARY) if (target->GetType() != cmState::INTERFACE_LIBRARY)
{ {
this->SetImportLocationProperty(config, suffix, target, properties); this->SetImportLocationProperty(config, suffix, target, properties);
} }
if(!properties.empty()) if(!properties.empty())
{ {
// Get the rest of the target details. // Get the rest of the target details.
if (target->GetType() != cmTarget::INTERFACE_LIBRARY) if (target->GetType() != cmState::INTERFACE_LIBRARY)
{ {
this->SetImportDetailProperties(config, suffix, this->SetImportDetailProperties(config, suffix,
target, target,
@ -216,7 +216,7 @@ cmExportBuildFileGenerator
// Add the import library for windows DLLs. // Add the import library for windows DLLs.
if(dll_platform && if(dll_platform &&
(target->GetType() == cmTarget::SHARED_LIBRARY || (target->GetType() == cmState::SHARED_LIBRARY ||
target->Target->IsExecutableWithExports()) && target->Target->IsExecutableWithExports()) &&
mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"))
{ {

View File

@ -168,7 +168,7 @@ bool cmExportCommand
if(cmTarget* target = gg->FindTarget(*currentTarget)) if(cmTarget* target = gg->FindTarget(*currentTarget))
{ {
if(target->GetType() == cmTarget::OBJECT_LIBRARY) if(target->GetType() == cmState::OBJECT_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "given OBJECT library \"" << *currentTarget e << "given OBJECT library \"" << *currentTarget
@ -176,7 +176,7 @@ bool cmExportCommand
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
} }
if (target->GetType() == cmTarget::UTILITY) if (target->GetType() == cmState::UTILITY)
{ {
this->SetError("given custom target \"" + *currentTarget this->SetError("given custom target \"" + *currentTarget
+ "\" which may not be exported."); + "\" which may not be exported.");

View File

@ -597,7 +597,7 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
getPropertyContents(gtarget, "COMPATIBLE_INTERFACE_NUMBER_MAX", getPropertyContents(gtarget, "COMPATIBLE_INTERFACE_NUMBER_MAX",
ifaceProperties); ifaceProperties);
if (target->GetType() != cmTarget::INTERFACE_LIBRARY) if (target->GetType() != cmState::INTERFACE_LIBRARY)
{ {
getCompatibleInterfaceProperties(gtarget, ifaceProperties, ""); getCompatibleInterfaceProperties(gtarget, ifaceProperties, "");
@ -885,8 +885,8 @@ cmExportFileGenerator
cmMakefile* mf = target->Makefile; cmMakefile* mf = target->Makefile;
// Add the soname for unix shared libraries. // Add the soname for unix shared libraries.
if(target->GetType() == cmTarget::SHARED_LIBRARY || if(target->GetType() == cmState::SHARED_LIBRARY ||
target->GetType() == cmTarget::MODULE_LIBRARY) target->GetType() == cmState::MODULE_LIBRARY)
{ {
// Check whether this is a DLL platform. // Check whether this is a DLL platform.
bool dll_platform = bool dll_platform =
@ -1059,22 +1059,22 @@ cmExportFileGenerator
os << "# Create imported target " << targetName << "\n"; os << "# Create imported target " << targetName << "\n";
switch(target->GetType()) switch(target->GetType())
{ {
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
os << "add_executable(" << targetName << " IMPORTED)\n"; os << "add_executable(" << targetName << " IMPORTED)\n";
break; break;
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
os << "add_library(" << targetName << " STATIC IMPORTED)\n"; os << "add_library(" << targetName << " STATIC IMPORTED)\n";
break; break;
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
os << "add_library(" << targetName << " SHARED IMPORTED)\n"; os << "add_library(" << targetName << " SHARED IMPORTED)\n";
break; break;
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
os << "add_library(" << targetName << " MODULE IMPORTED)\n"; os << "add_library(" << targetName << " MODULE IMPORTED)\n";
break; break;
case cmTarget::UNKNOWN_LIBRARY: case cmState::UNKNOWN_LIBRARY:
os << "add_library(" << targetName << " UNKNOWN IMPORTED)\n"; os << "add_library(" << targetName << " UNKNOWN IMPORTED)\n";
break; break;
case cmTarget::INTERFACE_LIBRARY: case cmState::INTERFACE_LIBRARY:
os << "add_library(" << targetName << " INTERFACE IMPORTED)\n"; os << "add_library(" << targetName << " INTERFACE IMPORTED)\n";
break; break;
default: // should never happen default: // should never happen

View File

@ -134,7 +134,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
cmTarget* te = (*tei)->Target; cmTarget* te = (*tei)->Target;
requiresConfigFiles = requiresConfigFiles requiresConfigFiles = requiresConfigFiles
|| te->GetType() != cmTarget::INTERFACE_LIBRARY; || te->GetType() != cmState::INTERFACE_LIBRARY;
this->GenerateImportTargetCode(os, te); this->GenerateImportTargetCode(os, te);
@ -180,7 +180,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
require2_8_12 = true; require2_8_12 = true;
} }
} }
if (te->GetType() == cmTarget::INTERFACE_LIBRARY) if (te->GetType() == cmState::INTERFACE_LIBRARY)
{ {
require3_0_0 = true; require3_0_0 = true;
} }
@ -337,7 +337,7 @@ cmExportInstallFileGenerator
{ {
// Collect import properties for this target. // Collect import properties for this target.
cmTargetExport const* te = *tei; cmTargetExport const* te = *tei;
if (te->Target->GetType() == cmTarget::INTERFACE_LIBRARY) if (te->Target->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }

View File

@ -96,8 +96,8 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
cmTarget const& target = l->second; cmTarget const& target = l->second;
// Skip non-library targets. // Skip non-library targets.
if(target.GetType() < cmTarget::STATIC_LIBRARY if(target.GetType() < cmState::STATIC_LIBRARY
|| target.GetType() > cmTarget::MODULE_LIBRARY) || target.GetType() > cmState::MODULE_LIBRARY)
{ {
continue; continue;
} }

View File

@ -73,7 +73,7 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
cmTarget dummyHead; cmTarget dummyHead;
dummyHead.SetType(cmTarget::EXECUTABLE, "try_compile_dummy_exe"); dummyHead.SetType(cmState::EXECUTABLE, "try_compile_dummy_exe");
dummyHead.SetMakefile(tgt->GetMakefile()); dummyHead.SetMakefile(tgt->GetMakefile());
cmGeneratorTarget* gtgt = cmGeneratorTarget* gtgt =

View File

@ -326,7 +326,7 @@ void cmExtraCodeBlocksGenerator
{ {
switch(ti->second.GetType()) switch(ti->second.GetType())
{ {
case cmTarget::GLOBAL_TARGET: case cmState::GLOBAL_TARGET:
{ {
// Only add the global targets from CMAKE_BINARY_DIR, // Only add the global targets from CMAKE_BINARY_DIR,
// not from the subdirs // not from the subdirs
@ -338,7 +338,7 @@ void cmExtraCodeBlocksGenerator
} }
} }
break; break;
case cmTarget::UTILITY: case cmState::UTILITY:
// Add all utility targets, except the Nightly/Continuous/ // Add all utility targets, except the Nightly/Continuous/
// Experimental-"sub"targets as e.g. NightlyStart // Experimental-"sub"targets as e.g. NightlyStart
if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly")) if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly"))
@ -352,11 +352,11 @@ void cmExtraCodeBlocksGenerator
this->AppendTarget(fout, ti->first, 0, this->AppendTarget(fout, ti->first, 0,
make.c_str(), *lg, compiler.c_str()); make.c_str(), *lg, compiler.c_str());
break; break;
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
{ {
this->AppendTarget(fout, ti->first, &ti->second, this->AppendTarget(fout, ti->first, &ti->second,
make.c_str(), *lg, compiler.c_str()); make.c_str(), *lg, compiler.c_str());
@ -392,12 +392,12 @@ void cmExtraCodeBlocksGenerator
{ {
switch(ti->second.GetType()) switch(ti->second.GetType())
{ {
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
case cmTarget::UTILITY: // can have sources since 2.6.3 case cmState::UTILITY: // can have sources since 2.6.3
{ {
std::vector<cmSourceFile*> sources; std::vector<cmSourceFile*> sources;
cmGeneratorTarget* gt = cmGeneratorTarget* gt =
@ -561,7 +561,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
{ {
int cbTargetType = this->GetCBTargetType(target); int cbTargetType = this->GetCBTargetType(target);
std::string workingDir = lg->GetCurrentBinaryDirectory(); 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 // Determine the directory where the executable target is created, and
// set the working directory to this dir. // 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 buildType = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
std::string location; std::string location;
if ( target->GetType()==cmTarget::OBJECT_LIBRARY) if ( target->GetType()==cmState::OBJECT_LIBRARY)
{ {
location = this->CreateDummyTargetFile(const_cast<cmLocalGenerator*>(lg), location = this->CreateDummyTargetFile(const_cast<cmLocalGenerator*>(lg),
target); target);
@ -724,7 +724,7 @@ std::string cmExtraCodeBlocksGenerator::GetCBCompilerId(const cmMakefile* mf)
// Translate the cmake target type into the CodeBlocks target type id // Translate the cmake target type into the CodeBlocks target type id
int cmExtraCodeBlocksGenerator::GetCBTargetType(cmTarget* target) int cmExtraCodeBlocksGenerator::GetCBTargetType(cmTarget* target)
{ {
if ( target->GetType()==cmTarget::EXECUTABLE) if ( target->GetType()==cmState::EXECUTABLE)
{ {
if ((target->GetPropertyAsBool("WIN32_EXECUTABLE")) if ((target->GetPropertyAsBool("WIN32_EXECUTABLE"))
|| (target->GetPropertyAsBool("MACOSX_BUNDLE"))) || (target->GetPropertyAsBool("MACOSX_BUNDLE")))
@ -736,13 +736,13 @@ int cmExtraCodeBlocksGenerator::GetCBTargetType(cmTarget* target)
return 1; return 1;
} }
} }
else if (( target->GetType()==cmTarget::STATIC_LIBRARY) else if (( target->GetType()==cmState::STATIC_LIBRARY)
|| (target->GetType()==cmTarget::OBJECT_LIBRARY)) || (target->GetType()==cmState::OBJECT_LIBRARY))
{ {
return 2; return 2;
} }
else if ((target->GetType()==cmTarget::SHARED_LIBRARY) else if ((target->GetType()==cmState::SHARED_LIBRARY)
|| (target->GetType()==cmTarget::MODULE_LIBRARY)) || (target->GetType()==cmState::MODULE_LIBRARY))
{ {
return 3; return 3;
} }

View File

@ -162,22 +162,22 @@ void cmExtraCodeLiteGenerator
switch(ti->second.GetType()) switch(ti->second.GetType())
{ {
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
{ {
projectType = "Executable"; projectType = "Executable";
} }
break; break;
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
{ {
projectType = "Static Library"; projectType = "Static Library";
} }
break; break;
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
{ {
projectType = "Dynamic Library"; projectType = "Dynamic Library";
} }
break; break;
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
{ {
projectType = "Dynamic Library"; projectType = "Dynamic Library";
} }
@ -188,10 +188,10 @@ void cmExtraCodeLiteGenerator
switch(ti->second.GetType()) switch(ti->second.GetType())
{ {
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
{ {
std::vector<cmSourceFile*> sources; std::vector<cmSourceFile*> sources;
cmGeneratorTarget* gt = cmGeneratorTarget* gt =

View File

@ -544,13 +544,13 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
linkName2 += "/"; linkName2 += "/";
switch(ti->second.GetType()) switch(ti->second.GetType())
{ {
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
{ {
const char* prefix = (ti->second.GetType()==cmTarget::EXECUTABLE ? const char* prefix = (ti->second.GetType()==cmState::EXECUTABLE ?
"[exe] " : "[lib] "); "[exe] " : "[lib] ");
linkName2 += prefix; linkName2 += prefix;
linkName2 += ti->first; linkName2 += ti->first;
@ -1046,7 +1046,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
{ {
switch(ti->second.GetType()) switch(ti->second.GetType())
{ {
case cmTarget::GLOBAL_TARGET: case cmState::GLOBAL_TARGET:
{ {
// Only add the global targets from CMAKE_BINARY_DIR, // Only add the global targets from CMAKE_BINARY_DIR,
// not from the subdirs // not from the subdirs
@ -1056,7 +1056,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
} }
} }
break; break;
case cmTarget::UTILITY: case cmState::UTILITY:
// Add all utility targets, except the Nightly/Continuous/ // Add all utility targets, except the Nightly/Continuous/
// Experimental-"sub"targets as e.g. NightlyStart // Experimental-"sub"targets as e.g. NightlyStart
if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly")) 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, ": "); this->AppendTarget(fout, ti->first, make, makeArgs, subdir, ": ");
break; break;
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
{ {
const char* prefix = (ti->second.GetType()==cmTarget::EXECUTABLE ? const char* prefix = (ti->second.GetType()==cmState::EXECUTABLE ?
"[exe] " : "[lib] "); "[exe] " : "[lib] ");
this->AppendTarget(fout, ti->first, make, makeArgs, subdir, prefix); this->AppendTarget(fout, ti->first, make, makeArgs, subdir, prefix);
std::string fastTarget = ti->first; std::string fastTarget = ti->first;

View File

@ -128,7 +128,7 @@ cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg,
{ {
switch(ti->second.GetType()) switch(ti->second.GetType())
{ {
case cmTarget::GLOBAL_TARGET: case cmState::GLOBAL_TARGET:
{ {
bool insertTarget = false; bool insertTarget = false;
// Only add the global targets from CMAKE_BINARY_DIR, // Only add the global targets from CMAKE_BINARY_DIR,
@ -159,7 +159,7 @@ cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg,
} }
} }
break; break;
case cmTarget::UTILITY: case cmState::UTILITY:
// Add all utility targets, except the Nightly/Continuous/ // Add all utility targets, except the Nightly/Continuous/
// Experimental-"sub"targets as e.g. NightlyStart // Experimental-"sub"targets as e.g. NightlyStart
if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly")) 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, this->AppendTarget(fout, ti->first, make, makeArgs,
currentDir, homeOutputDir); currentDir, homeOutputDir);
break; break;
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
{ {
this->AppendTarget(fout, ti->first, make, makeArgs, this->AppendTarget(fout, ti->first, make, makeArgs,
currentDir, homeOutputDir); currentDir, homeOutputDir);

View File

@ -168,7 +168,7 @@ void cmExtraSublimeTextGenerator::
{ {
switch(ti->second.GetType()) switch(ti->second.GetType())
{ {
case cmTarget::GLOBAL_TARGET: case cmState::GLOBAL_TARGET:
{ {
// Only add the global targets from CMAKE_BINARY_DIR, // Only add the global targets from CMAKE_BINARY_DIR,
// not from the subdirs // not from the subdirs
@ -181,7 +181,7 @@ void cmExtraSublimeTextGenerator::
} }
} }
break; break;
case cmTarget::UTILITY: case cmState::UTILITY:
// Add all utility targets, except the Nightly/Continuous/ // Add all utility targets, except the Nightly/Continuous/
// Experimental-"sub"targets as e.g. NightlyStart // Experimental-"sub"targets as e.g. NightlyStart
if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly")) if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly"))
@ -196,11 +196,11 @@ void cmExtraSublimeTextGenerator::
make.c_str(), makefile, compiler.c_str(), make.c_str(), makefile, compiler.c_str(),
sourceFileFlags, false); sourceFileFlags, false);
break; break;
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
{ {
this->AppendTarget(fout, ti->first, *lg, &ti->second, this->AppendTarget(fout, ti->first, *lg, &ti->second,
make.c_str(), makefile, compiler.c_str(), make.c_str(), makefile, compiler.c_str(),

View File

@ -1144,7 +1144,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
if (!prop) if (!prop)
{ {
if (target->IsImported() if (target->IsImported()
|| target->GetType() == cmTarget::INTERFACE_LIBRARY) || target->GetType() == cmState::INTERFACE_LIBRARY)
{ {
return linkedTargetsContent; return linkedTargetsContent;
} }
@ -1284,7 +1284,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
reportError(context, content->GetOriginalExpression(), e.str()); reportError(context, content->GetOriginalExpression(), e.str());
return std::string(); return std::string();
} }
if (gt->GetType() != cmTarget::OBJECT_LIBRARY) if (gt->GetType() != cmState::OBJECT_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "Objects of target \"" << tgtName e << "Objects of target \"" << tgtName
@ -1592,7 +1592,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactSonameTag>
"for DLL target platforms."); "for DLL target platforms.");
return std::string(); return std::string();
} }
if(target->GetType() != cmTarget::SHARED_LIBRARY) if(target->GetType() != cmState::SHARED_LIBRARY)
{ {
::reportError(context, content->GetOriginalExpression(), ::reportError(context, content->GetOriginalExpression(),
"TARGET_SONAME_FILE is allowed only for " "TARGET_SONAME_FILE is allowed only for "
@ -1632,11 +1632,11 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
return std::string(); return std::string();
} }
cmTarget::TargetType targetType = (cmTarget::TargetType)target->GetType(); cmState::TargetType targetType = (cmState::TargetType)target->GetType();
if(targetType != cmTarget::SHARED_LIBRARY && if(targetType != cmState::SHARED_LIBRARY &&
targetType != cmTarget::MODULE_LIBRARY && targetType != cmState::MODULE_LIBRARY &&
targetType != cmTarget::EXECUTABLE) targetType != cmState::EXECUTABLE)
{ {
::reportError(context, content->GetOriginalExpression(), ::reportError(context, content->GetOriginalExpression(),
"TARGET_PDB_FILE is allowed only for " "TARGET_PDB_FILE is allowed only for "
@ -1746,8 +1746,8 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
"No target \"" + name + "\""); "No target \"" + name + "\"");
return std::string(); return std::string();
} }
if(target->GetType() >= cmTarget::OBJECT_LIBRARY && if(target->GetType() >= cmState::OBJECT_LIBRARY &&
target->GetType() != cmTarget::UNKNOWN_LIBRARY) target->GetType() != cmState::UNKNOWN_LIBRARY)
{ {
::reportError(context, content->GetOriginalExpression(), ::reportError(context, content->GetOriginalExpression(),
"Target \"" + name + "\" is not an executable or library."); "Target \"" + name + "\" is not an executable or library.");

View File

@ -155,7 +155,7 @@ struct TagVisitor
: Data(data), Target(target), : Data(data), Target(target),
GlobalGenerator(target->GetLocalGenerator()->GetGlobalGenerator()), GlobalGenerator(target->GetLocalGenerator()->GetGlobalGenerator()),
Header(CM_HEADER_REGEX), 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); 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); DoAccept<IsSameTag<Tag, ExtraSourcesTag>::Result>::Do(this->Data, sf);
} }
@ -345,7 +345,7 @@ const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const
{ {
switch(this->GetType()) switch(this->GetType())
{ {
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
if(this->Target->IsDLLPlatform()) if(this->Target->IsDLLPlatform())
{ {
if(implib) if(implib)
@ -365,10 +365,10 @@ const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const
// library targets. // library targets.
return "LIBRARY"; return "LIBRARY";
} }
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
// Static libraries are always treated as archive targets. // Static libraries are always treated as archive targets.
return "ARCHIVE"; return "ARCHIVE";
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
if(implib) if(implib)
{ {
// Module libraries are always treated as library targets. // 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. // Module import libraries are treated as archive targets.
return "LIBRARY"; return "LIBRARY";
} }
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
if(implib) if(implib)
{ {
// Executable import libraries are treated as archive targets. // Executable import libraries are treated as archive targets.
@ -852,7 +852,7 @@ const char* cmGeneratorTarget::GetLocationForBuild() const
bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir, bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
const std::string& config) const const std::string& config) const
{ {
assert(this->GetType() != cmTarget::INTERFACE_LIBRARY); assert(this->GetType() != cmState::INTERFACE_LIBRARY);
std::string config_upper; std::string config_upper;
if(!config.empty()) if(!config.empty())
{ {
@ -1042,7 +1042,7 @@ static bool processSources(cmGeneratorTarget const* tgt,
void cmGeneratorTarget::GetSourceFiles(std::vector<std::string> &files, void cmGeneratorTarget::GetSourceFiles(std::vector<std::string> &files,
const std::string& config) const const std::string& config) const
{ {
assert(this->GetType() != cmTarget::INTERFACE_LIBRARY); assert(this->GetType() != cmState::INTERFACE_LIBRARY);
if (!this->Makefile->GetGlobalGenerator()->GetConfigureDoneCMP0026()) 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, // soname is supported only for shared libraries and modules,
// and then only when the platform supports an soname flag. // 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->GetPropertyAsBool("NO_SONAME") &&
this->Makefile->GetSONameFlag(this->GetLinkerLanguage(config))); 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 // Only executables and shared libraries can have an rpath and may
// need relinking. // need relinking.
if(this->GetType() != cmTarget::EXECUTABLE && if(this->GetType() != cmState::EXECUTABLE &&
this->GetType() != cmTarget::SHARED_LIBRARY && this->GetType() != cmState::SHARED_LIBRARY &&
this->GetType() != cmTarget::MODULE_LIBRARY) this->GetType() != cmState::MODULE_LIBRARY)
{ {
return false; return false;
} }
@ -1296,9 +1296,9 @@ cmGeneratorTarget::NeedRelinkBeforeInstall(const std::string& config) const
bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const
{ {
// Only certain target types have an rpath. // Only certain target types have an rpath.
if(!(this->GetType() == cmTarget::SHARED_LIBRARY || if(!(this->GetType() == cmState::SHARED_LIBRARY ||
this->GetType() == cmTarget::MODULE_LIBRARY || this->GetType() == cmState::MODULE_LIBRARY ||
this->GetType() == cmTarget::EXECUTABLE)) this->GetType() == cmState::EXECUTABLE))
{ {
return false; return false;
} }
@ -1363,7 +1363,7 @@ bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const
bool cmGeneratorTarget::IsImportedSharedLibWithoutSOName( bool cmGeneratorTarget::IsImportedSharedLibWithoutSOName(
const std::string& config) const 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)) if(cmTarget::ImportInfo const* info = this->Target->GetImportInfo(config))
{ {
@ -1382,7 +1382,7 @@ bool cmGeneratorTarget::HasMacOSXRpathInstallNameDir(
if(!this->IsImported()) if(!this->IsImported())
{ {
if(this->GetType() != cmTarget::SHARED_LIBRARY) if(this->GetType() != cmState::SHARED_LIBRARY)
{ {
return false; return false;
} }
@ -1960,12 +1960,12 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
return 0; return 0;
} }
if(this->GetType() > cmTarget::OBJECT_LIBRARY) if(this->GetType() > cmState::OBJECT_LIBRARY)
{ {
std::string msg = "cmTarget::GetCompileInfo called for "; std::string msg = "cmTarget::GetCompileInfo called for ";
msg += this->GetName(); msg += this->GetName();
msg += " which has type "; 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); this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
return 0; return 0;
} }
@ -2155,7 +2155,7 @@ cmTargetTraceDependencies
this->CurrentEntry = 0; this->CurrentEntry = 0;
// Queue all the source files already specified for the target. // 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; std::vector<std::string> configs;
this->Makefile->GetConfigurations(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. // the fact that the name matched a target was just a coincidence.
if(cmSystemTools::FileIsFullPath(dep.c_str())) if(cmSystemTools::FileIsFullPath(dep.c_str()))
{ {
if(t->GetType() >= cmTarget::EXECUTABLE && if(t->GetType() >= cmState::EXECUTABLE &&
t->GetType() <= cmTarget::MODULE_LIBRARY) t->GetType() <= cmState::MODULE_LIBRARY)
{ {
// This is really only for compatibility so we do not need to // This is really only for compatibility so we do not need to
// worry about configuration names and output names. // worry about configuration names and output names.
@ -2362,7 +2362,7 @@ cmTargetTraceDependencies
// Check for a target with this name. // Check for a target with this name.
if(cmTarget* t = this->Makefile->FindTargetToUse(command)) 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 // The command refers to an executable target built in
// this project. Add the target-level dependency to make // 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" // would find nothing anyway, but when building CMake itself the "install"
// target command ends up referencing the "cmake" target but we do not // target command ends up referencing the "cmake" target but we do not
// really want the dependency because "install" depend on "all" anyway. // really want the dependency because "install" depend on "all" anyway.
if(this->GetType() == cmTarget::GLOBAL_TARGET) if(this->GetType() == cmState::GLOBAL_TARGET)
{ {
return; return;
} }
@ -2498,7 +2498,7 @@ cmGeneratorTarget::GetCreateRuleVariable(std::string const& lang,
{ {
switch(this->GetType()) switch(this->GetType())
{ {
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
{ {
std::string var = "CMAKE_" + lang + "_CREATE_STATIC_LIBRARY"; std::string var = "CMAKE_" + lang + "_CREATE_STATIC_LIBRARY";
if(this->GetFeatureAsBool( if(this->GetFeatureAsBool(
@ -2512,11 +2512,11 @@ cmGeneratorTarget::GetCreateRuleVariable(std::string const& lang,
} }
return var; return var;
} }
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
return "CMAKE_" + lang + "_CREATE_SHARED_LIBRARY"; return "CMAKE_" + lang + "_CREATE_SHARED_LIBRARY";
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
return "CMAKE_" + lang + "_CREATE_SHARED_MODULE"; return "CMAKE_" + lang + "_CREATE_SHARED_MODULE";
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
return "CMAKE_" + lang + "_LINK_EXECUTABLE"; return "CMAKE_" + lang + "_LINK_EXECUTABLE";
default: default:
break; break;
@ -3041,13 +3041,13 @@ void cmGeneratorTarget::ComputeTargetManifest(
std::string realName; std::string realName;
std::string impName; std::string impName;
std::string pdbName; std::string pdbName;
if(this->GetType() == cmTarget::EXECUTABLE) if(this->GetType() == cmState::EXECUTABLE)
{ {
this->GetExecutableNames(name, realName, impName, pdbName, config); this->GetExecutableNames(name, realName, impName, pdbName, config);
} }
else if(this->GetType() == cmTarget::STATIC_LIBRARY || else if(this->GetType() == cmState::STATIC_LIBRARY ||
this->GetType() == cmTarget::SHARED_LIBRARY || this->GetType() == cmState::SHARED_LIBRARY ||
this->GetType() == cmTarget::MODULE_LIBRARY) this->GetType() == cmState::MODULE_LIBRARY)
{ {
this->GetLibraryNames(name, soName, realName, impName, pdbName, this->GetLibraryNames(name, soName, realName, impName, pdbName,
config); config);
@ -3155,7 +3155,7 @@ cmGeneratorTarget::NormalGetRealName(const std::string& config) const
this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg); 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. // Compute the real name that will be built.
std::string name; std::string name;
@ -3255,8 +3255,8 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name,
} }
// The import library name. // The import library name.
if(this->GetType() == cmTarget::SHARED_LIBRARY || if(this->GetType() == cmState::SHARED_LIBRARY ||
this->GetType() == cmTarget::MODULE_LIBRARY) this->GetType() == cmState::MODULE_LIBRARY)
{ {
impName = this->GetFullNameInternal(config, true); impName = this->GetFullNameInternal(config, true);
} }
@ -3294,7 +3294,7 @@ void cmGeneratorTarget::GetExecutableNames(std::string& name,
#else #else
// Check for executable version properties. // Check for executable version properties.
const char* version = this->GetProperty("VERSION"); 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; version = 0;
} }
@ -3350,10 +3350,10 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
std::string& outSuffix) const std::string& outSuffix) const
{ {
// Use just the target name for non-main target types. // Use just the target name for non-main target types.
if(this->GetType() != cmTarget::STATIC_LIBRARY && if(this->GetType() != cmState::STATIC_LIBRARY &&
this->GetType() != cmTarget::SHARED_LIBRARY && this->GetType() != cmState::SHARED_LIBRARY &&
this->GetType() != cmTarget::MODULE_LIBRARY && this->GetType() != cmState::MODULE_LIBRARY &&
this->GetType() != cmTarget::EXECUTABLE) this->GetType() != cmState::EXECUTABLE)
{ {
outPrefix = ""; outPrefix = "";
outBase = this->GetName(); outBase = this->GetName();
@ -3374,9 +3374,9 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
// The implib option is only allowed for shared libraries, module // The implib option is only allowed for shared libraries, module
// libraries, and executables. // libraries, and executables.
if(this->GetType() != cmTarget::SHARED_LIBRARY && if(this->GetType() != cmState::SHARED_LIBRARY &&
this->GetType() != cmTarget::MODULE_LIBRARY && this->GetType() != cmState::MODULE_LIBRARY &&
this->GetType() != cmTarget::EXECUTABLE) this->GetType() != cmState::EXECUTABLE)
{ {
implib = false; implib = false;
} }
@ -3462,7 +3462,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
// Name shared libraries with their version number on some platforms. // Name shared libraries with their version number on some platforms.
if(const char* soversion = this->GetProperty("SOVERSION")) 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")) this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION"))
{ {
outBase += "-"; outBase += "-";
@ -3657,8 +3657,8 @@ cmGeneratorTarget::GetCompatibleInterfaces(std::string const& config) const
bool cmGeneratorTarget::IsLinkInterfaceDependentBoolProperty( bool cmGeneratorTarget::IsLinkInterfaceDependentBoolProperty(
const std::string &p, const std::string& config) const const std::string &p, const std::string& config) const
{ {
if (this->GetType() == cmTarget::OBJECT_LIBRARY if (this->GetType() == cmState::OBJECT_LIBRARY
|| this->GetType() == cmTarget::INTERFACE_LIBRARY) || this->GetType() == cmState::INTERFACE_LIBRARY)
{ {
return false; return false;
} }
@ -3669,8 +3669,8 @@ bool cmGeneratorTarget::IsLinkInterfaceDependentBoolProperty(
bool cmGeneratorTarget::IsLinkInterfaceDependentStringProperty( bool cmGeneratorTarget::IsLinkInterfaceDependentStringProperty(
const std::string &p, const std::string& config) const const std::string &p, const std::string& config) const
{ {
if (this->GetType() == cmTarget::OBJECT_LIBRARY if (this->GetType() == cmState::OBJECT_LIBRARY
|| this->GetType() == cmTarget::INTERFACE_LIBRARY) || this->GetType() == cmState::INTERFACE_LIBRARY)
{ {
return false; return false;
} }
@ -3681,8 +3681,8 @@ bool cmGeneratorTarget::IsLinkInterfaceDependentStringProperty(
bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMinProperty( bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMinProperty(
const std::string &p, const std::string& config) const const std::string &p, const std::string& config) const
{ {
if (this->GetType() == cmTarget::OBJECT_LIBRARY if (this->GetType() == cmState::OBJECT_LIBRARY
|| this->GetType() == cmTarget::INTERFACE_LIBRARY) || this->GetType() == cmState::INTERFACE_LIBRARY)
{ {
return false; return false;
} }
@ -3693,8 +3693,8 @@ bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMinProperty(
bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMaxProperty( bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMaxProperty(
const std::string &p, const std::string& config) const const std::string &p, const std::string& config) const
{ {
if (this->GetType() == cmTarget::OBJECT_LIBRARY if (this->GetType() == cmState::OBJECT_LIBRARY
|| this->GetType() == cmTarget::INTERFACE_LIBRARY) || this->GetType() == cmState::INTERFACE_LIBRARY)
{ {
return false; return false;
} }
@ -4474,7 +4474,7 @@ cmGeneratorTarget::GetLinkInterface(const std::string& config,
// Link interfaces are not supported for executables that do not // Link interfaces are not supported for executables that do not
// export symbols. // export symbols.
if(this->GetType() == cmTarget::EXECUTABLE && if(this->GetType() == cmState::EXECUTABLE &&
!this->Target->IsExecutableWithExports()) !this->Target->IsExecutableWithExports())
{ {
return 0; return 0;
@ -4517,9 +4517,9 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
{ {
if(iface.ExplicitLibraries) if(iface.ExplicitLibraries)
{ {
if(this->GetType() == cmTarget::SHARED_LIBRARY if(this->GetType() == cmState::SHARED_LIBRARY
|| this->GetType() == cmTarget::STATIC_LIBRARY || this->GetType() == cmState::STATIC_LIBRARY
|| this->GetType() == cmTarget::INTERFACE_LIBRARY) || this->GetType() == cmState::INTERFACE_LIBRARY)
{ {
// Shared libraries may have runtime implementation dependencies // Shared libraries may have runtime implementation dependencies
// on other shared libraries that are not in the interface. // on other shared libraries that are not in the interface.
@ -4529,7 +4529,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
{ {
emitted.insert(*li); emitted.insert(*li);
} }
if (this->GetType() != cmTarget::INTERFACE_LIBRARY) if (this->GetType() != cmState::INTERFACE_LIBRARY)
{ {
cmLinkImplementation const* impl = cmLinkImplementation const* impl =
this->GetLinkImplementation(config); this->GetLinkImplementation(config);
@ -4541,7 +4541,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
if(li->Target) if(li->Target)
{ {
// This is a runtime dependency on another shared library. // 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); 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. // Construct the property name suffix for this configuration.
std::string suffix = "_"; std::string suffix = "_";
@ -4623,7 +4623,7 @@ cmGeneratorTarget::GetLinkInterfaceLibraries(const std::string& config,
// Link interfaces are not supported for executables that do not // Link interfaces are not supported for executables that do not
// export symbols. // export symbols.
if(this->GetType() == cmTarget::EXECUTABLE && if(this->GetType() == cmState::EXECUTABLE &&
!this->Target->IsExecutableWithExports()) !this->Target->IsExecutableWithExports())
{ {
return 0; return 0;
@ -4697,7 +4697,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
std::string msg = "cmGeneratorTarget::GetOutputInfo called for "; std::string msg = "cmGeneratorTarget::GetOutputInfo called for ";
msg += this->GetName(); msg += this->GetName();
msg += " which has type "; 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); this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
return 0; return 0;
} }
@ -4797,14 +4797,14 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
conf = ""; conf = "";
} }
} }
else if(this->GetType() == cmTarget::EXECUTABLE) else if(this->GetType() == cmState::EXECUTABLE)
{ {
// Lookup the output path for executables. // Lookup the output path for executables.
out = this->Makefile->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH"); out = this->Makefile->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH");
} }
else if(this->GetType() == cmTarget::STATIC_LIBRARY || else if(this->GetType() == cmState::STATIC_LIBRARY ||
this->GetType() == cmTarget::SHARED_LIBRARY || this->GetType() == cmState::SHARED_LIBRARY ||
this->GetType() == cmTarget::MODULE_LIBRARY) this->GetType() == cmState::MODULE_LIBRARY)
{ {
// Lookup the output path for libraries. // Lookup the output path for libraries.
out = this->Makefile->GetSafeDefinition("LIBRARY_OUTPUT_PATH"); out = this->Makefile->GetSafeDefinition("LIBRARY_OUTPUT_PATH");
@ -4934,7 +4934,7 @@ cmGeneratorTarget::ComputeLinkInterfaceLibraries(
linkIfaceProp = "INTERFACE_LINK_LIBRARIES"; linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
explicitLibraries = this->GetProperty(linkIfaceProp); explicitLibraries = this->GetProperty(linkIfaceProp);
} }
else if(this->GetType() == cmTarget::SHARED_LIBRARY || else if(this->GetType() == cmState::SHARED_LIBRARY ||
this->Target->IsExecutableWithExports()) this->Target->IsExecutableWithExports())
{ {
// CMP0022 OLD behavior is to use LINK_INTERFACE_LIBRARIES if set on a // 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 // There is no implicit link interface for executables or modules
// so if none was explicitly set then there is no link interface. // so if none was explicitly set then there is no link interface.
if(!explicitLibraries && if(!explicitLibraries &&
(this->GetType() == cmTarget::EXECUTABLE || (this->GetType() == cmState::EXECUTABLE ||
(this->GetType() == cmTarget::MODULE_LIBRARY))) (this->GetType() == cmState::MODULE_LIBRARY)))
{ {
return; return;
} }
@ -5445,13 +5445,13 @@ cmGeneratorTarget::FindTargetToLink(std::string const& name) const
// Skip targets that will not really be linked. This is probably a // Skip targets that will not really be linked. This is probably a
// name conflict between an external library and an executable // name conflict between an external library and an executable
// within the project. // within the project.
if(tgt && tgt->GetType() == cmTarget::EXECUTABLE && if(tgt && tgt->GetType() == cmState::EXECUTABLE &&
!tgt->IsExecutableWithExports()) !tgt->IsExecutableWithExports())
{ {
tgt = 0; tgt = 0;
} }
if(tgt && tgt->GetType() == cmTarget::OBJECT_LIBRARY) if(tgt && tgt->GetType() == cmState::OBJECT_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "Target \"" << this->GetName() << "\" links to " e << "Target \"" << this->GetName() << "\" links to "
@ -5509,7 +5509,7 @@ bool cmGeneratorTarget::GetImplibGNUtoMS(std::string const& gnuName,
bool cmGeneratorTarget::HasImportLibrary() const bool cmGeneratorTarget::HasImportLibrary() const
{ {
return (this->Target->IsDLLPlatform() && return (this->Target->IsDLLPlatform() &&
(this->GetType() == cmTarget::SHARED_LIBRARY || (this->GetType() == cmState::SHARED_LIBRARY ||
this->Target->IsExecutableWithExports())); this->Target->IsExecutableWithExports()));
} }

View File

@ -148,7 +148,7 @@ void cmGhsMultiTargetGenerator::Generate()
this->WriteCompilerFlags(config, language); this->WriteCompilerFlags(config, language);
this->WriteCompilerDefinitions(config, language); this->WriteCompilerDefinitions(config, language);
this->WriteIncludes(config, language); this->WriteIncludes(config, language);
if (this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE) if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
{ {
this->WriteTargetLinkLibraries(); this->WriteTargetLinkLibraries();
} }
@ -191,7 +191,7 @@ GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag(
{ {
output = GhsMultiGpj::INTERGRITY_APPLICATION; output = GhsMultiGpj::INTERGRITY_APPLICATION;
} }
else if (target->GetType() == cmTarget::STATIC_LIBRARY) else if (target->GetType() == cmState::STATIC_LIBRARY)
{ {
output = GhsMultiGpj::LIBRARY; output = GhsMultiGpj::LIBRARY;
} }
@ -215,13 +215,13 @@ void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string &config,
std::string outputDir(this->GetOutputDirectory(config)); std::string outputDir(this->GetOutputDirectory(config));
std::string outputFilename(this->GetOutputFilename(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 \"" *this->GetFolderBuildStreams() << " {optgroup=GhsCommonOptions} -o \""
<< outputDir << outputFilename << ".a\"" << outputDir << outputFilename << ".a\""
<< std::endl; << std::endl;
} }
else if (this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE) else if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
{ {
if (notKernel && !this->IsTargetGroup()) if (notKernel && !this->IsTargetGroup())
{ {

View File

@ -1444,15 +1444,15 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
for(cmTargets::iterator ti = targets.begin(); for(cmTargets::iterator ti = targets.begin();
ti != targets.end(); ++ti) ti != targets.end(); ++ti)
{ {
if (ti->second.GetType() == cmTarget::GLOBAL_TARGET) if (ti->second.GetType() == cmState::GLOBAL_TARGET)
{ {
continue; continue;
} }
if(ti->second.GetType() != cmTarget::EXECUTABLE && if(ti->second.GetType() != cmState::EXECUTABLE &&
ti->second.GetType() != cmTarget::STATIC_LIBRARY && ti->second.GetType() != cmState::STATIC_LIBRARY &&
ti->second.GetType() != cmTarget::SHARED_LIBRARY && ti->second.GetType() != cmState::SHARED_LIBRARY &&
ti->second.GetType() != cmTarget::MODULE_LIBRARY && ti->second.GetType() != cmState::MODULE_LIBRARY &&
ti->second.GetType() != cmTarget::OBJECT_LIBRARY) ti->second.GetType() != cmState::OBJECT_LIBRARY)
{ {
continue; continue;
} }
@ -1510,14 +1510,14 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
ti != targets.end(); ++ti) ti != targets.end(); ++ti)
{ {
cmTarget* t = &ti->second; cmTarget* t = &ti->second;
if (t->GetType() == cmTarget::GLOBAL_TARGET) if (t->GetType() == cmState::GLOBAL_TARGET)
{ {
continue; continue;
} }
t->AppendBuildInterfaceIncludes(); t->AppendBuildInterfaceIncludes();
if (t->GetType() == cmTarget::INTERFACE_LIBRARY) if (t->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -1650,7 +1650,7 @@ void cmGlobalGenerator::CheckTargetProperties()
for (cmTargets::iterator l = targets.begin(); for (cmTargets::iterator l = targets.begin();
l != targets.end(); l++) l != targets.end(); l++)
{ {
if (l->second.GetType() == cmTarget::INTERFACE_LIBRARY) if (l->second.GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -2058,7 +2058,7 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root, bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
cmGeneratorTarget* target) const cmGeneratorTarget* target) const
{ {
if(target->GetType() == cmTarget::INTERFACE_LIBRARY if(target->GetType() == cmState::INTERFACE_LIBRARY
|| target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) || target->GetPropertyAsBool("EXCLUDE_FROM_ALL"))
{ {
// This target is excluded from its directory. // This target is excluded from its directory.
@ -2519,7 +2519,7 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(
{ {
// Package // Package
cmTarget target; cmTarget target;
target.SetType(cmTarget::GLOBAL_TARGET, name); target.SetType(cmState::GLOBAL_TARGET, name);
target.SetProperty("EXCLUDE_FROM_ALL","TRUE"); target.SetProperty("EXCLUDE_FROM_ALL","TRUE");
std::vector<std::string> no_outputs; std::vector<std::string> no_outputs;
@ -2701,7 +2701,7 @@ void cmGlobalGenerator::GetTargetSets(TargetDependSet& projectTargets,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmGlobalGenerator::IsRootOnlyTarget(cmTarget* target) const bool cmGlobalGenerator::IsRootOnlyTarget(cmTarget* target) const
{ {
return (target->GetType() == cmTarget::GLOBAL_TARGET || return (target->GetType() == cmState::GLOBAL_TARGET ||
target->GetName() == this->GetAllTargetName()); target->GetName() == this->GetAllTargetName());
} }
@ -2915,7 +2915,7 @@ void cmGlobalGenerator::WriteSummary()
for(TargetMap::const_iterator ti = for(TargetMap::const_iterator ti =
this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti) this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti)
{ {
if ((ti->second)->GetType() == cmTarget::INTERFACE_LIBRARY) if ((ti->second)->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }

View File

@ -72,7 +72,7 @@ void cmGlobalKdevelopGenerator::Generate()
for (cmGeneratorTargetsType::const_iterator ti = targets.begin(); for (cmGeneratorTargetsType::const_iterator ti = targets.begin();
ti != targets.end(); ti++) ti != targets.end(); ti++)
{ {
if (ti->second->GetType()==cmTarget::EXECUTABLE) if (ti->second->GetType()==cmState::EXECUTABLE)
{ {
executable = ti->second->GetLocation(""); executable = ti->second->GetLocation("");
break; break;

View File

@ -926,18 +926,18 @@ cmGlobalNinjaGenerator
bool realname = target->IsFrameworkOnApple(); bool realname = target->IsFrameworkOnApple();
switch (target->GetType()) { switch (target->GetType()) {
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
{ {
cmGeneratorTarget *gtgt = this->GetGeneratorTarget(target); cmGeneratorTarget *gtgt = this->GetGeneratorTarget(target);
outputs.push_back(this->ConvertToNinjaPath( outputs.push_back(this->ConvertToNinjaPath(
gtgt->GetFullPath(configName, false, realname))); gtgt->GetFullPath(configName, false, realname)));
break; break;
} }
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
case cmTarget::UTILITY: { case cmState::UTILITY: {
std::string path = this->ConvertToNinjaPath( std::string path = this->ConvertToNinjaPath(
target->GetMakefile()->GetCurrentBinaryDirectory()); target->GetMakefile()->GetCurrentBinaryDirectory());
if (path.empty() || path == ".") if (path.empty() || path == ".")
@ -950,7 +950,7 @@ cmGlobalNinjaGenerator
break; break;
} }
case cmTarget::GLOBAL_TARGET: case cmState::GLOBAL_TARGET:
// Always use the target in HOME instead of an unused duplicate in a // Always use the target in HOME instead of an unused duplicate in a
// subdirectory. // subdirectory.
outputs.push_back(target->GetName()); outputs.push_back(target->GetName());
@ -965,7 +965,7 @@ void
cmGlobalNinjaGenerator cmGlobalNinjaGenerator
::AppendTargetDepends(cmTarget const* target, cmNinjaDeps& outputs) ::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 // Global targets only depend on other utilities, which may not appear in
// the TargetDepends set (e.g. "all"). // the TargetDepends set (e.g. "all").
std::set<std::string> const& utils = target->GetUtilities(); std::set<std::string> const& utils = target->GetUtilities();
@ -976,7 +976,7 @@ cmGlobalNinjaGenerator
for (cmTargetDependSet::const_iterator i = targetDeps.begin(); for (cmTargetDependSet::const_iterator i = targetDeps.begin();
i != targetDeps.end(); ++i) i != targetDeps.end(); ++i)
{ {
if ((*i)->GetType() == cmTarget::INTERFACE_LIBRARY) if ((*i)->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }

View File

@ -428,12 +428,12 @@ void cmGlobalUnixMakefileGenerator3
for (cmTargets::iterator l = lg->GetMakefile()->GetTargets().begin(); for (cmTargets::iterator l = lg->GetMakefile()->GetTargets().begin();
l != lg->GetMakefile()->GetTargets().end(); l++) l != lg->GetMakefile()->GetTargets().end(); l++)
{ {
if((l->second.GetType() == cmTarget::EXECUTABLE) || if((l->second.GetType() == cmState::EXECUTABLE) ||
(l->second.GetType() == cmTarget::STATIC_LIBRARY) || (l->second.GetType() == cmState::STATIC_LIBRARY) ||
(l->second.GetType() == cmTarget::SHARED_LIBRARY) || (l->second.GetType() == cmState::SHARED_LIBRARY) ||
(l->second.GetType() == cmTarget::MODULE_LIBRARY) || (l->second.GetType() == cmState::MODULE_LIBRARY) ||
(l->second.GetType() == cmTarget::OBJECT_LIBRARY) || (l->second.GetType() == cmState::OBJECT_LIBRARY) ||
(l->second.GetType() == cmTarget::UTILITY)) (l->second.GetType() == cmState::UTILITY))
{ {
std::string tname = lg->GetRelativeTargetDirectory(l->second); std::string tname = lg->GetRelativeTargetDirectory(l->second);
tname += "/DependInfo.cmake"; tname += "/DependInfo.cmake";
@ -467,12 +467,12 @@ cmGlobalUnixMakefileGenerator3
{ {
cmGeneratorTarget* gtarget = l->second; cmGeneratorTarget* gtarget = l->second;
int type = gtarget->GetType(); int type = gtarget->GetType();
if((type == cmTarget::EXECUTABLE) || if((type == cmState::EXECUTABLE) ||
(type == cmTarget::STATIC_LIBRARY) || (type == cmState::STATIC_LIBRARY) ||
(type == cmTarget::SHARED_LIBRARY) || (type == cmState::SHARED_LIBRARY) ||
(type == cmTarget::MODULE_LIBRARY) || (type == cmState::MODULE_LIBRARY) ||
(type == cmTarget::OBJECT_LIBRARY) || (type == cmState::OBJECT_LIBRARY) ||
(type == cmTarget::UTILITY)) (type == cmState::UTILITY))
{ {
if(gtarget->Target->IsImported()) if(gtarget->Target->IsImported())
{ {
@ -645,12 +645,12 @@ cmGlobalUnixMakefileGenerator3
emitted.insert(name).second && emitted.insert(name).second &&
// Handle user targets here. Global targets are handled in // Handle user targets here. Global targets are handled in
// the local generator on a per-directory basis. // the local generator on a per-directory basis.
((type == cmTarget::EXECUTABLE) || ((type == cmState::EXECUTABLE) ||
(type == cmTarget::STATIC_LIBRARY) || (type == cmState::STATIC_LIBRARY) ||
(type == cmTarget::SHARED_LIBRARY) || (type == cmState::SHARED_LIBRARY) ||
(type == cmTarget::MODULE_LIBRARY) || (type == cmState::MODULE_LIBRARY) ||
(type == cmTarget::OBJECT_LIBRARY) || (type == cmState::OBJECT_LIBRARY) ||
(type == cmTarget::UTILITY))) (type == cmState::UTILITY)))
{ {
// Add a rule to build the target by name. // Add a rule to build the target by name.
lg->WriteDivider(ruleFileStream); lg->WriteDivider(ruleFileStream);
@ -741,12 +741,12 @@ cmGlobalUnixMakefileGenerator3
int type = gtarget->GetType(); int type = gtarget->GetType();
std::string name = gtarget->GetName(); std::string name = gtarget->GetName();
if (!name.empty() if (!name.empty()
&& ( (type == cmTarget::EXECUTABLE) && ( (type == cmState::EXECUTABLE)
|| (type == cmTarget::STATIC_LIBRARY) || (type == cmState::STATIC_LIBRARY)
|| (type == cmTarget::SHARED_LIBRARY) || (type == cmState::SHARED_LIBRARY)
|| (type == cmTarget::MODULE_LIBRARY) || (type == cmState::MODULE_LIBRARY)
|| (type == cmTarget::OBJECT_LIBRARY) || (type == cmState::OBJECT_LIBRARY)
|| (type == cmTarget::UTILITY))) || (type == cmState::UTILITY)))
{ {
std::string makefileName; std::string makefileName;
// Add a rule to build the target by name. // Add a rule to build the target by name.
@ -937,7 +937,7 @@ void cmGlobalUnixMakefileGenerator3::InitializeProgressMarks()
cmLocalGenerator* tlg = gt->GetLocalGenerator(); cmLocalGenerator* tlg = gt->GetLocalGenerator();
if(gt->GetType() == cmTarget::INTERFACE_LIBRARY if(gt->GetType() == cmState::INTERFACE_LIBRARY
|| gt->GetPropertyAsBool("EXCLUDE_FROM_ALL")) || gt->GetPropertyAsBool("EXCLUDE_FROM_ALL"))
{ {
continue; continue;
@ -984,7 +984,7 @@ cmGlobalUnixMakefileGenerator3
for(TargetDependSet::const_iterator di = depends.begin(); for(TargetDependSet::const_iterator di = depends.begin();
di != depends.end(); ++di) di != depends.end(); ++di)
{ {
if ((*di)->GetType() == cmTarget::INTERFACE_LIBRARY) if ((*di)->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -1060,7 +1060,7 @@ cmGlobalUnixMakefileGenerator3
{ {
// Create the target-level dependency. // Create the target-level dependency.
cmGeneratorTarget const* dep = *i; cmGeneratorTarget const* dep = *i;
if (dep->GetType() == cmTarget::INTERFACE_LIBRARY) if (dep->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -1105,14 +1105,14 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t) for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t)
{ {
cmTarget const& target = t->second; cmTarget const& target = t->second;
cmTarget::TargetType type = target.GetType(); cmState::TargetType type = target.GetType();
if((type == cmTarget::EXECUTABLE) || if((type == cmState::EXECUTABLE) ||
(type == cmTarget::STATIC_LIBRARY) || (type == cmState::STATIC_LIBRARY) ||
(type == cmTarget::SHARED_LIBRARY) || (type == cmState::SHARED_LIBRARY) ||
(type == cmTarget::MODULE_LIBRARY) || (type == cmState::MODULE_LIBRARY) ||
(type == cmTarget::OBJECT_LIBRARY) || (type == cmState::OBJECT_LIBRARY) ||
(type == cmTarget::GLOBAL_TARGET) || (type == cmState::GLOBAL_TARGET) ||
(type == cmTarget::UTILITY)) (type == cmState::UTILITY))
{ {
std::string name = target.GetName(); std::string name = target.GetName();
if(emittedTargets.insert(name).second) if(emittedTargets.insert(name).second)

View File

@ -278,10 +278,10 @@ cmGlobalVisualStudio11Generator::GetInstalledWindowsCESDKs()
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool bool
cmGlobalVisualStudio11Generator::NeedsDeploy(cmTarget::TargetType type) const cmGlobalVisualStudio11Generator::NeedsDeploy(cmState::TargetType type) const
{ {
if((type == cmTarget::EXECUTABLE || if((type == cmState::EXECUTABLE ||
type == cmTarget::SHARED_LIBRARY) && type == cmState::SHARED_LIBRARY) &&
(this->SystemIsWindowsPhone || (this->SystemIsWindowsPhone ||
this->SystemIsWindowsStore)) this->SystemIsWindowsStore))
{ {

View File

@ -48,7 +48,7 @@ protected:
static std::set<std::string> GetInstalledWindowsCESDKs(); static std::set<std::string> GetInstalledWindowsCESDKs();
/** Return true if the configuration needs to be deployed */ /** Return true if the configuration needs to be deployed */
virtual bool NeedsDeploy(cmTarget::TargetType type) const; virtual bool NeedsDeploy(cmState::TargetType type) const;
private: private:
class Factory; class Factory;
friend class Factory; friend class Factory;

View File

@ -224,7 +224,7 @@ void cmGlobalVisualStudio6Generator
tt != orderedProjectTargets.end(); ++tt) tt != orderedProjectTargets.end(); ++tt)
{ {
cmTarget const* target = (*tt)->Target; cmTarget const* target = (*tt)->Target;
if(target->GetType() == cmTarget::INTERFACE_LIBRARY) if(target->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }

View File

@ -272,7 +272,7 @@ void cmGlobalVisualStudio71Generator
// executables to the libraries it uses are also done here // executables to the libraries it uses are also done here
void cmGlobalVisualStudio71Generator void cmGlobalVisualStudio71Generator
::WriteProjectConfigurations( ::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, std::vector<std::string> const& configs,
const std::set<std::string>& configsPartOfDefaultBuild, const std::set<std::string>& configsPartOfDefaultBuild,
std::string const& platformMapping) std::string const& platformMapping)

View File

@ -64,7 +64,7 @@ protected:
const std::string& name, const char* path, const std::string& name, const char* path,
cmTarget const& t); cmTarget const& t);
virtual void WriteProjectConfigurations( 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, std::vector<std::string> const& configs,
const std::set<std::string>& configsPartOfDefaultBuild, const std::set<std::string>& configsPartOfDefaultBuild,
const std::string& platformMapping = ""); const std::string& platformMapping = "");

View File

@ -402,7 +402,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations(
projectTargets.begin(); tt != projectTargets.end(); ++tt) projectTargets.begin(); tt != projectTargets.end(); ++tt)
{ {
cmTarget const* target = (*tt)->Target; cmTarget const* target = (*tt)->Target;
if(target->GetType() == cmTarget::INTERFACE_LIBRARY) if(target->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -442,7 +442,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
projectTargets.begin(); tt != projectTargets.end(); ++tt) projectTargets.begin(); tt != projectTargets.end(); ++tt)
{ {
cmTarget const* target = (*tt)->Target; cmTarget const* target = (*tt)->Target;
if(target->GetType() == cmTarget::INTERFACE_LIBRARY) if(target->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -536,7 +536,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends(
projectTargets.begin(); tt != projectTargets.end(); ++tt) projectTargets.begin(); tt != projectTargets.end(); ++tt)
{ {
cmTarget const* target = (*tt)->Target; cmTarget const* target = (*tt)->Target;
if(target->GetType() == cmTarget::INTERFACE_LIBRARY) if(target->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -762,7 +762,7 @@ cmGlobalVisualStudio7Generator
// executables to the libraries it uses are also done here // executables to the libraries it uses are also done here
void cmGlobalVisualStudio7Generator void cmGlobalVisualStudio7Generator
::WriteProjectConfigurations( ::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, std::vector<std::string> const& configs,
const std::set<std::string>& configsPartOfDefaultBuild, const std::set<std::string>& configsPartOfDefaultBuild,
const std::string& platformMapping) const std::string& platformMapping)
@ -1002,7 +1002,7 @@ cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
// if it is a utilitiy target then only make it part of the // if it is a utilitiy target then only make it part of the
// default build if another target depends on it // default build if another target depends on it
int type = target->GetType(); int type = target->GetType();
if (type == cmTarget::GLOBAL_TARGET) if (type == cmState::GLOBAL_TARGET)
{ {
// check if INSTALL target is part of default build // check if INSTALL target is part of default build
if(target->GetName() == "INSTALL") if(target->GetName() == "INSTALL")
@ -1025,7 +1025,7 @@ cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
} }
return activeConfigs; return activeConfigs;
} }
if(type == cmTarget::UTILITY && !this->IsDependedOn(projectTargets, target)) if(type == cmState::UTILITY && !this->IsDependedOn(projectTargets, target))
{ {
return activeConfigs; return activeConfigs;
} }

View File

@ -128,7 +128,7 @@ protected:
const std::string& name, const char* path, const std::string& name, const char* path,
cmTarget const&t); cmTarget const&t);
virtual void WriteProjectConfigurations( 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, std::vector<std::string> const& configs,
const std::set<std::string>& configsPartOfDefaultBuild, const std::set<std::string>& configsPartOfDefaultBuild,
const std::string& platformMapping = ""); const std::string& platformMapping = "");

View File

@ -386,7 +386,7 @@ cmGlobalVisualStudio8Generator
void void
cmGlobalVisualStudio8Generator cmGlobalVisualStudio8Generator
::WriteProjectConfigurations( ::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, std::vector<std::string> const& configs,
const std::set<std::string>& configsPartOfDefaultBuild, const std::set<std::string>& configsPartOfDefaultBuild,
std::string const& platformMapping) std::string const& platformMapping)
@ -423,10 +423,10 @@ cmGlobalVisualStudio8Generator
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool bool
cmGlobalVisualStudio8Generator::NeedsDeploy(cmTarget::TargetType type) const cmGlobalVisualStudio8Generator::NeedsDeploy(cmState::TargetType type) const
{ {
bool needsDeploy = (type == cmTarget::EXECUTABLE || bool needsDeploy = (type == cmState::EXECUTABLE ||
type == cmTarget::SHARED_LIBRARY); type == cmState::SHARED_LIBRARY);
return this->TargetsWindowsCE() && needsDeploy; return this->TargetsWindowsCE() && needsDeploy;
} }
@ -448,7 +448,7 @@ void cmGlobalVisualStudio8Generator::WriteProjectDepends(
for(OrderedTargetDependSet::const_iterator i = depends.begin(); for(OrderedTargetDependSet::const_iterator i = depends.begin();
i != depends.end(); ++i) i != depends.end(); ++i)
{ {
if((*i)->GetType() == cmTarget::INTERFACE_LIBRARY) if((*i)->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -468,7 +468,7 @@ bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies(
{ {
if(cmTarget* depTarget = this->FindTarget(ui->c_str())) if(cmTarget* depTarget = this->FindTarget(ui->c_str()))
{ {
if(depTarget->GetType() != cmTarget::INTERFACE_LIBRARY if(depTarget->GetType() != cmState::INTERFACE_LIBRARY
&& depTarget->GetProperty("EXTERNAL_MSPROJECT")) && depTarget->GetProperty("EXTERNAL_MSPROJECT"))
{ {
// This utility dependency names an external .vcproj target. // This utility dependency names an external .vcproj target.

View File

@ -77,14 +77,14 @@ protected:
bool AddCheckTarget(); bool AddCheckTarget();
/** Return true if the configuration needs to be deployed */ /** 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(); static cmIDEFlagTable const* GetExtraFlagTableVS8();
virtual void WriteSLNHeader(std::ostream& fout); virtual void WriteSLNHeader(std::ostream& fout);
virtual void WriteSolutionConfigurations( virtual void WriteSolutionConfigurations(
std::ostream& fout, std::vector<std::string> const& configs); std::ostream& fout, std::vector<std::string> const& configs);
virtual void WriteProjectConfigurations( 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, std::vector<std::string> const& configs,
const std::set<std::string>& configsPartOfDefaultBuild, const std::set<std::string>& configsPartOfDefaultBuild,
const std::string& platformMapping = ""); const std::string& platformMapping = "");

View File

@ -112,7 +112,7 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
for(cmGeneratorTargetsType::iterator t = targets.begin(); for(cmGeneratorTargetsType::iterator t = targets.begin();
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
if (t->second->GetType() == cmTarget::GLOBAL_TARGET if (t->second->GetType() == cmState::GLOBAL_TARGET
|| t->first->IsImported()) || t->first->IsImported())
{ {
continue; continue;
@ -337,12 +337,12 @@ cmGlobalVisualStudioGenerator::GetTargetLinkClosure(cmTarget* target)
void cmGlobalVisualStudioGenerator::FollowLinkDepends( void cmGlobalVisualStudioGenerator::FollowLinkDepends(
cmTarget const* target, std::set<cmTarget const*>& linked) cmTarget const* target, std::set<cmTarget const*>& linked)
{ {
if(target->GetType() == cmTarget::INTERFACE_LIBRARY) if(target->GetType() == cmState::INTERFACE_LIBRARY)
{ {
return; return;
} }
if(linked.insert(target).second && 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 // Static library targets do not list their link dependencies so
// we must follow them transitively now. // we must follow them transitively now.
@ -387,7 +387,7 @@ bool cmGlobalVisualStudioGenerator::ComputeTargetDepends()
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
static bool VSLinkable(cmTarget const* t) 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 // leaving them out for the static library itself but following them
// transitively for other targets. // transitively for other targets.
bool allowLinkable = (target.GetType() != cmTarget::STATIC_LIBRARY && bool allowLinkable = (target.GetType() != cmState::STATIC_LIBRARY &&
target.GetType() != cmTarget::SHARED_LIBRARY && target.GetType() != cmState::SHARED_LIBRARY &&
target.GetType() != cmTarget::MODULE_LIBRARY && target.GetType() != cmState::MODULE_LIBRARY &&
target.GetType() != cmTarget::EXECUTABLE); target.GetType() != cmState::EXECUTABLE);
cmGeneratorTarget* gt = this->GetGeneratorTarget(&target); cmGeneratorTarget* gt = this->GetGeneratorTarget(&target);
TargetDependSet const& depends = this->GetTargetDirectDepends(gt); TargetDependSet const& depends = this->GetTargetDirectDepends(gt);
@ -429,7 +429,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target)
// Static libraries cannot depend on their link implementation // Static libraries cannot depend on their link implementation
// due to behavior (2), but they do not really need to. // due to behavior (2), but they do not really need to.
std::set<cmTarget const*> linkDepends; std::set<cmTarget const*> linkDepends;
if(target.GetType() != cmTarget::STATIC_LIBRARY) if(target.GetType() != cmState::STATIC_LIBRARY)
{ {
for(TargetDependSet::const_iterator di = depends.begin(); for(TargetDependSet::const_iterator di = depends.begin();
di != depends.end(); ++di) di != depends.end(); ++di)
@ -457,7 +457,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target)
// Collect all targets linked by this target so we can avoid // Collect all targets linked by this target so we can avoid
// intermediate targets below. // intermediate targets below.
TargetSet linked; TargetSet linked;
if(target.GetType() != cmTarget::STATIC_LIBRARY) if(target.GetType() != cmState::STATIC_LIBRARY)
{ {
linked = this->GetTargetLinkClosure(&target); linked = this->GetTargetLinkClosure(&target);
} }

View File

@ -513,7 +513,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
{ {
cmTarget& target = l->second; cmTarget& target = l->second;
if (target.GetType() == cmTarget::GLOBAL_TARGET) if (target.GetType() == cmState::GLOBAL_TARGET)
{ {
continue; continue;
} }
@ -528,12 +528,12 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
// this will make sure that when the next target is built // this will make sure that when the next target is built
// things are up-to-date // things are up-to-date
if(!makeHelper.empty() && if(!makeHelper.empty() &&
(target.GetType() == cmTarget::EXECUTABLE || (target.GetType() == cmState::EXECUTABLE ||
// Nope - no post-build for OBJECT_LIRBRARY // Nope - no post-build for OBJECT_LIRBRARY
// target.GetType() == cmTarget::OBJECT_LIBRARY || // target.GetType() == cmState::OBJECT_LIBRARY ||
target.GetType() == cmTarget::STATIC_LIBRARY || target.GetType() == cmState::STATIC_LIBRARY ||
target.GetType() == cmTarget::SHARED_LIBRARY || target.GetType() == cmState::SHARED_LIBRARY ||
target.GetType() == cmTarget::MODULE_LIBRARY)) target.GetType() == cmState::MODULE_LIBRARY))
{ {
makeHelper[makeHelper.size()-1] = // fill placeholder makeHelper[makeHelper.size()-1] = // fill placeholder
this->PostBuildMakeTarget(target.GetName(), "$(CONFIGURATION)"); this->PostBuildMakeTarget(target.GetName(), "$(CONFIGURATION)");
@ -549,7 +549,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
dir.c_str()); dir.c_str());
} }
if(target.GetType() != cmTarget::INTERFACE_LIBRARY if(target.GetType() != cmState::INTERFACE_LIBRARY
&& !target.GetPropertyAsBool("EXCLUDE_FROM_ALL")) && !target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
{ {
allbuild->AddUtility(target.GetName()); allbuild->AddUtility(target.GetName());
@ -1100,13 +1100,13 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
continue; continue;
} }
if(cmtarget.GetType() == cmTarget::INTERFACE_LIBRARY) if(cmtarget.GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
if(cmtarget.GetType() == cmTarget::UTILITY || if(cmtarget.GetType() == cmState::UTILITY ||
cmtarget.GetType() == cmTarget::GLOBAL_TARGET) cmtarget.GetType() == cmState::GLOBAL_TARGET)
{ {
cmXCodeObject* t = this->CreateUtilityTarget(cmtarget); cmXCodeObject* t = this->CreateUtilityTarget(cmtarget);
if (!t) if (!t)
@ -1366,9 +1366,9 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguages()
void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget) void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
{ {
// This matters only for targets that link. // This matters only for targets that link.
if(cmtarget.GetType() != cmTarget::EXECUTABLE && if(cmtarget.GetType() != cmState::EXECUTABLE &&
cmtarget.GetType() != cmTarget::SHARED_LIBRARY && cmtarget.GetType() != cmState::SHARED_LIBRARY &&
cmtarget.GetType() != cmTarget::MODULE_LIBRARY) cmtarget.GetType() != cmState::MODULE_LIBRARY)
{ {
return; return;
} }
@ -1467,7 +1467,7 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
std::vector<cmCustomCommand> postbuild std::vector<cmCustomCommand> postbuild
= cmtarget.GetPostBuildCommands(); = cmtarget.GetPostBuildCommands();
if(cmtarget.GetType() == cmTarget::SHARED_LIBRARY && if(cmtarget.GetType() == cmState::SHARED_LIBRARY &&
!cmtarget.IsFrameworkOnApple()) !cmtarget.IsFrameworkOnApple())
{ {
cmCustomCommandLines cmd; cmCustomCommandLines cmd;
@ -1786,17 +1786,17 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
cmXCodeObject* buildSettings, cmXCodeObject* buildSettings,
const std::string& configName) const std::string& configName)
{ {
if(target.GetType() == cmTarget::INTERFACE_LIBRARY) if(target.GetType() == cmState::INTERFACE_LIBRARY)
{ {
return; return;
} }
std::string defFlags; std::string defFlags;
bool shared = ((target.GetType() == cmTarget::SHARED_LIBRARY) || bool shared = ((target.GetType() == cmState::SHARED_LIBRARY) ||
(target.GetType() == cmTarget::MODULE_LIBRARY)); (target.GetType() == cmState::MODULE_LIBRARY));
bool binary = ((target.GetType() == cmTarget::OBJECT_LIBRARY) || bool binary = ((target.GetType() == cmState::OBJECT_LIBRARY) ||
(target.GetType() == cmTarget::STATIC_LIBRARY) || (target.GetType() == cmState::STATIC_LIBRARY) ||
(target.GetType() == cmTarget::EXECUTABLE) || (target.GetType() == cmState::EXECUTABLE) ||
shared); shared);
// Compute the compilation flags for each language. // Compute the compilation flags for each language.
@ -1858,15 +1858,15 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
std::string extraLinkOptionsVar; std::string extraLinkOptionsVar;
std::string extraLinkOptions; std::string extraLinkOptions;
if(target.GetType() == cmTarget::EXECUTABLE) if(target.GetType() == cmState::EXECUTABLE)
{ {
extraLinkOptionsVar = "CMAKE_EXE_LINKER_FLAGS"; extraLinkOptionsVar = "CMAKE_EXE_LINKER_FLAGS";
} }
else if(target.GetType() == cmTarget::SHARED_LIBRARY) else if(target.GetType() == cmState::SHARED_LIBRARY)
{ {
extraLinkOptionsVar = "CMAKE_SHARED_LINKER_FLAGS"; extraLinkOptionsVar = "CMAKE_SHARED_LINKER_FLAGS";
} }
else if(target.GetType() == cmTarget::MODULE_LIBRARY) else if(target.GetType() == cmState::MODULE_LIBRARY)
{ {
extraLinkOptionsVar = "CMAKE_MODULE_LINKER_FLAGS"; extraLinkOptionsVar = "CMAKE_MODULE_LINKER_FLAGS";
} }
@ -1878,8 +1878,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
configName); configName);
} }
if(target.GetType() == cmTarget::OBJECT_LIBRARY || if(target.GetType() == cmState::OBJECT_LIBRARY ||
target.GetType() == cmTarget::STATIC_LIBRARY) target.GetType() == cmState::STATIC_LIBRARY)
{ {
this->CurrentLocalGenerator this->CurrentLocalGenerator
->GetStaticLibraryFlags(extraLinkOptions, ->GetStaticLibraryFlags(extraLinkOptions,
@ -1969,10 +1969,10 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
// Set attributes to specify the proper name for the target. // Set attributes to specify the proper name for the target.
std::string pndir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory(); std::string pndir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
if(target.GetType() == cmTarget::STATIC_LIBRARY || if(target.GetType() == cmState::STATIC_LIBRARY ||
target.GetType() == cmTarget::SHARED_LIBRARY || target.GetType() == cmState::SHARED_LIBRARY ||
target.GetType() == cmTarget::MODULE_LIBRARY || target.GetType() == cmState::MODULE_LIBRARY ||
target.GetType() == cmTarget::EXECUTABLE) target.GetType() == cmState::EXECUTABLE)
{ {
if(this->XcodeVersion >= 21) if(this->XcodeVersion >= 21)
{ {
@ -2000,7 +2000,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
buildSettings->AddAttribute("EXECUTABLE_SUFFIX", buildSettings->AddAttribute("EXECUTABLE_SUFFIX",
this->CreateString(pnsuffix.c_str())); this->CreateString(pnsuffix.c_str()));
} }
else if(target.GetType() == cmTarget::OBJECT_LIBRARY) else if(target.GetType() == cmState::OBJECT_LIBRARY)
{ {
pnprefix = "lib"; pnprefix = "lib";
pnbase = target.GetName(); pnbase = target.GetName();
@ -2031,15 +2031,15 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
// Handle settings for each target type. // Handle settings for each target type.
switch(target.GetType()) switch(target.GetType())
{ {
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
{ {
buildSettings->AddAttribute("LIBRARY_STYLE", buildSettings->AddAttribute("LIBRARY_STYLE",
this->CreateString("STATIC")); this->CreateString("STATIC"));
break; break;
} }
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
{ {
buildSettings->AddAttribute("LIBRARY_STYLE", buildSettings->AddAttribute("LIBRARY_STYLE",
this->CreateString("BUNDLE")); this->CreateString("BUNDLE"));
@ -2098,7 +2098,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
} }
break; break;
} }
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
{ {
if(target.GetPropertyAsBool("FRAMEWORK")) if(target.GetPropertyAsBool("FRAMEWORK"))
{ {
@ -2135,7 +2135,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
this->CreateString("DYNAMIC")); this->CreateString("DYNAMIC"));
break; break;
} }
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
{ {
// Add the flags to create an executable. // Add the flags to create an executable.
std::string createFlags = std::string createFlags =
@ -2327,7 +2327,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
// Create the INSTALL_PATH attribute. // Create the INSTALL_PATH attribute.
std::string install_name_dir; 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. // Get the install_name directory for the build tree.
install_name_dir = gtgt->GetInstallNameDirForBuildTree(configName); install_name_dir = gtgt->GetInstallNameDirForBuildTree(configName);
@ -2415,7 +2415,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
} }
// Runtime version information. // Runtime version information.
if(target.GetType() == cmTarget::SHARED_LIBRARY) if(target.GetType() == cmState::SHARED_LIBRARY)
{ {
int major; int major;
int minor; int minor;
@ -2550,7 +2550,7 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
this->XCodeObjectMap[&cmtarget] = target; this->XCodeObjectMap[&cmtarget] = target;
// Add source files without build rules for editing convenience. // Add source files without build rules for editing convenience.
if(cmtarget.GetType() == cmTarget::UTILITY) if(cmtarget.GetType() == cmState::UTILITY)
{ {
std::vector<cmSourceFile*> sources; std::vector<cmSourceFile*> sources;
cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget); cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
@ -2627,8 +2627,8 @@ const char*
cmGlobalXCodeGenerator::GetTargetLinkFlagsVar(cmTarget const& cmtarget) const cmGlobalXCodeGenerator::GetTargetLinkFlagsVar(cmTarget const& cmtarget) const
{ {
if(this->XcodeVersion >= 60 && if(this->XcodeVersion >= 60 &&
(cmtarget.GetType() == cmTarget::STATIC_LIBRARY || (cmtarget.GetType() == cmState::STATIC_LIBRARY ||
cmtarget.GetType() == cmTarget::OBJECT_LIBRARY)) cmtarget.GetType() == cmState::OBJECT_LIBRARY))
{ {
return "OTHER_LIBTOOLFLAGS"; return "OTHER_LIBTOOLFLAGS";
} }
@ -2643,10 +2643,10 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(cmTarget& cmtarget)
{ {
switch(cmtarget.GetType()) switch(cmtarget.GetType())
{ {
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
return "archive.ar"; return "archive.ar";
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
if (cmtarget.IsXCTestOnApple()) if (cmtarget.IsXCTestOnApple())
return "wrapper.cfbundle"; return "wrapper.cfbundle";
else if (cmtarget.IsCFBundleOnApple()) else if (cmtarget.IsCFBundleOnApple())
@ -2654,10 +2654,10 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(cmTarget& cmtarget)
else else
return ((this->XcodeVersion >= 22)? return ((this->XcodeVersion >= 22)?
"compiled.mach-o.executable" : "compiled.mach-o.dylib"); "compiled.mach-o.executable" : "compiled.mach-o.dylib");
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
return (cmtarget.GetPropertyAsBool("FRAMEWORK")? return (cmtarget.GetPropertyAsBool("FRAMEWORK")?
"wrapper.framework" : "compiled.mach-o.dylib"); "wrapper.framework" : "compiled.mach-o.dylib");
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
return "compiled.mach-o.executable"; return "compiled.mach-o.executable";
default: break; default: break;
} }
@ -2669,10 +2669,10 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(cmTarget& cmtarget)
{ {
switch(cmtarget.GetType()) switch(cmtarget.GetType())
{ {
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
return "com.apple.product-type.library.static"; return "com.apple.product-type.library.static";
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
if (cmtarget.IsXCTestOnApple()) if (cmtarget.IsXCTestOnApple())
return "com.apple.product-type.bundle.unit-test"; return "com.apple.product-type.bundle.unit-test";
else if (cmtarget.IsCFBundleOnApple()) else if (cmtarget.IsCFBundleOnApple())
@ -2681,11 +2681,11 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(cmTarget& cmtarget)
return ((this->XcodeVersion >= 22)? return ((this->XcodeVersion >= 22)?
"com.apple.product-type.tool" : "com.apple.product-type.tool" :
"com.apple.product-type.library.dynamic"); "com.apple.product-type.library.dynamic");
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
return (cmtarget.GetPropertyAsBool("FRAMEWORK")? return (cmtarget.GetPropertyAsBool("FRAMEWORK")?
"com.apple.product-type.framework" : "com.apple.product-type.framework" :
"com.apple.product-type.library.dynamic"); "com.apple.product-type.library.dynamic");
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
return (cmtarget.GetPropertyAsBool("MACOSX_BUNDLE")? return (cmtarget.GetPropertyAsBool("MACOSX_BUNDLE")?
"com.apple.product-type.application" : "com.apple.product-type.application" :
"com.apple.product-type.tool"); "com.apple.product-type.tool");
@ -2699,7 +2699,7 @@ cmXCodeObject*
cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget, cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
cmXCodeObject* buildPhases) cmXCodeObject* buildPhases)
{ {
if(cmtarget.GetType() == cmTarget::INTERFACE_LIBRARY) if(cmtarget.GetType() == cmState::INTERFACE_LIBRARY)
{ {
return 0; return 0;
} }
@ -2734,7 +2734,7 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
fileRef->AddAttribute("explicitFileType", this->CreateString(fileType)); fileRef->AddAttribute("explicitFileType", this->CreateString(fileType));
} }
std::string fullName; std::string fullName;
if(cmtarget.GetType() == cmTarget::OBJECT_LIBRARY) if(cmtarget.GetType() == cmState::OBJECT_LIBRARY)
{ {
fullName = "lib"; fullName = "lib";
fullName += cmtarget.GetName(); fullName += cmtarget.GetName();
@ -2909,7 +2909,7 @@ void cmGlobalXCodeGenerator
::AddDependAndLinkInformation(cmXCodeObject* target) ::AddDependAndLinkInformation(cmXCodeObject* target)
{ {
cmTarget* cmtarget = target->GetTarget(); cmTarget* cmtarget = target->GetTarget();
if(cmtarget->GetType() == cmTarget::INTERFACE_LIBRARY) if(cmtarget->GetType() == cmState::INTERFACE_LIBRARY)
{ {
return; return;
} }
@ -2958,8 +2958,8 @@ void cmGlobalXCodeGenerator
} }
// Skip link information for object libraries. // Skip link information for object libraries.
if(cmtarget->GetType() == cmTarget::OBJECT_LIBRARY || if(cmtarget->GetType() == cmState::OBJECT_LIBRARY ||
cmtarget->GetType() == cmTarget::STATIC_LIBRARY) cmtarget->GetType() == cmState::STATIC_LIBRARY)
{ {
continue; continue;
} }
@ -3024,7 +3024,7 @@ void cmGlobalXCodeGenerator
linkLibs += this->XCodeEscapePath(li->Value.c_str()); linkLibs += this->XCodeEscapePath(li->Value.c_str());
} }
else if (!li->Target else if (!li->Target
|| li->Target->GetType() != cmTarget::INTERFACE_LIBRARY) || li->Target->GetType() != cmState::INTERFACE_LIBRARY)
{ {
linkLibs += li->Value; linkLibs += li->Value;
} }
@ -3063,11 +3063,11 @@ bool cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
// end up with (empty anyhow) ALL_BUILD and XCODE_DEPEND_HELPER source // end up with (empty anyhow) ALL_BUILD and XCODE_DEPEND_HELPER source
// groups: // groups:
// //
if(cmtarget.GetType() == cmTarget::GLOBAL_TARGET) if(cmtarget.GetType() == cmState::GLOBAL_TARGET)
{ {
continue; continue;
} }
if(cmtarget.GetType() == cmTarget::INTERFACE_LIBRARY) if(cmtarget.GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -3624,21 +3624,21 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
cmTarget* t =target->GetTarget(); cmTarget* t =target->GetTarget();
cmGeneratorTarget *gt = this->GetGeneratorTarget(t); cmGeneratorTarget *gt = this->GetGeneratorTarget(t);
if(t->GetType() == cmTarget::EXECUTABLE || if(t->GetType() == cmState::EXECUTABLE ||
// Nope - no post-build for OBJECT_LIRBRARY // Nope - no post-build for OBJECT_LIRBRARY
// t->GetType() == cmTarget::OBJECT_LIBRARY || // t->GetType() == cmState::OBJECT_LIBRARY ||
t->GetType() == cmTarget::STATIC_LIBRARY || t->GetType() == cmState::STATIC_LIBRARY ||
t->GetType() == cmTarget::SHARED_LIBRARY || t->GetType() == cmState::SHARED_LIBRARY ||
t->GetType() == cmTarget::MODULE_LIBRARY) t->GetType() == cmState::MODULE_LIBRARY)
{ {
// Declare an entry point for the target post-build phase. // Declare an entry point for the target post-build phase.
makefileStream << this->PostBuildMakeTarget(t->GetName(), *ct) makefileStream << this->PostBuildMakeTarget(t->GetName(), *ct)
<< ":\n"; << ":\n";
} }
if(t->GetType() == cmTarget::EXECUTABLE || if(t->GetType() == cmState::EXECUTABLE ||
t->GetType() == cmTarget::SHARED_LIBRARY || t->GetType() == cmState::SHARED_LIBRARY ||
t->GetType() == cmTarget::MODULE_LIBRARY) t->GetType() == cmState::MODULE_LIBRARY)
{ {
std::string tfull = gt->GetFullPath(configName); std::string tfull = gt->GetFullPath(configName);
std::string trel = this->ConvertToRelativeForMake(tfull.c_str()); std::string trel = this->ConvertToRelativeForMake(tfull.c_str());

View File

@ -26,13 +26,13 @@ static const char* getShapeForTarget(const cmTarget* target)
switch ( target->GetType() ) switch ( target->GetType() )
{ {
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
return "house"; return "house";
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
return "diamond"; return "diamond";
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
return "polygon"; return "polygon";
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
return "octagon"; return "octagon";
default: default:
break; 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 const
{ {
switch (targetType) switch (targetType)
{ {
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
return this->GenerateForExecutables; return this->GenerateForExecutables;
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
return this->GenerateForStaticLibs; return this->GenerateForStaticLibs;
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
return this->GenerateForSharedLibs; return this->GenerateForSharedLibs;
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
return this->GenerateForModuleLibs; return this->GenerateForModuleLibs;
default: default:
break; break;

View File

@ -62,7 +62,7 @@ protected:
bool IgnoreThisTarget(const std::string& name); bool IgnoreThisTarget(const std::string& name);
bool GenerateForTargetType(cmTarget::TargetType targetType) const; bool GenerateForTargetType(cmState::TargetType targetType) const;
std::string GraphType; std::string GraphType;
std::string GraphName; std::string GraphName;

View File

@ -77,7 +77,7 @@ bool cmIncludeExternalMSProjectCommand
} }
// Create a target instance for this utility. // 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()); utility_name.c_str());
target->SetProperty("GENERATOR_FILE_NAME", utility_name.c_str()); target->SetProperty("GENERATOR_FILE_NAME", utility_name.c_str());

View File

@ -383,12 +383,12 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
if(cmTarget* target=this->Makefile->FindTarget(*targetIt)) if(cmTarget* target=this->Makefile->FindTarget(*targetIt))
{ {
// Found the target. Check its type. // Found the target. Check its type.
if(target->GetType() != cmTarget::EXECUTABLE && if(target->GetType() != cmState::EXECUTABLE &&
target->GetType() != cmTarget::STATIC_LIBRARY && target->GetType() != cmState::STATIC_LIBRARY &&
target->GetType() != cmTarget::SHARED_LIBRARY && target->GetType() != cmState::SHARED_LIBRARY &&
target->GetType() != cmTarget::MODULE_LIBRARY && target->GetType() != cmState::MODULE_LIBRARY &&
target->GetType() != cmTarget::OBJECT_LIBRARY && target->GetType() != cmState::OBJECT_LIBRARY &&
target->GetType() != cmTarget::INTERFACE_LIBRARY) target->GetType() != cmState::INTERFACE_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "TARGETS given target \"" << (*targetIt) e << "TARGETS given target \"" << (*targetIt)
@ -396,7 +396,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
} }
else if(target->GetType() == cmTarget::OBJECT_LIBRARY) else if(target->GetType() == cmState::OBJECT_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "TARGETS given OBJECT library \"" << (*targetIt) e << "TARGETS given OBJECT library \"" << (*targetIt)
@ -449,7 +449,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
switch(target.GetType()) switch(target.GetType())
{ {
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
{ {
// Shared libraries are handled differently on DLL and non-DLL // Shared libraries are handled differently on DLL and non-DLL
// platforms. All windows platforms are DLL platforms including // platforms. All windows platforms are DLL platforms including
@ -532,7 +532,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
} }
} }
break; break;
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
{ {
// Static libraries use ARCHIVE properties. // Static libraries use ARCHIVE properties.
if (!archiveArgs.GetDestination().empty()) if (!archiveArgs.GetDestination().empty())
@ -550,7 +550,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
} }
} }
break; break;
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
{ {
// Modules use LIBRARY properties. // Modules use LIBRARY properties.
if (!libraryArgs.GetDestination().empty()) if (!libraryArgs.GetDestination().empty())
@ -571,7 +571,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
} }
} }
break; break;
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
{ {
if(target.IsAppBundleOnApple()) if(target.IsAppBundleOnApple())
{ {
@ -635,7 +635,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
} }
} }
break; break;
case cmTarget::INTERFACE_LIBRARY: case cmState::INTERFACE_LIBRARY:
// Nothing to do. An INTERFACE_LIBRARY can be installed, but the // Nothing to do. An INTERFACE_LIBRARY can be installed, but the
// only effect of that is to make it exportable. It installs no // only effect of that is to make it exportable. It installs no
// other files itself. // other files itself.
@ -654,7 +654,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
bool createInstallGeneratorsForTargetFileSets = true; bool createInstallGeneratorsForTargetFileSets = true;
if(target.IsFrameworkOnApple() if(target.IsFrameworkOnApple()
|| target.GetType() == cmTarget::INTERFACE_LIBRARY) || target.GetType() == cmState::INTERFACE_LIBRARY)
{ {
createInstallGeneratorsForTargetFileSets = false; createInstallGeneratorsForTargetFileSets = false;
} }

View File

@ -94,29 +94,29 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
std::vector<std::string> filesFrom; std::vector<std::string> filesFrom;
std::vector<std::string> filesTo; std::vector<std::string> filesTo;
std::string literal_args; std::string literal_args;
cmTarget::TargetType targetType = cmState::TargetType targetType =
static_cast<cmTarget::TargetType>(this->Target->GetType()); static_cast<cmState::TargetType>(this->Target->GetType());
cmInstallType type = cmInstallType(); cmInstallType type = cmInstallType();
switch(targetType) switch(targetType)
{ {
case cmTarget::EXECUTABLE: type = cmInstallType_EXECUTABLE; break; case cmState::EXECUTABLE: type = cmInstallType_EXECUTABLE; break;
case cmTarget::STATIC_LIBRARY: type = cmInstallType_STATIC_LIBRARY; break; case cmState::STATIC_LIBRARY: type = cmInstallType_STATIC_LIBRARY; break;
case cmTarget::SHARED_LIBRARY: type = cmInstallType_SHARED_LIBRARY; break; case cmState::SHARED_LIBRARY: type = cmInstallType_SHARED_LIBRARY; break;
case cmTarget::MODULE_LIBRARY: type = cmInstallType_MODULE_LIBRARY; break; case cmState::MODULE_LIBRARY: type = cmInstallType_MODULE_LIBRARY; break;
case cmTarget::INTERFACE_LIBRARY: case cmState::INTERFACE_LIBRARY:
// Not reachable. We never create a cmInstallTargetGenerator for // Not reachable. We never create a cmInstallTargetGenerator for
// an INTERFACE_LIBRARY. // an INTERFACE_LIBRARY.
assert(0 && "INTERFACE_LIBRARY targets have no installable outputs."); assert(0 && "INTERFACE_LIBRARY targets have no installable outputs.");
break; break;
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
case cmTarget::UTILITY: case cmState::UTILITY:
case cmTarget::GLOBAL_TARGET: case cmState::GLOBAL_TARGET:
case cmTarget::UNKNOWN_LIBRARY: case cmState::UNKNOWN_LIBRARY:
this->Target->Target->GetMakefile()->IssueMessage(cmake::INTERNAL_ERROR, this->Target->Target->GetMakefile()->IssueMessage(cmake::INTERNAL_ERROR,
"cmInstallTargetGenerator created with non-installable target."); "cmInstallTargetGenerator created with non-installable target.");
return; return;
} }
if(targetType == cmTarget::EXECUTABLE) if(targetType == cmState::EXECUTABLE)
{ {
// There is a bug in cmInstallCommand if this fails. // There is a bug in cmInstallCommand if this fails.
assert(this->NamelinkMode == NamelinkModeNone); assert(this->NamelinkMode == NamelinkModeNone);
@ -375,7 +375,7 @@ cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target,
cmGeneratorTarget *gtgt = target->GetMakefile() cmGeneratorTarget *gtgt = target->GetMakefile()
->GetGlobalGenerator() ->GetGlobalGenerator()
->GetGeneratorTarget(target); ->GetGeneratorTarget(target);
if(target->GetType() == cmTarget::EXECUTABLE) if(target->GetType() == cmState::EXECUTABLE)
{ {
std::string targetName; std::string targetName;
std::string targetNameReal; std::string targetNameReal;
@ -542,9 +542,9 @@ cmInstallTargetGenerator
std::string const& toDestDirPath) std::string const& toDestDirPath)
{ {
if(this->ImportLibrary || if(this->ImportLibrary ||
!(this->Target->GetType() == cmTarget::SHARED_LIBRARY || !(this->Target->GetType() == cmState::SHARED_LIBRARY ||
this->Target->GetType() == cmTarget::MODULE_LIBRARY || this->Target->GetType() == cmState::MODULE_LIBRARY ||
this->Target->GetType() == cmTarget::EXECUTABLE)) this->Target->GetType() == cmState::EXECUTABLE))
{ {
return; return;
} }
@ -602,7 +602,7 @@ cmInstallTargetGenerator
// Edit the install_name of the target itself if necessary. // Edit the install_name of the target itself if necessary.
std::string new_id; std::string new_id;
if(this->Target->GetType() == cmTarget::SHARED_LIBRARY) if(this->Target->GetType() == cmState::SHARED_LIBRARY)
{ {
std::string for_build = std::string for_build =
this->Target->GetInstallNameDirForBuildTree(config); 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 // don't strip static and import libraries, because it removes the only
// symbol table they have so you can't link to them anymore // 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; return;
} }
@ -844,7 +844,7 @@ cmInstallTargetGenerator::AddRanlibRule(std::ostream& os,
const std::string& toDestDirPath) const std::string& toDestDirPath)
{ {
// Static libraries need ranlib on this platform. // Static libraries need ranlib on this platform.
if(this->Target->GetType() != cmTarget::STATIC_LIBRARY) if(this->Target->GetType() != cmState::STATIC_LIBRARY)
{ {
return; return;
} }

View File

@ -137,7 +137,7 @@ void cmLocalGenerator::TraceDependencies()
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
if (t->second->Target->IsImported() if (t->second->Target->IsImported()
|| t->second->GetType() == cmTarget::INTERFACE_LIBRARY) || t->second->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -472,7 +472,7 @@ void cmLocalGenerator::ComputeTargetManifest()
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
cmGeneratorTarget& target = *t->second; cmGeneratorTarget& target = *t->second;
if (target.GetType() == cmTarget::INTERFACE_LIBRARY) if (target.GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -1347,12 +1347,12 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
switch(target->GetType()) switch(target->GetType())
{ {
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
this->GetStaticLibraryFlags(linkFlags, buildType, target->Target); this->GetStaticLibraryFlags(linkFlags, buildType, target->Target);
break; break;
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
libraryLinkVariable = "CMAKE_MODULE_LINKER_FLAGS"; libraryLinkVariable = "CMAKE_MODULE_LINKER_FLAGS";
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
{ {
linkFlags = this->Makefile->GetSafeDefinition(libraryLinkVariable); linkFlags = this->Makefile->GetSafeDefinition(libraryLinkVariable);
linkFlags += " "; linkFlags += " ";
@ -1404,7 +1404,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
*target, false, false, useWatcomQuote); *target, false, false, useWatcomQuote);
} }
break; break;
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
{ {
linkFlags += linkFlags +=
this->Makefile->GetSafeDefinition("CMAKE_EXE_LINKER_FLAGS"); this->Makefile->GetSafeDefinition("CMAKE_EXE_LINKER_FLAGS");
@ -1549,7 +1549,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
this->Makefile->GetSafeDefinition("CMAKE_LIBRARY_PATH_TERMINATOR"); this->Makefile->GetSafeDefinition("CMAKE_LIBRARY_PATH_TERMINATOR");
// Flags to link an executable to shared libraries. // Flags to link an executable to shared libraries.
if (tgt.GetType() == cmTarget::EXECUTABLE && if (tgt.GetType() == cmState::EXECUTABLE &&
this->StateSnapshot.GetState()-> this->StateSnapshot.GetState()->
GetGlobalPropertyAsBool("TARGET_SUPPORTS_SHARED_LIBS")) GetGlobalPropertyAsBool("TARGET_SUPPORTS_SHARED_LIBS"))
{ {
@ -1631,7 +1631,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
ItemVector const& items = cli.GetItems(); ItemVector const& items = cli.GetItems();
for(ItemVector::const_iterator li = items.begin(); li != items.end(); ++li) 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; continue;
} }
@ -1817,8 +1817,8 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
if(cmSystemTools::FileIsFullPath(inName.c_str())) if(cmSystemTools::FileIsFullPath(inName.c_str()))
{ {
std::string tLocation; std::string tLocation;
if(target->GetType() >= cmTarget::EXECUTABLE && if(target->GetType() >= cmState::EXECUTABLE &&
target->GetType() <= cmTarget::MODULE_LIBRARY) target->GetType() <= cmState::MODULE_LIBRARY)
{ {
tLocation = target->GetLocation(config); tLocation = target->GetLocation(config);
tLocation = cmSystemTools::GetFilenamePath(tLocation); tLocation = cmSystemTools::GetFilenamePath(tLocation);
@ -1838,23 +1838,23 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
} }
switch (target->GetType()) switch (target->GetType())
{ {
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
case cmTarget::UNKNOWN_LIBRARY: case cmState::UNKNOWN_LIBRARY:
dep = target->GetLocation(config); dep = target->GetLocation(config);
return true; return true;
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
// An object library has no single file on which to depend. // An object library has no single file on which to depend.
// This was listed to get the target-level dependency. // This was listed to get the target-level dependency.
return false; return false;
case cmTarget::INTERFACE_LIBRARY: case cmState::INTERFACE_LIBRARY:
// An interface library has no file on which to depend. // An interface library has no file on which to depend.
// This was listed to get the target-level dependency. // This was listed to get the target-level dependency.
return false; return false;
case cmTarget::UTILITY: case cmState::UTILITY:
case cmTarget::GLOBAL_TARGET: case cmState::GLOBAL_TARGET:
// A utility target has no file on which to depend. This was listed // A utility target has no file on which to depend. This was listed
// only to get the target-level dependency. // only to get the target-level dependency.
return false; return false;
@ -2104,8 +2104,8 @@ void cmLocalGenerator
std::string warnCMP0063; std::string warnCMP0063;
std::string *pWarnCMP0063 = 0; std::string *pWarnCMP0063 = 0;
if (target->GetType() != cmTarget::SHARED_LIBRARY && if (target->GetType() != cmState::SHARED_LIBRARY &&
target->GetType() != cmTarget::MODULE_LIBRARY && target->GetType() != cmState::MODULE_LIBRARY &&
!target->IsExecutableWithExports()) !target->IsExecutableWithExports())
{ {
switch (target->GetPolicyStatusCMP0063()) switch (target->GetPolicyStatusCMP0063())
@ -2151,8 +2151,8 @@ void cmLocalGenerator::AddCMP0018Flags(std::string &flags,
{ {
int targetType = target->GetType(); int targetType = target->GetType();
bool shared = ((targetType == cmTarget::SHARED_LIBRARY) || bool shared = ((targetType == cmState::SHARED_LIBRARY) ||
(targetType == cmTarget::MODULE_LIBRARY)); (targetType == cmState::MODULE_LIBRARY));
if (this->GetShouldUseOldFlags(shared, lang)) if (this->GetShouldUseOldFlags(shared, lang))
{ {
@ -2160,7 +2160,7 @@ void cmLocalGenerator::AddCMP0018Flags(std::string &flags,
} }
else else
{ {
if (target->GetType() == cmTarget::OBJECT_LIBRARY) if (target->GetType() == cmState::OBJECT_LIBRARY)
{ {
if (target->GetPropertyAsBool("POSITION_INDEPENDENT_CODE")) if (target->GetPropertyAsBool("POSITION_INDEPENDENT_CODE"))
{ {
@ -2234,7 +2234,7 @@ void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags,
{ {
const char* picFlags = 0; const char* picFlags = 0;
if(targetType == cmTarget::EXECUTABLE) if(targetType == cmState::EXECUTABLE)
{ {
std::string flagsVar = "CMAKE_"; std::string flagsVar = "CMAKE_";
flagsVar += lang; flagsVar += lang;
@ -2512,7 +2512,7 @@ cmLocalGenerator
cmTargets& tgts = this->Makefile->GetTargets(); cmTargets& tgts = this->Makefile->GetTargets();
for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) 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; continue;
} }
@ -2540,9 +2540,9 @@ cmLocalGenerator
// Generate the proper install generator for this target type. // Generate the proper install generator for this target type.
switch(l->second.GetType()) switch(l->second.GetType())
{ {
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
{ {
// Use a target install generator. // Use a target install generator.
cmInstallTargetGeneratorLocal cmInstallTargetGeneratorLocal
@ -2550,7 +2550,7 @@ cmLocalGenerator
g.Generate(os, config, configurationTypes); g.Generate(os, config, configurationTypes);
} }
break; break;
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
{ {
#if defined(_WIN32) || defined(__CYGWIN__) #if defined(_WIN32) || defined(__CYGWIN__)
// Special code to handle DLL. Install the import library // Special code to handle DLL. Install the import library

View File

@ -31,7 +31,7 @@ void cmLocalGhsMultiGenerator::Generate()
for (cmGeneratorTargetsType::iterator l = tgts.begin(); l != tgts.end(); for (cmGeneratorTargetsType::iterator l = tgts.begin(); l != tgts.end();
++l) ++l)
{ {
if (l->second->GetType() == cmTarget::INTERFACE_LIBRARY if (l->second->GetType() == cmState::INTERFACE_LIBRARY
|| l->second->Target->IsImported()) || l->second->Target->IsImported())
{ {
continue; continue;

View File

@ -77,7 +77,7 @@ void cmLocalNinjaGenerator::Generate()
for(cmGeneratorTargetsType::iterator t = targets.begin(); for(cmGeneratorTargetsType::iterator t = targets.begin();
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
if (t->second->GetType() == cmTarget::INTERFACE_LIBRARY if (t->second->GetType() == cmState::INTERFACE_LIBRARY
|| t->second->Target->IsImported()) || t->second->Target->IsImported())
{ {
continue; continue;

View File

@ -119,7 +119,7 @@ void cmLocalUnixMakefileGenerator3::Generate()
for(cmGeneratorTargetsType::iterator t = targets.begin(); for(cmGeneratorTargetsType::iterator t = targets.begin();
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
if (t->second->GetType() == cmTarget::INTERFACE_LIBRARY if (t->second->GetType() == cmState::INTERFACE_LIBRARY
|| t->second->Target->IsImported()) || t->second->Target->IsImported())
{ {
continue; continue;
@ -180,7 +180,7 @@ GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles)
ti != targets.end(); ++ti) ti != targets.end(); ++ti)
{ {
cmGeneratorTarget* gt = ti->second; cmGeneratorTarget* gt = ti->second;
if (gt->GetType() == cmTarget::INTERFACE_LIBRARY) if (gt->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -423,12 +423,12 @@ void cmLocalUnixMakefileGenerator3
for(cmGeneratorTargetsType::iterator t = targets.begin(); for(cmGeneratorTargetsType::iterator t = targets.begin();
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
if((t->second->GetType() == cmTarget::EXECUTABLE) || if((t->second->GetType() == cmState::EXECUTABLE) ||
(t->second->GetType() == cmTarget::STATIC_LIBRARY) || (t->second->GetType() == cmState::STATIC_LIBRARY) ||
(t->second->GetType() == cmTarget::SHARED_LIBRARY) || (t->second->GetType() == cmState::SHARED_LIBRARY) ||
(t->second->GetType() == cmTarget::MODULE_LIBRARY) || (t->second->GetType() == cmState::MODULE_LIBRARY) ||
(t->second->GetType() == cmTarget::OBJECT_LIBRARY) || (t->second->GetType() == cmState::OBJECT_LIBRARY) ||
(t->second->GetType() == cmTarget::UTILITY)) (t->second->GetType() == cmState::UTILITY))
{ {
if (t->second->Target->IsImported()) if (t->second->Target->IsImported())
{ {
@ -1774,7 +1774,7 @@ void cmLocalUnixMakefileGenerator3
cmTargets::iterator glIt; cmTargets::iterator glIt;
for ( glIt = targets->begin(); glIt != targets->end(); ++ 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::string targetString = "Special rule for the target " + glIt->first;
std::vector<std::string> commands; std::vector<std::string> commands;

View File

@ -77,7 +77,7 @@ void cmLocalVisualStudio10Generator::Generate()
cmTargets &tgts = this->Makefile->GetTargets(); cmTargets &tgts = this->Makefile->GetTargets();
for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) 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; continue;
} }

View File

@ -86,8 +86,8 @@ void cmLocalVisualStudio6Generator::AddCMakeListsRules()
for(cmTargets::iterator l = tgts.begin(); for(cmTargets::iterator l = tgts.begin();
l != tgts.end(); l++) l != tgts.end(); l++)
{ {
if (l->second.GetType() == cmTarget::INTERFACE_LIBRARY if (l->second.GetType() == cmState::INTERFACE_LIBRARY
|| l->second.GetType() == cmTarget::GLOBAL_TARGET) || l->second.GetType() == cmState::GLOBAL_TARGET)
{ {
continue; continue;
} }
@ -132,22 +132,22 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
{ {
switch(l->second.GetType()) switch(l->second.GetType())
{ {
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
this->SetBuildType(STATIC_LIBRARY, l->first.c_str(), l->second); this->SetBuildType(STATIC_LIBRARY, l->first.c_str(), l->second);
break; break;
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
this->SetBuildType(DLL, l->first.c_str(), l->second); this->SetBuildType(DLL, l->first.c_str(), l->second);
break; break;
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
this->SetBuildType(EXECUTABLE,l->first.c_str(), l->second); this->SetBuildType(EXECUTABLE,l->first.c_str(), l->second);
break; break;
case cmTarget::UTILITY: case cmState::UTILITY:
case cmTarget::GLOBAL_TARGET: case cmState::GLOBAL_TARGET:
this->SetBuildType(UTILITY, l->first.c_str(), l->second); this->SetBuildType(UTILITY, l->first.c_str(), l->second);
break; break;
case cmTarget::INTERFACE_LIBRARY: case cmState::INTERFACE_LIBRARY:
continue; continue;
default: default:
cmSystemTools::Error("Bad target type: ", l->first.c_str()); 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 // special care for dependencies. The first rule must depend on all
// the dependencies of all the rules. The later rules must each // the dependencies of all the rules. The later rules must each
// depend only on the previous rule. // depend only on the previous rule.
if ((target.GetType() == cmTarget::UTILITY || if ((target.GetType() == cmState::UTILITY ||
target.GetType() == cmTarget::GLOBAL_TARGET) && target.GetType() == cmState::GLOBAL_TARGET) &&
(!target.GetPreBuildCommands().empty() || (!target.GetPreBuildCommands().empty() ||
!target.GetPostBuildCommands().empty())) !target.GetPostBuildCommands().empty()))
{ {
@ -482,8 +482,8 @@ void cmLocalVisualStudio6Generator
cmSystemTools::ExpandListArgument(dependsValue, depends); cmSystemTools::ExpandListArgument(dependsValue, depends);
} }
if (GetVS6TargetName(source) != libName || if (GetVS6TargetName(source) != libName ||
target.GetType() == cmTarget::UTILITY || target.GetType() == cmState::UTILITY ||
target.GetType() == cmTarget::GLOBAL_TARGET) target.GetType() == cmState::GLOBAL_TARGET)
{ {
fout << "# Begin Source File\n\n"; 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 // VS6 forgets to create the output directory for archives if it
// differs from the intermediate directory. // differs from the intermediate directory.
if(target.GetType() != cmTarget::STATIC_LIBRARY) { return pcc; } if(target.GetType() != cmState::STATIC_LIBRARY) { return pcc; }
cmGeneratorTarget* gt = cmGeneratorTarget* gt =
this->GlobalGenerator->GetGeneratorTarget(&target); this->GlobalGenerator->GetGeneratorTarget(&target);
@ -835,7 +835,7 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target,
const std::string& configName, const std::string& configName,
const std::string& /* libName */) const std::string& /* libName */)
{ {
if (target.GetType() >= cmTarget::UTILITY ) if (target.GetType() >= cmState::UTILITY )
{ {
return ""; return "";
} }
@ -948,8 +948,8 @@ void cmLocalVisualStudio6Generator
const std::string& libName, cmTarget &target, const std::string& libName, cmTarget &target,
std::vector<cmSourceGroup> &) std::vector<cmSourceGroup> &)
{ {
bool targetBuilds = (target.GetType() >= cmTarget::EXECUTABLE && bool targetBuilds = (target.GetType() >= cmState::EXECUTABLE &&
target.GetType() <= cmTarget::MODULE_LIBRARY); target.GetType() <= cmState::MODULE_LIBRARY);
#ifdef CM_USE_OLD_VS6 #ifdef CM_USE_OLD_VS6
// Lookup the library and executable output directories. // Lookup the library and executable output directories.
std::string libPath; std::string libPath;
@ -1108,12 +1108,12 @@ void cmLocalVisualStudio6Generator
// add libraries to executables and dlls (but never include // add libraries to executables and dlls (but never include
// a library in a library, bad recursion) // a library in a library, bad recursion)
// NEVER LINK STATIC LIBRARIES TO OTHER STATIC LIBRARIES // NEVER LINK STATIC LIBRARIES TO OTHER STATIC LIBRARIES
if ((target.GetType() != cmTarget::SHARED_LIBRARY if ((target.GetType() != cmState::SHARED_LIBRARY
&& target.GetType() != cmTarget::STATIC_LIBRARY && target.GetType() != cmState::STATIC_LIBRARY
&& target.GetType() != cmTarget::MODULE_LIBRARY) || && target.GetType() != cmState::MODULE_LIBRARY) ||
(target.GetType()==cmTarget::SHARED_LIBRARY (target.GetType()==cmState::SHARED_LIBRARY
&& libName != GetVS6TargetName(j->first)) || && libName != GetVS6TargetName(j->first)) ||
(target.GetType()==cmTarget::MODULE_LIBRARY (target.GetType()==cmState::MODULE_LIBRARY
&& libName != GetVS6TargetName(j->first))) && libName != GetVS6TargetName(j->first)))
{ {
// Compute the proper name to use to link this library. // Compute the proper name to use to link this library.
@ -1195,7 +1195,7 @@ void cmLocalVisualStudio6Generator
std::string extraLinkOptionsRelease; std::string extraLinkOptionsRelease;
std::string extraLinkOptionsMinSizeRel; std::string extraLinkOptionsMinSizeRel;
std::string extraLinkOptionsRelWithDebInfo; std::string extraLinkOptionsRelWithDebInfo;
if(target.GetType() == cmTarget::EXECUTABLE) if(target.GetType() == cmState::EXECUTABLE)
{ {
extraLinkOptions = this->Makefile-> extraLinkOptions = this->Makefile->
GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS"); GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS");
@ -1208,7 +1208,7 @@ void cmLocalVisualStudio6Generator
extraLinkOptionsRelWithDebInfo = this->Makefile-> extraLinkOptionsRelWithDebInfo = this->Makefile->
GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO"); GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO");
} }
if(target.GetType() == cmTarget::SHARED_LIBRARY) if(target.GetType() == cmState::SHARED_LIBRARY)
{ {
extraLinkOptions = this->Makefile-> extraLinkOptions = this->Makefile->
GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS"); GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS");
@ -1221,7 +1221,7 @@ void cmLocalVisualStudio6Generator
extraLinkOptionsRelWithDebInfo = this->Makefile-> extraLinkOptionsRelWithDebInfo = this->Makefile->
GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO"); GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO");
} }
if(target.GetType() == cmTarget::MODULE_LIBRARY) if(target.GetType() == cmState::MODULE_LIBRARY)
{ {
extraLinkOptions = this->Makefile-> extraLinkOptions = this->Makefile->
GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS"); GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS");
@ -1313,9 +1313,9 @@ void cmLocalVisualStudio6Generator
// Compute version number information. // Compute version number information.
std::string targetVersionFlag; std::string targetVersionFlag;
if(target.GetType() == cmTarget::EXECUTABLE || if(target.GetType() == cmState::EXECUTABLE ||
target.GetType() == cmTarget::SHARED_LIBRARY || target.GetType() == cmState::SHARED_LIBRARY ||
target.GetType() == cmTarget::MODULE_LIBRARY) target.GetType() == cmState::MODULE_LIBRARY)
{ {
int major; int major;
int minor; int minor;
@ -1332,10 +1332,10 @@ void cmLocalVisualStudio6Generator
std::string outputNameRelease = outputName; std::string outputNameRelease = outputName;
std::string outputNameMinSizeRel = outputName; std::string outputNameMinSizeRel = outputName;
std::string outputNameRelWithDebInfo = outputName; std::string outputNameRelWithDebInfo = outputName;
if(target.GetType() == cmTarget::EXECUTABLE || if(target.GetType() == cmState::EXECUTABLE ||
target.GetType() == cmTarget::STATIC_LIBRARY || target.GetType() == cmState::STATIC_LIBRARY ||
target.GetType() == cmTarget::SHARED_LIBRARY || target.GetType() == cmState::SHARED_LIBRARY ||
target.GetType() == cmTarget::MODULE_LIBRARY) target.GetType() == cmState::MODULE_LIBRARY)
{ {
outputName = gt->GetFullName(); outputName = gt->GetFullName();
outputNameDebug = gt->GetFullName("Debug"); outputNameDebug = gt->GetFullName("Debug");
@ -1343,7 +1343,7 @@ void cmLocalVisualStudio6Generator
outputNameMinSizeRel = gt->GetFullName("MinSizeRel"); outputNameMinSizeRel = gt->GetFullName("MinSizeRel");
outputNameRelWithDebInfo = gt->GetFullName("RelWithDebInfo"); outputNameRelWithDebInfo = gt->GetFullName("RelWithDebInfo");
} }
else if(target.GetType() == cmTarget::OBJECT_LIBRARY) else if(target.GetType() == cmState::OBJECT_LIBRARY)
{ {
outputName = target.GetName(); outputName = target.GetName();
outputName += ".lib"; outputName += ".lib";
@ -1359,10 +1359,10 @@ void cmLocalVisualStudio6Generator
std::string outputDirRelease; std::string outputDirRelease;
std::string outputDirMinSizeRel; std::string outputDirMinSizeRel;
std::string outputDirRelWithDebInfo; std::string outputDirRelWithDebInfo;
if(target.GetType() == cmTarget::EXECUTABLE || if(target.GetType() == cmState::EXECUTABLE ||
target.GetType() == cmTarget::STATIC_LIBRARY || target.GetType() == cmState::STATIC_LIBRARY ||
target.GetType() == cmTarget::SHARED_LIBRARY || target.GetType() == cmState::SHARED_LIBRARY ||
target.GetType() == cmTarget::MODULE_LIBRARY) target.GetType() == cmState::MODULE_LIBRARY)
{ {
#ifdef CM_USE_OLD_VS6 #ifdef CM_USE_OLD_VS6
outputDirOld = outputDirOld =
@ -1382,7 +1382,7 @@ void cmLocalVisualStudio6Generator
removeQuotes(this->ConvertToOutputFormat( removeQuotes(this->ConvertToOutputFormat(
gt->GetDirectory("RelWithDebInfo").c_str(), SHELL)); 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(); std::string outputDir = cmake::GetCMakeFilesDirectoryPostSlash();
outputDirDebug = outputDir + "Debug"; outputDirDebug = outputDir + "Debug";
@ -1396,9 +1396,9 @@ void cmLocalVisualStudio6Generator
std::string optionsRelease; std::string optionsRelease;
std::string optionsMinSizeRel; std::string optionsMinSizeRel;
std::string optionsRelWithDebInfo; std::string optionsRelWithDebInfo;
if(target.GetType() == cmTarget::EXECUTABLE || if(target.GetType() == cmState::EXECUTABLE ||
target.GetType() == cmTarget::SHARED_LIBRARY || target.GetType() == cmState::SHARED_LIBRARY ||
target.GetType() == cmTarget::MODULE_LIBRARY) target.GetType() == cmState::MODULE_LIBRARY)
{ {
extraLinkOptionsDebug = extraLinkOptionsDebug =
extraLinkOptions + " " + extraLinkOptionsDebug; extraLinkOptions + " " + extraLinkOptionsDebug;
@ -1424,9 +1424,9 @@ void cmLocalVisualStudio6Generator
std::string targetImplibFlagRelease; std::string targetImplibFlagRelease;
std::string targetImplibFlagMinSizeRel; std::string targetImplibFlagMinSizeRel;
std::string targetImplibFlagRelWithDebInfo; std::string targetImplibFlagRelWithDebInfo;
if(target.GetType() == cmTarget::SHARED_LIBRARY || if(target.GetType() == cmState::SHARED_LIBRARY ||
target.GetType() == cmTarget::MODULE_LIBRARY || target.GetType() == cmState::MODULE_LIBRARY ||
target.GetType() == cmTarget::EXECUTABLE) target.GetType() == cmState::EXECUTABLE)
{ {
std::string fullPathImpDebug = gt->GetDirectory("Debug", true); std::string fullPathImpDebug = gt->GetDirectory("Debug", true);
std::string fullPathImpRelease = gt->GetDirectory("Release", true); std::string fullPathImpRelease = gt->GetDirectory("Release", true);
@ -1494,7 +1494,7 @@ void cmLocalVisualStudio6Generator
std::string staticLibOptionsRelease; std::string staticLibOptionsRelease;
std::string staticLibOptionsMinSizeRel; std::string staticLibOptionsMinSizeRel;
std::string staticLibOptionsRelWithDebInfo; std::string staticLibOptionsRelWithDebInfo;
if(target.GetType() == cmTarget::STATIC_LIBRARY ) if(target.GetType() == cmState::STATIC_LIBRARY )
{ {
const char *libflagsGlobal = const char *libflagsGlobal =
this->Makefile->GetSafeDefinition("CMAKE_STATIC_LINKER_FLAGS"); this->Makefile->GetSafeDefinition("CMAKE_STATIC_LINKER_FLAGS");
@ -1567,8 +1567,8 @@ void cmLocalVisualStudio6Generator
libnameExports.c_str()); libnameExports.c_str());
cmSystemTools::ReplaceString(line, "CMAKE_MFC_FLAG", cmSystemTools::ReplaceString(line, "CMAKE_MFC_FLAG",
mfcFlag); mfcFlag);
if(target.GetType() == cmTarget::STATIC_LIBRARY || if(target.GetType() == cmState::STATIC_LIBRARY ||
target.GetType() == cmTarget::OBJECT_LIBRARY) target.GetType() == cmState::OBJECT_LIBRARY)
{ {
cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS_DEBUG", cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS_DEBUG",
staticLibOptionsDebug.c_str()); staticLibOptionsDebug.c_str());
@ -1674,7 +1674,7 @@ void cmLocalVisualStudio6Generator
(exePath.c_str(), SHELL)).c_str()); (exePath.c_str(), SHELL)).c_str());
#endif #endif
if(targetBuilds || target.GetType() == cmTarget::OBJECT_LIBRARY) if(targetBuilds || target.GetType() == cmState::OBJECT_LIBRARY)
{ {
cmSystemTools::ReplaceString(line, "OUTPUT_DIRECTORY_DEBUG", cmSystemTools::ReplaceString(line, "OUTPUT_DIRECTORY_DEBUG",
outputDirDebug.c_str()); outputDirDebug.c_str());
@ -1698,8 +1698,8 @@ void cmLocalVisualStudio6Generator
= this->Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX"); = this->Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX");
cmSystemTools::ReplaceString(line, "DEBUG_POSTFIX", cmSystemTools::ReplaceString(line, "DEBUG_POSTFIX",
debugPostfix?debugPostfix:""); debugPostfix?debugPostfix:"");
if(target.GetType() >= cmTarget::EXECUTABLE && if(target.GetType() >= cmState::EXECUTABLE &&
target.GetType() <= cmTarget::OBJECT_LIBRARY) target.GetType() <= cmState::OBJECT_LIBRARY)
{ {
// store flags for each configuration // store flags for each configuration
std::string flags = " "; std::string flags = " ";
@ -1899,7 +1899,7 @@ void cmLocalVisualStudio6Generator
this->ConvertToOutputFormat(l->Value.c_str(), SHELL); this->ConvertToOutputFormat(l->Value.c_str(), SHELL);
} }
else if (!l->Target else if (!l->Target
|| l->Target->GetType() != cmTarget::INTERFACE_LIBRARY) || l->Target->GetType() != cmState::INTERFACE_LIBRARY)
{ {
options += l->Value; options += l->Value;
} }

View File

@ -71,7 +71,7 @@ void cmLocalVisualStudio7Generator::AddHelperCommands()
for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++) 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; continue;
} }
@ -106,7 +106,7 @@ void cmLocalVisualStudio7Generator::AddCMakeListsRules()
// Add the rule to targets that need it. // Add the rule to targets that need it.
for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) 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; continue;
} }
@ -131,7 +131,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
l != tgts.end(); l++) l != tgts.end(); l++)
{ {
cmTarget& tgt = l->second; cmTarget& tgt = l->second;
if(tgt.GetType() == cmTarget::GLOBAL_TARGET) if(tgt.GetType() == cmState::GLOBAL_TARGET)
{ {
std::vector<std::string> no_depends; std::vector<std::string> no_depends;
cmCustomCommandLine force_command; cmCustomCommandLine force_command;
@ -182,7 +182,7 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles()
for(cmTargets::iterator l = tgts.begin(); for(cmTargets::iterator l = tgts.begin();
l != tgts.end(); l++) l != tgts.end(); l++)
{ {
if(l->second.GetType() == cmTarget::INTERFACE_LIBRARY) if(l->second.GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -672,22 +672,22 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
switch(target.GetType()) switch(target.GetType())
{ {
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
targetBuilds = false; // no manifest tool for object library targetBuilds = false; // no manifest tool for object library
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
projectType = "typeStaticLibrary"; projectType = "typeStaticLibrary";
configType = "4"; configType = "4";
break; break;
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
projectType = "typeDynamicLibrary"; projectType = "typeDynamicLibrary";
configType = "2"; configType = "2";
break; break;
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
configType = "1"; configType = "1";
break; break;
case cmTarget::UTILITY: case cmState::UTILITY:
case cmTarget::GLOBAL_TARGET: case cmState::GLOBAL_TARGET:
configType = "10"; configType = "10";
default: default:
targetBuilds = false; targetBuilds = false;
@ -788,10 +788,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
intermediateDir += "/"; intermediateDir += "/";
intermediateDir += configName; intermediateDir += configName;
if (target.GetType() < cmTarget::UTILITY) if (target.GetType() < cmState::UTILITY)
{ {
std::string const& outDir = std::string const& outDir =
target.GetType() == cmTarget::OBJECT_LIBRARY? target.GetType() == cmState::OBJECT_LIBRARY?
intermediateDir : gt->GetDirectory(configName); intermediateDir : gt->GetDirectory(configName);
fout << "\t\t\tOutputDirectory=\"" fout << "\t\t\tOutputDirectory=\""
<< this->ConvertToXMLOutputPathSingle(outDir.c_str()) << "\"\n"; << this->ConvertToXMLOutputPathSingle(outDir.c_str()) << "\"\n";
@ -882,7 +882,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
targetOptions.OutputFlagMap(fout, "\t\t\t\t"); targetOptions.OutputFlagMap(fout, "\t\t\t\t");
targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX"); targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX");
fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n"; 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. // Specify the compiler program database file if configured.
std::string pdb = gt->GetCompilePDBPath(configName); std::string pdb = gt->GetCompilePDBPath(configName);
@ -1045,21 +1045,21 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator);
std::string temp; std::string temp;
std::string extraLinkOptions; std::string extraLinkOptions;
if(target.GetType() == cmTarget::EXECUTABLE) if(target.GetType() == cmState::EXECUTABLE)
{ {
extraLinkOptions = extraLinkOptions =
this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS") this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS")
+ std::string(" ") + std::string(" ")
+ GetBuildTypeLinkerFlags("CMAKE_EXE_LINKER_FLAGS", configName); + GetBuildTypeLinkerFlags("CMAKE_EXE_LINKER_FLAGS", configName);
} }
if(target.GetType() == cmTarget::SHARED_LIBRARY) if(target.GetType() == cmState::SHARED_LIBRARY)
{ {
extraLinkOptions = extraLinkOptions =
this->Makefile->GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS") this->Makefile->GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS")
+ std::string(" ") + std::string(" ")
+ GetBuildTypeLinkerFlags("CMAKE_SHARED_LINKER_FLAGS", configName); + GetBuildTypeLinkerFlags("CMAKE_SHARED_LINKER_FLAGS", configName);
} }
if(target.GetType() == cmTarget::MODULE_LIBRARY) if(target.GetType() == cmState::MODULE_LIBRARY)
{ {
extraLinkOptions = extraLinkOptions =
this->Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS") this->Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS")
@ -1099,7 +1099,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
cmGeneratorTarget* gt = cmGeneratorTarget* gt =
this->GlobalGenerator->GetGeneratorTarget(&target); 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")) this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
{ {
if (target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) if (target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
@ -1109,9 +1109,9 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
} }
switch(target.GetType()) switch(target.GetType())
{ {
case cmTarget::UNKNOWN_LIBRARY: case cmState::UNKNOWN_LIBRARY:
break; break;
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
{ {
std::string libpath = this->GetTargetDirectory(target); std::string libpath = this->GetTargetDirectory(target);
libpath += "/"; libpath += "/";
@ -1127,7 +1127,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
<< this->ConvertToXMLOutputPathSingle(libpath.c_str()) << "\"/>\n"; << this->ConvertToXMLOutputPathSingle(libpath.c_str()) << "\"/>\n";
break; break;
} }
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
{ {
std::string targetNameFull = gt->GetFullName(configName); std::string targetNameFull = gt->GetFullName(configName);
std::string libpath = gt->GetDirectory(configName); std::string libpath = gt->GetDirectory(configName);
@ -1161,8 +1161,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
<< this->ConvertToXMLOutputPathSingle(libpath.c_str()) << "\"/>\n"; << this->ConvertToXMLOutputPathSingle(libpath.c_str()) << "\"/>\n";
break; break;
} }
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
{ {
std::string targetName; std::string targetName;
std::string targetNameSO; std::string targetNameSO;
@ -1260,7 +1260,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
fout << "/>\n"; fout << "/>\n";
} }
break; break;
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
{ {
std::string targetName; std::string targetName;
std::string targetNameFull; std::string targetNameFull;
@ -1374,9 +1374,9 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
<< this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"/>\n"; << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"/>\n";
break; break;
} }
case cmTarget::UTILITY: case cmState::UTILITY:
case cmTarget::GLOBAL_TARGET: case cmState::GLOBAL_TARGET:
case cmTarget::INTERFACE_LIBRARY: case cmState::INTERFACE_LIBRARY:
break; break;
} }
} }
@ -1408,7 +1408,7 @@ cmLocalVisualStudio7GeneratorInternals
fout << lg->ConvertToXMLOutputPath(rel.c_str()) << " "; fout << lg->ConvertToXMLOutputPath(rel.c_str()) << " ";
} }
else if (!l->Target else if (!l->Target
|| l->Target->GetType() != cmTarget::INTERFACE_LIBRARY) || l->Target->GetType() != cmState::INTERFACE_LIBRARY)
{ {
fout << l->Value << " "; fout << l->Value << " ";
} }
@ -1775,8 +1775,8 @@ bool cmLocalVisualStudio7Generator
std::string source = (*sf)->GetFullPath(); std::string source = (*sf)->GetFullPath();
FCInfo fcinfo(this, target, *(*sf), configs); FCInfo fcinfo(this, target, *(*sf), configs);
if (source != libName || target.GetType() == cmTarget::UTILITY || if (source != libName || target.GetType() == cmState::UTILITY ||
target.GetType() == cmTarget::GLOBAL_TARGET ) target.GetType() == cmState::GLOBAL_TARGET )
{ {
fout << "\t\t\t<File\n"; fout << "\t\t\t<File\n";
std::string d = this->ConvertToXMLOutputPathSingle(source.c_str()); std::string d = this->ConvertToXMLOutputPathSingle(source.c_str());
@ -2026,7 +2026,7 @@ void cmLocalVisualStudio7Generator
cmTarget &target, cmTarget &target,
const std::string& /*libName*/) const std::string& /*libName*/)
{ {
if (target.GetType() > cmTarget::GLOBAL_TARGET) if (target.GetType() > cmState::GLOBAL_TARGET)
{ {
return; return;
} }
@ -2043,7 +2043,7 @@ void cmLocalVisualStudio7Generator
tool = this->FortranProject? "VFPreLinkEventTool":"VCPreLinkEventTool"; tool = this->FortranProject? "VFPreLinkEventTool":"VCPreLinkEventTool";
event.Start(tool); event.Start(tool);
bool addedPrelink = false; bool addedPrelink = false;
if (target.GetType() == cmTarget::SHARED_LIBRARY && if (target.GetType() == cmState::SHARED_LIBRARY &&
this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
{ {
if (target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) if (target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
@ -2124,30 +2124,30 @@ cmLocalVisualStudio7Generator
const char* projectType = 0; const char* projectType = 0;
switch(target.GetType()) switch(target.GetType())
{ {
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
projectType = "typeStaticLibrary"; projectType = "typeStaticLibrary";
if(keyword) if(keyword)
{ {
keyword = "Static Library"; keyword = "Static Library";
} }
break; break;
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
projectType = "typeDynamicLibrary"; projectType = "typeDynamicLibrary";
if(!keyword) if(!keyword)
{ {
keyword = "Dll"; keyword = "Dll";
} }
break; break;
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
if(!keyword) if(!keyword)
{ {
keyword = "Console Application"; keyword = "Console Application";
} }
projectType = 0; projectType = 0;
break; break;
case cmTarget::UTILITY: case cmState::UTILITY:
case cmTarget::GLOBAL_TARGET: case cmState::GLOBAL_TARGET:
default: default:
break; break;
} }

View File

@ -89,8 +89,8 @@ cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target,
// If an executable exports symbols then VS wants to create an // If an executable exports symbols then VS wants to create an
// import library but forgets to create the output directory. // import library but forgets to create the output directory.
// The Intel Fortran plugin always forgets to the directory. // The Intel Fortran plugin always forgets to the directory.
if(target.GetType() != cmTarget::EXECUTABLE && if(target.GetType() != cmState::EXECUTABLE &&
!(isFortran && target.GetType() == cmTarget::SHARED_LIBRARY)) !(isFortran && target.GetType() == cmState::SHARED_LIBRARY))
{ return pcc; } { return pcc; }
cmGeneratorTarget* gt = cmGeneratorTarget* gt =
this->GetGlobalGenerator()->GetGeneratorTarget(&target); this->GetGlobalGenerator()->GetGeneratorTarget(&target);

View File

@ -759,7 +759,7 @@ void cmMakefile::ConfigureFinalPass()
for (cmTargets::iterator l = this->Targets.begin(); for (cmTargets::iterator l = this->Targets.begin();
l != this->Targets.end(); l++) l != this->Targets.end(); l++)
{ {
if (l->second.GetType() == cmTarget::INTERFACE_LIBRARY) if (l->second.GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -810,7 +810,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target,
return; return;
} }
if(ti->second.GetType() == cmTarget::OBJECT_LIBRARY) if(ti->second.GetType() == cmState::OBJECT_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "Target \"" << target << "\" is an OBJECT library " e << "Target \"" << target << "\" is an OBJECT library "
@ -818,7 +818,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target,
this->IssueMessage(cmake::FATAL_ERROR, e.str()); this->IssueMessage(cmake::FATAL_ERROR, e.str());
return; return;
} }
if(ti->second.GetType() == cmTarget::INTERFACE_LIBRARY) if(ti->second.GetType() == cmState::INTERFACE_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "Target \"" << target << "\" is an INTERFACE library " e << "Target \"" << target << "\" is an INTERFACE library "
@ -1184,7 +1184,7 @@ cmMakefile::AddUtilityCommand(const std::string& utilityName,
bool uses_terminal) bool uses_terminal)
{ {
// Create a target instance for this utility. // Create a target instance for this utility.
cmTarget* target = this->AddNewTarget(cmTarget::UTILITY, utilityName); cmTarget* target = this->AddNewTarget(cmState::UTILITY, utilityName);
if (excludeFromAll) if (excludeFromAll)
{ {
target->SetProperty("EXCLUDE_FROM_ALL", "TRUE"); target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
@ -1419,9 +1419,9 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
if(tgt) if(tgt)
{ {
// if it is not a static or shared library then you can not link to it // if it is not a static or shared library then you can not link to it
if(!((tgt->GetType() == cmTarget::STATIC_LIBRARY) || if(!((tgt->GetType() == cmState::STATIC_LIBRARY) ||
(tgt->GetType() == cmTarget::SHARED_LIBRARY) || (tgt->GetType() == cmState::SHARED_LIBRARY) ||
(tgt->GetType() == cmTarget::INTERFACE_LIBRARY) || (tgt->GetType() == cmState::INTERFACE_LIBRARY) ||
tgt->IsExecutableWithExports())) tgt->IsExecutableWithExports()))
{ {
std::ostringstream e; std::ostringstream e;
@ -2018,9 +2018,9 @@ void cmMakefile::AddGlobalLinkInformation(const std::string& name,
// for these targets do not add anything // for these targets do not add anything
switch(target.GetType()) switch(target.GetType())
{ {
case cmTarget::UTILITY: case cmState::UTILITY:
case cmTarget::GLOBAL_TARGET: case cmState::GLOBAL_TARGET:
case cmTarget::INTERFACE_LIBRARY: case cmState::INTERFACE_LIBRARY:
return; return;
default:; default:;
} }
@ -2057,20 +2057,20 @@ void cmMakefile::AddAlias(const std::string& lname, cmTarget *tgt)
} }
cmTarget* cmMakefile::AddLibrary(const std::string& lname, cmTarget* cmMakefile::AddLibrary(const std::string& lname,
cmTarget::TargetType type, cmState::TargetType type,
const std::vector<std::string> &srcs, const std::vector<std::string> &srcs,
bool excludeFromAll) bool excludeFromAll)
{ {
// wrong type ? default to STATIC // wrong type ? default to STATIC
if ( (type != cmTarget::STATIC_LIBRARY) if ( (type != cmState::STATIC_LIBRARY)
&& (type != cmTarget::SHARED_LIBRARY) && (type != cmState::SHARED_LIBRARY)
&& (type != cmTarget::MODULE_LIBRARY) && (type != cmState::MODULE_LIBRARY)
&& (type != cmTarget::OBJECT_LIBRARY) && (type != cmState::OBJECT_LIBRARY)
&& (type != cmTarget::INTERFACE_LIBRARY)) && (type != cmState::INTERFACE_LIBRARY))
{ {
this->IssueMessage(cmake::INTERNAL_ERROR, this->IssueMessage(cmake::INTERNAL_ERROR,
"cmMakefile::AddLibrary given invalid target type."); "cmMakefile::AddLibrary given invalid target type.");
type = cmTarget::STATIC_LIBRARY; type = cmState::STATIC_LIBRARY;
} }
cmTarget* target = this->AddNewTarget(type, lname); cmTarget* target = this->AddNewTarget(type, lname);
@ -2091,7 +2091,7 @@ cmTarget* cmMakefile::AddExecutable(const char *exeName,
const std::vector<std::string> &srcs, const std::vector<std::string> &srcs,
bool excludeFromAll) bool excludeFromAll)
{ {
cmTarget* target = this->AddNewTarget(cmTarget::EXECUTABLE, exeName); cmTarget* target = this->AddNewTarget(cmState::EXECUTABLE, exeName);
if(excludeFromAll) if(excludeFromAll)
{ {
target->SetProperty("EXCLUDE_FROM_ALL", "TRUE"); target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
@ -2103,7 +2103,7 @@ cmTarget* cmMakefile::AddExecutable(const char *exeName,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTarget* cmTarget*
cmMakefile::AddNewTarget(cmTarget::TargetType type, const std::string& name) cmMakefile::AddNewTarget(cmState::TargetType type, const std::string& name)
{ {
cmTargets::iterator it = cmTargets::iterator it =
this->Targets.insert(cmTargets::value_type(name, cmTarget())).first; this->Targets.insert(cmTargets::value_type(name, cmTarget())).first;
@ -2299,8 +2299,8 @@ void cmMakefile::ExpandVariablesCMP0019()
l != this->Targets.end(); ++l) l != this->Targets.end(); ++l)
{ {
cmTarget &t = l->second; cmTarget &t = l->second;
if (t.GetType() == cmTarget::INTERFACE_LIBRARY if (t.GetType() == cmState::INTERFACE_LIBRARY
|| t.GetType() == cmTarget::GLOBAL_TARGET) || t.GetType() == cmState::GLOBAL_TARGET)
{ {
continue; continue;
} }
@ -4178,7 +4178,7 @@ void cmMakefile::RaiseScope(const std::string& var, const char *varDef)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTarget* cmTarget*
cmMakefile::AddImportedTarget(const std::string& name, cmMakefile::AddImportedTarget(const std::string& name,
cmTarget::TargetType type, cmState::TargetType type,
bool global) bool global)
{ {
// Create the target. // 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. // The conflict is with a non-imported target.
// Allow this if the user has requested support. // Allow this if the user has requested support.
cmake* cm = this->GetCMakeInstance(); cmake* cm = this->GetCMakeInstance();
if(isCustom && existing->GetType() == cmTarget::UTILITY && if(isCustom && existing->GetType() == cmState::UTILITY &&
this != existing->GetMakefile() && this != existing->GetMakefile() &&
cm->GetState() cm->GetState()
->GetGlobalPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS")) ->GetGlobalPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS"))
@ -4295,22 +4295,22 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
<< "The existing target is "; << "The existing target is ";
switch(existing->GetType()) switch(existing->GetType())
{ {
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
e << "an executable "; e << "an executable ";
break; break;
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
e << "a static library "; e << "a static library ";
break; break;
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
e << "a shared library "; e << "a shared library ";
break; break;
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
e << "a module library "; e << "a module library ";
break; break;
case cmTarget::UTILITY: case cmState::UTILITY:
e << "a custom target "; e << "a custom target ";
break; break;
case cmTarget::INTERFACE_LIBRARY: case cmState::INTERFACE_LIBRARY:
e << "an interface library "; e << "an interface library ";
break; break;
default: break; default: break;

View File

@ -172,10 +172,10 @@ public:
/** Create a new imported target with the name and type given. */ /** Create a new imported target with the name and type given. */
cmTarget* AddImportedTarget(const std::string& name, cmTarget* AddImportedTarget(const std::string& name,
cmTarget::TargetType type, cmState::TargetType type,
bool global); 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. * Add an executable to the build.
@ -281,7 +281,7 @@ public:
/** /**
* Set the name of the library. * 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, const std::vector<std::string> &srcs,
bool excludeFromAll = false); bool excludeFromAll = false);
void AddAlias(const std::string& libname, cmTarget *tgt); void AddAlias(const std::string& libname, cmTarget *tgt);

View File

@ -26,7 +26,7 @@ cmMakefileLibraryTargetGenerator
cmMakefileTargetGenerator(target) cmMakefileTargetGenerator(target)
{ {
this->CustomCommandDriver = OnDepends; this->CustomCommandDriver = OnDepends;
if (this->GeneratorTarget->GetType() != cmTarget::INTERFACE_LIBRARY) if (this->GeneratorTarget->GetType() != cmState::INTERFACE_LIBRARY)
{ {
this->GeneratorTarget->GetLibraryNames( this->GeneratorTarget->GetLibraryNames(
this->TargetNameOut, this->TargetNameSO, this->TargetNameReal, this->TargetNameOut, this->TargetNameSO, this->TargetNameReal,
@ -64,10 +64,10 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
// Write the rule for this target type. // Write the rule for this target type.
switch(this->GeneratorTarget->GetType()) switch(this->GeneratorTarget->GetType())
{ {
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
this->WriteStaticLibraryRules(); this->WriteStaticLibraryRules();
break; break;
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
this->WriteSharedLibraryRules(false); this->WriteSharedLibraryRules(false);
if(this->GeneratorTarget->NeedRelinkBeforeInstall(this->ConfigName)) if(this->GeneratorTarget->NeedRelinkBeforeInstall(this->ConfigName))
{ {
@ -75,7 +75,7 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
this->WriteSharedLibraryRules(true); this->WriteSharedLibraryRules(true);
} }
break; break;
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
this->WriteModuleLibraryRules(false); this->WriteModuleLibraryRules(false);
if(this->GeneratorTarget->NeedRelinkBeforeInstall(this->ConfigName)) if(this->GeneratorTarget->NeedRelinkBeforeInstall(this->ConfigName))
{ {
@ -83,7 +83,7 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
this->WriteModuleLibraryRules(true); this->WriteModuleLibraryRules(true);
} }
break; break;
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
this->WriteObjectLibraryRules(); this->WriteObjectLibraryRules();
break; break;
default: default:
@ -253,8 +253,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
this->LocalGenerator->AppendFlags(linkFlags, extraFlags); this->LocalGenerator->AppendFlags(linkFlags, extraFlags);
// Add OSX version flags, if any. // Add OSX version flags, if any.
if(this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY || if(this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY ||
this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY) this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY)
{ {
this->AppendOSXVerFlag(linkFlags, linkLanguage, "COMPATIBILITY", true); this->AppendOSXVerFlag(linkFlags, linkLanguage, "COMPATIBILITY", true);
this->AppendOSXVerFlag(linkFlags, linkLanguage, "CURRENT", false); this->AppendOSXVerFlag(linkFlags, linkLanguage, "CURRENT", false);
@ -353,13 +353,13 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
buildEcho += linkLanguage; buildEcho += linkLanguage;
switch(this->GeneratorTarget->GetType()) switch(this->GeneratorTarget->GetType())
{ {
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
buildEcho += " static library "; buildEcho += " static library ";
break; break;
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
buildEcho += " shared library "; buildEcho += " shared library ";
break; break;
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
if (this->Target->IsCFBundleOnApple()) if (this->Target->IsCFBundleOnApple())
buildEcho += " CFBundle"; buildEcho += " CFBundle";
buildEcho += " shared module "; buildEcho += " shared module ";
@ -377,10 +377,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
const char* forbiddenFlagVar = 0; const char* forbiddenFlagVar = 0;
switch(this->GeneratorTarget->GetType()) switch(this->GeneratorTarget->GetType())
{ {
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
forbiddenFlagVar = "_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS"; forbiddenFlagVar = "_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS";
break; break;
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
forbiddenFlagVar = "_CREATE_SHARED_MODULE_FORBIDDEN_FLAGS"; forbiddenFlagVar = "_CREATE_SHARED_MODULE_FORBIDDEN_FLAGS";
break; break;
default: break; default: break;
@ -429,7 +429,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
#ifdef _WIN32 #ifdef _WIN32
// There may be a manifest file for this target. Add it to the // There may be a manifest file for this target. Add it to the
// clean set just in case. // clean set just in case.
if(this->GeneratorTarget->GetType() != cmTarget::STATIC_LIBRARY) if(this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY)
{ {
libCleanFiles.push_back( libCleanFiles.push_back(
this->Convert((targetFullPath+".manifest").c_str(), this->Convert((targetFullPath+".manifest").c_str(),
@ -441,7 +441,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
std::vector<std::string> commands1; std::vector<std::string> commands1;
// Add a command to remove any existing files for this library. // Add a command to remove any existing files for this library.
// for static libs only // for static libs only
if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY) if(this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY)
{ {
this->LocalGenerator->AppendCleanCommand(commands1, libCleanFiles, this->LocalGenerator->AppendCleanCommand(commands1, libCleanFiles,
*this->Target, "target"); *this->Target, "target");
@ -497,7 +497,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
std::vector<std::string> archiveAppendCommands; std::vector<std::string> archiveAppendCommands;
std::vector<std::string> archiveFinishCommands; std::vector<std::string> archiveFinishCommands;
std::string::size_type archiveCommandLimit = std::string::npos; std::string::size_type archiveCommandLimit = std::string::npos;
if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY) if(this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY)
{ {
haveStaticLibraryRule = haveStaticLibraryRule =
this->Makefile->GetDefinition(linkRuleVar)? true:false; this->Makefile->GetDefinition(linkRuleVar)? true:false;
@ -552,7 +552,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
// Collect up flags to link in needed libraries. // Collect up flags to link in needed libraries.
std::string linkLibs; std::string linkLibs;
if(this->GeneratorTarget->GetType() != cmTarget::STATIC_LIBRARY) if(this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY)
{ {
this->CreateLinkLibs(linkLibs, relink, useResponseFileForLibs, depends, this->CreateLinkLibs(linkLibs, relink, useResponseFileForLibs, depends,
useWatcomQuote); useWatcomQuote);
@ -566,7 +566,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
useWatcomQuote); useWatcomQuote);
// maybe create .def file from list of objects // 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")) this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
{ {
if(this->Target->GetPropertyAsBool("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. // Compute the directory portion of the install_name setting.
std::string install_name_dir; 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. // Get the install_name directory for the build tree.
install_name_dir = install_name_dir =

View File

@ -68,16 +68,16 @@ cmMakefileTargetGenerator::New(cmGeneratorTarget *tgt)
switch (tgt->GetType()) switch (tgt->GetType())
{ {
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
result = new cmMakefileExecutableTargetGenerator(tgt); result = new cmMakefileExecutableTargetGenerator(tgt);
break; break;
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
result = new cmMakefileLibraryTargetGenerator(tgt); result = new cmMakefileLibraryTargetGenerator(tgt);
break; break;
case cmTarget::UTILITY: case cmState::UTILITY:
result = new cmMakefileUtilityTargetGenerator(tgt); result = new cmMakefileUtilityTargetGenerator(tgt);
break; break;
default: default:
@ -542,10 +542,10 @@ cmMakefileTargetGenerator
std::string targetFullPathReal; std::string targetFullPathReal;
std::string targetFullPathPDB; std::string targetFullPathPDB;
std::string targetFullPathCompilePDB; std::string targetFullPathCompilePDB;
if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE || if(this->GeneratorTarget->GetType() == cmState::EXECUTABLE ||
this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY || this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY ||
this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY || this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY ||
this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY) this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY)
{ {
targetFullPathReal = targetFullPathReal =
this->GeneratorTarget->GetFullPath(this->ConfigName, false, true); this->GeneratorTarget->GetFullPath(this->ConfigName, false, true);
@ -554,7 +554,7 @@ cmMakefileTargetGenerator
targetFullPathPDB += "/"; targetFullPathPDB += "/";
targetFullPathPDB += this->GeneratorTarget->GetPDBName(this->ConfigName); targetFullPathPDB += this->GeneratorTarget->GetPDBName(this->ConfigName);
} }
if(this->GeneratorTarget->GetType() <= cmTarget::OBJECT_LIBRARY) if(this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY)
{ {
targetFullPathCompilePDB = targetFullPathCompilePDB =
this->GeneratorTarget->GetCompilePDBPath(this->ConfigName); this->GeneratorTarget->GetCompilePDBPath(this->ConfigName);
@ -1445,7 +1445,7 @@ void cmMakefileTargetGenerator
::AppendTargetDepends(std::vector<std::string>& depends) ::AppendTargetDepends(std::vector<std::string>& depends)
{ {
// Static libraries never depend on anything for linking. // Static libraries never depend on anything for linking.
if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY) if(this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY)
{ {
return; return;
} }

View File

@ -41,7 +41,7 @@ cmNinjaNormalTargetGenerator(cmGeneratorTarget* target)
, TargetLinkLanguage("") , TargetLinkLanguage("")
{ {
this->TargetLinkLanguage = target->GetLinkerLanguage(this->GetConfigName()); this->TargetLinkLanguage = target->GetLinkerLanguage(this->GetConfigName());
if (target->GetType() == cmTarget::EXECUTABLE) if (target->GetType() == cmState::EXECUTABLE)
this->GetGeneratorTarget()->GetExecutableNames(this->TargetNameOut, this->GetGeneratorTarget()->GetExecutableNames(this->TargetNameOut,
this->TargetNameReal, this->TargetNameReal,
this->TargetNameImport, this->TargetNameImport,
@ -55,7 +55,7 @@ cmNinjaNormalTargetGenerator(cmGeneratorTarget* target)
this->TargetNamePDB, this->TargetNamePDB,
GetLocalGenerator()->GetConfigName()); 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 // on Windows the output dir is already needed at compile time
// ensure the directory exists (OutDir test) // ensure the directory exists (OutDir test)
@ -87,7 +87,7 @@ void cmNinjaNormalTargetGenerator::Generate()
// Write the build statements // Write the build statements
this->WriteObjectBuildStatements(); this->WriteObjectBuildStatements();
if(this->GetGeneratorTarget()->GetType() == cmTarget::OBJECT_LIBRARY) if(this->GetGeneratorTarget()->GetType() == cmState::OBJECT_LIBRARY)
{ {
this->WriteObjectLibStatement(); this->WriteObjectLibStatement();
} }
@ -134,16 +134,16 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules()
const char *cmNinjaNormalTargetGenerator::GetVisibleTypeName() const const char *cmNinjaNormalTargetGenerator::GetVisibleTypeName() const
{ {
switch (this->GetGeneratorTarget()->GetType()) { switch (this->GetGeneratorTarget()->GetType()) {
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
return "static library"; return "static library";
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
return "shared library"; return "shared library";
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
if (this->GetTarget()->IsCFBundleOnApple()) if (this->GetTarget()->IsCFBundleOnApple())
return "CFBundle shared module"; return "CFBundle shared module";
else else
return "shared module"; return "shared module";
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
return "executable"; return "executable";
default: default:
return 0; return 0;
@ -157,7 +157,7 @@ cmNinjaNormalTargetGenerator
return this->TargetLinkLanguage return this->TargetLinkLanguage
+ "_" + "_"
+ cmTarget::GetTargetTypeName( + cmTarget::GetTargetTypeName(
(cmTarget::TargetType)this->GetGeneratorTarget()->GetType()) (cmState::TargetType)this->GetGeneratorTarget()->GetType())
+ "_LINKER__" + "_LINKER__"
+ cmGlobalNinjaGenerator::EncodeRuleName(this->GetTarget()->GetName()) + cmGlobalNinjaGenerator::EncodeRuleName(this->GetTarget()->GetName())
; ;
@ -167,8 +167,8 @@ void
cmNinjaNormalTargetGenerator cmNinjaNormalTargetGenerator
::WriteLinkRule(bool useResponseFile) ::WriteLinkRule(bool useResponseFile)
{ {
cmTarget::TargetType targetType = cmState::TargetType targetType =
(cmTarget::TargetType)this->GetGeneratorTarget()->GetType(); (cmState::TargetType)this->GetGeneratorTarget()->GetType();
std::string ruleName = this->LanguageLinkerRule(); std::string ruleName = this->LanguageLinkerRule();
// Select whether to use a response file for objects. // Select whether to use a response file for objects.
@ -242,7 +242,7 @@ cmNinjaNormalTargetGenerator
vars.Manifests = "$MANIFESTS"; vars.Manifests = "$MANIFESTS";
std::string langFlags; std::string langFlags;
if (targetType != cmTarget::EXECUTABLE) if (targetType != cmState::EXECUTABLE)
{ {
langFlags += "$LANGUAGE_COMPILE_FLAGS $ARCH_FLAGS"; langFlags += "$LANGUAGE_COMPILE_FLAGS $ARCH_FLAGS";
vars.LanguageCompileFlags = langFlags.c_str(); vars.LanguageCompileFlags = langFlags.c_str();
@ -285,7 +285,7 @@ cmNinjaNormalTargetGenerator
std::string cmakeCommand = std::string cmakeCommand =
this->GetLocalGenerator()->ConvertToOutputFormat( this->GetLocalGenerator()->ConvertToOutputFormat(
cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
if (targetType == cmTarget::EXECUTABLE) if (targetType == cmState::EXECUTABLE)
this->GetGlobalGenerator()->AddRule("CMAKE_SYMLINK_EXECUTABLE", this->GetGlobalGenerator()->AddRule("CMAKE_SYMLINK_EXECUTABLE",
cmakeCommand + cmakeCommand +
" -E cmake_symlink_executable" " -E cmake_symlink_executable"
@ -333,7 +333,7 @@ cmNinjaNormalTargetGenerator
} }
} }
switch (this->GetGeneratorTarget()->GetType()) { switch (this->GetGeneratorTarget()->GetType()) {
case cmTarget::STATIC_LIBRARY: { case cmState::STATIC_LIBRARY: {
// We have archive link commands set. First, delete the existing archive. // We have archive link commands set. First, delete the existing archive.
{ {
std::string cmakeCommand = std::string cmakeCommand =
@ -358,9 +358,9 @@ cmNinjaNormalTargetGenerator
} }
return linkCmds; return linkCmds;
} }
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
break; break;
default: default:
assert(0 && "Unexpected target type"); assert(0 && "Unexpected target type");
@ -443,7 +443,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
// Write comments. // Write comments.
cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream()); cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream());
const cmTarget::TargetType targetType = target.GetType(); const cmState::TargetType targetType = target.GetType();
this->GetBuildFileStream() this->GetBuildFileStream()
<< "# Link build statements for " << "# Link build statements for "
<< cmTarget::GetTargetTypeName(targetType) << cmTarget::GetTargetTypeName(targetType)
@ -490,7 +490,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
&genTarget, &genTarget,
useWatcomQuote); useWatcomQuote);
if(this->GetMakefile()->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS") 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")) 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 // Compute architecture specific link flags. Yes, these go into a different
// variable for executables, probably due to a mistake made when duplicating // variable for executables, probably due to a mistake made when duplicating
// code between the Makefile executable and library generators. // code between the Makefile executable and library generators.
if (targetType == cmTarget::EXECUTABLE) if (targetType == cmState::EXECUTABLE)
{ {
std::string t = vars["FLAGS"]; std::string t = vars["FLAGS"];
localGen.AddArchitectureFlags(t, &genTarget, TargetLinkLanguage, cfgName); localGen.AddArchitectureFlags(t, &genTarget, TargetLinkLanguage, cfgName);
@ -538,7 +538,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
{ {
vars["SONAME_FLAG"] = mf->GetSONameFlag(this->TargetLinkLanguage); vars["SONAME_FLAG"] = mf->GetSONameFlag(this->TargetLinkLanguage);
vars["SONAME"] = this->TargetNameSO; vars["SONAME"] = this->TargetNameSO;
if (targetType == cmTarget::SHARED_LIBRARY) if (targetType == cmState::SHARED_LIBRARY)
{ {
std::string install_dir = std::string install_dir =
this->GetGeneratorTarget()->GetInstallNameDirForBuildTree(cfgName); this->GetGeneratorTarget()->GetInstallNameDirForBuildTree(cfgName);
@ -626,7 +626,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
} }
// maybe create .def file from list of objects // 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")) this->GetMakefile()->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
{ {
if(target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) if(target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
@ -734,7 +734,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
if (targetOutput != targetOutputReal && !target.IsFrameworkOnApple()) if (targetOutput != targetOutputReal && !target.IsFrameworkOnApple())
{ {
if (targetType == cmTarget::EXECUTABLE) if (targetType == cmState::EXECUTABLE)
{ {
globalGen.WriteBuild(this->GetBuildFileStream(), globalGen.WriteBuild(this->GetBuildFileStream(),
"Create executable symlink " + targetOutput, "Create executable symlink " + targetOutput,

View File

@ -31,17 +31,17 @@ cmNinjaTargetGenerator::New(cmGeneratorTarget* target)
{ {
switch (target->GetType()) switch (target->GetType())
{ {
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
return new cmNinjaNormalTargetGenerator(target); return new cmNinjaNormalTargetGenerator(target);
case cmTarget::UTILITY: case cmState::UTILITY:
return new cmNinjaUtilityTargetGenerator(target);; return new cmNinjaUtilityTargetGenerator(target);;
case cmTarget::GLOBAL_TARGET: { case cmState::GLOBAL_TARGET: {
// We only want to process global targets that live in the home // We only want to process global targets that live in the home
// (i.e. top-level) directory. CMake creates copies of these targets // (i.e. top-level) directory. CMake creates copies of these targets
// in every directory, which we don't need. // in every directory, which we don't need.
@ -189,8 +189,8 @@ ComputeDefines(cmSourceFile const* source, const std::string& language)
cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
{ {
// Static libraries never depend on other targets for linking. // Static libraries never depend on other targets for linking.
if (this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY || if (this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY ||
this->GeneratorTarget->GetType() == cmTarget::OBJECT_LIBRARY) this->GeneratorTarget->GetType() == cmState::OBJECT_LIBRARY)
return cmNinjaDeps(); return cmNinjaDeps();
cmComputeLinkInformation* cli = cmComputeLinkInformation* cli =
@ -283,16 +283,16 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
{ {
std::string pdbPath; std::string pdbPath;
std::string compilePdbPath; std::string compilePdbPath;
if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE || if(this->GeneratorTarget->GetType() == cmState::EXECUTABLE ||
this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY || this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY ||
this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY || this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY ||
this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY) this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY)
{ {
pdbPath = this->GeneratorTarget->GetPDBDirectory(this->GetConfigName()); pdbPath = this->GeneratorTarget->GetPDBDirectory(this->GetConfigName());
pdbPath += "/"; pdbPath += "/";
pdbPath += this->GeneratorTarget->GetPDBName(this->GetConfigName()); pdbPath += this->GeneratorTarget->GetPDBName(this->GetConfigName());
} }
if(this->GeneratorTarget->GetType() <= cmTarget::OBJECT_LIBRARY) if(this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY)
{ {
compilePdbPath = compilePdbPath =
this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName()); this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName());
@ -481,7 +481,7 @@ cmNinjaTargetGenerator
this->GetBuildFileStream() this->GetBuildFileStream()
<< "# Object build statements for " << "# Object build statements for "
<< cmTarget::GetTargetTypeName( << cmTarget::GetTargetTypeName(
(cmTarget::TargetType)this->GetGeneratorTarget()->GetType()) (cmState::TargetType)this->GetGeneratorTarget()->GetType())
<< " target " << " target "
<< this->GetTargetName() << this->GetTargetName()
<< "\n\n"; << "\n\n";

View File

@ -181,6 +181,12 @@ public:
friend class Snapshot; friend class Snapshot;
}; };
enum TargetType { EXECUTABLE, STATIC_LIBRARY,
SHARED_LIBRARY, MODULE_LIBRARY,
OBJECT_LIBRARY, UTILITY, GLOBAL_TARGET,
INTERFACE_LIBRARY,
UNKNOWN_LIBRARY};
Snapshot CreateBaseSnapshot(); Snapshot CreateBaseSnapshot();
Snapshot Snapshot
CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot, CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot,

View File

@ -33,27 +33,27 @@
#define UNORDERED_SET std::set #define UNORDERED_SET std::set
#endif #endif
const char* cmTarget::GetTargetTypeName(TargetType targetType) const char* cmTarget::GetTargetTypeName(cmState::TargetType targetType)
{ {
switch( targetType ) switch( targetType )
{ {
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
return "STATIC_LIBRARY"; return "STATIC_LIBRARY";
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
return "MODULE_LIBRARY"; return "MODULE_LIBRARY";
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
return "SHARED_LIBRARY"; return "SHARED_LIBRARY";
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
return "OBJECT_LIBRARY"; return "OBJECT_LIBRARY";
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
return "EXECUTABLE"; return "EXECUTABLE";
case cmTarget::UTILITY: case cmState::UTILITY:
return "UTILITY"; return "UTILITY";
case cmTarget::GLOBAL_TARGET: case cmState::GLOBAL_TARGET:
return "GLOBAL_TARGET"; return "GLOBAL_TARGET";
case cmTarget::INTERFACE_LIBRARY: case cmState::INTERFACE_LIBRARY:
return "INTERFACE_LIBRARY"; return "INTERFACE_LIBRARY";
case cmTarget::UNKNOWN_LIBRARY: case cmState::UNKNOWN_LIBRARY:
return "UNKNOWN_LIBRARY"; return "UNKNOWN_LIBRARY";
} }
assert(0 && "Unexpected target type"); assert(0 && "Unexpected target type");
@ -93,13 +93,13 @@ cmTarget::cmTarget()
this->BuildInterfaceIncludesAppended = false; 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; this->Name = name;
// only add dependency information for library targets // only add dependency information for library targets
this->TargetTypeValue = type; this->TargetTypeValue = type;
if(this->TargetTypeValue >= STATIC_LIBRARY if(this->TargetTypeValue >= cmState::STATIC_LIBRARY
&& this->TargetTypeValue <= MODULE_LIBRARY) && this->TargetTypeValue <= cmState::MODULE_LIBRARY)
{ {
this->RecordDependencies = true; this->RecordDependencies = true;
} }
@ -129,7 +129,8 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->IsApple = this->Makefile->IsOn("APPLE"); this->IsApple = this->Makefile->IsOn("APPLE");
// Setup default property values. // 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", 0);
this->SetPropertyDefault("ANDROID_API_MIN", 0); this->SetPropertyDefault("ANDROID_API_MIN", 0);
@ -192,7 +193,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
mf->GetConfigurations(configNames); mf->GetConfigurations(configNames);
// Setup per-configuration property default values. // Setup per-configuration property default values.
if (this->GetType() != UTILITY) if (this->GetType() != cmState::UTILITY)
{ {
const char* configProps[] = { const char* configProps[] = {
"ARCHIVE_OUTPUT_DIRECTORY_", "ARCHIVE_OUTPUT_DIRECTORY_",
@ -208,7 +209,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
std::string configUpper = cmSystemTools::UpperCase(*ci); std::string configUpper = cmSystemTools::UpperCase(*ci);
for(const char** p = configProps; *p; ++p) for(const char** p = configProps; *p; ++p)
{ {
if (this->TargetTypeValue == INTERFACE_LIBRARY if (this->TargetTypeValue == cmState::INTERFACE_LIBRARY
&& strcmp(*p, "MAP_IMPORTED_CONFIG_") != 0) && strcmp(*p, "MAP_IMPORTED_CONFIG_") != 0)
{ {
continue; continue;
@ -223,8 +224,8 @@ void cmTarget::SetMakefile(cmMakefile* mf)
// compatibility with previous CMake versions in which executables // compatibility with previous CMake versions in which executables
// did not support this variable. Projects may still specify the // did not support this variable. Projects may still specify the
// property directly. // property directly.
if(this->TargetTypeValue != cmTarget::EXECUTABLE if(this->TargetTypeValue != cmState::EXECUTABLE
&& this->TargetTypeValue != cmTarget::INTERFACE_LIBRARY) && this->TargetTypeValue != cmState::INTERFACE_LIBRARY)
{ {
std::string property = cmSystemTools::UpperCase(*ci); std::string property = cmSystemTools::UpperCase(*ci);
property += "_POSTFIX"; property += "_POSTFIX";
@ -271,30 +272,32 @@ void cmTarget::SetMakefile(cmMakefile* mf)
parentOptionsBts.begin(), parentOptionsBts.end()); 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("C_VISIBILITY_PRESET", 0);
this->SetPropertyDefault("CXX_VISIBILITY_PRESET", 0); this->SetPropertyDefault("CXX_VISIBILITY_PRESET", 0);
this->SetPropertyDefault("VISIBILITY_INLINES_HIDDEN", 0); this->SetPropertyDefault("VISIBILITY_INLINES_HIDDEN", 0);
} }
if(this->TargetTypeValue == cmTarget::EXECUTABLE) if(this->TargetTypeValue == cmState::EXECUTABLE)
{ {
this->SetPropertyDefault("ANDROID_GUI", 0); this->SetPropertyDefault("ANDROID_GUI", 0);
this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", 0); this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", 0);
this->SetPropertyDefault("ENABLE_EXPORTS", 0); this->SetPropertyDefault("ENABLE_EXPORTS", 0);
} }
if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY if(this->TargetTypeValue == cmState::SHARED_LIBRARY
|| this->TargetTypeValue == cmTarget::MODULE_LIBRARY) || this->TargetTypeValue == cmState::MODULE_LIBRARY)
{ {
this->SetProperty("POSITION_INDEPENDENT_CODE", "True"); 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); 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); this->SetPropertyDefault("POSITION_INDEPENDENT_CODE", 0);
} }
@ -302,15 +305,16 @@ void cmTarget::SetMakefile(cmMakefile* mf)
// Record current policies for later use. // Record current policies for later use.
this->Makefile->RecordPolicies(this->PolicyMap); 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 // 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. // so ensure that the conditions don't lead to nonsense.
this->PolicyMap.Set(cmPolicies::CMP0022, cmPolicies::NEW); 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_COMPILE", 0);
this->SetPropertyDefault("JOB_POOL_LINK", 0); this->SetPropertyDefault("JOB_POOL_LINK", 0);
@ -363,18 +367,18 @@ cmListFileBacktrace const& cmTarget::GetBacktrace() const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::IsExecutableWithExports() const bool cmTarget::IsExecutableWithExports() const
{ {
return (this->GetType() == cmTarget::EXECUTABLE && return (this->GetType() == cmState::EXECUTABLE &&
this->GetPropertyAsBool("ENABLE_EXPORTS")); this->GetPropertyAsBool("ENABLE_EXPORTS"));
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::IsLinkable() const bool cmTarget::IsLinkable() const
{ {
return (this->GetType() == cmTarget::STATIC_LIBRARY || return (this->GetType() == cmState::STATIC_LIBRARY ||
this->GetType() == cmTarget::SHARED_LIBRARY || this->GetType() == cmState::SHARED_LIBRARY ||
this->GetType() == cmTarget::MODULE_LIBRARY || this->GetType() == cmState::MODULE_LIBRARY ||
this->GetType() == cmTarget::UNKNOWN_LIBRARY || this->GetType() == cmState::UNKNOWN_LIBRARY ||
this->GetType() == cmTarget::INTERFACE_LIBRARY || this->GetType() == cmState::INTERFACE_LIBRARY ||
this->IsExecutableWithExports()); this->IsExecutableWithExports());
} }
@ -382,14 +386,14 @@ bool cmTarget::IsLinkable() const
bool cmTarget::HasImportLibrary() const bool cmTarget::HasImportLibrary() const
{ {
return (this->DLLPlatform && return (this->DLLPlatform &&
(this->GetType() == cmTarget::SHARED_LIBRARY || (this->GetType() == cmState::SHARED_LIBRARY ||
this->IsExecutableWithExports())); this->IsExecutableWithExports()));
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::IsFrameworkOnApple() const bool cmTarget::IsFrameworkOnApple() const
{ {
return (this->GetType() == cmTarget::SHARED_LIBRARY && return (this->GetType() == cmState::SHARED_LIBRARY &&
this->Makefile->IsOn("APPLE") && this->Makefile->IsOn("APPLE") &&
this->GetPropertyAsBool("FRAMEWORK")); this->GetPropertyAsBool("FRAMEWORK"));
} }
@ -397,7 +401,7 @@ bool cmTarget::IsFrameworkOnApple() const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::IsAppBundleOnApple() const bool cmTarget::IsAppBundleOnApple() const
{ {
return (this->GetType() == cmTarget::EXECUTABLE && return (this->GetType() == cmState::EXECUTABLE &&
this->Makefile->IsOn("APPLE") && this->Makefile->IsOn("APPLE") &&
this->GetPropertyAsBool("MACOSX_BUNDLE")); this->GetPropertyAsBool("MACOSX_BUNDLE"));
} }
@ -405,7 +409,7 @@ bool cmTarget::IsAppBundleOnApple() const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::IsCFBundleOnApple() const bool cmTarget::IsCFBundleOnApple() const
{ {
return (this->GetType() == cmTarget::MODULE_LIBRARY && return (this->GetType() == cmState::MODULE_LIBRARY &&
this->Makefile->IsOn("APPLE") && this->Makefile->IsOn("APPLE") &&
this->GetPropertyAsBool("BUNDLE")); this->GetPropertyAsBool("BUNDLE"));
} }
@ -789,7 +793,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
} }
if (cmGeneratorExpression::Find(lib) != std::string::npos if (cmGeneratorExpression::Find(lib) != std::string::npos
|| (tgt && tgt->GetType() == INTERFACE_LIBRARY) || (tgt && tgt->GetType() == cmState::INTERFACE_LIBRARY)
|| (target == lib )) || (target == lib ))
{ {
return; return;
@ -1238,7 +1242,7 @@ static bool whiteListedInterfaceProperty(const std::string& prop)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::SetProperty(const std::string& prop, const char* value) void cmTarget::SetProperty(const std::string& prop, const char* value)
{ {
if (this->GetType() == INTERFACE_LIBRARY if (this->GetType() == cmState::INTERFACE_LIBRARY
&& !whiteListedInterfaceProperty(prop)) && !whiteListedInterfaceProperty(prop))
{ {
std::ostringstream e; 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, void cmTarget::AppendProperty(const std::string& prop, const char* value,
bool asString) bool asString)
{ {
if (this->GetType() == INTERFACE_LIBRARY if (this->GetType() == cmState::INTERFACE_LIBRARY
&& !whiteListedInterfaceProperty(prop)) && !whiteListedInterfaceProperty(prop))
{ {
std::ostringstream e; std::ostringstream e;
@ -1459,10 +1463,10 @@ std::string cmTarget::GetExportName() const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::AppendBuildInterfaceIncludes() void cmTarget::AppendBuildInterfaceIncludes()
{ {
if(this->GetType() != cmTarget::SHARED_LIBRARY && if(this->GetType() != cmState::SHARED_LIBRARY &&
this->GetType() != cmTarget::STATIC_LIBRARY && this->GetType() != cmState::STATIC_LIBRARY &&
this->GetType() != cmTarget::MODULE_LIBRARY && this->GetType() != cmState::MODULE_LIBRARY &&
this->GetType() != cmTarget::INTERFACE_LIBRARY && this->GetType() != cmState::INTERFACE_LIBRARY &&
!this->IsExecutableWithExports()) !this->IsExecutableWithExports())
{ {
return; return;
@ -1644,10 +1648,10 @@ void cmTarget::MarkAsImported()
bool cmTarget::HaveWellDefinedOutputFiles() const bool cmTarget::HaveWellDefinedOutputFiles() const
{ {
return return
this->GetType() == cmTarget::STATIC_LIBRARY || this->GetType() == cmState::STATIC_LIBRARY ||
this->GetType() == cmTarget::SHARED_LIBRARY || this->GetType() == cmState::SHARED_LIBRARY ||
this->GetType() == cmTarget::MODULE_LIBRARY || this->GetType() == cmState::MODULE_LIBRARY ||
this->GetType() == cmTarget::EXECUTABLE; this->GetType() == cmState::EXECUTABLE;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -1675,7 +1679,7 @@ void cmTarget::GetTargetVersion(bool soversion,
minor = 0; minor = 0;
patch = 0; patch = 0;
assert(this->GetType() != INTERFACE_LIBRARY); assert(this->GetType() != cmState::INTERFACE_LIBRARY);
// Look for a VERSION or SOVERSION property. // Look for a VERSION or SOVERSION property.
const char* prop = soversion? "SOVERSION" : "VERSION"; 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, const char *cmTarget::GetProperty(const std::string& prop,
cmMakefile* context) const cmMakefile* context) const
{ {
if (this->GetType() == INTERFACE_LIBRARY if (this->GetType() == cmState::INTERFACE_LIBRARY
&& !whiteListedInterfaceProperty(prop)) && !whiteListedInterfaceProperty(prop))
{ {
std::ostringstream e; std::ostringstream e;
@ -1755,11 +1759,11 @@ const char *cmTarget::GetProperty(const std::string& prop,
// Watch for special "computed" properties that are dependent on // Watch for special "computed" properties that are dependent on
// other properties or variables. Always recompute them. // other properties or variables. Always recompute them.
if(this->GetType() == cmTarget::EXECUTABLE || if(this->GetType() == cmState::EXECUTABLE ||
this->GetType() == cmTarget::STATIC_LIBRARY || this->GetType() == cmState::STATIC_LIBRARY ||
this->GetType() == cmTarget::SHARED_LIBRARY || this->GetType() == cmState::SHARED_LIBRARY ||
this->GetType() == cmTarget::MODULE_LIBRARY || this->GetType() == cmState::MODULE_LIBRARY ||
this->GetType() == cmTarget::UNKNOWN_LIBRARY) this->GetType() == cmState::UNKNOWN_LIBRARY)
{ {
static const std::string propLOCATION = "LOCATION"; static const std::string propLOCATION = "LOCATION";
if(prop == propLOCATION) if(prop == propLOCATION)
@ -2069,17 +2073,17 @@ const char* cmTarget::GetSuffixVariableInternal(bool implib) const
{ {
switch(this->GetType()) switch(this->GetType())
{ {
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
return "CMAKE_STATIC_LIBRARY_SUFFIX"; return "CMAKE_STATIC_LIBRARY_SUFFIX";
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
return (implib return (implib
? "CMAKE_IMPORT_LIBRARY_SUFFIX" ? "CMAKE_IMPORT_LIBRARY_SUFFIX"
: "CMAKE_SHARED_LIBRARY_SUFFIX"); : "CMAKE_SHARED_LIBRARY_SUFFIX");
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
return (implib return (implib
? "CMAKE_IMPORT_LIBRARY_SUFFIX" ? "CMAKE_IMPORT_LIBRARY_SUFFIX"
: "CMAKE_SHARED_MODULE_SUFFIX"); : "CMAKE_SHARED_MODULE_SUFFIX");
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
return (implib return (implib
? "CMAKE_IMPORT_LIBRARY_SUFFIX" ? "CMAKE_IMPORT_LIBRARY_SUFFIX"
// Android GUI application packages store the native // Android GUI application packages store the native
@ -2098,17 +2102,17 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const
{ {
switch(this->GetType()) switch(this->GetType())
{ {
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
return "CMAKE_STATIC_LIBRARY_PREFIX"; return "CMAKE_STATIC_LIBRARY_PREFIX";
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
return (implib return (implib
? "CMAKE_IMPORT_LIBRARY_PREFIX" ? "CMAKE_IMPORT_LIBRARY_PREFIX"
: "CMAKE_SHARED_LIBRARY_PREFIX"); : "CMAKE_SHARED_LIBRARY_PREFIX");
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
return (implib return (implib
? "CMAKE_IMPORT_LIBRARY_PREFIX" ? "CMAKE_IMPORT_LIBRARY_PREFIX"
: "CMAKE_SHARED_MODULE_PREFIX"); : "CMAKE_SHARED_MODULE_PREFIX");
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
return (implib return (implib
? "CMAKE_IMPORT_LIBRARY_PREFIX" ? "CMAKE_IMPORT_LIBRARY_PREFIX"
// Android GUI application packages store the native // Android GUI application packages store the native
@ -2184,7 +2188,7 @@ void cmTarget::SetPropertyDefault(const std::string& property,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetFrameworkVersion() const std::string cmTarget::GetFrameworkVersion() const
{ {
assert(this->GetType() != INTERFACE_LIBRARY); assert(this->GetType() != cmState::INTERFACE_LIBRARY);
if(const char* fversion = this->GetProperty("FRAMEWORK_VERSION")) if(const char* fversion = this->GetProperty("FRAMEWORK_VERSION"))
{ {
@ -2204,8 +2208,8 @@ std::string cmTarget::GetFrameworkVersion() const
const char* cmTarget::GetExportMacro() const const char* cmTarget::GetExportMacro() const
{ {
// Define the symbol for targets that export symbols. // Define the symbol for targets that export symbols.
if(this->GetType() == cmTarget::SHARED_LIBRARY || if(this->GetType() == cmState::SHARED_LIBRARY ||
this->GetType() == cmTarget::MODULE_LIBRARY || this->GetType() == cmState::MODULE_LIBRARY ||
this->IsExecutableWithExports()) this->IsExecutableWithExports())
{ {
if(const char* custom_export_name = this->GetProperty("DEFINE_SYMBOL")) 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; i = this->ImportInfoMap.insert(entry).first;
} }
if(this->GetType() == INTERFACE_LIBRARY) if(this->GetType() == cmState::INTERFACE_LIBRARY)
{ {
return &i->second; return &i->second;
} }
@ -2317,10 +2321,10 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
const char** imp, const char** imp,
std::string& suffix) const 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 // 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 // LOCATION at all, so leaving *loc and *imp unchanged is the appropriate
// and valid response. // and valid response.
return true; return true;
@ -2467,7 +2471,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
std::string linkProp = "INTERFACE_LINK_LIBRARIES"; std::string linkProp = "INTERFACE_LINK_LIBRARIES";
const char *propertyLibs = this->GetProperty(linkProp); const char *propertyLibs = this->GetProperty(linkProp);
if (this->GetType() != INTERFACE_LIBRARY) if (this->GetType() != cmState::INTERFACE_LIBRARY)
{ {
if(!propertyLibs) if(!propertyLibs)
{ {
@ -2488,7 +2492,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
info.Libraries = propertyLibs; info.Libraries = propertyLibs;
} }
} }
if(this->GetType() == INTERFACE_LIBRARY) if(this->GetType() == cmState::INTERFACE_LIBRARY)
{ {
return; return;
} }
@ -2516,7 +2520,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
} }
// Get the soname. // Get the soname.
if(this->GetType() == cmTarget::SHARED_LIBRARY) if(this->GetType() == cmState::SHARED_LIBRARY)
{ {
std::string soProp = "IMPORTED_SONAME"; std::string soProp = "IMPORTED_SONAME";
soProp += suffix; soProp += suffix;
@ -2531,7 +2535,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
} }
// Get the "no-soname" mark. // Get the "no-soname" mark.
if(this->GetType() == cmTarget::SHARED_LIBRARY) if(this->GetType() == cmState::SHARED_LIBRARY)
{ {
std::string soProp = "IMPORTED_NO_SONAME"; std::string soProp = "IMPORTED_NO_SONAME";
soProp += suffix; soProp += suffix;
@ -2550,7 +2554,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
{ {
info.ImportLibrary = imp; info.ImportLibrary = imp;
} }
else if(this->GetType() == cmTarget::SHARED_LIBRARY || else if(this->GetType() == cmState::SHARED_LIBRARY ||
this->IsExecutableWithExports()) this->IsExecutableWithExports())
{ {
std::string impProp = "IMPORTED_IMPLIB"; std::string impProp = "IMPORTED_IMPLIB";
@ -2597,7 +2601,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
} }
// Get the cyclic repetition count. // Get the cyclic repetition count.
if(this->GetType() == cmTarget::STATIC_LIBRARY) if(this->GetType() == cmState::STATIC_LIBRARY)
{ {
std::string linkProp = "IMPORTED_LINK_INTERFACE_MULTIPLICITY"; std::string linkProp = "IMPORTED_LINK_INTERFACE_MULTIPLICITY";
linkProp += suffix; linkProp += suffix;

View File

@ -77,18 +77,13 @@ class cmTarget
{ {
public: public:
cmTarget(); cmTarget();
enum TargetType { EXECUTABLE, STATIC_LIBRARY, static const char* GetTargetTypeName(cmState::TargetType targetType);
SHARED_LIBRARY, MODULE_LIBRARY,
OBJECT_LIBRARY, UTILITY, GLOBAL_TARGET,
INTERFACE_LIBRARY,
UNKNOWN_LIBRARY};
static const char* GetTargetTypeName(TargetType targetType);
enum CustomCommandType { PRE_BUILD, PRE_LINK, POST_BUILD }; enum CustomCommandType { PRE_BUILD, PRE_LINK, POST_BUILD };
/** /**
* Return the type of target. * Return the type of target.
*/ */
TargetType GetType() const cmState::TargetType GetType() const
{ {
return this->TargetTypeValue; return this->TargetTypeValue;
} }
@ -96,7 +91,7 @@ public:
/** /**
* Set the target type * Set the target type
*/ */
void SetType(TargetType f, const std::string& name); void SetType(cmState::TargetType f, const std::string& name);
void MarkAsImported(); void MarkAsImported();
@ -302,7 +297,7 @@ public:
{ return this->SystemIncludeDirectories; } { return this->SystemIncludeDirectories; }
bool LinkLanguagePropagatesToDependents() const bool LinkLanguagePropagatesToDependents() const
{ return this->TargetTypeValue == STATIC_LIBRARY; } { return this->TargetTypeValue == cmState::STATIC_LIBRARY; }
cmStringRange GetIncludeDirectoriesEntries() const; cmStringRange GetIncludeDirectoriesEntries() const;
cmBacktraceRange GetIncludeDirectoriesBacktraces() const; cmBacktraceRange GetIncludeDirectoriesBacktraces() const;
@ -420,7 +415,7 @@ private:
#endif #endif
cmMakefile* Makefile; cmMakefile* Makefile;
cmTargetInternalPointer Internal; cmTargetInternalPointer Internal;
TargetType TargetTypeValue; cmState::TargetType TargetTypeValue;
bool HaveInstallRule; bool HaveInstallRule;
bool RecordDependencies; bool RecordDependencies;
bool DLLPlatform; bool DLLPlatform;

View File

@ -88,7 +88,7 @@ bool cmTargetLinkLibrariesCommand
return true; return true;
} }
if(this->Target->GetType() == cmTarget::OBJECT_LIBRARY) if(this->Target->GetType() == cmState::OBJECT_LIBRARY)
{ {
std::ostringstream e; std::ostringstream e;
e << "Object library target \"" << args[0] << "\" " e << "Object library target \"" << args[0] << "\" "
@ -98,7 +98,7 @@ bool cmTargetLinkLibrariesCommand
return true; return true;
} }
if (this->Target->GetType() == cmTarget::UTILITY) if (this->Target->GetType() == cmState::UTILITY)
{ {
std::ostringstream e; std::ostringstream e;
const char *modal = 0; const char *modal = 0;
@ -352,7 +352,7 @@ bool
cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
cmTargetLinkLibraryType llt) cmTargetLinkLibraryType llt)
{ {
if(this->Target->GetType() == cmTarget::INTERFACE_LIBRARY if(this->Target->GetType() == cmState::INTERFACE_LIBRARY
&& this->CurrentProcessingState != ProcessingKeywordLinkInterface) && this->CurrentProcessingState != ProcessingKeywordLinkInterface)
{ {
this->Makefile->IssueMessage(cmake::FATAL_ERROR, this->Makefile->IssueMessage(cmake::FATAL_ERROR,
@ -428,7 +428,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
else if(this->CurrentProcessingState != ProcessingKeywordPublicInterface else if(this->CurrentProcessingState != ProcessingKeywordPublicInterface
&& this->CurrentProcessingState != ProcessingPlainPublicInterface) && this->CurrentProcessingState != ProcessingPlainPublicInterface)
{ {
if (this->Target->GetType() == cmTarget::STATIC_LIBRARY) if (this->Target->GetType() == cmState::STATIC_LIBRARY)
{ {
std::string configLib = this->Target std::string configLib = this->Target
->GetDebugGeneratorExpressions(lib, llt); ->GetDebugGeneratorExpressions(lib, llt);
@ -458,7 +458,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
return true; return true;
} }
if (this->Target->GetType() == cmTarget::INTERFACE_LIBRARY) if (this->Target->GetType() == cmState::INTERFACE_LIBRARY)
{ {
return true; return true;
} }

View File

@ -44,12 +44,12 @@ bool cmTargetPropCommandBase
this->HandleMissingTarget(args[0]); this->HandleMissingTarget(args[0]);
return false; return false;
} }
if ((this->Target->GetType() != cmTarget::SHARED_LIBRARY) if ((this->Target->GetType() != cmState::SHARED_LIBRARY)
&& (this->Target->GetType() != cmTarget::STATIC_LIBRARY) && (this->Target->GetType() != cmState::STATIC_LIBRARY)
&& (this->Target->GetType() != cmTarget::OBJECT_LIBRARY) && (this->Target->GetType() != cmState::OBJECT_LIBRARY)
&& (this->Target->GetType() != cmTarget::MODULE_LIBRARY) && (this->Target->GetType() != cmState::MODULE_LIBRARY)
&& (this->Target->GetType() != cmTarget::INTERFACE_LIBRARY) && (this->Target->GetType() != cmState::INTERFACE_LIBRARY)
&& (this->Target->GetType() != cmTarget::EXECUTABLE)) && (this->Target->GetType() != cmState::EXECUTABLE))
{ {
this->SetError("called with non-compilable target type"); this->SetError("called with non-compilable target type");
return false; return false;
@ -114,7 +114,7 @@ bool cmTargetPropCommandBase
return false; return false;
} }
if (this->Target->GetType() == cmTarget::INTERFACE_LIBRARY if (this->Target->GetType() == cmState::INTERFACE_LIBRARY
&& scope != "INTERFACE") && scope != "INTERFACE")
{ {
this->SetError("may only be set INTERFACE properties on INTERFACE " this->SetError("may only be set INTERFACE properties on INTERFACE "

View File

@ -90,7 +90,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
std::string exe = command[0]; std::string exe = command[0];
cmGeneratorTarget* target = cmGeneratorTarget* target =
this->LG->FindGeneratorTargetToUse(exe); this->LG->FindGeneratorTargetToUse(exe);
if(target && target->GetType() == cmTarget::EXECUTABLE) if(target && target->GetType() == cmState::EXECUTABLE)
{ {
// Use the target file on disk. // Use the target file on disk.
exe = target->GetFullPath(config); exe = target->GetFullPath(config);

View File

@ -269,7 +269,7 @@ void cmVisualStudio10TargetGenerator::WriteString(const char* line,
void cmVisualStudio10TargetGenerator::Generate() void cmVisualStudio10TargetGenerator::Generate()
{ {
// do not generate external ms projects // 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")) || this->Target->GetProperty("EXTERNAL_MSPROJECT"))
{ {
return; return;
@ -278,7 +278,7 @@ void cmVisualStudio10TargetGenerator::Generate()
this->Target->SetProperty("GENERATOR_FILE_NAME",this->Name.c_str()); this->Target->SetProperty("GENERATOR_FILE_NAME",this->Name.c_str());
this->Target->SetProperty("GENERATOR_FILE_NAME_EXT", this->Target->SetProperty("GENERATOR_FILE_NAME_EXT",
".vcxproj"); ".vcxproj");
if(this->GeneratorTarget->GetType() <= cmTarget::OBJECT_LIBRARY) if(this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY)
{ {
if(!this->ComputeClOptions()) if(!this->ComputeClOptions())
{ {
@ -361,7 +361,7 @@ void cmVisualStudio10TargetGenerator::Generate()
(*this->BuildFileStream) << "{" << this->GUID << "}</ProjectGUID>\n"; (*this->BuildFileStream) << "{" << this->GUID << "}</ProjectGUID>\n";
if(this->MSTools if(this->MSTools
&& this->GeneratorTarget->GetType() <= cmTarget::GLOBAL_TARGET) && this->GeneratorTarget->GetType() <= cmState::GLOBAL_TARGET)
{ {
this->WriteApplicationTypeSettings(); this->WriteApplicationTypeSettings();
this->VerifyNecessaryFiles(); this->VerifyNecessaryFiles();
@ -669,15 +669,15 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
std::string configType = "<ConfigurationType>"; std::string configType = "<ConfigurationType>";
switch(this->GeneratorTarget->GetType()) switch(this->GeneratorTarget->GetType())
{ {
case cmTarget::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmState::MODULE_LIBRARY:
configType += "DynamicLibrary"; configType += "DynamicLibrary";
break; break;
case cmTarget::OBJECT_LIBRARY: case cmState::OBJECT_LIBRARY:
case cmTarget::STATIC_LIBRARY: case cmState::STATIC_LIBRARY:
configType += "StaticLibrary"; configType += "StaticLibrary";
break; break;
case cmTarget::EXECUTABLE: case cmState::EXECUTABLE:
if(this->NsightTegra && if(this->NsightTegra &&
!this->Target->GetPropertyAsBool("ANDROID_GUI")) !this->Target->GetPropertyAsBool("ANDROID_GUI"))
{ {
@ -689,8 +689,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
configType += "Application"; configType += "Application";
} }
break; break;
case cmTarget::UTILITY: case cmState::UTILITY:
case cmTarget::GLOBAL_TARGET: case cmState::GLOBAL_TARGET:
if(this->NsightTegra) if(this->NsightTegra)
{ {
// Tegra-Android platform does not understand "Utility". // Tegra-Android platform does not understand "Utility".
@ -701,8 +701,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
configType += "Utility"; configType += "Utility";
} }
break; break;
case cmTarget::UNKNOWN_LIBRARY: case cmState::UNKNOWN_LIBRARY:
case cmTarget::INTERFACE_LIBRARY: case cmState::INTERFACE_LIBRARY:
break; break;
} }
configType += "</ConfigurationType>\n"; configType += "</ConfigurationType>\n";
@ -744,7 +744,7 @@ void cmVisualStudio10TargetGenerator
mfcLine += useOfMfcValue + "</UseOfMfc>\n"; mfcLine += useOfMfcValue + "</UseOfMfc>\n";
this->WriteString(mfcLine.c_str(), 2); 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->ClOptions[config]->UsingUnicode()) ||
this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") || this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
this->GlobalGenerator->TargetsWindowsPhone() || this->GlobalGenerator->TargetsWindowsPhone() ||
@ -753,7 +753,7 @@ void cmVisualStudio10TargetGenerator
{ {
this->WriteString("<CharacterSet>Unicode</CharacterSet>\n", 2); 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->ClOptions[config]->UsingSBCS())
{ {
this->WriteString("<CharacterSet>NotSet</CharacterSet>\n", 2); this->WriteString("<CharacterSet>NotSet</CharacterSet>\n", 2);
@ -1481,7 +1481,7 @@ void cmVisualStudio10TargetGenerator::WriteSources(
void cmVisualStudio10TargetGenerator::WriteAllSources() void cmVisualStudio10TargetGenerator::WriteAllSources()
{ {
if(this->GeneratorTarget->GetType() > cmTarget::UTILITY) if(this->GeneratorTarget->GetType() > cmState::UTILITY)
{ {
return; return;
} }
@ -1743,9 +1743,9 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
{ {
cmTarget::TargetType ttype = cmState::TargetType ttype =
(cmTarget::TargetType)this->GeneratorTarget->GetType(); (cmState::TargetType)this->GeneratorTarget->GetType();
if(ttype > cmTarget::GLOBAL_TARGET) if(ttype > cmState::GLOBAL_TARGET)
{ {
return; return;
} }
@ -1757,7 +1757,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
config = this->Configurations.begin(); config = this->Configurations.begin();
config != this->Configurations.end(); ++config) config != this->Configurations.end(); ++config)
{ {
if(ttype >= cmTarget::UTILITY) if(ttype >= cmState::UTILITY)
{ {
this->WritePlatformConfigTag("IntDir", config->c_str(), 3); this->WritePlatformConfigTag("IntDir", config->c_str(), 3);
*this->BuildFileStream *this->BuildFileStream
@ -1773,7 +1773,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
intermediateDir += "/"; intermediateDir += "/";
std::string outDir; std::string outDir;
std::string targetNameFull; std::string targetNameFull;
if(ttype == cmTarget::OBJECT_LIBRARY) if(ttype == cmState::OBJECT_LIBRARY)
{ {
outDir = intermediateDir; outDir = intermediateDir;
targetNameFull = this->Target->GetName(); targetNameFull = this->Target->GetName();
@ -1829,8 +1829,8 @@ OutputLinkIncremental(std::string const& configName)
} }
// static libraries and things greater than modules do not need // static libraries and things greater than modules do not need
// to set this option // to set this option
if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY if(this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY
|| this->GeneratorTarget->GetType() > cmTarget::MODULE_LIBRARY) || this->GeneratorTarget->GetType() > cmState::MODULE_LIBRARY)
{ {
return; return;
} }
@ -1968,8 +1968,8 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
{ {
clOptions.AddFlag("CompileAsWinRT", "true"); clOptions.AddFlag("CompileAsWinRT", "true");
// For WinRT components, add the _WINRT_DLL define to produce a lib // For WinRT components, add the _WINRT_DLL define to produce a lib
if (this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY || if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY ||
this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY ) this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY )
{ {
clOptions.AddDefine("_WINRT_DLL"); clOptions.AddDefine("_WINRT_DLL");
} }
@ -2177,8 +2177,8 @@ WriteMasmOptions(std::string const& configName,
void void
cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config) cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
{ {
if(this->GeneratorTarget->GetType() != cmTarget::STATIC_LIBRARY && if(this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY &&
this->GeneratorTarget->GetType() != cmTarget::OBJECT_LIBRARY) this->GeneratorTarget->GetType() != cmState::OBJECT_LIBRARY)
{ {
return; return;
} }
@ -2214,9 +2214,9 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
void cmVisualStudio10TargetGenerator::WriteManifestOptions( void cmVisualStudio10TargetGenerator::WriteManifestOptions(
std::string const& config) std::string const& config)
{ {
if (this->GeneratorTarget->GetType() != cmTarget::EXECUTABLE && if (this->GeneratorTarget->GetType() != cmState::EXECUTABLE &&
this->GeneratorTarget->GetType() != cmTarget::SHARED_LIBRARY && this->GeneratorTarget->GetType() != cmState::SHARED_LIBRARY &&
this->GeneratorTarget->GetType() != cmTarget::MODULE_LIBRARY) this->GeneratorTarget->GetType() != cmState::MODULE_LIBRARY)
{ {
return; return;
} }
@ -2382,9 +2382,9 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmVisualStudio10TargetGenerator::ComputeLinkOptions() bool cmVisualStudio10TargetGenerator::ComputeLinkOptions()
{ {
if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE || if(this->GeneratorTarget->GetType() == cmState::EXECUTABLE ||
this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY || this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY ||
this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY) this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY)
{ {
for(std::vector<std::string>::const_iterator for(std::vector<std::string>::const_iterator
i = this->Configurations.begin(); i = this->Configurations.begin();
@ -2421,11 +2421,11 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
std::string CONFIG = cmSystemTools::UpperCase(config); std::string CONFIG = cmSystemTools::UpperCase(config);
const char* linkType = "SHARED"; const char* linkType = "SHARED";
if(this->GeneratorTarget->GetType() == cmTarget::MODULE_LIBRARY) if(this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY)
{ {
linkType = "MODULE"; linkType = "MODULE";
} }
if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE) if(this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
{ {
linkType = "EXE"; linkType = "EXE";
} }
@ -2508,7 +2508,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
std::string targetNameFull; std::string targetNameFull;
std::string targetNameImport; std::string targetNameImport;
std::string targetNamePDB; std::string targetNamePDB;
if(this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE) if(this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
{ {
this->GeneratorTarget->GetExecutableNames(targetName, targetNameFull, this->GeneratorTarget->GetExecutableNames(targetName, targetNameFull,
targetNameImport, targetNamePDB, targetNameImport, targetNamePDB,
@ -2531,7 +2531,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
if (this->GlobalGenerator->TargetsWindowsCE()) if (this->GlobalGenerator->TargetsWindowsCE())
{ {
linkOptions.AddFlag("SubSystem", "WindowsCE"); linkOptions.AddFlag("SubSystem", "WindowsCE");
if (this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE) if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
{ {
if (this->ClOptions[config]->UsingUnicode()) if (this->ClOptions[config]->UsingUnicode())
{ {
@ -2553,7 +2553,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
if (this->GlobalGenerator->TargetsWindowsCE()) if (this->GlobalGenerator->TargetsWindowsCE())
{ {
linkOptions.AddFlag("SubSystem", "WindowsCE"); linkOptions.AddFlag("SubSystem", "WindowsCE");
if (this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE) if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
{ {
if (this->ClOptions[config]->UsingUnicode()) if (this->ClOptions[config]->UsingUnicode())
{ {
@ -2599,7 +2599,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
// A Windows Runtime component uses internal .NET metadata, // A Windows Runtime component uses internal .NET metadata,
// so does not have an import library. // so does not have an import library.
if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") && if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") &&
this->GeneratorTarget->GetType() != cmTarget::EXECUTABLE) this->GeneratorTarget->GetType() != cmState::EXECUTABLE)
{ {
linkOptions.AddFlag("GenerateWindowsMetadata", "true"); linkOptions.AddFlag("GenerateWindowsMetadata", "true");
} }
@ -2637,7 +2637,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
"%(IgnoreSpecificDefaultLibraries)"); "%(IgnoreSpecificDefaultLibraries)");
} }
if (this->GeneratorTarget->GetType() == cmTarget::SHARED_LIBRARY && if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY &&
this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
{ {
if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
@ -2654,8 +2654,8 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
void void
cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& config) cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& config)
{ {
if(this->GeneratorTarget->GetType() == cmTarget::STATIC_LIBRARY if(this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY
|| this->GeneratorTarget->GetType() > cmTarget::MODULE_LIBRARY) || this->GeneratorTarget->GetType() > cmState::MODULE_LIBRARY)
{ {
return; return;
} }
@ -2693,7 +2693,7 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
libVec.push_back(path); libVec.push_back(path);
} }
else if (!l->Target else if (!l->Target
|| l->Target->GetType() != cmTarget::INTERFACE_LIBRARY) || l->Target->GetType() != cmState::INTERFACE_LIBRARY)
{ {
libVec.push_back(l->Value); libVec.push_back(l->Value);
} }
@ -2765,7 +2765,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
this->WritePlatformConfigTag("ItemDefinitionGroup", i->c_str(), 1); this->WritePlatformConfigTag("ItemDefinitionGroup", i->c_str(), 1);
*this->BuildFileStream << "\n"; *this->BuildFileStream << "\n";
// output cl compile flags <ClCompile></ClCompile> // output cl compile flags <ClCompile></ClCompile>
if(this->GeneratorTarget->GetType() <= cmTarget::OBJECT_LIBRARY) if(this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY)
{ {
this->WriteClOptions(*i, includes); this->WriteClOptions(*i, includes);
// output rc compile flags <ResourceCompile></ResourceCompile> // output rc compile flags <ResourceCompile></ResourceCompile>
@ -2783,7 +2783,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
// output manifest flags <Manifest></Manifest> // output manifest flags <Manifest></Manifest>
this->WriteManifestOptions(*i); this->WriteManifestOptions(*i);
if(this->NsightTegra && if(this->NsightTegra &&
this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE && this->GeneratorTarget->GetType() == cmState::EXECUTABLE &&
this->Target->GetPropertyAsBool("ANDROID_GUI")) this->Target->GetPropertyAsBool("ANDROID_GUI"))
{ {
this->WriteAntBuildOptions(*i); this->WriteAntBuildOptions(*i);
@ -2796,7 +2796,7 @@ void
cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName) cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName)
{ {
bool addedPrelink = false; 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")) this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
{ {
if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
@ -2868,7 +2868,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
i != depends.end(); ++i) i != depends.end(); ++i)
{ {
cmTarget const* dt = (*i)->Target; cmTarget const* dt = (*i)->Target;
if(dt->GetType() == cmTarget::INTERFACE_LIBRARY) if(dt->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -3004,7 +3004,7 @@ void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile()
{ {
if((this->GlobalGenerator->TargetsWindowsStore() || if((this->GlobalGenerator->TargetsWindowsStore() ||
this->GlobalGenerator->TargetsWindowsPhone()) this->GlobalGenerator->TargetsWindowsPhone())
&& (cmTarget::EXECUTABLE == this->GeneratorTarget->GetType())) && (cmState::EXECUTABLE == this->GeneratorTarget->GetType()))
{ {
std::string pfxFile; std::string pfxFile;
std::vector<cmSourceFile const*> certificates; std::vector<cmSourceFile const*> certificates;
@ -3133,7 +3133,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
this->WriteString("<MinimumVisualStudioVersion>14.0" this->WriteString("<MinimumVisualStudioVersion>14.0"
"</MinimumVisualStudioVersion>\n", 2); "</MinimumVisualStudioVersion>\n", 2);
if(this->GeneratorTarget->GetType() < cmTarget::UTILITY) if(this->GeneratorTarget->GetType() < cmState::UTILITY)
{ {
isAppContainer = true; isAppContainer = true;
} }
@ -3147,7 +3147,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
this->WriteString("<MinimumVisualStudioVersion>12.0" this->WriteString("<MinimumVisualStudioVersion>12.0"
"</MinimumVisualStudioVersion>\n", 2); "</MinimumVisualStudioVersion>\n", 2);
if (this->GeneratorTarget->GetType() < cmTarget::UTILITY) if (this->GeneratorTarget->GetType() < cmState::UTILITY)
{ {
isAppContainer = true; isAppContainer = true;
} }
@ -3162,12 +3162,12 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
"</MinimumVisualStudioVersion>\n", 2); "</MinimumVisualStudioVersion>\n", 2);
if (isWindowsStore if (isWindowsStore
&& this->GeneratorTarget->GetType() < cmTarget::UTILITY) && this->GeneratorTarget->GetType() < cmState::UTILITY)
{ {
isAppContainer = true; isAppContainer = true;
} }
else if (isWindowsPhone && else if (isWindowsPhone &&
this->GeneratorTarget->GetType() == cmTarget::EXECUTABLE) this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
{ {
this->WriteString("<XapOutputs>true</XapOutputs>\n", 2); this->WriteString("<XapOutputs>true</XapOutputs>\n", 2);
this->WriteString("<XapFilename>", 2); this->WriteString("<XapFilename>", 2);
@ -3224,7 +3224,7 @@ void cmVisualStudio10TargetGenerator::VerifyNecessaryFiles()
{ {
// For Windows and Windows Phone executables, we will assume that if a // 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 // 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; std::vector<cmSourceFile const*> manifestSources;
this->GeneratorTarget->GetAppManifest(manifestSources, ""); this->GeneratorTarget->GetAppManifest(manifestSources, "");