blob: 06840d79e947bda4eeb6a0f5283046497f4e4e42 [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)
Jonathan Roelofs467ab052015-11-10 22:38:59 +000015 set(Depends )
Jonathan Roelofse9614322015-11-09 16:12:56 +000016 foreach(BinFile ${BinFiles})
Jonathan Roelofs467ab052015-11-10 22:38:59 +000017 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/${BinFile}
Jonathan Roelofse9614322015-11-09 16:12:56 +000018 COMMAND ${CMAKE_COMMAND} -E make_directory
19 ${CMAKE_BINARY_DIR}/bin
20 COMMAND ${CMAKE_COMMAND} -E copy
21 ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile}
Jonathan Roelofs2a439a12015-11-10 20:01:22 +000022 ${CMAKE_BINARY_DIR}/bin/
23 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile})
Jonathan Roelofs467ab052015-11-10 22:38:59 +000024 set(Depends ${Depends} ${CMAKE_BINARY_DIR}/bin/${BinFile})
Jonathan Roelofse9614322015-11-09 16:12:56 +000025 install(PROGRAMS ${BinFile} DESTINATION bin)
26 endforeach()
27
28 foreach(ResourceFile ${ResourceFiles})
Jonathan Roelofs467ab052015-11-10 22:38:59 +000029 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/share/scan-view/${ResourceFile}
Jonathan Roelofse9614322015-11-09 16:12:56 +000030 COMMAND ${CMAKE_COMMAND} -E make_directory
31 ${CMAKE_BINARY_DIR}/share/scan-view
32 COMMAND ${CMAKE_COMMAND} -E copy
Jonathan Roelofs467ab052015-11-10 22:38:59 +000033 ${CMAKE_CURRENT_SOURCE_DIR}/Resources/${ResourceFile}
Jonathan Roelofs2a439a12015-11-10 20:01:22 +000034 ${CMAKE_BINARY_DIR}/share/scan-view/
Jonathan Roelofs467ab052015-11-10 22:38:59 +000035 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Resources/${ResourceFile})
36 set(Depends ${Depends} ${CMAKE_BINARY_DIR}/share/scan-view/${ResourceFile})
Jonathan Roelofse9614322015-11-09 16:12:56 +000037 install(FILES ${ResourceFile} DESTINATION share/scan-view)
38 endforeach()
Jonathan Roelofs467ab052015-11-10 22:38:59 +000039
40 add_custom_target(scan-view ALL DEPENDS ${Depends})
Jonathan Roelofse9614322015-11-09 16:12:56 +000041endif()