FIX: stupid pb fixed (close to being medieval'ed by The Ken)
[cmake.git] / Source / cmMSDotNETGenerator.h
blobe572781c5d13ec7e4ce44d9ea365aa8bcc619e3f
1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmMSDotNETGenerator.h,v $
5 Language: C++
6 Date: $Date: 2002-06-11 18:15:02 $
7 Version: $Revision: 1.9 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 cmMSDotNETGenerator_h
18 #define cmMSDotNETGenerator_h
20 #include "cmStandardIncludes.h"
21 #include "cmMakefileGenerator.h"
22 #include "cmTarget.h"
23 #include "cmSourceGroup.h"
25 /** \class cmMSDotNETGenerator
26 * \brief Write a Microsoft Visual C++ DSP (project) file.
28 * cmMSDotNETGenerator produces a Microsoft Visual C++ DSP (project) file.
30 class cmMSDotNETGenerator : public cmMakefileGenerator
32 public:
33 ///! Constructor sets the generation of SLN files on.
34 cmMSDotNETGenerator();
36 ///! Destructor.
37 ~cmMSDotNETGenerator();
39 ///! Get the name for the generator.
40 virtual const char* GetName() {return "Visual Studio 7";}
42 ///! virtual copy constructor
43 virtual cmMakefileGenerator* CreateObject()
44 { return new cmMSDotNETGenerator;}
46 ///! Produce the makefile (in this case a Microsoft Visual C++ project).
47 virtual void GenerateMakefile();
49 ///! controls the SLN/DSP settings
50 virtual void SetLocal(bool);
52 /**
53 * Turn off the generation of a Microsoft Visual C++ SLN file.
54 * This causes only the dsp file to be created. This
55 * is used to run as a command line program from inside visual
56 * studio.
58 void BuildSLNOff() {m_BuildSLN = false;}
60 ///! Turn on the generation of a Microsoft Visual C++ SLN file.
61 void BuildProjOn() {m_BuildSLN = true;}
63 /**
64 * Try to determine system infomation such as shared library
65 * extension, pthreads, byte order etc.
67 virtual void EnableLanguage(const char*);
69 protected:
70 /**
71 * Return array of created VCProj names in a STL vector.
72 * Each executable must have its own dsp.
74 std::vector<std::string> GetCreatedProjectNames()
76 return m_CreatedProjectNames;
79 /**
80 * Return the makefile.
82 cmMakefile* GetMakefile()
84 return m_Makefile;
87 private:
88 void CreateSingleVCProj(const char *lname, cmTarget &tgt);
89 void WriteVCProjFile(std::ostream& fout, const char *libName,
90 cmTarget &tgt);
91 void WriteVCProjBeginGroup(std::ostream& fout,
92 const char* group,
93 const char* filter);
94 void WriteVCProjEndGroup(std::ostream& fout);
96 void WriteProjectStart(std::ostream& fout, const char *libName,
97 const cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
98 void WriteConfigurations(std::ostream& fout,
99 const char *libName,
100 const cmTarget &tgt);
101 void WriteConfiguration(std::ostream& fout,
102 const char* configName,
103 const char* libName,
104 const cmTarget &tgt);
106 void OutputDefineFlags(std::ostream& fout);
107 void WriteVCProjFooter(std::ostream& fout);
108 void AddVCProjBuildRule(cmSourceGroup&);
109 void WriteCustomRule(std::ostream& fout,
110 const char* source,
111 const char* command,
112 const std::set<std::string>& depends,
113 const std::set<std::string>& outputs,
114 const char* extraFlags);
116 void OutputTargetRules(std::ostream& fout,
117 const cmTarget &target,
118 const char *libName);
119 std::string CombineCommands(const cmSourceGroup::Commands &commands,
120 cmSourceGroup::CommandFiles &totalCommand,
121 const char *source);
124 virtual void OutputSLNFile();
125 void OutputVCProjFile();
126 std::string CreateGUID(const char* project);
127 void WriteSLNFile(std::ostream& fout);
128 void WriteSLNHeader(std::ostream& fout);
129 void WriteProject(std::ostream& fout,
130 const char* name, const char* path,
131 cmMSDotNETGenerator* project, const cmTarget &t);
132 void WriteProjectDepends(std::ostream& fout,
133 const char* name, const char* path,
134 cmMSDotNETGenerator* project, const cmTarget &t);
135 void WriteProjectConfigurations(std::ostream& fout, const char* name);
136 void WriteExternalProject(std::ostream& fout,
137 const char* name, const char* path,
138 const std::vector<std::string>& dependencies);
139 void WriteSLNFooter(std::ostream& fout);
140 void OutputBuildTool(std::ostream& fout, const char* configName,
141 const char* libname, const cmTarget& t);
142 void OutputLibraryDirectories(std::ostream& fout,
143 const char* configName,
144 const char* libName,
145 const cmTarget &target);
146 void OutputModuleDefinitionFile(std::ostream& fout,
147 const cmTarget &target);
148 void OutputLibraries(std::ostream& fout,
149 const char* configName,
150 const char* libName,
151 const cmTarget &target);
152 std::string ConvertToXMLOutputPath(const char* path);
153 std::string ConvertToXMLOutputPathSingle(const char* path);
154 private:
155 std::map<cmStdString, cmStdString> m_GUIDMap;
156 bool m_BuildSLN;
157 std::string m_LibraryOutputPath;
158 std::string m_ExecutableOutputPath;
159 std::string m_ModuleDefinitionFile;
160 std::vector<std::string> m_Configurations;
161 std::string m_VCProjHeaderTemplate;
162 std::string m_VCProjFooterTemplate;
163 std::vector<std::string> m_CreatedProjectNames;
167 #endif