Skip to content

Commit

Permalink
Updated project templates for MiniEngine's CreateNew scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
stanard committed Mar 1, 2021
1 parent 58fb026 commit 58b6bb1
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 75 deletions.
10 changes: 5 additions & 5 deletions MiniEngine/Tools/Scripts/CreateNewProject.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ def copy_app_template(project, guid):
shutil.copy(os.path.join(TEMPLATES_FOLDER, 'pch.h'), project)
shutil.copy(os.path.join(TEMPLATES_FOLDER, 'pch.cpp'), project)
copy_template_file('Main.cpp', project, guid)
copy_template_file('AppTemplate_VS15.sln', project, guid)
copy_template_file('AppTemplate_VS15.vcxproj', project, guid)
copy_template_file('AppTemplate_VS15.vcxproj.filters', project, guid)
copy_template_file('AppTemplate.sln', project, guid)
copy_template_file('AppTemplate.vcxproj', project, guid)
copy_template_file('AppTemplate.vcxproj.filters', project, guid)
for file in glob(os.path.join(TEMPLATES_FOLDER, '*.png')):
shutil.copy(file, project)

def copy_lib_template(project, guid):
'''Instantiates a new library project from a template'''
shutil.copy(os.path.join(TEMPLATES_FOLDER, 'pch.h'), project)
shutil.copy(os.path.join(TEMPLATES_FOLDER, 'pch.cpp'), project)
copy_template_file('LibTemplate_VS15.vcxproj', project, guid)
copy_template_file('LibTemplate_VS15.vcxproj.filters', project, guid)
copy_template_file('LibTemplate.vcxproj', project, guid)
copy_template_file('LibTemplate.vcxproj.filters', project, guid)

