summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2011-12-04 15:32:13 (GMT)
committerDavid Cole <david.cole@kitware.com>2012-02-22 11:31:49 (GMT)
commita4d5f7b9b270d3fa85e8a0a1608c4205dff744d9 (patch)
treea310848179c4f7c1a069e2d315d2f56bfdbf2067 /Source
parent8adaee2b0b2651cfd93bb4a915d11bdd4cba1b51 (diff)
downloadCMake-a4d5f7b9b270d3fa85e8a0a1608c4205dff744d9.zip
CMake-a4d5f7b9b270d3fa85e8a0a1608c4205dff744d9.tar.gz
CMake-a4d5f7b9b270d3fa85e8a0a1608c4205dff744d9.tar.bz2
Add API to get the ordered includes for a target.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTarget.cxx24
-rw-r--r--Source/cmTarget.h3
2 files changed, 27 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0c79b30..5c902e1 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4676,6 +4676,30 @@ cmTarget::GetLinkInformation(const char* config)
}
//----------------------------------------------------------------------------
+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 const& r): derived()
{
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 59f0184..dfed499 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -458,6 +458,9 @@ public:
directory. */
bool UsesDefaultOutputDir(const char* config, bool implib);
+ /** Get the include directories for this target. */
+ std::vector<std::string> GetIncludeDirectories();
+
private:
/**
* A list of direct dependencies. Use in conjunction with DependencyMap.