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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -272,7 +272,7 @@ void cmGlobalVisualStudio71Generator
// executables to the libraries it uses are also done here
void cmGlobalVisualStudio71Generator
::WriteProjectConfigurations(
std::ostream& fout, const std::string& name, cmTarget::TargetType,
std::ostream& fout, const std::string& name, cmState::TargetType,
std::vector<std::string> const& configs,
const std::set<std::string>& configsPartOfDefaultBuild,
std::string const& platformMapping)

View File

@ -64,7 +64,7 @@ protected:
const std::string& name, const char* path,
cmTarget const& t);
virtual void WriteProjectConfigurations(
std::ostream& fout, const std::string& name, cmTarget::TargetType type,
std::ostream& fout, const std::string& name, cmState::TargetType type,
std::vector<std::string> const& configs,
const std::set<std::string>& configsPartOfDefaultBuild,
const std::string& platformMapping = "");

View File

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

View File

@ -128,7 +128,7 @@ protected:
const std::string& name, const char* path,
cmTarget const&t);
virtual void WriteProjectConfigurations(
std::ostream& fout, const std::string& name, cmTarget::TargetType type,
std::ostream& fout, const std::string& name, cmState::TargetType type,
std::vector<std::string> const& configs,
const std::set<std::string>& configsPartOfDefaultBuild,
const std::string& platformMapping = "");

View File

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

View File

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

View File

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

View File

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

View File

@ -26,13 +26,13 @@ static const char* getShapeForTarget(const cmTarget* target)
switch ( target->GetType() )
{
case cmTarget::EXECUTABLE:
case cmState::EXECUTABLE:
return "house";
case cmTarget::STATIC_LIBRARY:
case cmState::STATIC_LIBRARY:
return "diamond";
case cmTarget::SHARED_LIBRARY:
case cmState::SHARED_LIBRARY:
return "polygon";
case cmTarget::MODULE_LIBRARY:
case cmState::MODULE_LIBRARY:
return "octagon";
default:
break;
@ -582,18 +582,18 @@ bool cmGraphVizWriter::IgnoreThisTarget(const std::string& name)
}
bool cmGraphVizWriter::GenerateForTargetType(cmTarget::TargetType targetType)
bool cmGraphVizWriter::GenerateForTargetType(cmState::TargetType targetType)
const
{
switch (targetType)
{
case cmTarget::EXECUTABLE:
case cmState::EXECUTABLE:
return this->GenerateForExecutables;
case cmTarget::STATIC_LIBRARY:
case cmState::STATIC_LIBRARY:
return this->GenerateForStaticLibs;
case cmTarget::SHARED_LIBRARY:
case cmState::SHARED_LIBRARY:
return this->GenerateForSharedLibs;
case cmTarget::MODULE_LIBRARY:
case cmState::MODULE_LIBRARY:
return this->GenerateForModuleLibs;
default:
break;

View File

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

View File

@ -77,7 +77,7 @@ bool cmIncludeExternalMSProjectCommand
}
// Create a target instance for this utility.
cmTarget* target=this->Makefile->AddNewTarget(cmTarget::UTILITY,
cmTarget* target=this->Makefile->AddNewTarget(cmState::UTILITY,
utility_name.c_str());
target->SetProperty("GENERATOR_FILE_NAME", utility_name.c_str());

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -77,7 +77,7 @@ void cmLocalVisualStudio10Generator::Generate()
cmTargets &tgts = this->Makefile->GetTargets();
for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l)
{
if(l->second.GetType() == cmTarget::INTERFACE_LIBRARY)
if(l->second.GetType() == cmState::INTERFACE_LIBRARY)
{
continue;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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