summaryrefslogtreecommitdiff
path: root/tools/msbuild
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2013-08-28 01:19:26 +0000
committerHans Wennborg <hans@hanshq.net>2013-08-28 01:19:26 +0000
commit110b5209d92f224050f2755539bda8f1d801f94b (patch)
tree1abf79efaf3ce8f49140abf72c11c48b7a21c0e1 /tools/msbuild
parent7f9a887d3f64d1227b911c9180767d95dbba4c10 (diff)
downloadllvm-110b5209d92f224050f2755539bda8f1d801f94b.tar.gz
llvm-110b5209d92f224050f2755539bda8f1d801f94b.tar.bz2
llvm-110b5209d92f224050f2755539bda8f1d801f94b.tar.xz
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
Diffstat (limited to 'tools/msbuild')
-rw-r--r--tools/msbuild/CMakeLists.txt10
-rw-r--r--tools/msbuild/install.bat34
-rw-r--r--tools/msbuild/uninstall.bat34
3 files changed, 78 insertions, 0 deletions
diff --git a/tools/msbuild/CMakeLists.txt b/tools/msbuild/CMakeLists.txt
new file mode 100644
index 0000000000..a1dca8aca8
--- /dev/null
+++ b/tools/msbuild/CMakeLists.txt
@@ -0,0 +1,10 @@
+if (WIN32)
+ install(DIRECTORY .
+ DESTINATION tools/msbuild
+ FILES_MATCHING
+ PATTERN "*.targets"
+ PATTERN "*.props"
+ PATTERN "*.bat"
+ PATTERN ".svn" EXCLUDE
+ )
+endif()
diff --git a/tools/msbuild/install.bat b/tools/msbuild/install.bat
new file mode 100644
index 0000000000..db11c86353
--- /dev/null
+++ b/tools/msbuild/install.bat
@@ -0,0 +1,34 @@
+@echo off
+
+echo Installing MSVC integration...
+
+REM Change to the directory of this batch file.
+cd /d %~dp0
+
+REM Search for the MSBuild toolsets directory.
+SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
+IF EXIST %D% GOTO FOUND_MSBUILD
+SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
+IF EXIST %D% GOTO FOUND_MSBUILD
+
+echo Failed to find MSBuild toolsets directory.
+goto FAILED
+
+:FOUND_MSBUILD
+IF NOT EXIST %D%\llvm mkdir %D%\llvm
+IF NOT %ERRORLEVEL% == 0 GOTO FAILED
+
+copy Microsoft.Cpp.Win32.llvm.props %D%\llvm
+IF NOT %ERRORLEVEL% == 0 GOTO FAILED
+copy Microsoft.Cpp.Win32.llvm.targets %D%\llvm
+IF NOT %ERRORLEVEL% == 0 GOTO FAILED
+
+echo Done!
+goto END
+
+:FAILED
+echo MSVC integration install failed.
+pause
+goto END
+
+:END
diff --git a/tools/msbuild/uninstall.bat b/tools/msbuild/uninstall.bat
new file mode 100644
index 0000000000..8bc304e0b8
--- /dev/null
+++ b/tools/msbuild/uninstall.bat
@@ -0,0 +1,34 @@
+@echo off
+
+echo Uninstalling MSVC integration...
+
+REM CD to the directory of this batch file.
+cd /d %~dp0
+
+REM Search for the MSBuild toolsets directory.
+SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
+IF EXIST %D% GOTO FOUND_MSBUILD
+SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
+IF EXIST %D% GOTO FOUND_MSBUILD
+
+echo Failed to find MSBuild toolsets directory.
+goto FAILED
+
+:FOUND_MSBUILD
+
+del %D%\llvm\Microsoft.Cpp.Win32.llvm.props
+IF NOT %ERRORLEVEL% == 0 GOTO FAILED
+del %D%\llvm\Microsoft.Cpp.Win32.llvm.targets
+IF NOT %ERRORLEVEL% == 0 GOTO FAILED
+rmdir %D%\llvm
+IF NOT %ERRORLEVEL% == 0 GOTO FAILED
+
+echo Done!
+goto END
+
+:FAILED
+echo MSVC integration uninstall failed.
+pause
+goto END
+
+:END