blob: d7561f90bd426745be2156e9aabbed7b499ce310 [file] [log] [blame]
Jonathan Roelofse9614322015-11-09 16:12:56 +00001option(CLANG_INSTALL_SCANVIEW "Install the scan-view tool" ON)
2
3set(BinFiles
4 Reporter.py
5 ScanView.py
6 scan-view
7 startfile.py)
8
Jonathan Roelofs9c0d3f52015-11-09 16:47:09 +00009set(ResourceFiles
Jonathan Roelofs467ab052015-11-10 22:38:59 +000010 FileRadar.scpt
11 GetRadarVersion.scpt
12 bugcatcher.ico)
Jonathan Roelofse9614322015-11-09 16:12:56 +000013
14if(CLANG_INSTALL_SCANVIEW)
15 foreach(BinFile ${BinFiles})
Jonathan Roelofs467ab052015-11-10 22:38:59 +000016 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/${BinFile}
Jonathan Roelofse9614322015-11-09 16:12:56 +000017 COMMAND ${CMAKE_COMMAND} -E make_directory
18 ${CMAKE_BINARY_DIR}/bin
19 COMMAND ${CMAKE_COMMAND} -E copy
20 ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile}
Jonathan Roelofs2a439a12015-11-10 20:01:22 +000021 ${CMAKE_BINARY_DIR}/bin/
22 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile})
Jonathan Roelofs1ff9c632015-11-10 22:48:11 +000023 list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
Jonathan Roelofse9614322015-11-09 16:12:56 +000024 install(PROGRAMS ${BinFile} DESTINATION bin)
25 endforeach()
26
27 foreach(ResourceFile ${ResourceFiles})
Jonathan Roelofs467ab052015-11-10 22:38:59 +000028 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/share/scan-view/${ResourceFile}
Jonathan Roelofse9614322015-11-09 16:12:56 +000029 COMMAND ${CMAKE_COMMAND} -E make_directory
30 ${CMAKE_BINARY_DIR}/share/scan-view
31 COMMAND ${CMAKE_COMMAND} -E copy
Jonathan Roelofs467ab052015-11-10 22:38:59 +000032 ${CMAKE_CURRENT_SOURCE_DIR}/Resources/${ResourceFile}
Jonathan Roelofs2a439a12015-11-10 20:01:22 +000033 ${CMAKE_BINARY_DIR}/share/scan-view/
Jonathan Roelofs467ab052015-11-10 22:38:59 +000034 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Resources/${ResourceFile})
Jonathan Roelofs1ff9c632015-11-10 22:48:11 +000035 list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ResourceFile})
Jonathan Roelofse9614322015-11-09 16:12:56 +000036 install(FILES ${ResourceFile} DESTINATION share/scan-view)
37 endforeach()
Jonathan Roelofs467ab052015-11-10 22:38:59 +000038
39 add_custom_target(scan-view ALL DEPENDS ${Depends})
Jonathan Roelofse9614322015-11-09 16:12:56 +000040endif()