cmGlobalVisualStudioVersionedGenerator.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmGlobalVisualStudioVersionedGenerator_h
  4. #define cmGlobalVisualStudioVersionedGenerator_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <iosfwd>
  7. #include <memory>
  8. #include <string>
  9. #include "cmGlobalVisualStudio14Generator.h"
  10. #include "cmVSSetupHelper.h"
  11. class cmGlobalGeneratorFactory;
  12. class cmake;
  13. /** \class cmGlobalVisualStudioVersionedGenerator */
  14. class cmGlobalVisualStudioVersionedGenerator
  15. : public cmGlobalVisualStudio14Generator
  16. {
  17. public:
  18. static std::unique_ptr<cmGlobalGeneratorFactory> NewFactory15();
  19. static std::unique_ptr<cmGlobalGeneratorFactory> NewFactory16();
  20. bool MatchesGeneratorName(const std::string& name) const override;
  21. bool SetGeneratorInstance(std::string const& i, cmMakefile* mf) override;
  22. bool GetVSInstance(std::string& dir) const;
  23. bool IsDefaultToolset(const std::string& version) const override;
  24. std::string GetAuxiliaryToolset() const override;
  25. protected:
  26. cmGlobalVisualStudioVersionedGenerator(
  27. VSVersion version, cmake* cm, const std::string& name,
  28. std::string const& platformInGeneratorName);
  29. bool InitializeWindows(cmMakefile* mf) override;
  30. bool SelectWindowsStoreToolset(std::string& toolset) const override;
  31. // Used to verify that the Desktop toolset for the current generator is
  32. // installed on the machine.
  33. bool IsWindowsDesktopToolsetInstalled() const override;
  34. // These aren't virtual because we need to check if the selected version
  35. // of the toolset is installed
  36. bool IsWindowsStoreToolsetInstalled() const;
  37. // Check for a Win 8 SDK known to the registry or VS installer tool.
  38. bool IsWin81SDKInstalled() const;
  39. std::string GetWindows10SDKMaxVersion() const override;
  40. std::string FindMSBuildCommand() override;
  41. std::string FindDevEnvCommand() override;
  42. private:
  43. class Factory15;
  44. friend class Factory15;
  45. class Factory16;
  46. friend class Factory16;
  47. mutable cmVSSetupAPIHelper vsSetupAPIHelper;
  48. };
  49. #endif