1 option(CLANG_INSTALL_SCANBUILD "Install the scan-build tool" ON)
3 include(GNUInstallDirs)
5 if (WIN32 AND NOT CYGWIN)
39 if(CLANG_INSTALL_SCANBUILD)
40 foreach(BinFile ${BinFiles})
41 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/${BinFile}
42 COMMAND ${CMAKE_COMMAND} -E make_directory
43 ${CMAKE_BINARY_DIR}/bin
44 COMMAND ${CMAKE_COMMAND} -E copy
45 ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}
46 ${CMAKE_BINARY_DIR}/bin/
47 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile})
48 list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
49 install(PROGRAMS bin/${BinFile}
50 DESTINATION "${CMAKE_INSTALL_BINDIR}"
54 foreach(LibexecFile ${LibexecFiles})
55 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}
56 COMMAND ${CMAKE_COMMAND} -E make_directory
57 ${CMAKE_BINARY_DIR}/libexec
58 COMMAND ${CMAKE_COMMAND} -E copy
59 ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile}
60 ${CMAKE_BINARY_DIR}/libexec/
61 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile})
62 list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile})
63 install(PROGRAMS libexec/${LibexecFile}
64 DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}"
68 foreach(ManPage ${ManPages})
69 add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage}"
70 COMMAND ${CMAKE_COMMAND} -E make_directory
71 "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1"
72 COMMAND ${CMAKE_COMMAND} -E copy
73 "${CMAKE_CURRENT_SOURCE_DIR}/man/${ManPage}"
74 "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/"
75 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/man/${ManPage})
76 list(APPEND Depends "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage}")
77 install(FILES man/${ManPage}
78 DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
82 foreach(ShareFile ${ShareFiles})
83 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile}
84 COMMAND ${CMAKE_COMMAND} -E make_directory
85 ${CMAKE_BINARY_DIR}/share/scan-build
86 COMMAND ${CMAKE_COMMAND} -E copy
87 ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile}
88 ${CMAKE_BINARY_DIR}/share/scan-build/
89 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile})
90 list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile})
91 install(FILES share/scan-build/${ShareFile}
92 DESTINATION "${CMAKE_INSTALL_DATADIR}/scan-build"
96 add_custom_target(scan-build ALL DEPENDS ${Depends})
97 set_target_properties(scan-build PROPERTIES FOLDER "Misc")
99 if(NOT LLVM_ENABLE_IDE)
100 add_llvm_install_targets("install-scan-build"
102 COMPONENT scan-build)