在自定义向导C ++ visual studio 2015中添加道具文件 [英] Add a props file in custom wizard C++ visual studio 2015

查看:69
本文介绍了在自定义向导C ++ visual studio 2015中添加道具文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 function AddConfigs(proj,strProjectName)
{
//
// Debug | Win32配置的设置
//
var config = proj。对象 .Configurations(' Debug | Win32');
config.OutputDirectory = .. \\..\\..\\\ \\out\\bin\\;
config.IntermediateDirectory = $(Configuration)\\;
// 选项:配置类型:0 => Makefile,1 =>应用程序(.exe),
// 2 =>动态库(.dll),3 =>静态库(.lib),4 =>实用程序。
config.ConfigurationType = 2;
// 选项:使用MFC:0 =>标准Windows库,1 =>静态链接,2 =>动态链接。
config.UseOfMFC = 0;
// 选项:使用ATL:0 =>不使用ATL,1 =>到ATL的静态链接,2 =>动态链接到ATL。
config.UseOfATL = 0;
// 选项:字符集:0 =>未设置,1 => Unicode,2 =>多字节字符集。
config.CharacterSet = 1;

var CLTool = config.Tools(' VCCLCompilerTool');
CLTool.AdditionalIncludeDirectories = .. \\..\\base-link \ \tool_lib\\include\\wtl\\; .. \\..\\base-link\\mts-framework\\include\\ ;
// 选项:优化:0 =>禁用(/ Od),1 =>最小化大小(/ O1),
// 2 =>最大化速度(/ O2),3 =>完全优化(/ Ox),4 =>自定义。
CLTool.Optimization = 0;
CLTool.PreprocessorDefinitions = WIN32; _WINDOWS; _DEBUG; _USRDLL;
CLTool.MinimalRebuild = true;
// 选项:基本运行时检查:0 =>默认值,1 =>堆栈帧(/ RTC),
// 2 =>未初始化的变量(/ RTCu),3 =>两者(/ RTC1,相当于/ RTCsu)。
CLTool.BasicRuntimeChecks = 3 ;
// 选项:运行时库:0 =>多线程(/ MT),1 =>多线程调试(/ MTd),
// 2 =>多线程DLL(/ MD),3 =>多线程调试DLL(/ MDd)。
CLTool.RuntimeLibrary = 3< /跨度>;
// 选项:使用预编译的标头:0 =>不使用,1 =>创建预编译头文件(/ Yc),
// 2 =>使用预编译的头文件(/ Yu)。
CLTool.UsePrecompiledHeader = 1;
// 选项:警告级别:0 =>忽略所有警告,1 =>忽略除最严重警告之外的所有警告(默认),
// 2 =>中级警告消息,3 =>低级警告消息,
// 4 =>显示信息级警告消息;对链接器无效。
CLTool.WarningLevel = 3;

// 选项:调试信息格式:0 =>停用,1 => C7兼容(/ Z7),
// 2 =>程序数据库(/ Zi),3 =>程序数据库支持编辑和继续(/ ZI),
// 4 =>来自上级项目继承或项目标准。
CLTool.DebugInformationFormat = 3;
// 优化 - 整个程序优化:否
CLTool.WholeProgramOptimization = < span class =code-string>
false;
// 代码生成 - 启用增强指令集:流式SIMD扩展2(/ arch:SSE2)
CLTool.EnableEnhancedInstructionSet = 2;

var LinkTool = config.Tools(' VCLinkerTool');
LinkTool.AdditionalLibraryDirectories = .. \\..\\base-link \ \mts-framework\\bin\\;
// LinkTool.OutputFile =$(outdir)/+ strProjectName +。dll;
// 选项:链接增量:0 =>默认值,1 =>否(/ INCREMENTAL:NO),2 =>是(/ INCREMENTAL)。
LinkTool.ProgramDatabaseFile = $(TargetDir)$(TargetName )的.pdb;
LinkTool.LinkIncremental = 2;
LinkTool.GenerateDebugInformation = true;
// 选项:子系统:0 =>未设置,1 =>控制台,2 => Windows,3 => Native,4 => EFI申请,
// 5 => EFI Boot Service,6 => EFI ROM,7 => EFI Runtime,8 => POSIX,9 => Windows CE。
LinkTool.SubSystem = 2;
// 选项:目标机器:0 =>未设置,1 => X86,2 => AM33,3 => ARM,4 => EBC,5 => IA64,6 => M32R,
// 7 => MIPS,8 => MIPS16,9 => MIPSFPU,10 => MIPSFPU16,11 => MIPSR41XX,12 => SH3,
// 13 => SH3DSP,14 => SH4,15 => SH5,16 => THUMB,17 => X64。
LinkTool.TargetMachine = 1;
// 优化 - 链接时间代码生成:默认
LinkTool.LinkTimeCodeGeneration = 0;

var MIDLTool = config.Tools(' VCMIDLTool');
MIDLTool.PreprocessorDefinitions = _ DEBUG;
MIDLTool.MkTypLibCompatible = false;

var ResourceTool = config.Tools(' VCResourceCompilerTool');
ResourceTool.PreprocessorDefinitions = _ DEBUG;
ResourceTool.Culture = 1031;
ResourceTool.AdditionalIncludeDirectories = $(IntDir) ;

var PostBuildTool = config.Tools(' VCPostBuildEventTool');
PostBuildTool.CommandLine = ;
PostBuildTool.Description = ;< pre lang = c ++>
}





