fix issue 9346. add binary directory to window title to make it easier to deal with...
[cmake.git] / Source / cmLocalVisualStudio7Generator.h
bloba8f6d0e997d2fd332e1cedd7765faa22201177f1
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmLocalVisualStudio7Generator.h,v $
5 Language: C++
6 Date: $Date: 2009-07-29 15:28:54 $
7 Version: $Revision: 1.59 $
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 cmLocalVisualStudio7Generator_h
18 #define cmLocalVisualStudio7Generator_h
20 #include "cmLocalVisualStudioGenerator.h"
21 #include "cmVisualStudioGeneratorOptions.h"
23 class cmTarget;
24 class cmSourceFile;
25 class cmCustomCommand;
26 class cmSourceGroup;
29 class cmLocalVisualStudio7GeneratorOptions;
30 class cmLocalVisualStudio7GeneratorFCInfo;
31 class cmLocalVisualStudio7GeneratorInternals;
33 /** \class cmLocalVisualStudio7Generator
34 * \brief Write Visual Studio .NET project files.
36 * cmLocalVisualStudio7Generator produces a Visual Studio .NET project
37 * file for each target in its directory.
39 class cmLocalVisualStudio7Generator : public cmLocalVisualStudioGenerator
41 public:
42 ///! Set cache only and recurse to false by default.
43 cmLocalVisualStudio7Generator();
45 virtual ~cmLocalVisualStudio7Generator();
47 virtual void AddHelperCommands();
49 /**
50 * Generate the makefile for this directory.
52 virtual void Generate();
54 enum BuildType {STATIC_LIBRARY, DLL, EXECUTABLE, WIN32_EXECUTABLE, UTILITY};
56 /**
57 * Specify the type of the build: static, dll, or executable.
59 void SetBuildType(BuildType,const char *name);
61 void SetVersion71() {this->Version = 71;}
62 void SetVersion8() {this->Version = 8;}
63 void SetVersion9() {this->Version = 9;}
64 void SetPlatformName(const char* n) { this->PlatformName = n;}
65 virtual void ConfigureFinalPass();
66 void GetTargetObjectFileDirectories(cmTarget* target,
67 std::vector<std::string>&
68 dirs);
70 void SetExtraFlagTable(cmVS7FlagTable const* table)
71 { this->ExtraFlagTable = table; }
72 virtual std::string GetTargetDirectory(cmTarget const&) const;
73 cmSourceFile* CreateVCProjBuildRule();
74 void WriteStampFiles();
75 // Compute the maximum length full path to the intermediate
76 // files directory for any configuration. This is used to construct
77 // object file names that do not produce paths that are too long.
78 void ComputeMaxDirectoryLength(std::string& maxdir,
79 cmTarget& target);
81 virtual void ReadAndStoreExternalGUID(const char* name,
82 const char* path);
83 private:
84 typedef cmVisualStudioGeneratorOptions Options;
85 typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo;
86 std::string GetBuildTypeLinkerFlags(std::string rootLinkerFlags,
87 const char* configName);
88 void FixGlobalTargets();
89 void WriteProjectFiles();
90 void WriteVCProjHeader(std::ostream& fout, const char *libName,
91 cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
92 void WriteVCProjFooter(std::ostream& fout);
93 void CreateSingleVCProj(const char *lname, cmTarget &tgt);
94 void WriteVCProjFile(std::ostream& fout, const char *libName,
95 cmTarget &tgt);
96 void WriteConfigurations(std::ostream& fout,
97 const char *libName, cmTarget &tgt);
98 void WriteConfiguration(std::ostream& fout,
99 const char* configName,
100 const char* libName, cmTarget &tgt);
101 std::string EscapeForXML(const char* s);
102 std::string ConvertToXMLOutputPath(const char* path);
103 std::string ConvertToXMLOutputPathSingle(const char* path);
104 void OutputTargetRules(std::ostream& fout, const char* configName,
105 cmTarget &target, const char *libName);
106 void OutputBuildTool(std::ostream& fout, const char* configName,
107 cmTarget& t, bool debug);
108 void OutputLibraryDirectories(std::ostream& fout,
109 std::vector<std::string> const& dirs);
110 void OutputModuleDefinitionFile(std::ostream& fout, cmTarget &target);
111 void WriteProjectStart(std::ostream& fout, const char *libName,
112 cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
113 void WriteProjectStartFortran(std::ostream& fout, const char *libName,
114 cmTarget &tgt);
115 void WriteVCProjBeginGroup(std::ostream& fout,
116 const char* group,
117 const char* filter);
118 void WriteVCProjEndGroup(std::ostream& fout);
120 void WriteCustomRule(std::ostream& fout,
121 const char* source,
122 const cmCustomCommand& command,
123 FCInfo& fcinfo);
124 void WriteTargetVersionAttribute(std::ostream& fout, cmTarget& target);
126 void WriteGroup(const cmSourceGroup *sg,
127 cmTarget& target, std::ostream &fout,
128 const char *libName, std::vector<std::string> *configs);
130 friend class cmLocalVisualStudio7GeneratorFCInfo;
131 friend class cmLocalVisualStudio7GeneratorInternals;
133 class EventWriter;
134 friend class EventWriter;
136 cmVS7FlagTable const* ExtraFlagTable;
137 std::string ModuleDefinitionFile;
138 int Version;
139 bool FortranProject;
140 std::string PlatformName; // Win32 or x64
141 cmLocalVisualStudio7GeneratorInternals* Internal;
145 #endif