1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmGlobalVisualStudio7Generator.h,v $
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"
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
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;
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
);
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
,
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();
75 * Generate the DSW workspace file.
77 virtual void OutputSLNFile();
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
,
97 ///! What is the configurations directory variable called?
98 virtual const char* GetCMakeCFGInitDirectory() { return "$(OutDir)"; }
102 bool operator()(cmTarget
const* l
, cmTarget
const* r
);
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
,
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
>
127 OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet
const&);
130 virtual void WriteTargetsToSolution(
132 cmLocalGenerator
* root
,
133 OrderedTargetDependSet
const& projectTargets
);
134 virtual void WriteTargetDepends(
136 OrderedTargetDependSet
const& projectTargets
);
137 virtual void WriteTargetConfigurations(
139 cmLocalGenerator
* root
,
140 OrderedTargetDependSet
const& projectTargets
);
142 void GenerateConfigurations(cmMakefile
* mf
);
144 virtual void WriteExternalProject(std::ostream
& fout
,
147 const std::set
<cmStdString
>&
150 std::string
ConvertToSolutionPath(const char* path
);
152 bool IsPartOfDefaultBuild(const char* project
,
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"