Advertisement
Guest User

Minishlink

a guest
Sep 28th, 2009
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Copyright (c) Microsoft Corporation.  All rights reserved.  */
  2.  
  3. var bCopyOnly = false;
  4.  
  5. function OnFinish(selProj, selObj)
  6. {
  7.     try
  8.     {
  9.         var strProjectPath = wizard.FindSymbol("PROJECT_PATH");
  10.         var strProjectName = wizard.FindSymbol("PROJECT_NAME");
  11.  
  12.         var bEmptyProject = wizard.FindSymbol("EMPTY_PROJECT");
  13.  
  14.         //strProjectPath += '\\scripts';
  15.  
  16.         selProj = CreateProject(strProjectName, strProjectPath);
  17.    
  18.         AddCommonConfig(selProj, strProjectName);
  19.         AddSpecificConfig(selProj, strProjectName, bEmptyProject);
  20.        
  21.         SetupFilters(selProj);
  22.  
  23.         if (!bEmptyProject)
  24.         {
  25.             var InfFile = CreateInfFile();
  26.             AddFilesToProjectWithInfFile(selProj, strProjectName);
  27.             SetCommonPchSettings(selProj);
  28.             InfFile.Delete();
  29.             var projName = strProjectPath + "\\" + strProjectName + ".vcproj";
  30.             selProj.Object.Save();
  31.         }
  32.     }
  33.     catch(e)
  34.     {
  35.         if (e.description.length != 0)
  36.             SetErrorInfo(e);
  37.         return e.number
  38.     }
  39. }
  40.  
  41. function GetTargetName(strName, strProjectName, strResourcePath)
  42. {
  43.     var strTarget = strName;
  44.  
  45.         switch (strName)
  46.         {
  47.             case "docs/readme.txt":
  48.                 strTarget = "docs/ReadMe.txt";
  49.                 break;
  50.             case "res/resource.h":
  51.                 strTarget = "res/Resource.h";
  52.                 break;
  53.             case "res/root.ico":
  54.                 strTarget = "res" + "\\" + strProjectName + ".ico";
  55.                 break;
  56.             case "res/root.rc":
  57.                 strTarget = "res" + "\\" + strProjectName + ".rc";
  58.                 break;
  59.             case "include/root.h":
  60.                 strTarget = "include" + "\\" + strProjectName + ".h";
  61.                 break;
  62.             case "src/root.cpp":
  63.                 strTarget = "src" + "\\" + strProjectName + ".cpp";
  64.                 break;
  65.             default:
  66.                 break;
  67.         }
  68.     return strTarget;
  69. }
  70.  
  71.  
  72. function AddSpecificConfig(proj, strProjectName, bEmptyProject)
  73. {
  74.     var bCommonFramework = wizard.FindSymbol('FRAMEWORK_YES');
  75.     var bPostbuildCopy = wizard.FindSymbol('POSTBUILD_COPY');
  76.     var sOgreFolder = wizard.FindSymbol('OGRE_FOLDER');
  77.     var bUseCEGUI = wizard.FindSymbol('CEGUI_YES');
  78.     var bExampleFramework = wizard.FindSymbol('FRAMEWORK_YES');
  79.    
  80.     strOgreMainDir = '$(OGRE_HOME)';
  81.     strCEGUIRendererDir = '$(OGRE_HOME)' + '\\samples\\include';
  82.    
  83.    
  84. //DEBUG//////////////////////////////////////////////////////
  85. //set configurations for debug|win32
  86.  
  87.     var config = proj.Object.Configurations("Debug|Win32");
  88.     config.IntermediateDirectory = 'obj\\$(ConfigurationName)';
  89.     config.OutputDirectory = 'bin\\$(ConfigurationName)';
  90.     config.CharacterSet = charSetMBCS;
  91.    
  92.     var debugSettings = config.DebugSettings;
  93.     if(bPostbuildCopy)
  94.     {
  95.         debugSettings.WorkingDirectory = strOgreMainDir + "\\bin\\$(ConfigurationName)";
  96.         debugSettings.Command = strOgreMainDir + "\\bin\\$(ConfigurationName)\\$(ProjectName).exe";
  97.     }
  98.     else
  99.     {
  100.         debugSettings.WorkingDirectory = "..\\bin\\$(ConfigurationName)";
  101.         debugSettings.Command = "..\\bin\\$(ConfigurationName)\\$(ProjectName).exe";
  102.     }
  103.  
  104.  
  105.     var CLTool = config.Tools("VCCLCompilerTool");
  106.     CLTool.UsePrecompiledHeader = pchNone;
  107.  
  108.     CLTool.RuntimeLibrary = rtMultiThreadedDebugDLL;
  109.     CLTool.MinimalRebuild = true;
  110.     CLTool.DebugInformationFormat = debugEditAndContinue;
  111.     CLTool.BasicRuntimeChecks = runtimeBasicCheckAll;
  112.     CLTool.Optimization = optimizeDisabled;
  113.     CLTool.ExceptionHandling = cppExceptionHandlingYes;
  114.     CLTool.RuntimeTypeInfo = true;
  115.     CLTool.floatingPointModel = FloatingPointFast;
  116.  
  117.     CLTool.Detect64BitPortabilityProblems = false;
  118.     CLTool.EnableFunctionLevelLinking = true;
  119.     CLTool.MinimalRebuild = true;
  120.     CLTool.WarningLevel = WarningLevel_3;
  121.     CLTool.PreprocessorDefinitions = "WIN32;_DEBUG;_WINDOWS";
  122.  
  123.     strAdditionalIncludeDirectories = "include;" + strOgreMainDir + "\\include";
  124.  
  125.     if(bUseCEGUI)
  126.         strAdditionalIncludeDirectories = strAdditionalIncludeDirectories + ";" + strOgreMainDir + "\\include\\CEGUI" + ";" + strCEGUIRendererDir;
  127.  
  128.     if(bExampleFramework)
  129.         strAdditionalIncludeDirectories = strAdditionalIncludeDirectories + ";" + strOgreMainDir + "\\samples\\include";
  130.    
  131.     CLTool.AdditionalIncludeDirectories = strAdditionalIncludeDirectories;
  132.  
  133.  
  134.     var LinkTool = config.Tools("VCLinkerTool");
  135.  
  136.     LinkTool.ProgramDatabaseFile = "$(TargetDir)\\$(TargetName)" + ".pdb";
  137.     LinkTool.GenerateDebugInformation = true;
  138.     LinkTool.ProgramDatabaseFile = "$(OutDir)/" + strProjectName + ".pdb";
  139.     LinkTool.LinkIncremental = linkIncrementalYes;
  140.     LinkTool.SubSystem = subSystemWindows;
  141.     LinkTool.OutputFile = "$(OutDir)\\$(ProjectName)" + ".exe";
  142.     LinkTool.TargetMachine = machineTypeOption.machineX86;
  143.     LinkTool.OptimizeForWindows98 = optWin98No;
  144.  
  145.     strAdditionalLibraryDirectories = strOgreMainDir + "\\lib";
  146.     strAdditionalDependencies = "OgreMain_d.lib OIS_d.lib";
  147.        
  148.     if(bUseCEGUI)
  149.     {
  150.         strAdditionalDependencies = strAdditionalDependencies + " CEGUIBase_d.lib OgreGUIRenderer_d.lib";
  151.     }
  152.  
  153.     LinkTool.AdditionalLibraryDirectories = strAdditionalLibraryDirectories;
  154.     LinkTool.AdditionalDependencies = strAdditionalDependencies;
  155.  
  156.     if(bPostbuildCopy)
  157.     {
  158.         var PostBuildTool = config.Tools("VCPostBuildEventTool");
  159.         PostBuildTool.Description = "Copying exe to samples bin directory ...";
  160.  
  161.         PostBuildTool.CommandLine = 'copy "$(OutDir)\\$(TargetFileName)" "' + strOgreMainDir + '\\bin\\$(ConfigurationName)"';
  162.     }
  163.    
  164.    
  165. //RELEASE//////////////////////////////////////////////////////
  166. //set configurations for release|win32
  167.  
  168.     config = proj.Object.Configurations.Item("Release|Win32");
  169.     config.IntermediateDirectory = 'obj\\$(ConfigurationName)';
  170.     config.OutputDirectory = 'bin\\$(ConfigurationName)';
  171.     config.CharacterSet = charSetMBCS;
  172.    
  173.     var debugSettings = config.DebugSettings;
  174.     if(bPostbuildCopy)
  175.     {
  176.         debugSettings.WorkingDirectory = strOgreMainDir + "\\bin\\$(ConfigurationName)";
  177.         debugSettings.Command = strOgreMainDir + "\\bin\\$(ConfigurationName)\\$(ProjectName).exe";
  178.     }
  179.     else
  180.     {
  181.         debugSettings.WorkingDirectory = "..\\bin\\$(ConfigurationName)";
  182.         debugSettings.Command = "..\\bin\\$(ConfigurationName)\\$(ProjectName).exe";
  183.     }
  184.    
  185.     var CLTool = config.Tools("VCCLCompilerTool");
  186.     CLTool.UsePrecompiledHeader = pchNone;
  187.  
  188.     CLTool.RuntimeLibrary = rtMultiThreadedDLL;
  189.     CLTool.ExceptionHandling = cppExceptionHandlingYes;
  190.     CLTool.RuntimeTypeInfo = true;
  191.     CLTool.DebugInformationFormat = debugEnabled;
  192.     CLTool.WarningLevel = WarningLevel_3;
  193.     //CLTool.ImproveFloatingPointConsistency = true;       
  194.     CLTool.Detect64BitPortabilityProblems = false;
  195.     CLTool.PreprocessorDefinitions = "WIN32;NDEBUG;_WINDOWS";
  196.     CLTool.EnableFunctionLevelLinking = true;
  197.     CLTool.MinimalRebuild = true;
  198.     CLTool.FavorSizeOrSpeed = favorSizeOrSpeedOption.favorSpeed;
  199.     //CLTool.GlobalOptimizations = true;
  200.     CLTool.InlineFunctionExpansion = inlineExpansionOption.expandOnlyInline;
  201.     //CLTool.Optimization = optimizeOption.optimizeMaxSpeed;
  202.     CLTool.OmitFramePointers = true;
  203.     //CLTool.OptimizeForProcessor = ProcessorOptimizeOption.procOptimizePentiumProAndAbove;
  204.     //CLTool.OptimizeForWindowsApplication = true;
  205.     CLTool.StringPooling = true;
  206.     CLTool.InlineFunctionExpansion = expandOnlyInline;
  207.     CLTool.BufferSecurityCheck = false;
  208.     CLTool.floatingPointModel = FloatingPointFast;
  209.     CLTool.EnableIntrinsicFunctions = true;
  210.    
  211.     strAdditionalIncludeDirectories = "include;" + strOgreMainDir + "\\include";
  212.        
  213.     if(bUseCEGUI)
  214.         strAdditionalIncludeDirectories = strAdditionalIncludeDirectories + ";" + strOgreMainDir + "\\include\\CEGUI" + ";" + strCEGUIRendererDir;
  215.    
  216.     if(bExampleFramework)
  217.         strAdditionalIncludeDirectories = strAdditionalIncludeDirectories + ";" + strOgreMainDir + "\\samples\\include";
  218.  
  219.     CLTool.AdditionalIncludeDirectories = strAdditionalIncludeDirectories;
  220.  
  221.  
  222.  
  223.     var LinkTool = config.Tools("VCLinkerTool");
  224.     LinkTool.GenerateDebugInformation = false;
  225.     LinkTool.LinkIncremental = linkIncrementalNo;
  226.     LinkTool.OptimizeForWindows98 = optWin98No;
  227.  
  228.     LinkTool.SubSystem = subSystemWindows;
  229.  
  230.     LinkTool.OutputFile = "$(OutDir)\\$(ProjectName)" + ".exe";
  231.  
  232.     strAdditionalLibraryDirectories = strOgreMainDir + "\\lib";
  233.        
  234.     strAdditionalDependencies = "OgreMain.lib OIS.lib";
  235.        
  236.     if(bUseCEGUI)
  237.     {
  238.         strAdditionalDependencies = strAdditionalDependencies + " CEGUIBase.lib OgreGUIRenderer.lib";
  239.     }
  240.    
  241.     LinkTool.AdditionalLibraryDirectories = strAdditionalLibraryDirectories;
  242.     LinkTool.AdditionalDependencies = strAdditionalDependencies;
  243.    
  244.     if(bPostbuildCopy)
  245.     {
  246.         var PostBuildTool = config.Tools("VCPostBuildEventTool");
  247.         PostBuildTool.Description = "Copying exe to samples bin directory ...";
  248.  
  249.         PostBuildTool.CommandLine = 'copy "$(OutDir)\\$(TargetFileName)" "' + strOgreMainDir + '\\Bin\\$(ConfigurationName)"';
  250.     }
  251.  
  252. }
  253.  
  254. function SetFileProperties(projfile, strName)
  255. {
  256.     return false;
  257. }
  258.  
  259. function DoOpenFile(strTarget)
  260. {
  261.     return false;
  262. }
  263.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement