forked from microsoft/AirSim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix windows clean build (installs cmake if we need it).
- Loading branch information
1 parent
3673979
commit bef8643
Showing
5 changed files
with
103 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,6 @@ | ||
@echo off | ||
|
||
setlocal | ||
set ROOT_DIR=%CD% | ||
|
||
git submodule update --init --recursive | ||
|
||
WHERE cmake >nul 2>nul | ||
IF %ERRORLEVEL% NEQ 0 ( | ||
echo cmake was not found! First install the latest version from https://cmake.org/. | ||
goto :buildfailed | ||
) | ||
|
||
IF NOT EXIST external\rpclib\build mkdir external\rpclib\build | ||
cd external\rpclib\build | ||
cmake -G"Visual Studio 14 2015 Win64" .. | ||
cmake --build . | ||
cmake --build . --config Release | ||
if ERRORLEVEL 1 goto :buildfailed | ||
chdir /d %ROOT_DIR% | ||
|
||
set RPCLIB_TARGET_LIB=AirLib\deps\rpclib\lib\x64 | ||
if NOT exist %RPCLIB_TARGET_LIB% mkdir %RPCLIB_TARGET_LIB% | ||
|
||
set RPCLIB_TARGET_INCLUDE=AirLib\deps\rpclib\include | ||
if NOT exist %RPCLIB_TARGET_INCLUDE% mkdir %RPCLIB_TARGET_INCLUDE% | ||
|
||
robocopy /MIR external\rpclib\include %RPCLIB_TARGET_INCLUDE% | ||
robocopy /MIR external\rpclib\build\output\lib %RPCLIB_TARGET_LIB% | ||
|
||
|
||
msbuild /p:Platform=x64 /p:Configuration=Debug AirSim.sln | ||
if ERRORLEVEL 1 goto :buildfailed | ||
msbuild /p:Platform=x64 /p:Configuration=Release AirSim.sln | ||
if ERRORLEVEL 1 goto :buildfailed | ||
|
||
set MAVLINK_TARGET_LIB=AirLib\deps\MavLinkCom\lib | ||
if NOT exist %MAVLINK_TARGET_LIB% mkdir %MAVLINK_TARGET_LIB% | ||
|
||
set MAVLINK_TARGET_INCLUDE=AirLib\deps\MavLinkCom\include | ||
if NOT exist %MAVLINK_TARGET_INCLUDE% mkdir %MAVLINK_TARGET_INCLUDE% | ||
|
||
if NOT exist Unreal\Plugins\AirSim\Source\AirLib mkdir Unreal\Plugins\AirSim\Source\AirLib | ||
|
||
robocopy /MIR MavLinkCom\include %MAVLINK_TARGET_INCLUDE% | ||
robocopy /MIR MavLinkCom\lib %MAVLINK_TARGET_LIB% | ||
robocopy /MIR AirLib Unreal\Plugins\AirSim\Source\AirLib /XD temp | ||
goto :eof | ||
powershell -f build.ps1 | ||
|
||
:buildfailed | ||
chdir /d %ROOT_DIR% | ||
echo #### Build failed | ||
goto :eof |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
|
||
|
||
function Get-ScriptDirectory | ||
{ | ||
$Invocation = (Get-Variable MyInvocation -Scope 1).Value | ||
Split-Path $Invocation.MyCommand.Path | ||
} | ||
|
||
$scriptDir = Get-ScriptDirectory | ||
Set-Location -Path $scriptDir | ||
|
||
function HttpGet($uri) | ||
{ | ||
$rc = & $scriptDir\tools\httpget $uri; | ||
echo "httpget returned $rc" | ||
} | ||
function Unzip($zipFile) | ||
{ | ||
$rc = & $scriptDir\tools\unzip $zipFile; | ||
echo "unzip returned $rc"; | ||
} | ||
function UnzipToDir($zipFile, $dir) | ||
{ | ||
echo "$scriptDir\tools\unzip $zipFile -d $dir" | ||
$rc = & $scriptDir\tools\unzip $zipFile "-d" $dir | ||
echo "unzip returned $rc"; | ||
} | ||
|
||
function InstallCMake() | ||
{ | ||
echo "Checking cmake install..." | ||
if (-Not (Get-Command "cmake.exe" -ErrorAction SilentlyContinue)) | ||
{ | ||
if (-Not (Test-Path "$scriptDir\cmake-3.7.2-win64-x64")) { | ||
HttpGet "https://cmake.org/files/v3.7/cmake-3.7.2-win64-x64.zip"; | ||
echo "Decompressing cmake..."; | ||
Unzip "cmake-3.7.2-win64-x64.zip"; | ||
Remove-Item cmake-3.7.2-win64-x64.zip; | ||
} | ||
$env:Path = "$env:Path;$scriptDir\cmake-3.7.2-win64-x64\bin\"; | ||
} | ||
if (-Not (Get-Command "cmake.exe" -ErrorAction SilentlyContinue)) | ||
{ | ||
throw "Install cmake failed!!!" | ||
} | ||
} | ||
|
||
$start = Get-Date | ||
echo "======================= Build Started $start ===================="; | ||
|
||
git submodule update --init --recursive; | ||
InstallCMake; | ||
|
||
if (-Not (Test-Path "external\rpclib\build")) { | ||
mkdir "external\rpclib\build" | ||
} | ||
Set-Location -Path "external\rpclib\build" | ||
|
||
cmake -G"Visual Studio 14 2015 Win64" .. | ||
cmake --build . | ||
cmake --build . --config Release | ||
|
||
Set-Location -Path $scriptDir | ||
|
||
$env:RPCLIB_TARGET_LIB="AirLib\deps\rpclib\lib\x64"; | ||
if (-Not (Test-Path "$env:RPCLIB_TARGET_LIB")) { | ||
mkdir $env:RPCLIB_TARGET_LIB | ||
} | ||
$env:RPCLIB_TARGET_INCLUDE="AirLib\deps\rpclib\include" | ||
if (-Not (Test-Path "$env:RPCLIB_TARGET_INCLUDE")) { | ||
mkdir $env:RPCLIB_TARGET_INCLUDE | ||
} | ||
|
||
robocopy /MIR external\rpclib\include $env:RPCLIB_TARGET_INCLUDE | ||
robocopy /MIR external\rpclib\build\output\lib $env:RPCLIB_TARGET_LIB | ||
|
||
msbuild /p:Platform=x64 /p:Configuration=Debug AirSim.sln | ||
msbuild /p:Platform=x64 /p:Configuration=Release AirSim.sln | ||
|
||
$env:MAVLINK_TARGET_LIB="AirLib\deps\MavLinkCom\lib" | ||
if (-Not (Test-Path "$env:MAVLINK_TARGET_LIB")) { | ||
mkdir $env:MAVLINK_TARGET_LIB | ||
} | ||
$env:MAVLINK_TARGET_INCLUDE="AirLib\deps\MavLinkCom\include" | ||
if (-Not (Test-Path "$env:MAVLINK_TARGET_INCLUDE")) { | ||
mkdir $env:MAVLINK_TARGET_INCLUDE | ||
} | ||
$env:UNREAL_AIRLIB_TARGET_DIR="Unreal\Plugins\AirSim\Source\AirLib" | ||
if (-Not (Test-Path "$env:UNREAL_AIRLIB_TARGET_DIR")) { | ||
mkdir "Unreal\Plugins\AirSim\Source\AirLib" | ||
} | ||
robocopy /MIR MavLinkCom\include $env:MAVLINK_TARGET_INCLUDE | ||
robocopy /MIR MavLinkCom\lib $env:MAVLINK_TARGET_LIB | ||
robocopy /MIR AirLib $env:UNREAL_AIRLIB_TARGET_DIR /XD temp | ||
|
||
$end = Get-Date | ||
$diff = $end - $start | ||
echo "======================= Build Completed in $diff ===================="; |
Binary file not shown.
Binary file not shown.