Fix for version.h generation

git-svn-id: http://svn.code.sf.net/p/gpac/code/trunk/gpac@2721 63c20433-aa62-49bd-875c-5a186b69a8fb
This commit is contained in:
Cyril Concolato
2011-03-01 17:00:32 +00:00
parent 42b2754a0e
commit 1f42a5fb4b
3 changed files with 16 additions and 6 deletions

View File

@@ -28,7 +28,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="for /f &quot;delims=&quot; %%a in (&apos;svnversion&apos;) do echo #define GPAC_SVN_REVISION &quot;%%a&quot; &gt; test.h &amp; ECHO n|COMP test.h include\gpac\version.h &gt; nul &amp; if errorlevel 1 COPY test.h include\gpac\version.h &amp; DEL test.h"
CommandLine="$(InputDir)..\..\version.bat"
/>
<Tool
Name="VCCustomBuildTool"
@@ -107,7 +107,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="for /f &quot;delims=&quot; %%a in (&apos;svnversion&apos;) do echo #define GPAC_SVN_REVISION &quot;%%a&quot; &gt; test.h &amp; ECHO n|COMP test.h include\gpac\version.h &gt; nul &amp; if errorlevel 1 COPY test.h include\gpac\version.h &amp; DEL test.h"
CommandLine="$(InputDir)..\..\version.bat"
/>
<Tool
Name="VCCustomBuildTool"
@@ -191,7 +191,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="@echo off &amp; cd ..\.. &amp; for /f &quot;delims=&quot; %%a in (&apos;svnversion&apos;) do echo #define GPAC_SVN_REVISION &quot;%%a&quot; &gt; test.h &amp; ECHO n|COMP test.h include\gpac\version.h &gt; nul &amp; if errorlevel 1 COPY test.h include\gpac\version.h &amp; DEL test.h"
CommandLine="$(InputDir)..\..\version.bat"
/>
<Tool
Name="VCCustomBuildTool"
@@ -268,7 +268,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="for /f &quot;delims=&quot; %%a in (&apos;svnversion&apos;) do echo #define GPAC_SVN_REVISION &quot;%%a&quot; &gt; test.h &amp; ECHO n|COMP test.h include\gpac\version.h &gt; nul &amp; if errorlevel 1 COPY test.h include\gpac\version.h &amp; DEL test.h"
CommandLine="$(InputDir)..\..\version.bat"
/>
<Tool
Name="VCCustomBuildTool"

View File

@@ -29,7 +29,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="cd ..\.. &amp; for /f &quot;delims=&quot; %%a in (&apos;svnversion&apos;) do echo #define GPAC_SVN_REVISION &quot;%%a&quot; &gt; test.h &amp; ECHO n|COMP test.h include\gpac\version.h &gt; nul &amp; if errorlevel 1 MOVE test.h include\gpac\version.h"
CommandLine="$(InputDir)..\..\version.bat"
/>
<Tool
Name="VCCustomBuildTool"
@@ -108,7 +108,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="cd ..\.. &amp; for /f &quot;delims=&quot; %%a in (&apos;svnversion&apos;) do echo #define GPAC_SVN_REVISION &quot;%%a&quot; &gt; test.h &amp; ECHO n|COMP test.h include\gpac\version.h &gt; nul &amp; if errorlevel 1 MOVE test.h include\gpac\version.h"
CommandLine="$(InputDir)..\..\version.bat"
/>
<Tool
Name="VCCustomBuildTool"

10
version.bat Normal file
View File

@@ -0,0 +1,10 @@
@echo off
cd /d %~dp0
for /f "delims=" %%a in ('svnversion') do echo #define GPAC_SVN_REVISION "%%a" > test.h
if not exist include\gpac\version.h goto create
ECHO n|COMP test.h include\gpac\version.h > nul
if errorlevel 1 goto create
DEL test.h
exit/b
:create
MOVE /Y test.h include\gpac\version.h