1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmGlobalVisualStudio7Generator.h,v $
6 Date: $Date: 2008-01-31 21:38:45 $
7 Version: $Revision: 1.45 $
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)"; }
101 static cmVS7FlagTable
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(std::ostream
& fout
,
112 bool partOfDefaultBuild
);
113 virtual void WriteSLNFooter(std::ostream
& fout
);
114 virtual void WriteSLNHeader(std::ostream
& fout
);
115 virtual void AddPlatformDefinitions(cmMakefile
* mf
);
117 virtual void WriteTargetsToSolution(
119 cmLocalGenerator
* root
,
120 cmGlobalGenerator::TargetDependSet
& projectTargets
,
121 cmGlobalGenerator::TargetDependSet
& originalTargets
);
122 virtual void WriteTargetDepends(
124 cmGlobalGenerator::TargetDependSet
& projectTargets
);
125 virtual void WriteTargetConfigurations(
127 cmLocalGenerator
* root
,
128 cmGlobalGenerator::TargetDependSet
& projectTargets
);
130 void AddAllBuildDepends(cmLocalGenerator
* root
,
132 cmGlobalGenerator::TargetDependSet
& targets
);
134 void GenerateConfigurations(cmMakefile
* mf
);
136 virtual void WriteExternalProject(std::ostream
& fout
,
139 const std::vector
<std::string
>&
142 std::string
ConvertToSolutionPath(const char* path
);
144 bool IsPartOfDefaultBuild(const char* project
,
146 std::vector
<std::string
> Configurations
;
147 std::map
<cmStdString
, cmStdString
> GUIDMap
;
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"