[Lldb-commits] [lldb] 9531146 - [lldb] Use `GNUInstallDirs` to support custom installation dirs.
John Ericson via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 21 16:29:26 PST 2021
Author: John Ericson
Date: 2021-12-22T00:28:53Z
New Revision: 95311468997160401c027e3bad3b14a391c1ead6
URL: https://github.com/llvm/llvm-project/commit/95311468997160401c027e3bad3b14a391c1ead6
DIFF: https://github.com/llvm/llvm-project/commit/95311468997160401c027e3bad3b14a391c1ead6.diff
LOG: [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
Added:
Modified:
lldb/CMakeLists.txt
lldb/cmake/modules/AddLLDB.cmake
lldb/cmake/modules/LLDBConfig.cmake
Removed:
################################################################################
diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 5c2dac3f51f6d..79d451965ed43 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -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}
diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake
index 8be214a8509a5..3291a7c808e16 100644
--- a/lldb/cmake/modules/AddLLDB.cmake
+++ b/lldb/cmake/modules/AddLLDB.cmake
@@ -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})
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index 01c501a7f717b..e12e548ad0c41 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -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
More information about the lldb-commits
mailing list