Skip to content

Commit

Permalink
Add gen_version_win.bat for windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyH committed Sep 10, 2015
1 parent cc41d93 commit be2c078
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
40 changes: 40 additions & 0 deletions OpenApoc.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,27 @@
<LinkIncremental>true</LinkIncremental>
<LibraryPath>$(LIB);$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)\dependencies\physfs\src;$(ProjectDir)\dependencies\tinyxml2;$(ProjectDir)\dependencies\allegro\addons\physfs;$(ProjectDir)\dependencies\allegro\addons\native_dialog;$(ProjectDir)\dependencies\allegro\addons\primitives;$(ProjectDir)\dependencies\allegro\addons\ttf;$(ProjectDir)\dependencies\allegro\addons\image;$(ProjectDir)\dependencies\allegro\addons\font;$(ProjectDir)\dependencies\allegro\addons\color;$(ProjectDir)\dependencies\allegro\addons\acodec;$(ProjectDir)\dependencies\allegro\addons\audio;$(ProjectDir)\dependencies\include;$(ProjectDir)\dependencies\allegro\include;$(ProjectDir)\dependencies\icu55\source\io;$(ProjectDir)\dependencies\icu55\source\i18n;$(ProjectDir)\dependencies\icu55\source\common;$(ProjectDir)\dependencies\glm;$(IncludePath);$(ProjectDir)\</IncludePath>
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<LibraryPath>$(LIB);$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)\dependencies\physfs\src;$(ProjectDir)\dependencies\tinyxml2;$(ProjectDir)\dependencies\allegro\addons\physfs;$(ProjectDir)\dependencies\allegro\addons\native_dialog;$(ProjectDir)\dependencies\allegro\addons\primitives;$(ProjectDir)\dependencies\allegro\addons\ttf;$(ProjectDir)\dependencies\allegro\addons\image;$(ProjectDir)\dependencies\allegro\addons\font;$(ProjectDir)\dependencies\allegro\addons\color;$(ProjectDir)\dependencies\allegro\addons\acodec;$(ProjectDir)\dependencies\allegro\addons\audio;$(ProjectDir)\dependencies\include;$(ProjectDir)\dependencies\allegro\include;$(ProjectDir)\dependencies\icu55\source\io;$(ProjectDir)\dependencies\icu55\source\i18n;$(ProjectDir)\dependencies\icu55\source\common;$(ProjectDir)\dependencies\glm;$(IncludePath);$(ProjectDir)\</IncludePath>
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)bin\$(Configuration)\</OutDir>
<IntDir>obj\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<LibraryPath>$(LIB);$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)\dependencies\physfs\src;$(ProjectDir)\dependencies\tinyxml2;$(ProjectDir)\dependencies\allegro\addons\physfs;$(ProjectDir)\dependencies\allegro\addons\native_dialog;$(ProjectDir)\dependencies\allegro\addons\primitives;$(ProjectDir)\dependencies\allegro\addons\ttf;$(ProjectDir)\dependencies\allegro\addons\image;$(ProjectDir)\dependencies\allegro\addons\font;$(ProjectDir)\dependencies\allegro\addons\color;$(ProjectDir)\dependencies\allegro\addons\acodec;$(ProjectDir)\dependencies\allegro\addons\audio;$(ProjectDir)\dependencies\include;$(ProjectDir)\dependencies\allegro\include;$(ProjectDir)\dependencies\icu55\source\io;$(ProjectDir)\dependencies\icu55\source\i18n;$(ProjectDir)\dependencies\icu55\source\common;$(ProjectDir)\dependencies\glm;$(IncludePath);$(ProjectDir)\</IncludePath>
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<LibraryPath>$(LIB);$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)\dependencies\physfs\src;$(ProjectDir)\dependencies\tinyxml2;$(ProjectDir)\dependencies\allegro\addons\physfs;$(ProjectDir)\dependencies\allegro\addons\native_dialog;$(ProjectDir)\dependencies\allegro\addons\primitives;$(ProjectDir)\dependencies\allegro\addons\ttf;$(ProjectDir)\dependencies\allegro\addons\image;$(ProjectDir)\dependencies\allegro\addons\font;$(ProjectDir)\dependencies\allegro\addons\color;$(ProjectDir)\dependencies\allegro\addons\acodec;$(ProjectDir)\dependencies\allegro\addons\audio;$(ProjectDir)\dependencies\include;$(ProjectDir)\dependencies\allegro\include;$(ProjectDir)\dependencies\icu55\source\io;$(ProjectDir)\dependencies\icu55\source\i18n;$(ProjectDir)\dependencies\icu55\source\common;$(ProjectDir)\dependencies\glm;$(IncludePath);$(ProjectDir)\</IncludePath>
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down Expand Up @@ -118,6 +122,15 @@
<PostBuildEvent>
<Message>Copy ICU DLLs</Message>
</PostBuildEvent>
<CustomBuildStep>
<Command>gen_version_win.bat</Command>
</CustomBuildStep>
<CustomBuildStep>
<Message>Generating version.h</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>version.h</Outputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
Expand All @@ -143,6 +156,15 @@
<PostBuildEvent>
<Message>Copy ICU DLLs</Message>
</PostBuildEvent>
<CustomBuildStep>
<Command>gen_version_win.bat</Command>
</CustomBuildStep>
<CustomBuildStep>
<Message>Generating version.h</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>version.h</Outputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
Expand Down Expand Up @@ -171,6 +193,15 @@
<PostBuildEvent>
<Message>Copy ICU DLLs</Message>
</PostBuildEvent>
<CustomBuildStep>
<Command>gen_version_win.bat</Command>
</CustomBuildStep>
<CustomBuildStep>
<Message>Generating version.h</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>version.h</Outputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
Expand Down Expand Up @@ -199,6 +230,15 @@
<PostBuildEvent>
<Message>Copy ICU DLLs</Message>
</PostBuildEvent>
<CustomBuildStep>
<Command>gen_version_win.bat</Command>
</CustomBuildStep>
<CustomBuildStep>
<Message>Generating version.h</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>version.h</Outputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="forms\checkbox.cpp" />
Expand Down
11 changes: 11 additions & 0 deletions gen_version_win.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
git describe --all --tags --long
if %ERRORLEVEL% NEQ 0 GOTO :error

for /f "delims=" %%i in ('git describe --all --tags --long') do echo #define OPENAPOC_VERSION "%%i" > version.h
GOTO :end

:error
echo #define OPENAPOC_VERSION "0.0-git_not_in_path" > version.h
GOTO :end

:end

0 comments on commit be2c078

Please sign in to comment.