diff options
author | Brad King <brad.king@kitware.com> | 2014-06-16 13:38:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-06-23 13:22:07 (GMT) |
commit | edce43514d854a84d2a00c975268f898bd1dda45 (patch) | |
tree | bec0a19c256153bcca1cd84ecc7c97f2d455c3f1 | |
parent | 097be4139df044c86daadb665ec224ee66e6b3bb (diff) | |
download | CMake-edce43514d854a84d2a00c975268f898bd1dda45.zip CMake-edce43514d854a84d2a00c975268f898bd1dda45.tar.gz CMake-edce43514d854a84d2a00c975268f898bd1dda45.tar.bz2 |
cmExportFileGenerator: Make SetImportLinkProperty a template
Allow the vector of property entries to have any element type
that can convert to std::string.
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmExportFileGenerator.h | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 9f5eee5..1f39d7a 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -865,15 +865,16 @@ cmExportFileGenerator } //---------------------------------------------------------------------------- +template <typename T> void cmExportFileGenerator ::SetImportLinkProperty(std::string const& suffix, cmTarget* target, const std::string& propName, - std::vector<std::string> const& entries, + std::vector<T> const& entries, ImportPropertyMap& properties, std::vector<std::string>& missingTargets - ) + ) { // Skip the property if there are no entries. if(entries.empty()) @@ -884,7 +885,7 @@ cmExportFileGenerator // Construct the property value. std::string link_entries; const char* sep = ""; - for(std::vector<std::string>::const_iterator li = entries.begin(); + for(typename std::vector<T>::const_iterator li = entries.begin(); li != entries.end(); ++li) { // Separate this from the previous entry. @@ -902,7 +903,6 @@ cmExportFileGenerator properties[prop] = link_entries; } - //---------------------------------------------------------------------------- void cmExportFileGenerator::GenerateImportHeaderCode(std::ostream& os, const std::string& config) diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h index abd8ad5..919924e 100644 --- a/Source/cmExportFileGenerator.h +++ b/Source/cmExportFileGenerator.h @@ -95,9 +95,11 @@ protected: std::string const& suffix, cmTarget* target, ImportPropertyMap& properties, std::vector<std::string>& missingTargets); + + template <typename T> void SetImportLinkProperty(std::string const& suffix, cmTarget* target, const std::string& propName, - std::vector<std::string> const& entries, + std::vector<T> const& entries, ImportPropertyMap& properties, std::vector<std::string>& missingTargets); |