llvm.org GIT mirror llvm / 110b520
cmake: Add msbuild integration to the install This adds the msbuild integration files to the install, provides batch scripts for (un)installing it in a convenient way, and hooks up the nsis installer to run those scripts. Differential Revision: http://llvm-reviews.chandlerc.com/D1537 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189434 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 7 years ago
4 changed file(s) with 83 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
511511 if(WIN32 AND NOT UNIX)
512512 set(CPACK_PACKAGE_ICON "${LLVM_MAIN_SRC_DIR}\\\\cmake\\\\nsis_logo.bmp")
513513 set(CPACK_NSIS_MODIFY_PATH "ON")
514 set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON")
515 set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
516 "ExecWait '$INSTDIR/tools/msbuild/install.bat'")
517 set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
518 "ExecWait '$INSTDIR/tools/msbuild/uninstall.bat'")
514519 endif()
515520 include(CPack)
516521
0 if (WIN32)
1 install(DIRECTORY .
2 DESTINATION tools/msbuild
3 FILES_MATCHING
4 PATTERN "*.targets"
5 PATTERN "*.props"
6 PATTERN "*.bat"
7 PATTERN ".svn" EXCLUDE
8 )
9 endif()
0 @echo off
1
2 echo Installing MSVC integration...
3
4 REM Change to the directory of this batch file.
5 cd /d %~dp0
6
7 REM Search for the MSBuild toolsets directory.
8 SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
9 IF EXIST %D% GOTO FOUND_MSBUILD
10 SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
11 IF EXIST %D% GOTO FOUND_MSBUILD
12
13 echo Failed to find MSBuild toolsets directory.
14 goto FAILED
15
16 :FOUND_MSBUILD
17 IF NOT EXIST %D%\llvm mkdir %D%\llvm
18 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
19
20 copy Microsoft.Cpp.Win32.llvm.props %D%\llvm
21 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
22 copy Microsoft.Cpp.Win32.llvm.targets %D%\llvm
23 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
24
25 echo Done!
26 goto END
27
28 :FAILED
29 echo MSVC integration install failed.
30 pause
31 goto END
32
33 :END
0 @echo off
1
2 echo Uninstalling MSVC integration...
3
4 REM CD to the directory of this batch file.
5 cd /d %~dp0
6
7 REM Search for the MSBuild toolsets directory.
8 SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
9 IF EXIST %D% GOTO FOUND_MSBUILD
10 SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
11 IF EXIST %D% GOTO FOUND_MSBUILD
12
13 echo Failed to find MSBuild toolsets directory.
14 goto FAILED
15
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
24
25 echo Done!
26 goto END
27
28 :FAILED
29 echo MSVC integration uninstall failed.
30 pause
31 goto END
32
33 :END