我的尝试:



我必须在配置中将Platform工具集添加为Visual Studio 2015(v140)。

请让我知道我要添加的变量。

解决方案

(配置)\\;
// 选项:配置类型:0 => Makefile,1 =>应用程序(.exe),
// 2 =>动态库(.dll),3 =>静态库(.lib),4 =>实用程序。
config.ConfigurationType = 2;
// 选项:使用MFC:0 =>标准Windows库,1 =>静态链接,2 =>动态链接。
config.UseOfMFC = < span class =code-string> 0;
// 选项:使用ATL:0 =>不使用ATL,1 =>到ATL的静态链接,2 =>动态链接到ATL。
config.UseOfATL = 0;
// 选项:字符集:0 =>未设置,1 => Unicode,2 =>多字节字符集。
config.CharacterSet = 1;

var CLTool = config.Tools(' VCCLCompilerTool');
CLTool.AdditionalIncludeDirectories = .. \\..\\base-link \ \tool_lib\\include\\wtl\\; .. \\..\\base-link\\mts-framework\\include\\ ;
// 选项:优化:0 =>禁用(/ Od),1 =>最小化大小(/ O1),
// 2 =>最大化速度(/ O2),3 =>完全优化(/ Ox),4 =>自定义。
CLTool.Optimization = 0;
CLTool.PreprocessorDefinitions = WIN32; _WINDOWS; _DEBUG; _USRDLL;
CLTool.MinimalRebuild = true;
// 选项:基本运行时检查:0 =>默认值,1 =>堆栈帧(/ RTC),
// 2 =>未初始化的变量(/ RTCu),3 =>两者(/ RTC1,相当于/ RTCsu)。
CLTool.BasicRuntimeChecks = 3 ;
// 选项:运行时库:0 =>多线程(/ MT),1 =>多线程调试(/ MTd),
// 2 =>多线程DLL(/ MD),3 =>多线程调试DLL(/ MDd)。
CLTool.RuntimeLibrary = 3< /跨度>;
// 选项:使用预编译的标头:0 =>不使用,1 =>创建预编译头文件(/ Yc),
// 2 =>使用预编译的头文件(/ Yu)。
CLTool.UsePrecompiledHeader = 1;
// 选项:警告级别:0 =>忽略所有警告,1 =>忽略除最严重警告之外的所有警告(默认),
// 2 =>中级警告消息,3 =>低级警告消息,
// 4 =>显示信息级警告消息;对链接器无效。
CLTool.WarningLevel = 3;

// 选项:调试信息格式:0 =>停用,1 => C7兼容(/ Z7),
// 2 =>程序数据库(/ Zi),3 =>程序数据库支持编辑和继续(/ ZI),
// 4 =>来自上级项目继承或项目标准。
CLTool.DebugInformationFormat = 3;
// 优化 - 整个程序优化:否
CLTool.WholeProgramOptimization = < span class =code-string>
false;
// 代码生成 - 启用增强指令集:流式SIMD扩展2(/ arch:SSE2)
CLTool.EnableEnhancedInstructionSet = 2;

var LinkTool = config.Tools(' VCLinkerTool');
LinkTool.AdditionalLibraryDirectories = .. \\..\\base-link \ \mts-framework\\bin\\;
// LinkTool.OutputFile =


(outdir)/ + strProjectName +。dll;
// 选项:链接增量:0 = >默认值,1 =>否(/ INCREMENTAL:NO),2 =>是(/ INCREMENTAL)。
LinkTool.ProgramDatabaseFile =

