Initial commit.
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / cmLocalVisualStudio7Generator.h
blob5795622cebfbc65fbce05199b0f2db0fcc8b6129
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmLocalVisualStudio7Generator.h,v $
5 Language: C++
6 Date: $Date: 2008/01/30 17:04:38 $
7 Version: $Revision: 1.50 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmLocalVisualStudio7Generator_h
18 #define cmLocalVisualStudio7Generator_h
20 #include "cmLocalVisualStudioGenerator.h"
22 class cmTarget;
23 class cmSourceFile;
24 class cmCustomCommand;
25 class cmSourceGroup;
26 struct cmVS7FlagTable;
28 class cmLocalVisualStudio7GeneratorOptions;
29 class cmLocalVisualStudio7GeneratorFCInfo;
30 class cmLocalVisualStudio7GeneratorInternals;
32 /** \class cmLocalVisualStudio7Generator
33 * \brief Write Visual Studio .NET project files.
35 * cmLocalVisualStudio7Generator produces a Visual Studio .NET project
36 * file for each target in its directory.
38 class cmLocalVisualStudio7Generator : public cmLocalVisualStudioGenerator
40 public:
41 ///! Set cache only and recurse to false by default.
42 cmLocalVisualStudio7Generator();
44 virtual ~cmLocalVisualStudio7Generator();
46 virtual void AddHelperCommands();
48 /**
49 * Generate the makefile for this directory.
51 virtual void Generate();
53 enum BuildType {STATIC_LIBRARY, DLL, EXECUTABLE, WIN32_EXECUTABLE, UTILITY};
55 /**
56 * Specify the type of the build: static, dll, or executable.
58 void SetBuildType(BuildType,const char *name);
60 void SetVersion71() {this->Version = 71;}
61 void SetVersion8() {this->Version = 8;}
62 void SetVersion9() {this->Version = 9;}
63 void SetPlatformName(const char* n) { this->PlatformName = n;}
64 virtual void ConfigureFinalPass();
65 void GetTargetObjectFileDirectories(cmTarget* target,
66 std::vector<std::string>&
67 dirs);
69 void SetExtraFlagTable(cmVS7FlagTable const* table)
70 { this->ExtraFlagTable = table; }
71 private:
72 typedef cmLocalVisualStudio7GeneratorOptions Options;
73 typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo;
74 void ReadAndStoreExternalGUID(const char* name,
75 const char* path);
76 std::string GetBuildTypeLinkerFlags(std::string rootLinkerFlags,
77 const char* configName);
78 void FixGlobalTargets();
79 void WriteProjectFiles();
80 void WriteStampFiles();
81 void WriteVCProjHeader(std::ostream& fout, const char *libName,
82 cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
83 void WriteVCProjFooter(std::ostream& fout);
84 void CreateSingleVCProj(const char *lname, cmTarget &tgt);
85 void WriteVCProjFile(std::ostream& fout, const char *libName,
86 cmTarget &tgt);
87 cmSourceFile* CreateVCProjBuildRule();
88 void WriteConfigurations(std::ostream& fout,
89 const char *libName, cmTarget &tgt);
90 void WriteConfiguration(std::ostream& fout,
91 const char* configName,
92 const char* libName, cmTarget &tgt);
93 std::string EscapeForXML(const char* s);
94 std::string ConvertToXMLOutputPath(const char* path);
95 std::string ConvertToXMLOutputPathSingle(const char* path);
96 void OutputTargetRules(std::ostream& fout, const char* configName,
97 cmTarget &target, const char *libName);
98 void OutputBuildTool(std::ostream& fout, const char* configName,
99 cmTarget& t, bool debug);
100 void OutputLibraryDirectories(std::ostream& fout,
101 std::vector<std::string> const& dirs);
102 void OutputModuleDefinitionFile(std::ostream& fout, cmTarget &target);
103 void WriteProjectStart(std::ostream& fout, const char *libName,
104 cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
105 void WriteVCProjBeginGroup(std::ostream& fout,
106 const char* group,
107 const char* filter);
108 void WriteVCProjEndGroup(std::ostream& fout);
110 void WriteCustomRule(std::ostream& fout,
111 const char* source,
112 const cmCustomCommand& command,
113 FCInfo& fcinfo);
114 void WriteTargetVersionAttribute(std::ostream& fout, cmTarget& target);
116 void WriteGroup(const cmSourceGroup *sg,
117 cmTarget& target, std::ostream &fout,
118 const char *libName, std::vector<std::string> *configs);
119 virtual std::string GetTargetDirectory(cmTarget const&) const;
121 friend class cmLocalVisualStudio7GeneratorFCInfo;
122 friend class cmLocalVisualStudio7GeneratorInternals;
124 cmVS7FlagTable const* ExtraFlagTable;
125 std::string ModuleDefinitionFile;
126 int Version;
127 std::string PlatformName; // Win32 or x64
128 cmLocalVisualStudio7GeneratorInternals* Internal;
131 // This is a table mapping XML tag IDE names to command line options
132 struct cmVS7FlagTable
134 const char* IDEName; // name used in the IDE xml file
135 const char* commandFlag; // command line flag
136 const char* comment; // comment
137 const char* value; // string value
138 unsigned int special; // flags for special handling requests
139 enum
141 UserValue = (1<<0), // flag contains a user-specified value
142 UserIgnored = (1<<1), // ignore any user value
143 UserRequired = (1<<2), // match only when user value is non-empty
144 Continue = (1<<3), // continue looking for matching entries
145 SemicolonAppendable = (1<<4), // a flag that if specified multiple times
146 // should have its value appended to the
147 // old value with semicolons (e.g.
148 // /NODEFAULTLIB: =>
149 // IgnoreDefaultLibraryNames)
151 UserValueIgnored = UserValue | UserIgnored,
152 UserValueRequired = UserValue | UserRequired
156 #endif