Bläddra i källkod

Added post-build script to copy pak and dll files, fixed PolycodeDir variable

* Tweaked PolycodeDir variable so that it matches visual studio conventions (includes a trailing slash)

* Added post-build event script to copy default.pak and hdr.pak if they don't already exist in the solution directory

* Added post-build event script to copy the release or debug openal32 and zlib dlls to built target directory if they don't already exist
Danny Warren 13 år sedan
förälder
incheckning
f473ebf99f
1 ändrade filer med 18 tillägg och 3 borttagningar
  1. 18 3
      Assets/Templates/C++/Windows/Polycode.props

+ 18 - 3
Assets/Templates/C++/Windows/Polycode.props

@@ -2,7 +2,7 @@
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ImportGroup Label="PropertySheets" />
   <ImportGroup Label="PropertySheets" />
   <PropertyGroup Label="UserMacros">
   <PropertyGroup Label="UserMacros">
-    <PolycodeDir>$(SolutionDir)..\..</PolycodeDir>
+    <PolycodeDir>$(SolutionDir)..\..\</PolycodeDir>
     <PolycodeCoreLibsDebug>Polycore_d.lib</PolycodeCoreLibsDebug>
     <PolycodeCoreLibsDebug>Polycore_d.lib</PolycodeCoreLibsDebug>
     <PolycodeCoreLibsRelease>Polycore.lib</PolycodeCoreLibsRelease>
     <PolycodeCoreLibsRelease>Polycore.lib</PolycodeCoreLibsRelease>
     <PolycodeDependLibsDebug>freetype_d.lib;liboggd.lib;libpng15_staticd.lib;libvorbisd.lib;libvorbisfiled.lib;lua5.1d.lib;OpenAL32d.lib;physfsd.lib;zlibd.lib;zlibstaticd.lib</PolycodeDependLibsDebug>
     <PolycodeDependLibsDebug>freetype_d.lib;liboggd.lib;libpng15_staticd.lib;libvorbisd.lib;libvorbisfiled.lib;lua5.1d.lib;OpenAL32d.lib;physfsd.lib;zlibd.lib;zlibstaticd.lib</PolycodeDependLibsDebug>
@@ -13,10 +13,10 @@
     <PolycodeLibsRelease>$(PolycodeCoreLibsRelease);$(PolycodeDependLibsRelease);$(PolycodeWinLibsRelease)</PolycodeLibsRelease>
     <PolycodeLibsRelease>$(PolycodeCoreLibsRelease);$(PolycodeDependLibsRelease);$(PolycodeWinLibsRelease)</PolycodeLibsRelease>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup>
   <PropertyGroup>
-    <IncludePath>$(PolycodeDir)\Core\include;$(PolycodeDir)\Core\Dependencies\include;$(PolycodeDir)\Core\PolycodeView;$(PolycodeDir)\Core\Dependencies\include\AL;$(IncludePath)</IncludePath>
+    <IncludePath>$(PolycodeDir)Core\include;$(PolycodeDir)Core\Dependencies\include;$(PolycodeDir)Core\PolycodeView;$(PolycodeDir)Core\Dependencies\include\AL;$(IncludePath)</IncludePath>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup>
   <PropertyGroup>
-    <LibraryPath>$(PolycodeDir)\Core\lib;$(PolycodeDir)\Core\Dependencies\lib;$(LibraryPath)</LibraryPath>
+    <LibraryPath>$(PolycodeDir)Core\lib;$(PolycodeDir)Core\Dependencies\lib;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   </PropertyGroup>
   <ItemDefinitionGroup>
   <ItemDefinitionGroup>
     <ClCompile>
     <ClCompile>
@@ -27,6 +27,21 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <SubSystem>Windows</SubSystem>
     </Link>
     </Link>
+    <PostBuildEvent>
+      <Command>if not exist "$(SolutionDir)default.pak" copy "$(PolycodeDir)Core\Assets\default.pak" "$(SolutionDir)"
+if not exist "$(SolutionDir)hdr.pak" copy "$(PolycodeDir)Core\Assets\hdr.pak" "$(SolutionDir)"
+
+if "$(ConfigurationName)" == "Debug" (
+  if not exist "$(TargetDir)OpenAL32d.dll" copy "$(PolycodeDir)Core\Dependencies\bin\OpenAL32d.dll" "$(TargetDir)"
+  if not exist "$(TargetDir)zlibd.dll" copy "$(PolycodeDir)Core\Dependencies\bin\zlibd.dll" "$(TargetDir)"
+) else (
+    if not exist "$(TargetDir)OpenAL32.dll" copy "$(PolycodeDir)Core\Dependencies\bin\OpenAL32.dll" "$(TargetDir)"
+    if not exist "$(TargetDir)zlib.dll" copy "$(PolycodeDir)Core\Dependencies\bin\zlib.dll" "$(TargetDir)"
+)</Command>
+    </PostBuildEvent>
+    <PostBuildEvent>
+      <Message>Copying polycode pak files and dlls to project</Message>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
   <ItemGroup>
   <ItemGroup>
     <BuildMacro Include="PolycodeDir">
     <BuildMacro Include="PolycodeDir">