(TARGETDIR)

function AddConfigs(proj, strProjectName)
{
        //
        // Settings for the Debug|Win32 configuration
        //
        var config = proj.Object.Configurations('Debug|Win32');
        config.OutputDirectory = "..\\..\\..\\out\\bin\\";
        config.IntermediateDirectory="$(Configuration)\\";
        // Option: Configuration type: 0 => Makefile, 1 => Application (.exe),
        //         2 => Dynamic Library (.dll), 3 => Static Library (.lib), 4 => Utility.
        config.ConfigurationType="2";
        // Option: Use of MFC: 0 => Standard Windows Libraries, 1 => Static link, 2 => Dynamic link.	
        config.UseOfMFC="0";
        // Option: Use of ATL: 0 => Not Using ATL, 1 => Static Link to ATL, 2 => Dynamic Link to ATL.		
        config.UseOfATL="0";
        // Option: Character set: 0 => Not set, 1 => Unicode, 2 => Multi-Byte Character Set.
        config.CharacterSet = "1";

        var CLTool = config.Tools('VCCLCompilerTool');
        CLTool.AdditionalIncludeDirectories = "..\\..\\base-link\\tool_lib\\include\\wtl\\;..\\..\\base-link\\mts-framework\\include\\";
        // Option: Optimization: 0 => Disabled (/Od), 1 => Minimize Size (/O1),
        //         2 => Maximize Speed (/O2), 3 => Full Optimization (/Ox), 4 => Custom.
        CLTool.Optimization="0";
        CLTool.PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL";
        CLTool.MinimalRebuild="true";
        // Option: Basic runtime checks: 0 => Default, 1 => Stack Frames (/RTCs),
        //         2 => Uninitialized Variables (/RTCu), 3 => Both (/RTC1, equivalent to /RTCsu).
        CLTool.BasicRuntimeChecks="3";
        // Option: Runtime library: 0 => Multi-threaded (/MT), 1 => Multi-threaded Debug (/MTd),
        //         2 => Multi-threaded DLL (/MD), 3 => Multi-threaded Debug DLL (/MDd).
        CLTool.RuntimeLibrary="3";
        // Option: Use precompiled header: 0 => Not use, 1 => Create Precompiled Header File (/Yc),
        //         2 => Use Precompiled Header File (/Yu).
        CLTool.UsePrecompiledHeader="1";
        // Option: Warning level: 0 => Ignore all warnings, 1 => Ignore all but the most severe warnings (Default),
        //         2 => Medium level warning messages, 3 => Low level warning messages,
        //         4 => Show informational-level warning messages; not valid for linker.
        CLTool.WarningLevel="3";

        // Option: Debug information format: 0 => Deactivated, 1 => C7-Compatible (/Z7),
        //         2 => Program database (/Zi), 3 => Program database to support Edit and Continue (/ZI),
        //         4 => from superordinate project inherit or project standard.
        CLTool.DebugInformationFormat="3";		
        // Optimization – Whole Program Optimization: No
        CLTool.WholeProgramOptimization="false";
        // Code Generation – Enable Enhanced Instruction Set: Streaming SIMD Extensions 2 (/arch:SSE2)
        CLTool.EnableEnhancedInstructionSet="2";

        var LinkTool = config.Tools('VCLinkerTool');
        LinkTool.AdditionalLibraryDirectories = "..\\..\\base-link\\mts-framework\\bin\\";
        //	    LinkTool.OutputFile = "$(outdir)/" + strProjectName + ".dll";
        // Option: Link incremental: 0 => Default, 1 => No (/INCREMENTAL:NO), 2 => Yes (/INCREMENTAL).
        LinkTool.ProgramDatabaseFile = "$(TargetDir)$(TargetName).pdb";
        LinkTool.LinkIncremental="2";
        LinkTool.GenerateDebugInformation="true";
        // Option: Subsystem: 0 => Not set, 1 => Console, 2 => Windows, 3 => Native, 4 => EFI Application,
        //         5 => EFI Boot Service, 6 => EFI ROM, 7 => EFI Runtime, 8 => POSIX, 9 => Windows CE.
        LinkTool.SubSystem="2";
        // Option: Target machine: 0 => Not set, 1 => X86, 2 => AM33, 3 => ARM, 4 => EBC, 5 => IA64, 6 => M32R,
        //         7 => MIPS, 8 => MIPS16, 9 => MIPSFPU, 10 => MIPSFPU16, 11 => MIPSR41XX, 12 => SH3,
        //         13 => SH3DSP, 14 => SH4, 15 => SH5, 16 => THUMB, 17 => X64.
        LinkTool.TargetMachine="1";
        // Optimization – Link Time Code Generation: Default
        LinkTool.LinkTimeCodeGeneration="0";

        var MIDLTool = config.Tools('VCMIDLTool');	
        MIDLTool.PreprocessorDefinitions="_DEBUG";
        MIDLTool.MkTypLibCompatible="false";

        var ResourceTool = config.Tools('VCResourceCompilerTool');
        ResourceTool.PreprocessorDefinitions="_DEBUG";
        ResourceTool.Culture="1031";
        ResourceTool.AdditionalIncludeDirectories=""$(IntDir)"";

        var PostBuildTool = config.Tools('VCPostBuildEventTool');
        PostBuildTool.CommandLine="";
        PostBuildTool.Description="";<pre lang="c++">
}



