install win64 builds into ProgramFiles by default
authoralfadur
Fri, 23 Aug 2019 19:26:52 +0300
changeset 15350 81037b6052f4
parent 15349 96254b857257
child 15351 3907c95227b8
install win64 builds into ProgramFiles by default
tools/build_vcpkg.bat
--- a/tools/build_vcpkg.bat	Thu Aug 22 22:46:19 2019 +0300
+++ b/tools/build_vcpkg.bat	Fri Aug 23 19:26:52 2019 +0300
@@ -3,8 +3,11 @@
 ::CONFIG START
 ::edit these variables if necessary
 
-::change between "Debug" and "Release"
-set BUILD_TYPE="Release"
+::change between Debug and Release
+set BUILD_TYPE=Release
+::path where Hedgewars will be installed to
+::default is %ProgramFiles%\hedgewars and requires running this script as administrator  
+set INSTALL_LOCATION=
 ::set if vcpkg is not on path
 set VCPKG_PATH=%VCPKG_ROOT%
 ::set if CMake is not on path
@@ -29,17 +32,30 @@
 )
 
 if "%FORCE_X64_CROSS_COMPILE%" NEQ "" (
-    set CROSS_COMPILE_FLAG="-DWIN32_WIN64_CROSS_COMPILE=1"
+    set CROSS_COMPILE_FLAG=-DWIN32_WIN64_CROSS_COMPILE=1
+    if "%INSTALL_LOCATION%" == "" (
+        set INSTALL_LOCATION=%ProgramFiles%/hedgewars
+    )
+) else (
+    set CROSS_COMPILE_FLAG=
+)
+
+if "%INSTALL_LOCATION%" NEQ "" (
+    set PREFIX_FLAG=-DCMAKE_INSTALL_PREFIX=%INSTALL_LOCATION%
+) else (
+    set PREFIX_FLAG=
 )
 
 if "%BUILD_SERVER%" == "" (
-    set BUILD_SERVER_FLAG="-DNOSERVER=1"
-)              
+    set BUILD_SERVER_FLAG=-DNOSERVER=1
+) else (
+    set BUILD_SERVER_FLAG=
+)             
 
 echo Running cmake...
 set ERRORLEVEL=
 
-cmake . -DCMAKE_TOOLCHAIN_FILE="%VCPKG_PATH%\scripts\buildsystems\vcpkg.cmake" -G"NMake Makefiles" "%CROSS_COMPILE_FLAG%" "%BUILD_SERVER_FLAG%" -DCMAKE_BUILD_TYPE="%BUILD_TYPE%" -DSDL2_BUILDING_LIBRARY=1
+cmake . -DCMAKE_TOOLCHAIN_FILE="%VCPKG_PATH%\scripts\buildsystems\vcpkg.cmake" -G"NMake Makefiles" %CROSS_COMPILE_FLAG% %BUILD_SERVER_FLAG% "%PREFIX_FLAG%" -DCMAKE_BUILD_TYPE="%BUILD_TYPE%" -DSDL2_BUILDING_LIBRARY=1
 
 if %ERRORLEVEL% NEQ 0 goto exitpoint