Last active
May 23, 2022 17:50
-
-
Save AMZN-alexpete/f0cec60bea29db10a647ebbdb8de6fc5 to your computer and use it in GitHub Desktop.
O3DE configure .bat file for use inside engine or project folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal ENABLEDELAYEDEXPANSION | |
rem IMPORTANT, make sure this 3rdparty path is correct | |
set CMAKE_PARAMS=-DLY_3RDPARTY_PATH="f:/git/3rdparty" -DLY_RENDERDOC_ENABLED=ON -DLY_PIX_ENABLED=ON | |
rem find latest VS version available | |
pushd "c:\Program Files (x86)\Microsoft Visual Studio\Installer" | |
for /f "usebackq tokens=*" %%i in (`call "vswhere.exe" -latest -format value -property catalog_productLineVersion`) do ( | |
set Params=%* | |
for /f "tokens=1*" %%a in ("!%%i!") do EndLocal & set %1=%%b | |
set VSVERSIONYEAR=%%i | |
) | |
for /f "usebackq tokens=*" %%i in (`call "vswhere.exe" -latest -format value -property catalog_productDisplayVersion`) do ( | |
set Params=%* | |
for /f "tokens=1*" %%a in ("!%%i!") do EndLocal & set %1=%%b | |
set VSVERSION=%%i | |
) | |
popd | |
rem trim off excess characters | |
set VSVERSIONYEAR=%VSVERSIONYEAR:~0,4% | |
set VSVERSION=%VSVERSION:~0,2% | |
echo VS version is %VSVERSION% (%VSVERSIONYEAR%) | |
set CMAKE_GENERATOR="Visual Studio %VSVERSION%" | |
set CMAKE_BUILD_FOLDER=build/windows_vs%VSVERSIONYEAR% | |
if exist CMakeLists.txt ( | |
if exist engine.json ( | |
rem need to specify a project | |
set CMAKE_PARAMS=%CMAKE_PARAMS% -DLY_PROJECTS=AutomatedTesting | |
) else ( | |
rem consider disabling test modules when building projects | |
rem set CMAKE_PARAMS=%CMAKE_PARAMS% -DLY_DISABLE_TEST_MODULES=ON | |
) | |
set CMD=cmake -B !CMAKE_BUILD_FOLDER! -G ""!CMAKE_GENERATOR!"" !CMAKE_PARAMS! | |
echo !CMD! | |
powershell -Command "Measure-Command {!CMD! | OUT-Default}" | |
) else if exist wscript ( | |
rem WAF support | |
echo lmbr_waf configure --3rdpartypath c:\p4\3rdparty | |
lmbr_waf configure --3rdpartypath c:\p4\3rdparty | |
) else ( | |
echo No CMakeLists.txt found to configure, run this command in an engine or project folder | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use this command enough I have a little script so I just navigate to the engine or project folder and type
c
and pressenter