What I have tried:

I have to add Platform toolset as "Visual Studio 2015 (v140)" in configuration.
Please let me know what variable i have to add.

解决方案

(Configuration)\\"; // Option: Configuration type: 0 => Makefile, 1 => Application (.exe), // 2 => Dynamic Library (.dll), 3 => Static Library (.lib), 4 => Utility. config.ConfigurationType="2"; // Option: Use of MFC: 0 => Standard Windows Libraries, 1 => Static link, 2 => Dynamic link. config.UseOfMFC="0"; // Option: Use of ATL: 0 => Not Using ATL, 1 => Static Link to ATL, 2 => Dynamic Link to ATL. config.UseOfATL="0"; // Option: Character set: 0 => Not set, 1 => Unicode, 2 => Multi-Byte Character Set. config.CharacterSet = "1"; var CLTool = config.Tools('VCCLCompilerTool'); CLTool.AdditionalIncludeDirectories = "..\\..\\base-link\\tool_lib\\include\\wtl\\;..\\..\\base-link\\mts-framework\\include\\"; // Option: Optimization: 0 => Disabled (/Od), 1 => Minimize Size (/O1), // 2 => Maximize Speed (/O2), 3 => Full Optimization (/Ox), 4 => Custom. CLTool.Optimization="0"; CLTool.PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL"; CLTool.MinimalRebuild="true"; // Option: Basic runtime checks: 0 => Default, 1 => Stack Frames (/RTCs), // 2 => Uninitialized Variables (/RTCu), 3 => Both (/RTC1, equivalent to /RTCsu). CLTool.BasicRuntimeChecks="3"; // Option: Runtime library: 0 => Multi-threaded (/MT), 1 => Multi-threaded Debug (/MTd), // 2 => Multi-threaded DLL (/MD), 3 => Multi-threaded Debug DLL (/MDd). CLTool.RuntimeLibrary="3"; // Option: Use precompiled header: 0 => Not use, 1 => Create Precompiled Header File (/Yc), // 2 => Use Precompiled Header File (/Yu). CLTool.UsePrecompiledHeader="1"; // Option: Warning level: 0 => Ignore all warnings, 1 => Ignore all but the most severe warnings (Default), // 2 => Medium level warning messages, 3 => Low level warning messages, // 4 => Show informational-level warning messages; not valid for linker. CLTool.WarningLevel="3"; // Option: Debug information format: 0 => Deactivated, 1 => C7-Compatible (/Z7), // 2 => Program database (/Zi), 3 => Program database to support Edit and Continue (/ZI), // 4 => from superordinate project inherit or project standard. CLTool.DebugInformationFormat="3"; // Optimization – Whole Program Optimization: No CLTool.WholeProgramOptimization="false"; // Code Generation – Enable Enhanced Instruction Set: Streaming SIMD Extensions 2 (/arch:SSE2) CLTool.EnableEnhancedInstructionSet="2"; var LinkTool = config.Tools('VCLinkerTool'); LinkTool.AdditionalLibraryDirectories = "..\\..\\base-link\\mts-framework\\bin\\"; // LinkTool.OutputFile = "


(outdir)/" + strProjectName + ".dll"; // Option: Link incremental: 0 => Default, 1 => No (/INCREMENTAL:NO), 2 => Yes (/INCREMENTAL). LinkTool.ProgramDatabaseFile = "


(TargetDir)


这篇关于在自定义向导C ++ visual studio 2015中添加道具文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