Merge topic 'curl-tls-verify'
[kiteware-cmake.git] / Source / cmLocalVisualStudio7Generator.h
blob7c395d640ea3c5a5832ef9eaf4fe05c39a1de048
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
5 #include "cmConfigure.h" // IWYU pragma: keep
7 #include <iosfwd>
8 #include <map>
9 #include <memory>
10 #include <set>
11 #include <string>
12 #include <vector>
14 #include "cmLocalVisualStudioGenerator.h"
15 #include "cmVisualStudioGeneratorOptions.h"
17 class cmCustomCommand;
18 class cmGeneratorTarget;
19 class cmGlobalGenerator;
20 class cmLocalVisualStudio7GeneratorFCInfo;
21 class cmLocalVisualStudio7GeneratorInternals;
22 class cmMakefile;
23 class cmSourceFile;
24 class cmSourceGroup;
26 class cmVS7GeneratorOptions : public cmVisualStudioGeneratorOptions
28 public:
29 cmVS7GeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
30 cmVS7FlagTable const* table = nullptr,
31 cmVS7FlagTable const* extraTable = nullptr)
32 : cmVisualStudioGeneratorOptions(lg, tool, table, extraTable)
35 void OutputFlag(std::ostream& fout, int indent, const std::string& tag,
36 const std::string& content) override;
39 /** \class cmLocalVisualStudio7Generator
40 * \brief Write Visual Studio .NET project files.
42 * cmLocalVisualStudio7Generator produces a Visual Studio .NET project
43 * file for each target in its directory.
45 class cmLocalVisualStudio7Generator : public cmLocalVisualStudioGenerator
47 public:
48 //! Set cache only and recurse to false by default.
49 cmLocalVisualStudio7Generator(cmGlobalGenerator* gg, cmMakefile* mf);
51 ~cmLocalVisualStudio7Generator() override;
53 cmLocalVisualStudio7Generator(const cmLocalVisualStudio7Generator&) = delete;
54 const cmLocalVisualStudio7Generator& operator=(
55 const cmLocalVisualStudio7Generator&) = delete;
57 void AddHelperCommands() override;
59 /**
60 * Generate the makefile for this directory.
62 void Generate() override;
64 enum BuildType
66 STATIC_LIBRARY,
67 DLL,
68 EXECUTABLE,
69 WIN32_EXECUTABLE,
70 UTILITY
73 /**
74 * Specify the type of the build: static, dll, or executable.
76 void SetBuildType(BuildType, const std::string& name);
78 std::string GetTargetDirectory(
79 cmGeneratorTarget const* target) const override;
80 cmSourceFile* CreateVCProjBuildRule();
81 void WriteStampFiles();
82 std::string ComputeLongestObjectDirectory(
83 cmGeneratorTarget const*) const override;
85 virtual void ReadAndStoreExternalGUID(const std::string& name,
86 const char* path);
88 std::set<cmSourceFile const*>& GetSourcesVisited(
89 cmGeneratorTarget const* target)
91 return this->SourcesVisited[target];
94 bool IsVFProj() const override { return this->FortranProject; }
96 protected:
97 virtual void GenerateTarget(cmGeneratorTarget* target);
99 private:
100 using Options = cmVS7GeneratorOptions;
101 using FCInfo = cmLocalVisualStudio7GeneratorFCInfo;
102 std::string GetBuildTypeLinkerFlags(std::string const& rootLinkerFlags,
103 const std::string& configName);
104 void FixGlobalTargets();
105 void WriteVCProjHeader(std::ostream& fout, const std::string& libName,
106 cmGeneratorTarget* tgt,
107 std::vector<cmSourceGroup>& sgs);
108 void WriteVCProjFooter(std::ostream& fout, cmGeneratorTarget* target);
109 void WriteVCProjFile(std::ostream& fout, const std::string& libName,
110 cmGeneratorTarget* tgt);
111 void WriteConfigurations(std::ostream& fout,
112 std::vector<std::string> const& configs,
113 const std::string& libName, cmGeneratorTarget* tgt);
114 void WriteConfiguration(std::ostream& fout, const std::string& configName,
115 const std::string& libName, cmGeneratorTarget* tgt);
116 std::string EscapeForXML(const std::string& s);
117 std::string ConvertToXMLOutputPath(const std::string& path);
118 std::string ConvertToXMLOutputPathSingle(const std::string& path);
119 void OutputTargetRules(std::ostream& fout, const std::string& configName,
120 cmGeneratorTarget* target,
121 const std::string& libName);
122 void OutputBuildTool(std::ostream& fout, const std::string& configName,
123 cmGeneratorTarget* t, const Options& targetOptions);
124 void OutputDeploymentDebuggerTool(std::ostream& fout,
125 std::string const& config,
126 cmGeneratorTarget* target);
127 void OutputLibraryDirectories(std::ostream& fout,
128 std::vector<std::string> const& stdlink,
129 std::vector<std::string> const& dirs);
130 void WriteProjectSCC(std::ostream& fout, cmGeneratorTarget* target);
131 void WriteProjectStart(std::ostream& fout, const std::string& libName,
132 cmGeneratorTarget* tgt,
133 std::vector<cmSourceGroup>& sgs);
134 void WriteProjectStartFortran(std::ostream& fout, const std::string& libName,
135 cmGeneratorTarget* tgt);
136 void WriteVCProjBeginGroup(std::ostream& fout, const char* group,
137 const char* filter);
138 void WriteVCProjEndGroup(std::ostream& fout);
140 void WriteCustomRule(std::ostream& fout,
141 std::vector<std::string> const& configs,
142 const char* source, const cmCustomCommand& command,
143 FCInfo& fcinfo);
144 void WriteTargetVersionAttribute(std::ostream& fout, cmGeneratorTarget* gt);
146 class AllConfigSources;
147 bool WriteGroup(const cmSourceGroup* sg, cmGeneratorTarget* target,
148 std::ostream& fout, const std::string& libName,
149 std::vector<std::string> const& configs,
150 AllConfigSources const& sources);
152 friend class cmLocalVisualStudio7GeneratorFCInfo;
153 friend class cmLocalVisualStudio7GeneratorInternals;
155 class EventWriter;
157 friend class EventWriter;
159 bool FortranProject = false;
160 bool WindowsCEProject = false;
161 std::unique_ptr<cmLocalVisualStudio7GeneratorInternals> Internal;
163 std::map<cmGeneratorTarget const*, std::set<cmSourceFile const*>>
164 SourcesVisited;