vcproject_gen.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- Python -*-
3 #
4 
5 # @file vcproject_gen.py
6 # @brief rtc-template VC++ project file generator class
7 # @date $Date: 2007/09/26 07:43:29 $
8 # @author Noriaki Ando <n-ando@aist.go.jp> and S.Kurihara
9 
10 import re
11 import os
12 import time
13 import StringIO
14 import ezt
15 import gen_base
16 import uuid
17 
19  return "VC++ project-file generator"
20 
22  """
23  VC++ project-file generator specific usage (short version)
24  """
25  return """
26 Options for VC++ backend:
27 
28 """
29 
30 def usage():
31  """
32  VC++ project-file generator specific usage
33  """
34  return """
35 -------------------------------
36  Help for VC++ project-file geenrator
37 -------------------------------
38 """
39 
41  opt_args_fmt = []
42  return opt_args_fmt
43 
44 
45 proj_file = """<?xml version="1.0" encoding="shift_jis"?>
46 <VisualStudioProject
47  ProjectType="Visual C++"
48  Version="[vc_version]"
49  Name="[fname]"
50  ProjectGUID="[guid]"
51  RootNamespace="[fname]"
52  Keyword="Win32Proj"
53  >
54  <Platforms>
55  <Platform
56  Name="Win32"
57  />
58  </Platforms>
59  <ToolFiles>
60  </ToolFiles>
61  <Configurations>
62  <Configuration
63  Name="Debug|Win32"
64  OutputDirectory=".\\Debug"
65  IntermediateDirectory=".\\Debug"
66  ConfigurationType="1"
67  InheritedPropertySheets=".\\OpenRTM-aist.vsprops"
68  CharacterSet="2"
69  >
70  <Tool
71  Name="VCPreBuildEventTool"
72  />
73  <Tool
74  Name="VCCustomBuildTool"
75  />
76  <Tool
77  Name="VCXMLDataGeneratorTool"
78  />
79  <Tool
80  Name="VCWebServiceProxyGeneratorTool"
81  />
82  <Tool
83  Name="VCMIDLTool"
84  />
85  <Tool
86  Name="VCCLCompilerTool"
87  Optimization="0"
88  PreprocessorDefinitions="USE_stub_in_nt_dll;WIN32;_DEBUG;_CONSOLE;__WIN32__;__x86__;_WIN32_WINNT=0x0400;__NT__;__OSVERSION__=4;_CRT_SECURE_NO_DEPRECATE"
89  MinimalRebuild="true"
90  BasicRuntimeChecks="3"
91  RuntimeLibrary="3"
92  UsePrecompiledHeader="0"
93  WarningLevel="3"
94  Detect64BitPortabilityProblems="false"
95  DebugInformationFormat="4"
96  />
97  <Tool
98  Name="VCManagedResourceCompilerTool"
99  />
100  <Tool
101  Name="VCResourceCompilerTool"
102  />
103  <Tool
104  Name="VCPreLinkEventTool"
105  />
106  <Tool
107  Name="VCLinkerTool"
108  AdditionalDependencies="ACEd.lib RTC041d.lib omniORB407_rtd.lib omniDynamic407_rtd.lib omnithread32_rtd.lib advapi32.lib ws2_32.lib mswsock.lib"
109  OutputFile="$(OutDir)\\[fname].exe"
110  LinkIncremental="2"
111  IgnoreDefaultLibraryNames=""
112  GenerateDebugInformation="true"
113  SubSystem="1"
114  TargetMachine="1"
115  />
116  <Tool
117  Name="VCALinkTool"
118  />
119  <Tool
120  Name="VCManifestTool"
121  />
122  <Tool
123  Name="VCXDCMakeTool"
124  />
125  <Tool
126  Name="VCBscMakeTool"
127  />
128  <Tool
129  Name="VCFxCopTool"
130  />
131  <Tool
132  Name="VCAppVerifierTool"
133  />
134  <Tool
135  Name="VCWebDeploymentTool"
136  />
137  <Tool
138  Name="VCPostBuildEventTool"
139  />
140  </Configuration>
141  <Configuration
142  Name="Release|Win32"
143  OutputDirectory=".\\Release"
144  IntermediateDirectory=".\\Release"
145  ConfigurationType="1"
146  InheritedPropertySheets=".\\OpenRTM-aist.vsprops"
147  CharacterSet="0"
148  WholeProgramOptimization="0"
149  >
150  <Tool
151  Name="VCPreBuildEventTool"
152  />
153  <Tool
154  Name="VCCustomBuildTool"
155  />
156  <Tool
157  Name="VCXMLDataGeneratorTool"
158  />
159  <Tool
160  Name="VCWebServiceProxyGeneratorTool"
161  />
162  <Tool
163  Name="VCMIDLTool"
164  />
165  <Tool
166  Name="VCCLCompilerTool"
167  PreprocessorDefinitions="USE_stub_in_nt_dll;WIN32;NDEBUG;_CONSOLE;__WIN32__;__x86__;_WIN32_WINNT=0x0400;__NT__;__OSVERSION__=4"
168  RuntimeLibrary="2"
169  UsePrecompiledHeader="0"
170  WarningLevel="3"
171  Detect64BitPortabilityProblems="false"
172  DebugInformationFormat="3"
173  />
174  <Tool
175  Name="VCManagedResourceCompilerTool"
176  />
177  <Tool
178  Name="VCResourceCompilerTool"
179  />
180  <Tool
181  Name="VCPreLinkEventTool"
182  />
183  <Tool
184  Name="VCLinkerTool"
185  AdditionalDependencies="ACE.lib RTC041.lib omniORB407_rt.lib omniDynamic407_rt.lib omnithread32_rt.lib advapi32.lib ws2_32.lib mswsock.lib"
186  OutputFile="$(OutDir)/$(ProjectName).exe"
187  LinkIncremental="1"
188  GenerateDebugInformation="false"
189  SubSystem="1"
190  OptimizeReferences="2"
191  EnableCOMDATFolding="2"
192  LinkTimeCodeGeneration="0"
193  TargetMachine="1"
194  />
195  <Tool
196  Name="VCALinkTool"
197  />
198  <Tool
199  Name="VCManifestTool"
200  />
201  <Tool
202  Name="VCXDCMakeTool"
203  />
204  <Tool
205  Name="VCBscMakeTool"
206  />
207  <Tool
208  Name="VCFxCopTool"
209  />
210  <Tool
211  Name="VCAppVerifierTool"
212  />
213  <Tool
214  Name="VCWebDeploymentTool"
215  />
216  <Tool
217  Name="VCPostBuildEventTool"
218  />
219  </Configuration>
220  </Configurations>
221  <References>
222  </References>
223  <Files>
224  <Filter
225  Name="source file"
226  Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
227  UniqueIdentifier="[SourceGUID]"
228  >
229  <File
230  RelativePath=".\\[fname_cpp]"
231  >
232  </File>
233  <File
234  RelativePath=".\\[fname_comp]"
235  >
236  </File>
237  </Filter>
238  <Filter
239  Name="header file"
240  Filter="h;hpp;hxx;hm;inl;inc;xsd"
241  UniqueIdentifier="[HeaderGUID]"
242  >
243  <File
244  RelativePath=".\\[fname_h]"
245  >
246  </File>
247  </Filter>
248  <Filter
249  Name="resource file"
250  Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
251  UniqueIdentifier="[ResourceGUID]"
252  >
253  </Filter>
254  </Files>
255  <Globals>
256  </Globals>
257 </VisualStudioProject>
258 """
259 
260 props_file = """<?xml version="1.0" encoding="shift_jis"?>
261 <VisualStudioPropertySheet
262  ProjectType="Visual C++"
263  Version="8.00"
264  Name="OpenRTM-aist-0.4"
265  >
266  <Tool
267  Name="VCCLCompilerTool"
268  AdditionalIncludeDirectories="&quot;$(rtm_root)&quot;;&quot;$(rtm_root)\\rtm\\idl&quot;;&quot;$(ace_include)&quot;;&quot;$(omni_include)&quot;;."
269  />
270  <Tool
271  Name="VCLinkerTool"
272  AdditionalLibraryDirectories="&quot;$(rtm_root)\\bin&quot;;&quot;$(ace_libdir)&quot;;&quot;$(omni_libdir)&quot;"
273  />
274  <UserMacro
275  Name="ace_root"
276  Value="%ACE_ROOT%"
277  />
278  <UserMacro
279  Name="omni_root"
280  Value="%OMNI_ROOT%"
281  />
282  <UserMacro
283  Name="rtm_root"
284  Value="%RTM_ROOT%"
285  />
286  <UserMacro
287  Name="ace_include"
288  Value="$(ace_root)"
289  />
290  <UserMacro
291  Name="ace_libdir"
292  Value="$(ace_root)\\lib"
293  />
294  <UserMacro
295  Name="omni_include"
296  Value="$(omni_root)\\include"
297  />
298  <UserMacro
299  Name="omni_libdir"
300  Value="$(omni_root)\\lib\\x86_win32"
301  />
302  <UserMacro
303  Name="omni_bin"
304  Value="$(omni_root)\\bin\\x86_win32"
305  />
306  <UserMacro
307  Name="rtm_includes"
308  Value="&quot;$(rtm_root)&quot;;&quot;$(rtm_root)\\rtm\\idl&quot;;&quot;$(ace_include)&quot;;&quot;$(omni_include)&quot;;."
309  />
310  <UserMacro
311  Name="rtm_libdir"
312  Value="&quot;$(rtm_root)\\bin&quot;;&quot;$(ace_libdir)&quot;;&quot;$(omni_libdir)&quot;;."
313  />
314  <UserMacro
315  Name="rtm_path"
316  Value="&quot;$(rtm_root)\\bin&quot;;&quot;$(rtm_root)\\build&quot;;&quot;$(omni_bin)&quot;"
317  />
318 </VisualStudioPropertySheet>
319 """
320 
321 
323  """
324  VC++ project-file generator
325  """
326  _fname_space = 16
327  def __init__(self, data, opts):
328  self.data = data.copy()
329 
330  self.data["begin_brace"] = "["
331  self.data["end_brace"] = "]"
332  self.data["vcproject_file"] = self.data["fname"] + ".vcproj"
333  self.data["props_file"] = "OpenRTM-aist.vsprops"
334  self.data["l_name"] = self.data["fname"].lower()
335  self.data["guid"] = uuid.uuid1()
336  self.data["SourceGUID"] = uuid.uuid1()
337  self.data["HeaderGUID"] = uuid.uuid1()
338  self.data["ResourceGUID"] = uuid.uuid1()
339  self.data["vc_version"] = "8.00"
340  self.data["fname_h"] = self.data["fname"] + ".h"
341  self.data["fname_cpp"] = self.data["fname"] + ".cpp"
342  self.data["fname_comp"] = self.data["fname"] + "Comp.cpp"
343 
344  self.tags = {}
345  self.gen_tags(self.tags)
346 
347  return
348 
349  def print_vcproject(self):
350  """
351  Generate VC++ project-file
352  """
353  self.gen(self.data["props_file"],
354  props_file, self.data, self.tags)
355 
356  self.gen(self.data["vcproject_file"],
357  proj_file, self.data, self.tags)
358  return
359 
360 
361  def print_all(self):
362  self.print_vcproject()
def uuid1(node=None, clock_seq=None)
def gen(self, fname, temp_txt, data, tags)
Definition: gen_base.py:105


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Jun 6 2019 19:11:35