diff options
author | David Cole <david.cole@kitware.com> | 2012-03-08 20:13:15 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-03-08 20:13:15 (GMT) |
commit | 580171185bac5d23f34f0658b3740973818989b1 (patch) | |
tree | c697492a78256caf46fee7be9b716723da24bebc /Source/cmTarget.cxx | |
parent | 3a36fa99715df39ae8fe5deabf000df201682136 (diff) | |
parent | d662dff7690ae4a3b22947f07de4fc952c33e568 (diff) | |
download | CMake-580171185bac5d23f34f0658b3740973818989b1.zip CMake-580171185bac5d23f34f0658b3740973818989b1.tar.gz CMake-580171185bac5d23f34f0658b3740973818989b1.tar.bz2 |
Merge topic 'target-include-directories'
d662dff Fix shadowed variable warning on dashboard results
f66e735 Fix compiler warning reported on older Borland dashboard.
d90eed4 Fix compiler error reported on older Borland dashboard.
8233636 Update the documentation regarding INCLUDE_DIRECTORIES.
d899eb7 Call ExpandVariablesInString for each target's INCLUDE_DIRECTORIES
c21db87 Make search paths ordered and unique
22021f0 Remove cmMakefile::GetIncludeDirectories
9106b56 Extract and use the INCLUDE_DIRECTORIES target properties.
840509b Keep the INCLUDE_DIRECTORIES target property up to date.
a4d5f7b Add API to get the ordered includes for a target.
8adaee2 CMake: Eliminate cmMakefile::IncludeDirectories
7620932 Remove include flags memoization.
97a5faa Make it safe to call this method without creating duplicates.
edd5303 Refactor GetIncludeFlags to take includes instead of fetching them
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 2ec97c8..43f2068 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -480,6 +480,26 @@ void cmTarget::DefineProperties(cmake *cm) "undefined behavior."); cm->DefineProperty + ("INCLUDE_DIRECTORIES", cmProperty::TARGET, + "List of preprocessor include file search directories.", + "This property specifies the list of directories given " + "so far to the include_directories command. " + "This property exists on directories and targets. " + "In addition to accepting values from the include_directories " + "command, values may be set directly on any directory or any " + "target using the set_property command. " + "A target gets its initial value for this property from the value " + "of the directory property. " + "A directory gets its initial value from its parent directory if " + "it has one. " + "Both directory and target property values are adjusted by calls " + "to the include_directories command." + "\n" + "The target property values are used by the generators to set " + "the include paths for the compiler. " + "See also the include_directories command."); + + cm->DefineProperty ("INSTALL_NAME_DIR", cmProperty::TARGET, "Mac OSX directory name for installed targets.", "INSTALL_NAME_DIR is a string specifying the " @@ -1269,6 +1289,11 @@ void cmTarget::SetMakefile(cmMakefile* mf) // Save the backtrace of target construction. this->Makefile->GetBacktrace(this->Internal->Backtrace); + // Initialize the INCLUDE_DIRECTORIES property based on the current value + // of the same directory property: + this->SetProperty("INCLUDE_DIRECTORIES", + this->Makefile->GetProperty("INCLUDE_DIRECTORIES")); + // Record current policies for later use. this->PolicyStatusCMP0003 = this->Makefile->GetPolicyStatus(cmPolicies::CMP0003); @@ -4668,6 +4693,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() { |