ENH: Add a notion of a global target

This commit is contained in:
Andy Cedilnik 2006-02-23 10:03:24 -05:00
parent f1fb182270
commit ea5564624c
3 changed files with 9 additions and 2 deletions

View File

@ -1056,6 +1056,7 @@ void cmMakefile::AddGlobalLinkInformation(const char* name, cmTarget& target)
switch(target.GetType()) switch(target.GetType())
{ {
case cmTarget::UTILITY: case cmTarget::UTILITY:
case cmTarget::GLOBAL_TARGET:
case cmTarget::INSTALL_FILES: case cmTarget::INSTALL_FILES:
case cmTarget::INSTALL_PROGRAMS: case cmTarget::INSTALL_PROGRAMS:
return; return;

View File

@ -135,7 +135,7 @@ void cmTarget::TraceVSDependencies(std::string projFile,
srcFilesQueued.insert(projFile); srcFilesQueued.insert(projFile);
} }
// add in the library depends for custom targets // add in the library depends for custom targets
if (this->GetType() == cmTarget::UTILITY) if (this->GetType() == cmTarget::UTILITY || this->GetType() == cmTarget::GLOBAL_TARGET)
{ {
for (std::vector<cmCustomCommand>::iterator ic = for (std::vector<cmCustomCommand>::iterator ic =
this->GetPostBuildCommands().begin(); this->GetPostBuildCommands().begin();
@ -886,6 +886,9 @@ const char *cmTarget::GetProperty(const char* prop)
case cmTarget::UTILITY: case cmTarget::UTILITY:
return "UTILITY"; return "UTILITY";
break; break;
case cmTarget::GLOBAL_TARGET:
return "GLOBAL_TARGET";
break;
case cmTarget::INSTALL_FILES: case cmTarget::INSTALL_FILES:
return "INSTALL_FILES"; return "INSTALL_FILES";
break; break;
@ -991,6 +994,7 @@ const char* cmTarget::GetCreateRuleVariable()
case cmTarget::EXECUTABLE: case cmTarget::EXECUTABLE:
return "_LINK_EXECUTABLE"; return "_LINK_EXECUTABLE";
case cmTarget::UTILITY: case cmTarget::UTILITY:
case cmTarget::GLOBAL_TARGET:
case cmTarget::INSTALL_FILES: case cmTarget::INSTALL_FILES:
case cmTarget::INSTALL_PROGRAMS: case cmTarget::INSTALL_PROGRAMS:
break; break;
@ -1014,6 +1018,7 @@ const char* cmTarget::GetSuffixVariableInternal(TargetType type,
case cmTarget::EXECUTABLE: case cmTarget::EXECUTABLE:
return "CMAKE_EXECUTABLE_SUFFIX"; return "CMAKE_EXECUTABLE_SUFFIX";
case cmTarget::UTILITY: case cmTarget::UTILITY:
case cmTarget::GLOBAL_TARGET:
case cmTarget::INSTALL_FILES: case cmTarget::INSTALL_FILES:
case cmTarget::INSTALL_PROGRAMS: case cmTarget::INSTALL_PROGRAMS:
break; break;
@ -1037,6 +1042,7 @@ const char* cmTarget::GetPrefixVariableInternal(TargetType type,
return "CMAKE_SHARED_MODULE_PREFIX"; return "CMAKE_SHARED_MODULE_PREFIX";
case cmTarget::EXECUTABLE: case cmTarget::EXECUTABLE:
case cmTarget::UTILITY: case cmTarget::UTILITY:
case cmTarget::GLOBAL_TARGET:
case cmTarget::INSTALL_FILES: case cmTarget::INSTALL_FILES:
case cmTarget::INSTALL_PROGRAMS: case cmTarget::INSTALL_PROGRAMS:
break; break;

View File

@ -35,7 +35,7 @@ public:
cmTarget(); cmTarget();
enum TargetType { EXECUTABLE, STATIC_LIBRARY, enum TargetType { EXECUTABLE, STATIC_LIBRARY,
SHARED_LIBRARY, MODULE_LIBRARY, UTILITY, INSTALL_FILES, SHARED_LIBRARY, MODULE_LIBRARY, UTILITY, INSTALL_FILES,
INSTALL_PROGRAMS }; INSTALL_PROGRAMS, GLOBAL_TARGET};
enum CustomCommandType { PRE_BUILD, PRE_LINK, POST_BUILD }; enum CustomCommandType { PRE_BUILD, PRE_LINK, POST_BUILD };