20 vcxproj_template =
"""<?xml version="1.0" encoding="utf-8"?> 21 <Project DefaultTargets="Build" ToolsVersion="[Version]" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 22 <ItemGroup Label="ProjectConfigurations"> 23 <ProjectConfiguration Include="Debug|Win32"> 24 <Configuration>Debug</Configuration> 25 <Platform>Win32</Platform> 26 </ProjectConfiguration> 27 <ProjectConfiguration Include="Debug|x64"> 28 <Configuration>Debug</Configuration> 29 <Platform>x64</Platform> 30 </ProjectConfiguration> 31 <ProjectConfiguration Include="Release|Win32"> 32 <Configuration>Release</Configuration> 33 <Platform>Win32</Platform> 34 </ProjectConfiguration> 35 <ProjectConfiguration Include="Release|x64"> 36 <Configuration>Release</Configuration> 37 <Platform>x64</Platform> 38 </ProjectConfiguration> 40 <PropertyGroup Label="Globals"> 41 <ProjectName>[RootNamespace]</ProjectName> 42 <ProjectGuid>{[ProjectGUID]}</ProjectGuid> 43 <RootNamespace>[RootNamespace]</RootNamespace> 44 <Keyword>Win32Proj</Keyword> 46 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> 47 [for conf in Configurations] 48 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='[conf.Name]'" Label="Configuration"> 49 <ConfigurationType>%s</ConfigurationType> 50 <CharacterSet>NotSet</CharacterSet> 53 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> 54 <ImportGroup Label="ExtensionSettings"> 56 [for conf in Configurations] 57 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='[conf.Name]'" Label="PropertySheets"> 58 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> 59 [for inher in conf.VC10_InheritedPropertySheets] 61 <Import Project="[inher]" /> 66 <PropertyGroup Label="UserMacros" /> 68 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> 69 [for conf in Configurations] 70 <OutDir Condition="'$(Configuration)|$(Platform)'=='[conf.Name]'">[conf.VC10_OutputDirectory]</OutDir> 71 <IntDir Condition="'$(Configuration)|$(Platform)'=='[conf.Name]'">[conf.VC10_IntermediateDirectory]</IntDir> 72 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='[conf.Name]'">[conf.VC10_LinkIncrementalCondition]</LinkIncremental> 76 [for conf in Configurations] 77 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='[conf.Name]'"> 78 <!-- PreBuildEvent --> 98 <!-- PostBuildEvent --> 102 </ItemDefinitionGroup> 106 <Filter Include="[Source.Name]"> 107 <UniqueIdentifier>{[Source.GUID]}</UniqueIdentifier> 108 <Extensions>[Source.Filter]</Extensions> 112 <Filter Include="[Header.Name]"> 113 <UniqueIdentifier>{[Header.GUID]}</UniqueIdentifier> 114 <Extensions>[Header.Filter]</Extensions> 119 [if-any Source.Files][for file in Source.Files] 120 <ClCompile Include="[file.Path]"> 121 <Filter>[Source.Name]</Filter> 126 [if-any Header.Files][for file in Header.Files] 127 <ClInclude Include="[file.Path]"> 128 <Filter>[Header.Name]</Filter> 132 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> 133 <ImportGroup Label="ExtensionTargets"> 142 conf_type = {
"EXE":
"Application",
"DLL":
"DynamicLibrary",
144 "LIB":
"StaticLibrary",
145 "RTCEXE":
"Application",
"RTCDLL":
"DynamicLibrary"}
151 PreBuildEventtools = {
"EXE":
152 [
"VC10_VCPreBuildEventTool",
154 "VCXMLDataGeneratorTool",
155 "VCWebServiceProxyGeneratorTool",
157 "VCManagedResourceCompilerTool",
158 "VCResourceCompilerTool",
161 [
"VC10_VCPreBuildEventTool"],
163 [
"VC10_VCPreBuildEventTool"]
165 PreBuildEventtools[
"RTCEXE"] = PreBuildEventtools[
"EXE"]
166 PreBuildEventtools[
"RTCDLL"] = PreBuildEventtools[
"DLL"]
168 [
"VCCustomBuildTool",
169 "VCXMLDataGeneratorTool",
170 "VCWebServiceProxyGeneratorTool",
172 "VC10_VCCLCompilerTool",
173 "VCManagedResourceCompilerTool",
174 "VCResourceCompilerTool",
177 [
"VCCustomBuildTool",
178 "VCXMLDataGeneratorTool",
179 "VCWebServiceProxyGeneratorTool",
181 "VC10_VCCLCompilerTool",
182 "VCManagedResourceCompilerTool",
183 "VCResourceCompilerTool",
186 [
"VCCustomBuildTool",
187 "VCXMLDataGeneratorTool",
188 "VCWebServiceProxyGeneratorTool",
190 "VC10_VCCLCompilerTool",
191 "VCManagedResourceCompilerTool",
192 "VCResourceCompilerTool"]
194 Cltools[
"RTCEXE"] = Cltools[
"EXE"]
195 Cltools[
"RTCDLL"] = Cltools[
"DLL"]
203 Libtools[
"RTCEXE"] = Libtools[
"EXE"]
204 Libtools[
"RTCDLL"] = Libtools[
"DLL"]
205 PreLinkEventtools = {
"EXE":
206 [
"VC10_VCPreLinkEventTool"],
208 [
"VC10_VCPreLinkEventTool"],
212 PreLinkEventtools[
"RTCEXE"] = PreLinkEventtools[
"EXE"]
213 PreLinkEventtools[
"RTCDLL"] = PreLinkEventtools[
"DLL"]
215 [
"VC10_VCPreLinkEventTool",
223 "VCWebDeploymentTool"],
225 [
"VC10_VCLinkerTool",
232 "VCWebDeploymentTool"],
236 Linktools[
"RTCEXE"] = Linktools[
"EXE"]
237 Linktools[
"RTCDLL"] = Linktools[
"DLL"]
238 PostBuildEventtools = {
"EXE":
239 [
"VC10_VCPostBuildEventTool"],
241 [
"VC10_VCPostBuildEventTool"],
243 [
"VC10_VCPostBuildEventTool"]
245 PostBuildEventtools[
"RTCEXE"] = PostBuildEventtools[
"EXE"]
246 PostBuildEventtools[
"RTCDLL"] = PostBuildEventtools[
"DLL"]
252 tool_elem =
"""[if-any conf.%s][for tool in conf.%s] 254 <[tool.Key]>[tool.Value]</[tool.Key]> 260 ProjectType: Visual C++ 261 Version: "__VCVERSION__" 262 Name: # Your Project Name 263 ProjectGUID: __GUID__ 271 VC10_OutputDirectory: $(ProjectDir)$(Configuration) 272 VC10_IntermediateDirectory: $(Configuration) 273 VC10_InheritedPropertySheets: # Set vsprops file if you need 280 for l
in text.splitlines():
281 m = re.match(
"^Configurations:", l)
286 ret += l.replace(
"Win32",
"x64") +
"\n" 292 exe_yaml =
"""ProjectType: "Visual C++" 293 Version: "__VCVERSION__" 294 Name: __PROJECT_NAME__ 295 ProjectGUID: __GUID__ 296 RootNamespace: __PROJECT_NAME__ 299 #------------------------------------------------------------ 300 # Debug Configuration 301 #------------------------------------------------------------ 302 - Name: "Debug|Win32" 303 VC10_OutputDirectory: $(ProjectDir)$(Configuration)" 304 VC10_IntermediateDirectory: "$(Configuratio)" 305 ConfigurationType: "1" 306 # VC10_InheritedPropertySheets: 308 VC10_LinkIncrementalCondition: "true" 309 # VCPreBuildEventTool: 311 # VCXMLDataGeneratorTool: 312 # VCWebServiceProxyGeneratorTool: 314 VC10_VCCLCompilerTool: 317 - Key: PreprocessorDefinitions 318 Value: "WIN32;_DEBUG;_CONSOLE;__WIN32__;__x86__;_WIN32_WINNT=0x0400;__NT__;__OSVERSION__=4;%(PreprocessorDefinitions)" 319 - Key: MinimalRebuild 321 - Key: BasicRuntimeChecks 322 Value: "EnableFastChecks" 323 - Key: RuntimeLibrary 324 Value: "MultiThreadedDebugDLL" 325 - Key: PrecompiledHeader 329 - Key: Detect64BitPortabilityProblems 331 - Key: DebugInformationFormat 332 Value: "EditAndContinue" 333 # VCManagedResourceCompilerTool: 334 # VCResourceCompilerTool: 335 # VC10_VCPreLinkEventTool: 337 - Key: AdditionalDependencies 340 Value: "$(OutDir)\\\\__PROJECT_NAME__.exe" 341 - Key: LinkIncremental 343 - Key: IgnoreDefaultLibraryNames 345 - Key: GenerateDebugInformation 357 # VCWebDeploymentTool: 358 VC_10VCPostBuildEventTool: 359 VCPreLinkEvent: 'lib -out:"$(TargetDir)coil_static.lib" "$(TargetDir)*.obj" 360 set PATH=%PATH%%3b$(coil_path) 362 start /wait cmd /c makedeffile.py coil_static.lib coil$(coil_dllver)d $(coil_version) coil$(coil_dllver)d.def 363 move coil$(coil_dllver)d.def ..\' 364 VC10_VCPostBuildEventTool: 'copy "$(OutDir)\$(TargetName).lib" "$(SolutionDir)bin\\coil$(coil_dllver)d.lib" 365 copy "$(OutDir)\coil$(coil_dllver)d.dll" "$(SolutionDir)bin\\"' 366 VCPreLinkEvent: 'lib -out:"$(TargetDir)coil_static.lib" "$(TargetDir)*.obj" 367 set PATH=%PATH%%3b$(coil_path) 369 start /wait cmd /c makedeffile.py coil_static.lib coil$(coil_dllver) $(coil_version) coil$(coil_dllver).def 370 move coil$(coil_dllver).def ..\\' 371 VC10_VCPostBuildEventTool: 'copy "$(OutDir)\$(TargetName).lib" "$(SolutionDir)bin\\coil$(coil_dllver).lib" 372 copy "$(OutDir)\coil$(coil_dllver).dll" "$(SolutionDir)bin\\"' 373 #------------------------------------------------------------ 374 # Release Configuration 375 #------------------------------------------------------------ 376 - Name: "Release|Win32" 377 VC10_OutputDirectory: $(ProjectDir)$(Configuration)" 378 VC10_IntermediateDirectory: "$(Configuratio)" 379 ConfigurationType: "1" 380 # VC10_InheritedPropertySheets: "" 382 VC10_LinkIncrementalCondition: "false" 383 WholeProgramOptimization: "0" 384 # VCPreBuildEventTool: 386 # VCXMLDataGeneratorTool: 387 # VCWebServiceProxyGeneratorTool: 389 VC10_VCCLCompilerTool: 390 - Key: PreprocessorDefinitions 391 Value: "WIN32;NDEBUG;_CONSOLE;__WIN32__;__x86__;_WIN32_WINNT=0x0400;__NT__;__OSVERSION__=4;%(PreprocessorDefinitions)" 392 - Key: RuntimeLibrary 393 Value: "MultiThreadedDLL" 394 - Key: PrecompiledHeader 398 - Key: Detect64BitPortabilityProblems 400 - Key: DebugInformationFormat 401 Value: "ProgramDatabase" 402 # VCManagedResourceCompilerTool" 403 # VCResourceCompilerTool" 404 # VC10_VCPreLinkEventTool" 406 - Key: AdditionalDependencies 409 Value: "$(OutDir)\\\\__PROJECT_NAME__.exe" 410 - Key: LinkIncremental 412 - Key: GenerateDebugInformation 416 - Key: OptimizeReferences 418 - Key: EnableCOMDATFolding 420 - Key: LinkTimeCodeGeneration 430 # VCWebDeploymentTool: 431 # VC10_VCPostBuildEventTool: 435 dll_yaml =
"""ProjectType: "Visual C++" 436 Version: "__VCVERSION__" 437 Name: __PROJECT_NAME__ 438 ProjectGUID: __GUID__ 439 RootNamespace: __PROJECT_NAME__ 442 - Name: "Debug|Win32" 443 VC10_OutputDirectory: "$(ProjectDir)$(Configuration)" 444 VC10_IntermediateDirectory: "$(Configuration)" 445 ConfigurationType: "2" 446 # VC10_InheritedPropertySheets: "" 448 VC10_LinkIncrementalCondition: "true" 449 # VCPreBuildEventTool: 451 # VCXMLDataGeneratorTool: 452 # VCWebServiceProxyGeneratorTool: 454 VC10_VCCLCompilerTool: 457 - Key: PreprocessorDefinitions 458 Value: "WIN32;_DEBUG;_WINDOWS;_USRDLL;__WIN32__;__NT__;__OSVERSION__=4;__x86__;_WIN32_WINNT=0x0400;_CRT_SECURE_NO_DEPRECATE" 459 - Key: MinimalRebuild 461 - Key: BasicRuntimeChecks 462 Value: "EnableFastChecks" 463 - Key: RuntimeLibrary 464 Value: "MultiThreadedDebugDLL" 465 - Key: PrecompiledHeader 469 - Key: Detect64BitPortabilityProblems 471 - Key: DebugInformationFormat 472 Value: "EditAndContinue" 473 # VCManagedResourceCompilerTool: 474 # VCResourceCompilerTool: 475 VC10_VCPreLinkEventTool: 478 lib -out:"$(TargetDir)RTC_static.lib" "$(TargetDir)*.obj" "$(SolutionDir)\\\\rtm\\\\idl\\\\$(ConfigurationName)\\\\*.obj" 479 set PATH=%PATH%;$(rtm_path) 481 start /wait cmd /c makedeffile.py RTC_static.lib RTC042d 0.4.1 RTC042d.def 482 move RTC042d.def ..\\\\ 484 - Key: AdditionalDependencies 487 Value: "$(OutDir)\\\\__PROJECT_NAME__.dll" 490 - Key: LinkIncremental 492 - Key: ModuleDefinitionFile 493 Value: "$(TargetName).def" 494 - Key: GenerateDebugInformation 506 # VCWebDeploymentTool: 507 VC10_VCPostBuildEventTool: 510 copy "$(OutDir)\\\\$(TargetName).lib" "$(SolutionDir)bin\\\\" 511 copy "$(OutDir)\\\\$(TargetName).dll" "$(SolutionDir)bin\\\\" 512 - Name: "Release|Win32" 513 VC10_OutputDirectory: "$(ProjectDir)$(Configuration)" 514 VC10_IntermediateDirectory: "$(Configuration)" 515 ConfigurationType: "2" 516 VC10_InheritedPropertySheets: "" 518 VC10_LinkIncrementalCondition: "false" 519 WholeProgramOptimization: "0" 520 # VCPreBuildEventTool: 522 # VCXMLDataGeneratorTool: 523 # VCWebServiceProxyGeneratorTool: 525 VC10_VCCLCompilerTool: 526 - Key: PreprocessorDefinitions 527 Value: "WIN32;NDEBUG;_WINDOWS;_USRDLL;__WIN32__;__NT__;__OSVERSION__=4;__x86__;_WIN32_WINNT=0x0400;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)" 528 - Key: RuntimeLibrary 529 Value: "MultiThreadedDLL" 530 - Key: UsePrecompiledHeader 534 - Key: Detect64BitPortabilityProblems 536 - Key: DebugInformationFormat 537 Value: "ProgramDatabase" 538 # VCManagedResourceCompilerTool: 539 # VCResourceCompilerTool: 540 VC10_VCPreLinkEventTool: 543 lib -out:"$(TargetDir)RTC_static.lib" "$(TargetDir)*.obj" "$(SolutionDir)\\\\rtm\\\\idl\\\\$(ConfigurationName)\\\\*.obj" 544 set PATH=%PATH%;$(rtm_path) 546 start /wait cmd /c makedeffile.py RTC_static.lib RTC042 0.4.1 RTC042.def 547 move RTC042.def ..\\\\ 549 - Key: AdditionalDependencies 552 Value: "$(OutDir)\\\\__PROJECT_NAME__.dll" 553 - Key: LinkIncremental 555 - Key: ModuleDefinitionFile 556 Value: "$(TargetName).def" 557 - Key: GenerateDebugInformation 561 - Key: OptimizeReferences 563 - Key: EnableCOMDATFolding 573 # VCWebDeploymentTool: 574 VC10_VCPostBuildEventTool: 577 copy "$(OutDir)\\\\$(TargetName).lib" "$(SolutionDir)bin\\\\" 578 copy "$(OutDir)\\\\$(TargetName).dll" "$(SolutionDir)bin\\\\" 583 lib_yaml =
"""ProjectType: "Visual C++" 584 Version: "__VCVERSION__" 585 Name: __PROJECT_NAME__ 586 ProjectGUID: __GUID__ 587 RootNamespace: __PROJECT_NAME__ 590 - Name: "Debug|Win32" 591 VC10_OutputDirectory: "$(ProjectDir)$(Configuration)" 592 VC10_IntermediateDirectory: "$(Configuration)" 593 ConfigurationType: "4" 594 # VC10_InheritedPropertySheets: "..\\\\..\\\\OpenRTM-aist.vsprops" 596 VC10_LinkIncrementalCondition: "true" 597 DeleteExtensionsOnClean: "" 601 set PATH=$(rtm_path);%PYTHON_ROOT%\\\\;%PATH% 602 for %%x in (*.idl) do makewrapper.py %%x 603 for %%x in (*.idl) do omniidl -bcxx -Wba -nf %%x 605 # VCXMLDataGeneratorTool: 606 # VCWebServiceProxyGeneratorTool: 608 VC10_VCCLCompilerTool: 611 - Key: PreprocessorDefinitions 612 Value: "WIN32;_DEBUG;_LIB;__WIN32__;__NT__;__OSVERSION__=4;__x86__;_WIN32_WINNT=0x0400;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)" 613 - Key: MinimalRebuild 615 - Key: BasicRuntimeChecks 616 Value: "EnableFastChecks" 617 - Key: RuntimeLibrary 618 Value: "MultiThreadedDebugDLL" 619 - Key: PrecompiledHeader 623 - Key: Detect64BitPortabilityProblems 625 - Key: DebugInformationFormat 626 Value: "EditAndContinue" 627 # VCManagedResourceCompilerTool: 628 # VCResourceCompilerTool: 629 # VC10_VCPreLinkEventTool: 632 Value: "$(OutDir)\\\\__PROJECT_NAME__.lib" 637 VC10_VCPostBuildEventTool: 639 Value: "make .def file" 642 copy "$(OutDir)\\\\libRTCSkeld.lib" "$(SolutionDir)\\\\bin" 643 - Name: "Release|Win32" 644 VC10_OutputDirectory: "$(ProjectDir)$(Configuration)" 645 VC10_IntermediateDirectory: "$(Configuration)" 646 ConfigurationType: "4" 647 # VC10_InheritedPropertySheets: "..\\\\..\\\\OpenRTM-aist.vsprops" 649 VC10_LinkIncrementalCondition: "false" 650 WholeProgramOptimization: "0" 654 set PATH=$(rtm_path);%PYTHON_ROOT%\\\\;%PATH% 655 for %%x in (*.idl) do makewrapper.py %%x 656 for %%x in (*.idl) do omniidl -bcxx -Wba -nf %%x 658 # VCXMLDataGeneratorTool: 659 # VCWebServiceProxyGeneratorTool: 661 VC10_VCCLCompilerTool: 662 - Key: PreprocessorDefinitions 663 Value: "WIN32;NDEBUG;_LIB;__WIN32__;__NT__;__OSVERSION__=4;__x86__;_WIN32_WINNT=0x0400;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)" 664 - Key: RuntimeLibrary 665 Value: "MultiThreadedDLL" 666 - Key: PrecompiledHeader 670 - Key: Detect64BitPortabilityProblems 672 - Key: DebugInformationFormat 673 Value: "ProgramDatabase" 674 # VCManagedResourceCompilerTool: 675 # VCResourceCompilerTool: 676 # VC10_VCPreLinkEventTool: 679 Value: "$(OutDir)\\\\__PROJECT_NAME__.lib" 684 VC10_VCPostBuildEventTool: 687 copy "$(OutDir)\\\\libRTCSkel.lib" "$(SolutionDir)\\\\bin" 691 rtcexe_yaml=
"""ProjectType: "Visual C++" 692 Version: "__VCVERSION__" 693 Name: __PROJECT_NAME__ 694 ProjectGUID: __GUID__ 695 RootNamespace: __PROJECT_NAME__ 698 #------------------------------------------------------------ 699 # Debug Configuration 700 #------------------------------------------------------------ 701 - Name: "Debug|Win32" 702 VC10_OutputDirectory: "$(ProjectDir)__PROJECT_NAME__\\\\$(Configuration)" 703 VC10_IntermediateDirectory: "__PROJECT_NAME__\\\\$(Configuration)" 704 ConfigurationType: "1" 705 VC10_InheritedPropertySheets: 706 - "$(SolutionDir)user_config.props" 707 - "$(SolutionDir)rtm_config.props" 709 VC10_LinkIncrementalCondition: "true" 713 set PATH=$(rtm_path);%PYTHON_ROOT%\\\\;%PATH% 714 for %%x in (*.idl) do rtm-skelwrapper.py --include-dir="" --skel-suffix=Skel --stub-suffix=Stub --idl-file=%%x 715 for %%x in (*.idl) do $(rtm_idlc) $(rtm_idlflags) %%x 716 VC10_VCCLCompilerTool: 719 - Key: PreprocessorDefinitions 720 Value: "USE_stub_in_nt_dll;WIN32;_DEBUG;_CONSOLE;__WIN32__;__x86__;_WIN32_WINNT=0x0400;__NT__;__OSVERSION__=4;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)" 721 - Key: MinimalRebuild 723 - Key: BasicRuntimeChecks 724 Value: "EnableFastChecks" 725 - Key: RuntimeLibrary 726 Value: "MultiThreadedDebugDLL" 727 - Key: PrecompiledHeader 731 - Key: Detect64BitPortabilityProblems 733 - Key: DebugInformationFormat 734 Value: "EditAndContinue" 736 - Key: AdditionalDependencies 737 Value: "$(rtm_libd);%(AdditionalDependencies)" 739 Value: "$(OutDir)\\\\__PROJECT_NAME__.exe" 740 - Key: LinkIncremental 742 - Key: GenerateDebugInformation 748 #------------------------------------------------------------ 749 # Release Configuration 750 #------------------------------------------------------------ 751 - Name: "Release|Win32" 752 VC10_OutputDirectory: "$(ProjectDir)__PROJECT_NAME__\\\\$(Configuration)" 753 VC10_IntermediateDirectory: "__PROJECT_NAME__\\\\$(Configuration)" 754 ConfigurationType: "1" 755 VC10_InheritedPropertySheets: 756 - "$(SolutionDir)user_config.props" 757 - "$(SolutionDir)rtm_config.props" 759 VC10_LinkIncrementalCondition: "false" 760 WholeProgramOptimization: "0" 764 set PATH=$(rtm_path);%PYTHON_ROOT%\\\\;%PATH% 765 for %%x in (*.idl) do rtm-skelwrapper.py --include-dir="" --skel-suffix=Skel --stub-suffix=Stub --idl-file=%%x 766 for %%x in (*.idl) do $(rtm_idlc) $(rtm_idlflags) %%x 767 VC10_VCPostBuildEventTool: 770 if NOT EXIST "$(SolutionDir)\\\\components" mkdir "$(SolutionDir)\\\\components" 771 copy "$(OutDir)\\\\__PROJECT_NAME__.exe" "$(SolutionDir)\\\\components" 772 VC10_VCCLCompilerTool: 773 - Key: PreprocessorDefinitions 774 Value: "USE_stub_in_nt_dll;WIN32;NDEBUG;_CONSOLE;__WIN32__;__x86__;_WIN32_WINNT=0x0400;__NT__;__OSVERSION__=4;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)" 775 - Key: RuntimeLibrary 776 Value: "MultiThreadedDLL" 777 - Key: PrecompiledHeader 781 - Key: Detect64BitPortabilityProblems 783 - Key: DebugInformationFormat 784 Value: "ProgramDatabase" 787 - Key: AdditionalDependencies 788 Value: "$(rtm_lib);%(AdditionalDependencies)" 790 Value: "$(OutDir)\\\\__PROJECT_NAME__.exe" 791 - Key: LinkIncremental 793 - Key: GenerateDebugInformation 797 - Key: OptimizeReferences 799 - Key: EnableCOMDATFolding 801 - Key: LinkTimeCodeGeneration 808 rtcdll_yaml=
"""ProjectType: "Visual C++" 809 Version: "__VCVERSION__" 810 Name: __PROJECT_NAME__ 811 ProjectGUID: __GUID__ 812 RootNamespace: __PROJECT_NAME__ 815 #------------------------------------------------------------ 816 # Debug Configuration 817 #------------------------------------------------------------ 818 - Name: "Debug|Win32" 819 VC10_OutputDirectory: "$(ProjectDir)__PROJECT_NAME__\\\\$(Configuration)" 820 VC10_IntermediateDirectory: "__PROJECT_NAME__\\\\$(Configuration)" 821 ConfigurationType: "2" 822 VC10_InheritedPropertySheets: 823 - "$(SolutionDir)user_config.props" 824 - "$(SolutionDir)rtm_config.props" 826 VC10_LinkIncrementalCondition: "true" 830 set PATH=$(rtm_path);%PYTHON_ROOT%\\\\;%PATH% 831 for %%x in (*.idl) do rtm-skelwrapper.py --include-dir="" --skel-suffix=Skel --stub-suffix=Stub --idl-file=%%x 832 for %%x in (*.idl) do $(rtm_idlc) $(rtm_idlflags) %%x 833 VC10_VCCLCompilerTool: 836 - Key: PreprocessorDefinitions 837 Value: "USE_stub_in_nt_dll;WIN32;_DEBUG;_WINDOWS;_USRDLL;__WIN32__;__NT__;__OSVERSION__=4;__x86__;_WIN32_WINNT=0x0400;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)" 838 - Key: MinimalRebuild 840 - Key: BasicRuntimeChecks 841 Value: "EnableFastChecks" 842 - Key: RuntimeLibrary 843 Value: "MultiThreadedDebugDLL" 844 - Key: PrecompiledHeader 848 - Key: Detect64BitPortabilityProblems 850 - Key: DebugInformationFormat 851 Value: "EditAndContinue" 853 - Key: AdditionalDependencies 854 Value: "$(rtm_libd);%(AdditionalDependencies)" 856 # Value: "$(OutDir)\\\\__PROJECT_NAME__.dll" 859 - Key: LinkIncremental 861 # - Key: ModuleDefinitionFile 862 # Value: "$(TargetName).def" 863 - Key: GenerateDebugInformation 869 #------------------------------------------------------------ 870 # Release Configuration 871 #------------------------------------------------------------ 872 - Name: "Release|Win32" 873 VC10_OutputDirectory: "$(ProjectDir)__PROJECT_NAME__\\\\$(Configuration)" 874 VC10_IntermediateDirectory: "__PROJECT_NAME__\\\\$(Configuration)" 875 ConfigurationType: "2" 876 VC10_InheritedPropertySheets: 877 - "$(SolutionDir)user_config.props" 878 - "$(SolutionDir)rtm_config.props" 880 VC10_LinkIncrementalCondition: "false" 881 WholeProgramOptimization: "0" 885 set PATH=$(rtm_path);%PYTHON_ROOT%\\\\;%PATH% 886 for %%x in (*.idl) do rtm-skelwrapper.py --include-dir="" --skel-suffix=Skel --stub-suffix=Stub --idl-file=%%x 887 for %%x in (*.idl) do $(rtm_idlc) $(rtm_idlflags) %%x 888 VC10_VCPostBuildEventTool: 891 if NOT EXIST "$(SolutionDir)\\\\components" mkdir "$(SolutionDir)\\\\components" 892 copy "$(OutDir)\\\\__PROJECT_NAME__.dll" "$(SolutionDir)\\\\components" 893 VC10_VCCLCompilerTool: 894 - Key: PreprocessorDefinitions 895 Value: "USE_stub_in_nt_dll;WIN32;NDEBUG;_WINDOWS;_USRDLL;__WIN32__;__NT__;__OSVERSION__=4;__x86__;_WIN32_WINNT=0x0400;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)" 896 - Key: RuntimeLibrary 897 Value: "MultiThreadedDLL" 898 - Key: PrecompiledHeader 902 - Key: Detect64BitPortabilityProblems 904 - Key: DebugInformationFormat 905 Value: "ProgramDatabase" 907 - Key: AdditionalDependencies 908 Value: "$(rtm_lib);%(AdditionalDependencies)" 910 # Value: "$(OutDir)\\\\__PROJECT_NAME__.dll" 911 - Key: LinkIncremental 913 # - Key: ModuleDefinitionFile 914 # Value: "$(TargetName).def" 915 - Key: GenerateDebugInformation 919 - Key: OptimizeReferences 921 - Key: EnableCOMDATFolding 931 vcprojtool.py cmd options 933 vcproj: Generate vcproj 934 yaml : Generate example yaml file 935 flist : Generate file list as yaml 937 vcprojtool.py vcproj --type [exe|dll|nmake|lib] 943 vcprojtool.py yaml --type [exe|dll|nmake|lib] --output 944 vcprojtool.py flist --out --source|--header|--resource * 956 class InvalidOption(VCProjException):
958 self.
msg =
"Error: InvalidOption:\n " 963 self.
msg =
"Error: InvalidCommand:\n " 973 self.
dict = yaml.load(yaml_text)
983 for tool
in PreBuildEventtools[type]:
984 t = tool_elem % (tool, tool)
990 for tool
in Cltools[type]:
991 t = tool_elem % (tool, tool)
997 for tool
in Libtools[type]:
998 t = tool_elem % (tool, tool)
1004 for tool
in PreLinkEventtools[type]:
1005 t = tool_elem % (tool, tool)
1011 for tool
in Linktools[type]:
1012 t = tool_elem % (tool, tool)
1018 for tool
in PostBuildEventtools[type]:
1019 t = tool_elem % (tool, tool)
1029 if not dict.has_key(
"Configurations"):
return 1031 def escape_cmd(text):
1032 text = text.replace(
"\"",
""")
1033 text = text.replace(
"\r\n",
"\n")
1034 text = text.replace(
"\n",
"
")
1036 from types
import DictType, ListType
1037 for conf
in dict[
"Configurations"]:
1038 for tool
in conf.keys():
1039 if isinstance(conf[tool], ListType):
1040 for keyval
in conf[tool]:
1041 if isinstance(keyval, DictType) \
1042 and keyval.has_key(
"Key") \
1043 and keyval.has_key(
"Value") \
1044 and keyval[
"Key"] ==
"Command":
1045 keyval[
"Value"] = escape_cmd(keyval[
"Value"])
1051 def __init__(self, type, vcversion, projectname, version, flist):
1059 "RTCEXE": rtcexe_yaml,
"RTCDLL": rtcdll_yaml}
1071 token0 = text.split(
"__GUID__")
1073 for i
in range(1, len(token0)):
1075 text0 += u + token0[i]
1077 token1 = text0.split(
"__UUID")
1079 for i
in range(1, len(token1)):
1081 text1 += u + token1[i]
1087 if self.
flist.has_key(
"yaml")
and len(self.
flist[
"yaml"]) > 0:
1090 if loaded.find(
"ProjectType:") < 0:
1095 print "type should be specified." 1106 text = text.replace(
"__PROJECT_NAME__", self.
projectname)
1108 text = text.replace(
"__VERSION__", self.
version)
1110 text = text.replace(
"__VCVERSION__", self.
vcversion)
1111 text = text.replace(
"__VCSHORTVER__",
1123 "name":
"Source Files",
1124 "filter":
"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx",
1128 "name":
"Header Files",
1129 "filter":
"h;hpp;hxx;hm;inl;inc;xsd",
1133 "name":
"Resource Files",
1134 "filter":
"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav",
1147 for f
in [
"source",
"header",
"resource"]:
1148 if len(self.
flist[f]) > 0:
1149 text += self.
temp % \
1151 self.
filter[f][
"filter"])
1152 for file
in self.
flist[f]:
1154 file = file.replace(
"/",
"\\")
1155 text +=
" - Path: " + file +
"\n" 1195 if not (cmd ==
"vcxproj" or cmd ==
"flist" or cmd ==
"yaml"):
1203 flist = {
"yaml": [],
"source": [],
"header": [],
"resource": []}
1209 if opt ==
"--projectname":
1211 if i < argc: projectname = argv[i]
1213 elif opt ==
"--version":
1215 if i < argc: version = argv[i]
1217 elif opt ==
"--vcversion":
1219 if i < argc: vcversion = argv[i]
1221 elif opt ==
"--output" or opt ==
"--out" or opt ==
"-o":
1223 if i < argc: outfname = argv[i]
1225 elif opt ==
"--type" or opt ==
"-t":
1227 if i < argc: type = argv[i]
1230 if not conf_type.has_key(type):
1233 " --type should be [exe|dll|nmake|lib]")
1234 elif opt[:2] ==
"--" and flist.has_key(opt[2:]):
1238 while i < argc
and argv[i][:2] !=
"--":
1239 flist[lname].
append(argv[i])
1241 if len(flist[lname]) == 0:
1247 return (cmd, vcversion, projectname, version, outfname, type, flist)
1259 except VCProjException, e:
1260 print "\n" + e.msg +
"\n" 1266 projectname = res[2]
1272 if cmd ==
"vcxproj":
1275 projectname, version, flist).
generate()
1277 elif cmd ==
"flist":
1285 fd = open(outfile,
"wb")
1293 print FileList({
"source": [
"hoge.cpp",
"hage.cpp",
"fuga.cpp"],
1294 "header": [
"hoge.h",
"hage.h",
"fuga.h"],
1298 print YamlConfig(
"EXE",
"10.00",
"Test",
"0.9.1",
1304 [
"hoge.h",
"hage.h",
"fuga.h"],
1315 [
"hoge.h",
"hage.h",
"fuga.h"],
1324 if __name__ ==
"__main__":
def uuid1(node=None, clock_seq=None)
void append(SDOPackage::NVList &dest, const SDOPackage::NVList &src)
Append an element to NVList.
def generate(idl_file, preproc_args, impl_suffix, skel_suffix="Skel", fd_h=None, fd_cpp=None)