1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #ifndef cmGlobalVisualStudio7Generator_h
13 #define cmGlobalVisualStudio7Generator_h
15 #include "cmGlobalVisualStudioGenerator.h"
18 struct cmIDEFlagTable;
20 /** \class cmGlobalVisualStudio7Generator
21 * \brief Write a Unix makefiles.
23 * cmGlobalVisualStudio7Generator manages UNIX build process for a tree
25 class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
28 cmGlobalVisualStudio7Generator();
29 static cmGlobalGenerator* New() {
30 return new cmGlobalVisualStudio7Generator; }
32 ///! Get the name for the generator.
33 virtual const char* GetName() const {
34 return cmGlobalVisualStudio7Generator::GetActualName();}
35 static const char* GetActualName() {return "Visual Studio 7";}
37 ///! Create a local generator appropriate to this Global Generator
38 virtual cmLocalGenerator *CreateLocalGenerator();
40 /** Get the documentation entry for this generator. */
41 virtual void GetDocumentation(cmDocumentationEntry& entry) const;
44 * Try to determine system infomation such as shared library
45 * extension, pthreads, byte order etc.
47 virtual void EnableLanguage(std::vector<std::string>const& languages,
48 cmMakefile *, bool optional);
51 * Try running cmake and building a file. This is used for dynamically
52 * loaded commands, not as part of the usual build process.
54 virtual std::string GenerateBuildCommand(const char* makeProgram,
55 const char *projectName,
56 const char* additionalOptions,
57 const char *targetName,
63 * Generate the all required files for building this project/tree. This
64 * basically creates a series of LocalGenerators for each directory and
65 * requests that they Generate.
67 virtual void Generate();
70 * Generate the DSW workspace file.
72 virtual void OutputSLNFile();
75 * Get the list of configurations
77 std::vector<std::string> *GetConfigurations();
79 ///! Create a GUID or get an existing one.
80 void CreateGUID(const char* name);
81 std::string GetGUID(const char* name);
83 /** Append the subdirectory for the given configuration. */
84 virtual void AppendDirectoryForConfig(const char* prefix,
89 ///! What is the configurations directory variable called?
90 virtual const char* GetCMakeCFGIntDir() const { return "$(OutDir)"; }
92 /** Return true if the target project file should have the option
93 LinkLibraryDependencies and link to .sln dependencies. */
94 virtual bool NeedLinkLibraryDependencies(cmTarget&) { return false; }
97 virtual const char* GetIDEVersion() { return "7.0"; }
99 static cmIDEFlagTable const* GetExtraFlagTableVS7();
100 virtual void OutputSLNFile(cmLocalGenerator* root,
101 std::vector<cmLocalGenerator*>& generators);
102 virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
103 std::vector<cmLocalGenerator*>& generators);
104 virtual void WriteProject(std::ostream& fout,
105 const char* name, const char* path, cmTarget &t);
106 virtual void WriteProjectDepends(std::ostream& fout,
107 const char* name, const char* path, cmTarget &t);
108 virtual void WriteProjectConfigurations(std::ostream& fout,
110 bool partOfDefaultBuild,
111 const char* platformMapping = NULL);
112 virtual void WriteSLNFooter(std::ostream& fout);
113 virtual void WriteSLNHeader(std::ostream& fout);
114 virtual std::string WriteUtilityDepend(cmTarget* target);
115 virtual void AddPlatformDefinitions(cmMakefile* mf);
117 virtual void WriteTargetsToSolution(
119 cmLocalGenerator* root,
120 OrderedTargetDependSet const& projectTargets);
121 virtual void WriteTargetDepends(
123 OrderedTargetDependSet const& projectTargets);
124 virtual void WriteTargetConfigurations(
126 cmLocalGenerator* root,
127 OrderedTargetDependSet const& projectTargets);
129 void GenerateConfigurations(cmMakefile* mf);
131 virtual void WriteExternalProject(std::ostream& fout,
134 const char* typeGuid,
135 const std::set<cmStdString>&
138 std::string ConvertToSolutionPath(const char* path);
140 bool IsPartOfDefaultBuild(const char* project,
142 std::vector<std::string> Configurations;
143 std::map<cmStdString, cmStdString> GUIDMap;
145 virtual void WriteFolders(std::ostream& fout);
146 virtual void WriteFoldersContent(std::ostream& fout);
147 std::map<std::string,std::set<std::string> > VisualStudioFolders;
149 // Set during OutputSLNFile with the name of the current project.
150 // There is one SLN file per project.
151 std::string CurrentProject;
154 #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"