Commit a4d5f7b9 authored by Stephen Kelly's avatar Stephen Kelly Committed by David Cole

Add API to get the ordered includes for a target.

parent 8adaee2b
...@@ -4675,6 +4675,30 @@ cmTarget::GetLinkInformation(const char* config) ...@@ -4675,6 +4675,30 @@ cmTarget::GetLinkInformation(const char* config)
return i->second; return i->second;
} }
//----------------------------------------------------------------------------
std::vector<std::string> cmTarget::GetIncludeDirectories()
{
std::vector<std::string> includes;
const char *prop = this->GetProperty("INCLUDE_DIRECTORIES");
if(prop)
{
cmSystemTools::ExpandListArgument(prop, includes);
}
std::set<std::string> uniqueIncludes;
std::vector<std::string> orderedAndUniqueIncludes;
for(std::vector<std::string>::const_iterator
li = includes.begin(); li != includes.end(); ++li)
{
if(uniqueIncludes.insert(*li).second)
{
orderedAndUniqueIncludes.push_back(*li);
}
}
return orderedAndUniqueIncludes;
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTargetLinkInformationMap cmTargetLinkInformationMap
::cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r): derived() ::cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r): derived()
......
...@@ -458,6 +458,9 @@ public: ...@@ -458,6 +458,9 @@ public:
directory. */ directory. */
bool UsesDefaultOutputDir(const char* config, bool implib); bool UsesDefaultOutputDir(const char* config, bool implib);
/** Get the include directories for this target. */
std::vector<std::string> GetIncludeDirectories();
private: private:
/** /**
* A list of direct dependencies. Use in conjunction with DependencyMap. * A list of direct dependencies. Use in conjunction with DependencyMap.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment