1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmGlobalVisualStudio7Generator.h,v $
6 Date: $Date: 2009-01-21 22:36:06 $
7 Version: $Revision: 1.47 $
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 cmVS7FlagTable
;
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 static cmVS7FlagTable
const* GetExtraFlagTableVS7();
107 virtual void OutputSLNFile(cmLocalGenerator
* root
,
108 std::vector
<cmLocalGenerator
*>& generators
);
109 virtual void WriteSLNFile(std::ostream
& fout
, cmLocalGenerator
* root
,
110 std::vector
<cmLocalGenerator
*>& generators
);
111 virtual void WriteProject(std::ostream
& fout
,
112 const char* name
, const char* path
, cmTarget
&t
);
113 virtual void WriteProjectDepends(std::ostream
& fout
,
114 const char* name
, const char* path
, cmTarget
&t
);
115 virtual void WriteProjectConfigurations(std::ostream
& fout
,
117 bool partOfDefaultBuild
);
118 virtual void WriteSLNFooter(std::ostream
& fout
);
119 virtual void WriteSLNHeader(std::ostream
& fout
);
120 virtual void AddPlatformDefinitions(cmMakefile
* mf
);
122 class OrderedTargetDependSet
: public std::multiset
<cmTarget
*, TargetCompare
>
125 OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet
const&);
128 virtual void WriteTargetsToSolution(
130 cmLocalGenerator
* root
,
131 OrderedTargetDependSet
const& projectTargets
,
132 cmGlobalGenerator::TargetDependSet
& originalTargets
);
133 virtual void WriteTargetDepends(
135 OrderedTargetDependSet
const& projectTargets
);
136 virtual void WriteTargetConfigurations(
138 cmLocalGenerator
* root
,
139 OrderedTargetDependSet
const& projectTargets
);
141 void AddAllBuildDepends(cmLocalGenerator
* root
,
143 cmGlobalGenerator::TargetDependSet
& targets
);
145 void GenerateConfigurations(cmMakefile
* mf
);
147 virtual void WriteExternalProject(std::ostream
& fout
,
150 const std::vector
<std::string
>&
153 std::string
ConvertToSolutionPath(const char* path
);
155 bool IsPartOfDefaultBuild(const char* project
,
157 std::vector
<std::string
> Configurations
;
158 std::map
<cmStdString
, cmStdString
> GUIDMap
;
160 // Set during OutputSLNFile with the name of the current project.
161 // There is one SLN file per project.
162 std::string CurrentProject
;
165 #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"