cmGlobalVisualStudioVersionedGenerator.h 1.99 KB
Newer Older
1 2
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
3 4
#ifndef cmGlobalVisualStudioVersionedGenerator_h
#define cmGlobalVisualStudioVersionedGenerator_h
5

6
#include "cmConfigure.h" // IWYU pragma: keep
7 8 9 10

#include <iosfwd>
#include <string>

11
#include "cmGlobalVisualStudio14Generator.h"
12
#include "cmVSSetupHelper.h"
13

14 15 16
class cmGlobalGeneratorFactory;
class cmake;

17 18 19
/** \class cmGlobalVisualStudioVersionedGenerator  */
class cmGlobalVisualStudioVersionedGenerator
  : public cmGlobalVisualStudio14Generator
20 21
{
public:
22
  static cmGlobalGeneratorFactory* NewFactory15();
23
  static cmGlobalGeneratorFactory* NewFactory16();
24

25
  bool MatchesGeneratorName(const std::string& name) const override;
26

27 28 29 30
  bool SetGeneratorInstance(std::string const& i, cmMakefile* mf) override;

  bool GetVSInstance(std::string& dir) const;

31
  bool IsDefaultToolset(const std::string& version) const override;
32 33
  std::string GetAuxiliaryToolset() const override;

34
protected:
35
  cmGlobalVisualStudioVersionedGenerator(
36
    VSVersion version, cmake* cm, const std::string& name,
37
    std::string const& platformInGeneratorName);
38

39
  bool InitializeWindows(cmMakefile* mf) override;
40
  bool SelectWindowsStoreToolset(std::string& toolset) const override;
41 42 43

  // Used to verify that the Desktop toolset for the current generator is
  // installed on the machine.
44
  bool IsWindowsDesktopToolsetInstalled() const override;
45 46 47 48 49

  // These aren't virtual because we need to check if the selected version
  // of the toolset is installed
  bool IsWindowsStoreToolsetInstalled() const;

50 51 52
  // Check for a Win 8 SDK known to the registry or VS installer tool.
  bool IsWin81SDKInstalled() const;

53 54
  std::string GetWindows10SDKMaxVersion() const override;

55 56
  std::string FindMSBuildCommand() override;
  std::string FindDevEnvCommand() override;
57

58
private:
59 60
  class Factory15;
  friend class Factory15;
61 62
  class Factory16;
  friend class Factory16;
63
  mutable cmVSSetupAPIHelper vsSetupAPIHelper;
64 65
};
#endif