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"
16 #include "cmGlobalGeneratorFactory.h"
19 struct cmIDEFlagTable;
21 /** \class cmGlobalVisualStudio7Generator
22 * \brief Write a Unix makefiles.
24 * cmGlobalVisualStudio7Generator manages UNIX build process for a tree
26 class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
29 cmGlobalVisualStudio7Generator();
30 static cmGlobalGeneratorFactory* NewFactory() {
31 return new cmGlobalGeneratorSimpleFactory
32 <cmGlobalVisualStudio7Generator>(); }
34 ///! Get the name for the generator.
35 virtual const char* GetName() const {
36 return cmGlobalVisualStudio7Generator::GetActualName();}
37 static const char* GetActualName() {return "Visual Studio 7";}
39 ///! Create a local generator appropriate to this Global Generator
40 virtual cmLocalGenerator *CreateLocalGenerator();
42 /** Get the documentation entry for this generator. */
43 static void GetDocumentation(cmDocumentationEntry& entry);
46 * Try to determine system infomation such as shared library
47 * extension, pthreads, byte order etc.
49 virtual void EnableLanguage(std::vector<std::string>const& languages,
50 cmMakefile *, bool optional);
53 * Try running cmake and building a file. This is used for dynamically
54 * loaded commands, not as part of the usual build process.
56 virtual std::string GenerateBuildCommand(const char* makeProgram,
57 const char *projectName,
58 const char* additionalOptions,
59 const char *targetName,
65 * Generate the all required files for building this project/tree. This
66 * basically creates a series of LocalGenerators for each directory and
67 * requests that they Generate.
69 virtual void Generate();
72 * Generate the DSW workspace file.
74 virtual void OutputSLNFile();
77 * Get the list of configurations
79 std::vector<std::string> *GetConfigurations();
81 ///! Create a GUID or get an existing one.
82 void CreateGUID(const char* name);
83 std::string GetGUID(const char* name);
85 /** Append the subdirectory for the given configuration. */
86 virtual void AppendDirectoryForConfig(const char* prefix,
91 ///! What is the configurations directory variable called?
92 virtual const char* GetCMakeCFGIntDir() const { return "$(OutDir)"; }
94 /** Return true if the target project file should have the option
95 LinkLibraryDependencies and link to .sln dependencies. */
96 virtual bool NeedLinkLibraryDependencies(cmTarget&) { return false; }
99 virtual const char* GetIDEVersion() { return "7.0"; }
101 static cmIDEFlagTable const* GetExtraFlagTableVS7();
102 virtual void OutputSLNFile(cmLocalGenerator* root,
103 std::vector<cmLocalGenerator*>& generators);
104 virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
105 std::vector<cmLocalGenerator*>& generators);
106 virtual void WriteProject(std::ostream& fout,
107 const char* name, const char* path, cmTarget &t);
108 virtual void WriteProjectDepends(std::ostream& fout,
109 const char* name, const char* path, cmTarget &t);
110 virtual void WriteProjectConfigurations(
111 std::ostream& fout, const char* name, cmTarget::TargetType type,
112 const std::set<std::string>& configsPartOfDefaultBuild,
113 const char* platformMapping = NULL);
114 virtual void WriteSLNGlobalSections(std::ostream& fout,
115 cmLocalGenerator* root);
116 virtual void WriteSLNFooter(std::ostream& fout);
117 virtual void WriteSLNHeader(std::ostream& fout);
118 virtual std::string WriteUtilityDepend(cmTarget* target);
120 virtual void WriteTargetsToSolution(
122 cmLocalGenerator* root,
123 OrderedTargetDependSet const& projectTargets);
124 virtual void WriteTargetDepends(
126 OrderedTargetDependSet const& projectTargets);
127 virtual void WriteTargetConfigurations(
129 cmLocalGenerator* root,
130 OrderedTargetDependSet const& projectTargets);
132 void GenerateConfigurations(cmMakefile* mf);
134 virtual void WriteExternalProject(std::ostream& fout,
137 const char* typeGuid,
138 const std::set<cmStdString>&
141 std::string ConvertToSolutionPath(const char* path);
143 std::set<std::string> IsPartOfDefaultBuild(const char* project,
145 std::vector<std::string> Configurations;
146 std::map<cmStdString, cmStdString> GUIDMap;
148 virtual void WriteFolders(std::ostream& fout);
149 virtual void WriteFoldersContent(std::ostream& fout);
150 std::map<std::string,std::set<std::string> > VisualStudioFolders;
152 // Set during OutputSLNFile with the name of the current project.
153 // There is one SLN file per project.
154 std::string CurrentProject;
157 #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"