cmGlobalVisualStudioVersionedGenerator.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 GetVSInstanceVersion(unsigned long long& vsInstanceVersion) const;
  24. bool IsDefaultToolset(const std::string& version) const override;
  25. std::string GetAuxiliaryToolset() const override;
  26. bool IsStdOutEncodingSupported() const override;
  27. const char* GetAndroidApplicationTypeRevision() const override;
  28. protected:
  29. cmGlobalVisualStudioVersionedGenerator(
  30. VSVersion version, cmake* cm, const std::string& name,
  31. std::string const& platformInGeneratorName);
  32. bool InitializeWindows(cmMakefile* mf) override;
  33. bool SelectWindowsStoreToolset(std::string& toolset) const override;
  34. // Used to verify that the Desktop toolset for the current generator is
  35. // installed on the machine.
  36. bool IsWindowsDesktopToolsetInstalled() const override;
  37. // These aren't virtual because we need to check if the selected version
  38. // of the toolset is installed
  39. bool IsWindowsStoreToolsetInstalled() const;
  40. // Check for a Win 8 SDK known to the registry or VS installer tool.
  41. bool IsWin81SDKInstalled() const;
  42. std::string GetWindows10SDKMaxVersion() const override;
  43. std::string FindMSBuildCommand() override;
  44. std::string FindDevEnvCommand() override;
  45. private:
  46. class Factory15;
  47. friend class Factory15;
  48. class Factory16;
  49. friend class Factory16;
  50. mutable cmVSSetupAPIHelper vsSetupAPIHelper;
  51. };
  52. #endif