llvm.org GIT mirror llvm / 1bcff6c
msbuild integration: provide separate files for VS2010 and VS2012 The previous msbuild integration only worked if VS2010 was installed. This patch renames the current integration to LLVM-vs2010 and adds LLVM-vs2012. Differential Revision: http://llvm-reviews.chandlerc.com/D1614 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190173 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 7 years ago
7 changed file(s) with 60 addition(s) and 37 deletion(s). Raw diff Collapse all Expand all
0 if (WIN32)
1 set(prop_file "Microsoft.Cpp.Win32.llvm.props")
1 set(prop_file_in "Microsoft.Cpp.Win32.llvm.props.in")
2 set(prop_file_v100 "Microsoft.Cpp.Win32.LLVM-vs2010.props")
3 set(prop_file_v110 "Microsoft.Cpp.Win32.LLVM-vs2012.props")
24
35 # CPack will install a registry key in this format that we wish to reference.
46 set(REG_KEY "${CMAKE_PROJECT_NAME} ${CPACK_PACKAGE_VERSION}")
5 configure_file(${prop_file}.in ${prop_file})
6 install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${prop_file}" DESTINATION tools/msbuild)
7
8 set(VS_VERSION "v100")
9 configure_file(${prop_file_in} ${prop_file_v100})
10 set(VS_VERSION "v110")
11 configure_file(${prop_file_in} ${prop_file_v110})
12
13 set(REG_KEY)
14 set(VS_VERSION)
15 install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${prop_file_v100}" DESTINATION tools/msbuild)
16 install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${prop_file_v110}" DESTINATION tools/msbuild)
717
818 install(DIRECTORY .
919 DESTINATION tools/msbuild
1222 PATTERN "*.bat"
1323 PATTERN ".svn" EXCLUDE
1424 )
15 endif()
25 endif()
0 
1
1
22
33
44 $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\@REG_KEY@)
+0
-2
tools/msbuild/Microsoft.Cpp.Win32.llvm.targets less more
None 
1
0 @echo off
11
22 echo Installing MSVC integration...
3 set SUCCESS=0
34
45 REM Change to the directory of this batch file.
56 cd /d %~dp0
67
78 REM Search for the MSBuild toolsets directory.
89 SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
9 IF EXIST %D% GOTO FOUND_MSBUILD
10 IF EXIST %D% GOTO FOUND_V100
1011 SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
11 IF EXIST %D% GOTO FOUND_MSBUILD
12 IF EXIST %D% GOTO FOUND_V100
1213
13 echo Failed to find MSBuild toolsets directory.
14 goto FAILED
14 :TRY_V110
15 SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\Win32\PlatformToolsets"
16 IF EXIST %D% GOTO FOUND_V110
17 SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\Win32\PlatformToolsets"
18 IF EXIST %D% GOTO FOUND_V110
1519
16 :FOUND_MSBUILD
17 IF NOT EXIST %D%\llvm mkdir %D%\llvm
20 IF NOT SUCCESS == 1 echo Failed to find MSBuild toolsets directory.
21 IF NOT SUCCESS == 1 goto FAILED
22
23
24 :FOUND_V100
25 IF NOT EXIST %D%\LLVM-vs2010 mkdir %D%\LLVM-vs2010
1826 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
27 copy Microsoft.Cpp.Win32.LLVM-vs2010.props %D%\LLVM-vs2010
28 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
29 copy Microsoft.Cpp.Win32.LLVM-vs2010.targets %D%\LLVM-vs2010
30 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
31 set SUCCESS=1
32 GOTO TRY_V110
1933
20 copy Microsoft.Cpp.Win32.llvm.props %D%\llvm
34 :FOUND_V110
35 IF NOT EXIST %D%\LLVM-vs2012 mkdir %D%\LLVM-vs2012
2136 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
22 copy Microsoft.Cpp.Win32.llvm.targets %D%\llvm
37 copy Microsoft.Cpp.Win32.LLVM-vs2012.props %D%\LLVM-vs2012
2338 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
24
39 copy Microsoft.Cpp.Win32.LLVM-vs2012.targets %D%\LLVM-vs2012
40 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
2541 echo Done!
2642 goto END
2743
44 REM CD to the directory of this batch file.
55 cd /d %~dp0
66
7 REM Search for the MSBuild toolsets directory.
87 SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
9 IF EXIST %D% GOTO FOUND_MSBUILD
8 IF EXIST %D%\LLVM-vs2010 del %D%\LLVM-vs2010\Microsoft.Cpp.Win32.LLVM-vs2010.props
9 IF EXIST %D%\LLVM-vs2010 del %D%\LLVM-vs2010\Microsoft.Cpp.Win32.LLVM-vs2010.targets
10 IF EXIST %D%\LLVM-vs2010 rmdir %D%\LLVM-vs2010
11
1012 SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
11 IF EXIST %D% GOTO FOUND_MSBUILD
13 IF EXIST %D%\LLVM-vs2010 del %D%\LLVM-vs2010\Microsoft.Cpp.Win32.LLVM-vs2010.props
14 IF EXIST %D%\LLVM-vs2010 del %D%\LLVM-vs2010\Microsoft.Cpp.Win32.LLVM-vs2010.targets
15 IF EXIST %D%\LLVM-vs2010 rmdir %D%\LLVM-vs2010
1216
13 echo Failed to find MSBuild toolsets directory.
14 goto FAILED
17 SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\Win32\PlatformToolsets"
18 IF EXIST %D%\LLVM-vs2012 del %D%\LLVM-vs2012\Microsoft.Cpp.Win32.LLVM-vs2012.props
19 IF EXIST %D%\LLVM-vs2012 del %D%\LLVM-vs2012\Microsoft.Cpp.Win32.LLVM-vs2012.targets
20 IF EXIST %D%\LLVM-vs2012 rmdir %D%\LLVM-vs2012
1521
16 :FOUND_MSBUILD
17
18 del %D%\llvm\Microsoft.Cpp.Win32.llvm.props
19 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
20 del %D%\llvm\Microsoft.Cpp.Win32.llvm.targets
21 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
22 rmdir %D%\llvm
23 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
22 SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\Win32\PlatformToolsets"
23 IF EXIST %D%\LLVM-vs2012 del %D%\LLVM-vs2012\Microsoft.Cpp.Win32.LLVM-vs2012.props
24 IF EXIST %D%\LLVM-vs2012 del %D%\LLVM-vs2012\Microsoft.Cpp.Win32.LLVM-vs2012.targets
25 IF EXIST %D%\LLVM-vs2012 rmdir %D%\LLVM-vs2012
2426
2527 echo Done!
26 goto END
27
28 :FAILED
29 echo MSVC integration uninstall failed.
30 pause
31 goto END
32
33 :END