John Ericson da77db58d7 Revert "[cmake] Use GNUInstallDirs to support custom installation dirs."
https://lab.llvm.org/buildbot/#/builders/46/builds/21146 Still have
this odd error, not sure how to reproduce, so I will just try breaking
up my patch.

This reverts commit 4a678f8072004eff9214c1a4e1836a14abb69535.
2022-01-16 05:48:30 +00:00

50 lines
1.8 KiB
CMake

option(CLANG_INSTALL_SCANVIEW "Install the scan-view tool" ON)
set(BinFiles
scan-view)
set(ShareFiles
ScanView.py
Reporter.py
startfile.py
bugcatcher.ico)
if(CLANG_INSTALL_SCANVIEW)
foreach(BinFile ${BinFiles})
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/${BinFile}
COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_BINARY_DIR}/bin
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}
${CMAKE_BINARY_DIR}/bin/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile})
list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
install(PROGRAMS bin/${BinFile}
DESTINATION bin
COMPONENT scan-view)
endforeach()
foreach(ShareFile ${ShareFiles})
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile}
COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_BINARY_DIR}/share/scan-view
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile}
${CMAKE_BINARY_DIR}/share/scan-view/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile})
list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile})
install(FILES share/${ShareFile}
DESTINATION share/scan-view
COMPONENT scan-view)
endforeach()
add_custom_target(scan-view ALL DEPENDS ${Depends})
set_target_properties(scan-view PROPERTIES FOLDER "Misc")
if(NOT LLVM_ENABLE_IDE)
add_llvm_install_targets("install-scan-view"
DEPENDS scan-view
COMPONENT scan-view)
endif()
endif()