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