Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 1 | option(BUILD_CLANG_FORMAT_VS_PLUGIN "Build clang-format VS plugin" OFF) |
| 2 | if (BUILD_CLANG_FORMAT_VS_PLUGIN) |
| 3 | add_custom_target(clang_format_exe_for_vsix |
| 4 | ${CMAKE_COMMAND} -E copy_if_different |
| 5 | "${LLVM_TOOLS_BINARY_DIR}/${CMAKE_CFG_INTDIR}/clang-format.exe" |
| 6 | "${CMAKE_CURRENT_SOURCE_DIR}/ClangFormat/clang-format.exe" |
| 7 | DEPENDS clang-format) |
| 8 | |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 9 | add_custom_target(clang_format_license |
| 10 | ${CMAKE_COMMAND} -E copy_if_different |
| 11 | "${CLANG_SOURCE_DIR}/LICENSE.TXT" |
| 12 | "${CMAKE_CURRENT_SOURCE_DIR}/ClangFormat/license.txt") |
| 13 | |
| 14 | if (NOT CLANG_FORMAT_VS_VERSION) |
| 15 | set(CLANG_FORMAT_VS_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}") |
| 16 | endif() |
| 17 | |
| 18 | configure_file("source.extension.vsixmanifest.in" |
| 19 | "${CMAKE_CURRENT_SOURCE_DIR}/ClangFormat/source.extension.vsixmanifest") |
| 20 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 21 | add_custom_target(clang_format_vsix ALL |
| 22 | devenv "${CMAKE_CURRENT_SOURCE_DIR}/ClangFormat.sln" /Build Release |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 23 | DEPENDS clang_format_exe_for_vsix "${CMAKE_CURRENT_SOURCE_DIR}/ClangFormat/source.extension.vsixmanifest" |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 24 | COMMAND ${CMAKE_COMMAND} -E copy_if_different |
| 25 | "${CMAKE_CURRENT_SOURCE_DIR}/ClangFormat/bin/Release/ClangFormat.vsix" |
| 26 | "${LLVM_TOOLS_BINARY_DIR}/${CMAKE_CFG_INTDIR}/ClangFormat.vsix" |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 27 | DEPENDS clang_format_exe_for_vsix clang_format_license) |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 28 | endif() |