Imported Upstream version 3.19.4
[platform/upstream/cmake.git] / Source / cmGlobalVisualStudioVersionedGenerator.h
1 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2    file Copyright.txt or https://cmake.org/licensing for details.  */
3 #pragma once
4
5 #include "cmConfigure.h" // IWYU pragma: keep
6
7 #include <iosfwd>
8 #include <memory>
9 #include <string>
10
11 #include "cmGlobalVisualStudio14Generator.h"
12 #include "cmVSSetupHelper.h"
13
14 class cmGlobalGeneratorFactory;
15 class cmake;
16
17 /** \class cmGlobalVisualStudioVersionedGenerator  */
18 class cmGlobalVisualStudioVersionedGenerator
19   : public cmGlobalVisualStudio14Generator
20 {
21 public:
22   static std::unique_ptr<cmGlobalGeneratorFactory> NewFactory15();
23   static std::unique_ptr<cmGlobalGeneratorFactory> NewFactory16();
24
25   bool MatchesGeneratorName(const std::string& name) const override;
26
27   bool SetGeneratorInstance(std::string const& i, cmMakefile* mf) override;
28
29   bool GetVSInstance(std::string& dir) const;
30
31   bool GetVSInstanceVersion(unsigned long long& vsInstanceVersion) const;
32
33   bool IsDefaultToolset(const std::string& version) const override;
34   std::string GetAuxiliaryToolset() const override;
35
36   bool IsStdOutEncodingSupported() const override;
37
38   const char* GetAndroidApplicationTypeRevision() const override;
39
40 protected:
41   cmGlobalVisualStudioVersionedGenerator(
42     VSVersion version, cmake* cm, const std::string& name,
43     std::string const& platformInGeneratorName);
44
45   bool InitializeWindows(cmMakefile* mf) override;
46   bool SelectWindowsStoreToolset(std::string& toolset) const override;
47
48   // Used to verify that the Desktop toolset for the current generator is
49   // installed on the machine.
50   bool IsWindowsDesktopToolsetInstalled() const override;
51
52   // These aren't virtual because we need to check if the selected version
53   // of the toolset is installed
54   bool IsWindowsStoreToolsetInstalled() const;
55
56   // Check for a Win 8 SDK known to the registry or VS installer tool.
57   bool IsWin81SDKInstalled() const;
58
59   std::string GetWindows10SDKMaxVersionDefault(cmMakefile*) const override;
60
61   std::string FindMSBuildCommand() override;
62   std::string FindDevEnvCommand() override;
63
64 private:
65   class Factory15;
66   friend class Factory15;
67   class Factory16;
68   friend class Factory16;
69   mutable cmVSSetupAPIHelper vsSetupAPIHelper;
70 };