compileMsbuild.bat 799 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
@ECHO Off
:: add *_HOME to PATH temporarily
IF NOT [%cmake_HOME%] == [] (
   set PATH="%cmake_HOME%;%PATH%"
)
IF NOT [%msbuild_HOME%] == [] (
   set PATH="%msbuild_HOME%;%PATH%"
)

:: source additional environment variables
call vcvars64.bat
call %ROS_HOME%\local_setup.bat

:: check if needed programs are in PATH
where cmake
IF NOT %ERRORLEVEL% EQU 0 (
   echo "Can not find cmake in PATH! Aborting."
   exit /B 1
)
where vcvars64.bat
IF NOT %ERRORLEVEL% EQU 0 (
   echo "Can not find vcvars64.bat in PATH! Aborting."
   exit /B 1
)
where msbuild
IF NOT %ERRORLEVEL% EQU 0 (
   echo "Can not find msbuild in PATH! Aborting."
   exit /B 1
)

:: cmake
cmake -B./build/ -G "Visual Studio 15 2017 Win64" %* ./src

:: msbuild
cd .\build
msbuild /t:build /p:Configuration=Release ALL_BUILD.vcxproj
cd ..