22 set (LibScanbuildResources
27 # libear is compiled dynamically in build_libear using the specified cc
34 foreach(BinFile ${BinFiles})
35 if ("${BinFile}" STREQUAL "scan-build")
36 # Need to rename scan-build to scan-build-py to prevent overwriting
37 # scan-build Perl implementation.
38 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/scan-build-py
39 COMMAND ${CMAKE_COMMAND} -E make_directory
40 ${CMAKE_BINARY_DIR}/bin
41 COMMAND ${CMAKE_COMMAND} -E copy
42 ${CMAKE_CURRENT_SOURCE_DIR}/bin/scan-build
43 ${CMAKE_BINARY_DIR}/bin/scan-build-py
44 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/scan-build)
45 install (PROGRAMS "bin/scan-build"
46 DESTINATION "${CMAKE_INSTALL_BINDIR}"
48 COMPONENT scan-build-py)
49 list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/scan-build-py)
51 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/${BinFile}
52 COMMAND ${CMAKE_COMMAND} -E make_directory
53 ${CMAKE_BINARY_DIR}/bin
54 COMMAND ${CMAKE_COMMAND} -E copy
55 ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}
56 ${CMAKE_BINARY_DIR}/bin/
57 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile})
58 install(PROGRAMS bin/${BinFile}
59 DESTINATION "${CMAKE_INSTALL_BINDIR}"
60 COMPONENT scan-build-py)
61 list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
65 foreach(lib ${LibExecs})
66 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/libexec/${lib}
67 COMMAND ${CMAKE_COMMAND} -E make_directory
68 ${CMAKE_BINARY_DIR}/libexec
69 COMMAND ${CMAKE_COMMAND} -E copy
70 ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${lib}
71 ${CMAKE_BINARY_DIR}/libexec/
72 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${lib})
73 list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${lib})
74 install(PROGRAMS libexec/${lib}
75 DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}"
76 COMPONENT scan-build-py)
79 foreach(lib ${LibScanbuild})
80 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib}
81 COMMAND ${CMAKE_COMMAND} -E make_directory
82 ${CMAKE_BINARY_DIR}/lib
83 COMMAND ${CMAKE_COMMAND} -E make_directory
84 ${CMAKE_BINARY_DIR}/lib/libscanbuild
85 COMMAND ${CMAKE_COMMAND} -E copy
86 ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib}
87 ${CMAKE_BINARY_DIR}/lib/libscanbuild/
88 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib})
89 list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib})
90 install(FILES lib/libscanbuild/${lib}
91 DESTINATION lib/libscanbuild
92 COMPONENT scan-build-py)
95 foreach(resource ${LibScanbuildResources})
96 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource}
97 COMMAND ${CMAKE_COMMAND} -E make_directory
98 ${CMAKE_BINARY_DIR}/lib
99 COMMAND ${CMAKE_COMMAND} -E make_directory
100 ${CMAKE_BINARY_DIR}/lib/libscanbuild
101 COMMAND ${CMAKE_COMMAND} -E make_directory
102 ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources
103 COMMAND ${CMAKE_COMMAND} -E copy
104 ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource}
105 ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources
106 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource})
107 list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource})
108 install(FILES lib/libscanbuild/resources/${resource}
109 DESTINATION lib/libscanbuild/resources
110 COMPONENT scan-build-py)
113 foreach(lib ${LibEar})
114 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libear/${lib}
115 COMMAND ${CMAKE_COMMAND} -E make_directory
116 ${CMAKE_BINARY_DIR}/lib
117 COMMAND ${CMAKE_COMMAND} -E make_directory
118 ${CMAKE_BINARY_DIR}/lib/libear
119 COMMAND ${CMAKE_COMMAND} -E copy
120 ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib}
121 ${CMAKE_BINARY_DIR}/lib/libear/
122 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib})
123 list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib})
124 install(FILES lib/libear/${lib}
125 DESTINATION lib/libear
126 COMPONENT scan-build-py)
129 add_custom_target(scan-build-py ALL DEPENDS ${Depends})
130 add_llvm_install_targets("install-scan-build-py"
131 DEPENDS scan-build-py
132 COMPONENT scan-build-py)