[lldb] Use GNUInstallDirs to support custom installation dirs.

Extracted from D99484. My new plan is to start from the outside and work
inward.

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D115570
This commit is contained in:
John Ericson 2021-04-04 13:02:18 -04:00
parent a282ea4898
commit 9531146899
3 changed files with 7 additions and 3 deletions

View file

@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.13.4)
include(GNUInstallDirs)
# Add path for custom modules.
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}

View file

@ -1,3 +1,5 @@
include(GNUInstallDirs)
function(lldb_tablegen)
# Syntax:
# lldb_tablegen output-file [tablegen-arg ...] SOURCE source-file
@ -113,7 +115,7 @@ function(add_lldb_library name)
endif()
# RUNTIME is relevant for DLL platforms, FRAMEWORK for macOS
install(TARGETS ${name} COMPONENT ${name}
RUNTIME DESTINATION bin
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY DESTINATION ${install_dest}
ARCHIVE DESTINATION ${install_dest}
FRAMEWORK DESTINATION ${install_dest})

View file

@ -231,7 +231,7 @@ include_directories(BEFORE
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
install(DIRECTORY include/
COMPONENT lldb-headers
DESTINATION include
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
FILES_MATCHING
PATTERN "*.h"
PATTERN ".cmake" EXCLUDE
@ -239,7 +239,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
COMPONENT lldb-headers
DESTINATION include
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
FILES_MATCHING
PATTERN "*.h"
PATTERN ".cmake" EXCLUDE