Fix Xcode project references to the source tree
[cmake.git] / Source / cmGlobalVisualStudio7Generator.h
blob39f184e984c04ffd63120ec32f2cef8b9a662a35
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmGlobalVisualStudio7Generator.h,v $
5 Language: C++
6 Date: $Date: 2009-09-16 15:44:06 $
7 Version: $Revision: 1.51 $
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 cmGlobalVisualStudio7Generator_h
18 #define cmGlobalVisualStudio7Generator_h
20 #include "cmGlobalVisualStudioGenerator.h"
22 class cmTarget;
23 struct cmIDEFlagTable;
25 /** \class cmGlobalVisualStudio7Generator
26 * \brief Write a Unix makefiles.
28 * cmGlobalVisualStudio7Generator manages UNIX build process for a tree
30 class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
32 public:
33 cmGlobalVisualStudio7Generator();
34 static cmGlobalGenerator* New() {
35 return new cmGlobalVisualStudio7Generator; }
37 ///! Get the name for the generator.
38 virtual const char* GetName() const {
39 return cmGlobalVisualStudio7Generator::GetActualName();}
40 static const char* GetActualName() {return "Visual Studio 7";}
42 ///! Create a local generator appropriate to this Global Generator
43 virtual cmLocalGenerator *CreateLocalGenerator();
45 /** Get the documentation entry for this generator. */
46 virtual void GetDocumentation(cmDocumentationEntry& entry) const;
48 /**
49 * Try to determine system infomation such as shared library
50 * extension, pthreads, byte order etc.
52 virtual void EnableLanguage(std::vector<std::string>const& languages,
53 cmMakefile *, bool optional);
55 /**
56 * Try running cmake and building a file. This is used for dynalically
57 * loaded commands, not as part of the usual build process.
59 virtual std::string GenerateBuildCommand(const char* makeProgram,
60 const char *projectName,
61 const char* additionalOptions,
62 const char *targetName,
63 const char* config,
64 bool ignoreErrors,
65 bool fast);
67 /**
68 * Generate the all required files for building this project/tree. This
69 * basically creates a series of LocalGenerators for each directory and
70 * requests that they Generate.
72 virtual void Generate();
74 /**
75 * Generate the DSW workspace file.
77 virtual void OutputSLNFile();
79 /**
80 * Get the list of configurations
82 std::vector<std::string> *GetConfigurations();
84 ///! Create a GUID or get an existing one.
85 void CreateGUID(const char* name);
86 std::string GetGUID(const char* name);
88 ///! do configure step
89 virtual void Configure();
91 /** Append the subdirectory for the given configuration. */
92 virtual void AppendDirectoryForConfig(const char* prefix,
93 const char* config,
94 const char* suffix,
95 std::string& dir);
97 ///! What is the configurations directory variable called?
98 virtual const char* GetCMakeCFGInitDirectory() { return "$(OutDir)"; }
100 struct TargetCompare
102 bool operator()(cmTarget const* l, cmTarget const* r);
105 protected:
106 virtual const char* GetIDEVersion() { return "7.0"; }
108 static cmIDEFlagTable const* GetExtraFlagTableVS7();
109 virtual void OutputSLNFile(cmLocalGenerator* root,
110 std::vector<cmLocalGenerator*>& generators);
111 virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
112 std::vector<cmLocalGenerator*>& generators);
113 virtual void WriteProject(std::ostream& fout,
114 const char* name, const char* path, cmTarget &t);
115 virtual void WriteProjectDepends(std::ostream& fout,
116 const char* name, const char* path, cmTarget &t);
117 virtual void WriteProjectConfigurations(std::ostream& fout,
118 const char* name,
119 bool partOfDefaultBuild);
120 virtual void WriteSLNFooter(std::ostream& fout);
121 virtual void WriteSLNHeader(std::ostream& fout);
122 virtual void AddPlatformDefinitions(cmMakefile* mf);
124 class OrderedTargetDependSet: public std::multiset<cmTarget*, TargetCompare>
126 public:
127 OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const&);
130 virtual void WriteTargetsToSolution(
131 std::ostream& fout,
132 cmLocalGenerator* root,
133 OrderedTargetDependSet const& projectTargets);
134 virtual void WriteTargetDepends(
135 std::ostream& fout,
136 OrderedTargetDependSet const& projectTargets);
137 virtual void WriteTargetConfigurations(
138 std::ostream& fout,
139 cmLocalGenerator* root,
140 OrderedTargetDependSet const& projectTargets);
142 void GenerateConfigurations(cmMakefile* mf);
144 virtual void WriteExternalProject(std::ostream& fout,
145 const char* name,
146 const char* path,
147 const std::set<cmStdString>&
148 dependencies);
150 std::string ConvertToSolutionPath(const char* path);
152 bool IsPartOfDefaultBuild(const char* project,
153 cmTarget* target);
154 std::vector<std::string> Configurations;
155 std::map<cmStdString, cmStdString> GUIDMap;
157 // Set during OutputSLNFile with the name of the current project.
158 // There is one SLN file per project.
159 std::string CurrentProject;
162 #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"
164 #endif