ENH: added Alexander's target property TYPE
This commit is contained in:
parent
d5814719d6
commit
7f2e7443bf
@ -61,6 +61,10 @@ public:
|
|||||||
"the full path to the file on disk that will be created for the "
|
"the full path to the file on disk that will be created for the "
|
||||||
"target. This is very useful for executable targets to get "
|
"target. This is very useful for executable targets to get "
|
||||||
"the path to the executable file for use in a custom command. "
|
"the path to the executable file for use in a custom command. "
|
||||||
|
"the path to the executable file for use in a custom command.\n"
|
||||||
|
"The read-only property \"TYPE\" returns which type the specified "
|
||||||
|
"target has (EXECUTABLE, STATIC_LIBRARY, SHARED_LIBRARY, "
|
||||||
|
"MODULE_LIBRARY, UTILITY, INSTALL_FILES or INSTALL_PROGRAMS)."
|
||||||
"This command can get properties for any target so far created. "
|
"This command can get properties for any target so far created. "
|
||||||
"The targets do not need to be in the current CMakeLists.txt file.";
|
"The targets do not need to be in the current CMakeLists.txt file.";
|
||||||
}
|
}
|
||||||
|
@ -743,6 +743,36 @@ const char *cmTarget::GetProperty(const char* prop)
|
|||||||
this->UpdateLocation();
|
this->UpdateLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the type property returns what type the target is
|
||||||
|
if (!strcmp(prop,"TYPE"))
|
||||||
|
{
|
||||||
|
switch( this->GetType() )
|
||||||
|
{
|
||||||
|
case cmTarget::STATIC_LIBRARY:
|
||||||
|
return "STATIC_LIBRARY";
|
||||||
|
break;
|
||||||
|
case cmTarget::MODULE_LIBRARY:
|
||||||
|
return "MODULE_LIBRARY";
|
||||||
|
break;
|
||||||
|
case cmTarget::SHARED_LIBRARY:
|
||||||
|
return "SHARED_LIBRARY";
|
||||||
|
break;
|
||||||
|
case cmTarget::EXECUTABLE:
|
||||||
|
return "EXECUTABLE";
|
||||||
|
break;
|
||||||
|
case cmTarget::UTILITY:
|
||||||
|
return "UTILITY";
|
||||||
|
break;
|
||||||
|
case cmTarget::INSTALL_FILES:
|
||||||
|
return "INSTALL_FILES";
|
||||||
|
break;
|
||||||
|
case cmTarget::INSTALL_PROGRAMS:
|
||||||
|
return "INSTALL_PROGRAMS";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
std::map<cmStdString,cmStdString>::const_iterator i =
|
std::map<cmStdString,cmStdString>::const_iterator i =
|
||||||
m_Properties.find(prop);
|
m_Properties.find(prop);
|
||||||
if (i != m_Properties.end())
|
if (i != m_Properties.end())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user