cmGlobalVisualStudio8Generator.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. #include <iosfwd>
  5. #include <set>
  6. #include <string>
  7. #include <vector>
  8. #include <cm/optional>
  9. #include "cmGlobalVisualStudio71Generator.h"
  10. class cmGeneratorTarget;
  11. class cmMakefile;
  12. class cmake;
  13. struct cmIDEFlagTable;
  14. /** \class cmGlobalVisualStudio8Generator
  15. * \brief Write a Unix makefiles.
  16. *
  17. * cmGlobalVisualStudio8Generator manages UNIX build process for a tree
  18. */
  19. class cmGlobalVisualStudio8Generator : public cmGlobalVisualStudio71Generator
  20. {
  21. public:
  22. //! Get the name for the generator.
  23. std::string GetName() const override { return this->Name; }
  24. /** Get the name of the main stamp list file. */
  25. static std::string GetGenerateStampList();
  26. void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
  27. bool optional) override;
  28. virtual void AddPlatformDefinitions(cmMakefile* mf);
  29. bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override;
  30. cm::optional<std::string> const& GetTargetFrameworkVersion() const;
  31. cm::optional<std::string> const& GetTargetFrameworkIdentifier() const;
  32. cm::optional<std::string> const& GetTargetFrameworkTargetsVersion() const;
  33. /**
  34. * Override Configure and Generate to add the build-system check
  35. * target.
  36. */
  37. void Configure() override;
  38. /** Return true if the target project file should have the option
  39. LinkLibraryDependencies and link to .sln dependencies. */
  40. bool NeedLinkLibraryDependencies(cmGeneratorTarget* target) override;
  41. /** Return true if building for Windows CE */
  42. bool TargetsWindowsCE() const override
  43. {
  44. return !this->WindowsCEVersion.empty();
  45. }
  46. protected:
  47. cmGlobalVisualStudio8Generator(cmake* cm, const std::string& name,
  48. std::string const& platformInGeneratorName);
  49. virtual bool InitializePlatform(cmMakefile* mf);
  50. virtual bool ProcessGeneratorPlatformField(std::string const& key,
  51. std::string const& value);
  52. void AddExtraIDETargets() override;
  53. std::string FindDevEnvCommand() override;
  54. bool VSLinksDependencies() const override { return false; }
  55. bool AddCheckTarget();
  56. /** Return true if the configuration needs to be deployed */
  57. virtual bool NeedsDeploy(cmGeneratorTarget const& target,
  58. const char* config) const;
  59. /** Returns true if the target system support debugging deployment. */
  60. virtual bool TargetSystemSupportsDeployment() const;
  61. static cmIDEFlagTable const* GetExtraFlagTableVS8();
  62. void WriteSolutionConfigurations(
  63. std::ostream& fout, std::vector<std::string> const& configs) override;
  64. void WriteProjectConfigurations(
  65. std::ostream& fout, const std::string& name,
  66. cmGeneratorTarget const& target, std::vector<std::string> const& configs,
  67. const std::set<std::string>& configsPartOfDefaultBuild,
  68. const std::string& platformMapping = "") override;
  69. bool ComputeTargetDepends() override;
  70. void WriteProjectDepends(std::ostream& fout, const std::string& name,
  71. const std::string& path,
  72. const cmGeneratorTarget* t) override;
  73. bool UseFolderProperty() const override;
  74. std::string Name;
  75. std::string WindowsCEVersion;
  76. cm::optional<std::string> DefaultTargetFrameworkVersion;
  77. cm::optional<std::string> DefaultTargetFrameworkIdentifier;
  78. cm::optional<std::string> DefaultTargetFrameworkTargetsVersion;
  79. private:
  80. bool ParseGeneratorPlatform(std::string const& is, cmMakefile* mf);
  81. };