|
1 | | -add_custom_target(scan-build ALL) |
2 | | - |
3 | 1 | option(CLANG_INSTALL_SCANBUILD "Install the scan-build tool" ON) |
4 | 2 |
|
5 | 3 | if (WIN32 AND NOT CYGWIN) |
@@ -29,47 +27,55 @@ set(ResourceFiles |
29 | 27 |
|
30 | 28 |
|
31 | 29 | if(CLANG_INSTALL_SCANBUILD) |
| 30 | + set(Depends ) |
32 | 31 | foreach(BinFile ${BinFiles}) |
33 | | - add_custom_command(TARGET scan-build PRE_BUILD |
| 32 | + add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/${BinFile} |
34 | 33 | COMMAND ${CMAKE_COMMAND} -E make_directory |
35 | 34 | ${CMAKE_BINARY_DIR}/bin |
36 | 35 | COMMAND ${CMAKE_COMMAND} -E copy |
37 | 36 | ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile} |
38 | 37 | ${CMAKE_BINARY_DIR}/bin/ |
39 | 38 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile}) |
| 39 | + set(Depends ${Depends} ${CMAKE_BINARY_DIR}/bin/${BinFile}) |
40 | 40 | install(PROGRAMS ${BinFile} DESTINATION bin) |
41 | 41 | endforeach() |
42 | 42 |
|
43 | 43 | foreach(LibexecFile ${LibexecFiles}) |
44 | | - add_custom_command(TARGET scan-build PRE_BUILD |
| 44 | + add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/libexec/${LibexecFile} |
45 | 45 | COMMAND ${CMAKE_COMMAND} -E make_directory |
46 | 46 | ${CMAKE_BINARY_DIR}/libexec |
47 | 47 | COMMAND ${CMAKE_COMMAND} -E copy |
48 | 48 | ${CMAKE_CURRENT_SOURCE_DIR}/${LibexecFile} |
49 | 49 | ${CMAKE_BINARY_DIR}/libexec/ |
50 | 50 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${LibexecFile}) |
| 51 | + set(Depends ${Depends} ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}) |
51 | 52 | install(PROGRAMS ${LibexecFile} DESTINATION libexec) |
52 | 53 | endforeach() |
53 | 54 |
|
54 | 55 | foreach(ManPage ${ManPages}) |
55 | | - add_custom_command(TARGET scan-build PRE_BUILD |
| 56 | + add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/share/man/man1/${ManPage} |
56 | 57 | COMMAND ${CMAKE_COMMAND} -E make_directory |
57 | 58 | ${CMAKE_BINARY_DIR}/share/man/man1 |
58 | 59 | COMMAND ${CMAKE_COMMAND} -E copy |
59 | 60 | ${CMAKE_CURRENT_SOURCE_DIR}/${ManPage} |
60 | 61 | ${CMAKE_BINARY_DIR}/share/man/man1/ |
61 | 62 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ManPage}) |
| 63 | + set(Depends ${Depends} ${CMAKE_BINARY_DIR}/share/man/man1/${ManPage}) |
62 | 64 | install(PROGRAMS ${ManPage} DESTINATION share/man/man1) |
63 | 65 | endforeach() |
64 | 66 |
|
65 | 67 | foreach(ResourceFile ${ResourceFiles}) |
66 | | - add_custom_command(TARGET scan-build PRE_BUILD |
| 68 | + add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/${ResourceFile} |
67 | 69 | COMMAND ${CMAKE_COMMAND} -E make_directory |
68 | 70 | ${CMAKE_BINARY_DIR}/bin |
69 | 71 | COMMAND ${CMAKE_COMMAND} -E copy |
70 | 72 | ${CMAKE_CURRENT_SOURCE_DIR}/${ResourceFile} |
71 | 73 | ${CMAKE_BINARY_DIR}/bin/ |
72 | 74 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ResourceFile}) |
| 75 | + set(Depends ${Depends} ${CMAKE_BINARY_DIR}/bin/${ResourceFile}) |
73 | 76 | install(FILES ${ResourceFile} DESTINATION bin) |
74 | 77 | endforeach() |
| 78 | + |
| 79 | + add_custom_target(scan-build ALL DEPENDS ${Depends}) |
75 | 80 | endif() |
| 81 | + |
0 commit comments