msbuild integration: provide separate files for VS2010 and VS2012
[oota-llvm.git] / tools / msbuild / install.bat
index db11c863538939d15d5280482e9f78533e0a9996..2d5af629afff6d6192f4ac51c92d78c31bd2155e 100644 (file)
@@ -1,28 +1,44 @@
 @echo off\r
 \r
 echo Installing MSVC integration...\r
+set SUCCESS=0\r
 \r
 REM Change to the directory of this batch file.\r
 cd /d %~dp0\r
 \r
 REM Search for the MSBuild toolsets directory.\r
 SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"\r
-IF EXIST %D% GOTO FOUND_MSBUILD\r
+IF EXIST %D% GOTO FOUND_V100\r
 SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"\r
-IF EXIST %D% GOTO FOUND_MSBUILD\r
+IF EXIST %D% GOTO FOUND_V100\r
 \r
-echo Failed to find MSBuild toolsets directory.\r
-goto FAILED\r
+:TRY_V110\r
+SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\Win32\PlatformToolsets"\r
+IF EXIST %D% GOTO FOUND_V110\r
+SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\Win32\PlatformToolsets"\r
+IF EXIST %D% GOTO FOUND_V110\r
+\r
+IF NOT SUCCESS == 1 echo Failed to find MSBuild toolsets directory.\r
+IF NOT SUCCESS == 1 goto FAILED\r
 \r
-:FOUND_MSBUILD\r
-IF NOT EXIST %D%\llvm mkdir %D%\llvm\r
-IF NOT %ERRORLEVEL% == 0 GOTO FAILED\r
 \r
-copy Microsoft.Cpp.Win32.llvm.props %D%\llvm\r
+:FOUND_V100\r
+IF NOT EXIST %D%\LLVM-vs2010 mkdir %D%\LLVM-vs2010\r
+IF NOT %ERRORLEVEL% == 0 GOTO FAILED\r
+copy Microsoft.Cpp.Win32.LLVM-vs2010.props %D%\LLVM-vs2010\r
 IF NOT %ERRORLEVEL% == 0 GOTO FAILED\r
-copy Microsoft.Cpp.Win32.llvm.targets %D%\llvm\r
+copy Microsoft.Cpp.Win32.LLVM-vs2010.targets %D%\LLVM-vs2010\r
 IF NOT %ERRORLEVEL% == 0 GOTO FAILED\r
+set SUCCESS=1\r
+GOTO TRY_V110\r
 \r
+:FOUND_V110\r
+IF NOT EXIST %D%\LLVM-vs2012 mkdir %D%\LLVM-vs2012\r
+IF NOT %ERRORLEVEL% == 0 GOTO FAILED\r
+copy Microsoft.Cpp.Win32.LLVM-vs2012.props %D%\LLVM-vs2012\r
+IF NOT %ERRORLEVEL% == 0 GOTO FAILED\r
+copy Microsoft.Cpp.Win32.LLVM-vs2012.targets %D%\LLVM-vs2012\r
+IF NOT %ERRORLEVEL% == 0 GOTO FAILED\r
 echo Done!\r
 goto END\r
 \r