summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Schweiger <husker@dzdm.de>2022-02-07 12:07:40 (GMT)
committerFlorian Schweiger <husker@dzdm.de>2022-02-07 12:07:40 (GMT)
commit309191052cf83bc5535ff66e9ece04cda18d5fe5 (patch)
treef7a01a613683771f83d185638887bc84eb70ca0a
parentf7791698cbfd1b1de0ae2e26d1feebbc92acdc42 (diff)
downloadCMake-309191052cf83bc5535ff66e9ece04cda18d5fe5.zip
CMake-309191052cf83bc5535ff66e9ece04cda18d5fe5.tar.gz
CMake-309191052cf83bc5535ff66e9ece04cda18d5fe5.tar.bz2
VS: Set Visual Studio versions read out from solution file
-rw-r--r--Source/cmVisualStudioSlnData.h17
-rw-r--r--Source/cmVisualStudioSlnParser.cxx9
2 files changed, 24 insertions, 2 deletions
diff --git a/Source/cmVisualStudioSlnData.h b/Source/cmVisualStudioSlnData.h
index b217bd8..19e58f5 100644
--- a/Source/cmVisualStudioSlnData.h
+++ b/Source/cmVisualStudioSlnData.h
@@ -31,6 +31,22 @@ private:
class cmSlnData
{
public:
+ std::string GetVisualStudioVersion() const { return visualStudioVersion; }
+ void SetVisualStudioVersion(const std::string& version)
+ {
+ visualStudioVersion = version;
+ }
+
+ std::string GetMinimumVisualStudioVersion() const
+ {
+ return minimumVisualStudioVersion;
+ }
+
+ void SetMinimumVisualStudioVersion(const std::string& version)
+ {
+ minimumVisualStudioVersion = version;
+ }
+
const cmSlnProjectEntry* GetProjectByGUID(
const std::string& projectGUID) const;
@@ -44,6 +60,7 @@ public:
const std::string& projectRelativePath);
private:
+ std::string visualStudioVersion, minimumVisualStudioVersion;
using ProjectStorage = std::map<std::string, cmSlnProjectEntry>;
ProjectStorage ProjectsByGUID;
using ProjectStringIndex = std::map<std::string, ProjectStorage::iterator>;
diff --git a/Source/cmVisualStudioSlnParser.cxx b/Source/cmVisualStudioSlnParser.cxx
index d900a95..8138f4c 100644
--- a/Source/cmVisualStudioSlnParser.cxx
+++ b/Source/cmVisualStudioSlnParser.cxx
@@ -219,9 +219,14 @@ bool cmVisualStudioSlnParser::State::Process(
this->Stack.push(FileStateProject);
} else
this->IgnoreUntilTag("EndProject");
- } else if (line.GetTag().compare("Global") == 0)
+ } else if (line.GetTag().compare("Global") == 0) {
+
this->Stack.push(FileStateGlobal);
- else {
+ } else if (line.GetTag().compare("VisualStudioVersion") == 0) {
+ output.SetVisualStudioVersion(line.GetValue(0));
+ } else if (line.GetTag().compare("MinimumVisualStudioVersion") == 0) {
+ output.SetMinimumVisualStudioVersion(line.GetValue(0));
+ } else {
result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
return false;
}