Create UE path variable without /../

This commit is contained in:
Xavier Solé Nogués 2024-04-24 15:30:28 +02:00 committed by Blyron
parent f0db576510
commit e16d1d0edc
2 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,5 @@
SETLOCAL EnableDelayedExpansion
echo Starting Content Download...
if not exist "Unreal\CarlaUnreal\Content" mkdir Unreal\CarlaUnreal\Content
start cmd /c git -C Unreal/CarlaUnreal/Content clone -b ue5-dev https://bitbucket.org/carla-simulator/carla-content.git Carla
@ -56,8 +58,12 @@ if exist "%CARLA_UNREAL_ENGINE_PATH%" (
echo Found UnrealEngine5 %CARLA_UNREAL_ENGINE_PATH% - OK
) else if exist ..\UnrealEngine5_carla (
echo Found UnrealEngine5 ..\UnrealEngine5_carla - OK
set CARLA_UNREAL_ENGINE_PATH=%cd:\=\\%\\..\\UnrealEngine5_carla
setx CARLA_UNREAL_ENGINE_PATH %cd:\=\\%\\..\\UnrealEngine5_carla
pushd ..
pushd UnrealEngine5_carla
set CARLA_UNREAL_ENGINE_PATH=!cd!
setx CARLA_UNREAL_ENGINE_PATH !cd!
popd
popd
REM TODO: Check if UnrealEngine binary file exists and if not build it
) else (
echo Found UnrealEngine5 $CARLA_UNREAL_ENGINE_PATH - FAIL
@ -71,8 +77,8 @@ if exist "%CARLA_UNREAL_ENGINE_PATH%" (
call GenerateProjectFiles.bat || exit /b
echo Opening Visual Studio 2022...
msbuild Engine\Intermediate\ProjectFiles\UE5.vcxproj /property:Configuration="Development_Editor" /property:Platform="x64" || exit /b
set CARLA_UNREAL_ENGINE_PATH=%cd:\=\\%\\..\\UnrealEngine5_carla
setx CARLA_UNREAL_ENGINE_PATH %cd:\=\\%\\..\\UnrealEngine5_carla
set CARLA_UNREAL_ENGINE_PATH=!cd!
setx CARLA_UNREAL_ENGINE_PATH !cd!
popd
popd
)

View File

@ -72,9 +72,13 @@ fi
if [ ! -z $CARLA_UNREAL_ENGINE_PATH ] && [ -d $CARLA_UNREAL_ENGINE_PATH ]; then
echo "Found UnrealEngine5 $CARLA_UNREAL_ENGINE_PATH - OK"
elif [ -d ../UnrealEngine5_carla ]; then
pushd ..
pushd UnrealEngine5_carla
echo "Found UnrealEngine5 ../UnrealEngine5_carla - OK"
export CARLA_UNREAL_ENGINE_PATH=$PWD/../UnrealEngine5_carla
export CARLA_UNREAL_ENGINE_PATH=$PWD
echo -e '\n#CARLA UnrealEngine5\nexport CARLA_UNREAL_ENGINE_PATH='$CARLA_UNREAL_ENGINE_PATH >> ~/.bashrc
popd
popd
#TODO: Check if UnrealEngine binary file exists and if not build it
else
echo "Found UnrealEngine5 $CARLA_UNREAL_ENGINE_PATH - FAIL"