def create_project():
if len(sys.argv) != 3 or sys.argv[1].lower() != 'app' and sys.argv[1].lower() != 'lib':
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26403.7
# Visual Studio 16
VisualStudioVersion = 16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TEMPLATE_NAME", "TEMPLATE_NAME_VS15.vcxproj", "{TEMPLATE_GUID}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TEMPLATE_NAME", "TEMPLATE_NAME.vcxproj", "{TEMPLATE_GUID}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Core", "..\Core\Core_VS15.vcxproj", "{86A58508-0D6A-4786-A32F-01A301FDC6F3}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Core", "..\Core\Core.vcxproj", "{86A58508-0D6A-4786-A32F-01A301FDC6F3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
Expand All @@ -15,65 +15,55 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<RootNamespace>TEMPLATE_NAME</RootNamespace>
<ProjectGuid>{TEMPLATE_GUID}</ProjectGuid>
<ApplicationEnvironment>title</ApplicationEnvironment>
<DefaultLanguage>en-US</DefaultLanguage>
<Keyword>Win32Proj</Keyword>
<ProjectName>TEMPLATE_NAME</ProjectName>
<RootNamespace>TEMPLATE_NAME</RootNamespace>
<PlatformToolset>v141</PlatformToolset>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<PlatformToolset>v142</PlatformToolset>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<TargetRuntime>Native</TargetRuntime>
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<EmbedManifest>false</EmbedManifest>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\PropertySheets\VS15.props" />
<Import Project="..\PropertySheets\Debug.props" />
<Import Project="..\PropertySheets\Win32.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Profile|x64'" Label="PropertySheets">
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\PropertySheets\VS15.props" />
<Import Project="..\PropertySheets\Profile.props" />
<Import Project="..\PropertySheets\Win32.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\PropertySheets\VS15.props" />
<Import Project="..\PropertySheets\Release.props" />
<Import Project="..\PropertySheets\Win32.props" />
<Import Project="..\PropertySheets\Build.props" />
<Import Project="..\PropertySheets\Desktop.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\Core</AdditionalIncludeDirectories>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile />
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<AdditionalIncludeDirectories>..\Core;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<Link>
<AdditionalOptions>/nodefaultlib:MSVCRT %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
<Link>
<AdditionalOptions Condition="'$(Configuration)'=='Debug'">/nodefaultlib:MSVCRT %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Main.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Core/Core_VS15.vcxproj">
<ProjectReference Include="../Core/Core.vcxproj">
<Project>{86A58508-0D6A-4786-A32F-01A301FDC6F3}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
Expand All @@ -85,23 +75,23 @@
<Image Include="SplashScreen.png" />
<Image Include="StoreLogo.png" />
<Image Include="WideLogo.png" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ItemDefinitionGroup>
<Link>
<AdditionalLibraryDirectories>..\..\Packages\zlib-vc140-static-64.1.2.11\lib\native\libs\x64\static\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>zlibstatic.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/nodefaultlib:LIBCMT %(AdditionalOptions)</AdditionalOptions>
</Link>
<AdditionalLibraryDirectories>..\..\Packages\zlib-msvc-x64.1.2.11.8900\build\native\lib_release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>zlibstatic.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\Packages\WinPixEventRuntime.1.0.181206001\build\WinPixEventRuntime.targets" Condition="Exists('..\..\Packages\WinPixEventRuntime.1.0.181206001\build\WinPixEventRuntime.targets')" />
<Import Project="..\..\Packages\WinPixEventRuntime.1.0.210209001\build\WinPixEventRuntime.targets" Condition="Exists('..\..\Packages\WinPixEventRuntime.1.0.210209001\build\WinPixEventRuntime.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\Packages\WinPixEventRuntime.1.0.181206001\build\WinPixEventRuntime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\WinPixEventRuntime.1.0.181206001\build\WinPixEventRuntime.targets'))" />
<Error Condition="!Exists('..\..\Packages\zlib-vc140-static-64.1.2.11\build\native\zlib-vc140-static-64.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\zlib-vc140-static-64.1.2.11\build\native\zlib-vc140-static-64.targets'))" />
<Error Condition="!Exists('..\..\Packages\zlib-msvc-x64.1.2.11.8900\build\native\zlib-msvc-x64.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\zlib-msvc-x64.1.2.11.8900\build\native\zlib-msvc-x64.targets'))" />
<Error Condition="!Exists('..\..\Packages\WinPixEventRuntime.1.0.210209001\build\WinPixEventRuntime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\WinPixEventRuntime.1.0.210209001\build\WinPixEventRuntime.targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pch.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<Image Include="Logo.png">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
Expand All @@ -20,35 +20,25 @@
<ProjectName>TEMPLATE_NAME</ProjectName>
<RootNamespace>TEMPLATE_NAME</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<ApplicationEnvironment>title</ApplicationEnvironment>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<Keyword>Win32Proj</Keyword>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
<TargetRuntime>Native</TargetRuntime>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<EmbedManifest>false</EmbedManifest>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
<Import Project="..\PropertySheets\VS15.props" />
<Import Project="..\PropertySheets\Debug.props" />
<Import Project="..\PropertySheets\Win32.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Profile|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
<Import Project="..\PropertySheets\VS15.props" />
<Import Project="..\PropertySheets\Profile.props" />
<Import Project="..\PropertySheets\Win32.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
<Import Project="..\PropertySheets\VS15.props" />
<Import Project="..\PropertySheets\Release.props" />
<Import Project="..\PropertySheets\Win32.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\PropertySheets\Build.props" />
<Import Project="..\PropertySheets\Desktop.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
Expand All @@ -58,8 +48,6 @@
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='X64'">
<Link>
<AdditionalDependencies>d3d11.lib;dxguid.lib;winmm.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
Expand Down
2 changes: 1 addition & 1 deletion MiniEngine/Tools/Scripts/ProjectTemplates/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void TEMPLATE_NAME::Cleanup( void )
// Free up resources in an orderly fashion
}

void TEMPLATE_NAME::Update( float deltaT )
void TEMPLATE_NAME::Update( float /*deltaT*/ )
{
ScopedTimer _prof(L"Update State");

Expand Down
4 changes: 2 additions & 2 deletions MiniEngine/Tools/Scripts/ProjectTemplates/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="WinPixEventRuntime" version="1.0.180612001" targetFramework="native" />
<package id="zlib-vc140-static-64" version="1.2.11" targetFramework="native" />
<package id="WinPixEventRuntime" version="1.0.210209001" targetFramework="native" />
<package id="zlib-msvc-x64" version="1.2.11.8900" targetFramework="native" />
</packages>

0 comments on commit 58b6bb1

Please sign in to comment.