diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2016-06-10 07:34:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-06-10 13:33:02 (GMT) |
commit | 120899c6980fcd81aa2a0d7b733ae15332a7a133 (patch) | |
tree | dd7876776937bb8d61fadff3d7c3844178b0f979 /Source/cmPropertyMap.cxx | |
parent | 7066218e792927cb6494ce73e834b8ddb3d275e6 (diff) | |
download | CMake-120899c6980fcd81aa2a0d7b733ae15332a7a133.zip CMake-120899c6980fcd81aa2a0d7b733ae15332a7a133.tar.gz CMake-120899c6980fcd81aa2a0d7b733ae15332a7a133.tar.bz2 |
cmPropertyList: Add a way to retrieve all properties
Diffstat (limited to 'Source/cmPropertyMap.cxx')
-rw-r--r-- | Source/cmPropertyMap.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index 74e04da..de1281e 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -15,6 +15,7 @@ #include "cmSystemTools.h" #include "cmake.h" +#include <algorithm> #include <assert.h> cmProperty* cmPropertyMap::GetOrCreateProperty(const std::string& name) @@ -29,6 +30,17 @@ cmProperty* cmPropertyMap::GetOrCreateProperty(const std::string& name) return prop; } +std::vector<std::string> cmPropertyMap::GetPropertyList() const +{ + std::vector<std::string> keyList; + for (cmPropertyMap::const_iterator i = this->begin(), e = this->end(); + i != e; ++i) { + keyList.push_back(i->first); + } + std::sort(keyList.begin(), keyList.end()); + return keyList; +} + void cmPropertyMap::SetProperty(const std::string& name, const char* value) { if (!value) { |