[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / tools / scan-build / CMakeLists.txt
blobef687b0e90a1701acf2c10ea879b8f577b70670d
1 option(CLANG_INSTALL_SCANBUILD "Install the scan-build tool" ON)
3 include(GNUInstallDirs)
5 if (WIN32 AND NOT CYGWIN)
6   set(BinFiles
7         scan-build
8         scan-build.bat
9         )
10   set(LibexecFiles
11         ccc-analyzer
12         c++-analyzer
13         ccc-analyzer.bat
14         c++-analyzer.bat
15         )
16 else()
17   set(BinFiles
18         scan-build
19         )
20   set(LibexecFiles
21         ccc-analyzer
22         c++-analyzer
23         )
24   if (APPLE)
25     list(APPEND BinFiles
26            set-xcode-analyzer
27            )
28   endif()
29 endif()
31 set(ManPages
32       scan-build.1)
34 set(ShareFiles
35       scanview.css
36       sorttable.js)
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}"
51             COMPONENT scan-build)
52   endforeach()
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}"
65             COMPONENT scan-build)
66   endforeach()
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"
79             COMPONENT scan-build)
80   endforeach()
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"
93             COMPONENT scan-build)
94   endforeach()
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"
101                              DEPENDS scan-build
102                              COMPONENT scan-build)
103   endif()
104 endif()