Ericson2314 updated this revision to Diff 399020. Ericson2314 added a comment.
rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99484/new/ https://reviews.llvm.org/D99484 Files: clang-tools-extra/CMakeLists.txt clang-tools-extra/clang-doc/tool/CMakeLists.txt clang-tools-extra/clang-include-fixer/find-all-symbols/tool/CMakeLists.txt clang-tools-extra/clang-include-fixer/tool/CMakeLists.txt clang-tools-extra/clang-tidy/CMakeLists.txt clang-tools-extra/clang-tidy/tool/CMakeLists.txt clang-tools-extra/modularize/CMakeLists.txt clang/CMakeLists.txt clang/cmake/modules/AddClang.cmake clang/tools/c-index-test/CMakeLists.txt clang/tools/clang-format/CMakeLists.txt clang/tools/clang-nvlink-wrapper/CMakeLists.txt clang/tools/clang-rename/CMakeLists.txt clang/tools/libclang/CMakeLists.txt clang/tools/scan-build-py/CMakeLists.txt clang/tools/scan-build/CMakeLists.txt clang/tools/scan-view/CMakeLists.txt clang/utils/hmaptool/CMakeLists.txt compiler-rt/cmake/base-config-ix.cmake libc/CMakeLists.txt libcxx/CMakeLists.txt libcxx/cmake/Modules/HandleLibCXXABI.cmake libcxxabi/CMakeLists.txt libunwind/CMakeLists.txt llvm/cmake/modules/LLVMInstallSymlink.cmake mlir/CMakeLists.txt mlir/cmake/modules/AddMLIR.cmake openmp/CMakeLists.txt openmp/libompd/src/CMakeLists.txt openmp/runtime/src/CMakeLists.txt openmp/tools/multiplex/CMakeLists.txt polly/CMakeLists.txt polly/cmake/CMakeLists.txt polly/lib/External/CMakeLists.txt pstl/CMakeLists.txt
Index: pstl/CMakeLists.txt =================================================================== --- pstl/CMakeLists.txt +++ pstl/CMakeLists.txt @@ -7,6 +7,8 @@ #===----------------------------------------------------------------------===## cmake_minimum_required(VERSION 3.13.4) +include(GNUInstallDirs) + set(PARALLELSTL_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/include/pstl/internal/pstl_config.h") file(STRINGS "${PARALLELSTL_VERSION_FILE}" PARALLELSTL_VERSION_SOURCE REGEX "#define _PSTL_VERSION .*$") string(REGEX REPLACE "#define _PSTL_VERSION (.*)$" "\\1" PARALLELSTL_VERSION_SOURCE "${PARALLELSTL_VERSION_SOURCE}") @@ -90,10 +92,10 @@ "${CMAKE_CURRENT_BINARY_DIR}/ParallelSTLConfigVersion.cmake" DESTINATION lib/cmake/ParallelSTL) install(DIRECTORY include/ - DESTINATION include + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" PATTERN "*.in" EXCLUDE) install(FILES "${PSTL_CONFIG_SITE_PATH}" - DESTINATION include) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") add_custom_target(install-pstl COMMAND "${CMAKE_COMMAND}" -P "${PROJECT_BINARY_DIR}/cmake_install.cmake" -DCOMPONENT=ParallelSTL) Index: polly/lib/External/CMakeLists.txt =================================================================== --- polly/lib/External/CMakeLists.txt +++ polly/lib/External/CMakeLists.txt @@ -290,7 +290,7 @@ install(DIRECTORY ${ISL_SOURCE_DIR}/include/ ${ISL_BINARY_DIR}/include/ - DESTINATION include/polly + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/polly" FILES_MATCHING PATTERN "*.h" PATTERN "CMakeFiles" EXCLUDE Index: polly/cmake/CMakeLists.txt =================================================================== --- polly/cmake/CMakeLists.txt +++ polly/cmake/CMakeLists.txt @@ -1,5 +1,6 @@ # Keep this in sync with llvm/cmake/CMakeLists.txt! +include(ExtendPath) include(FindPrefixFromConfig) set(LLVM_INSTALL_PACKAGE_DIR "lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") @@ -83,17 +84,18 @@ # Generate PollyConfig.cmake for the install tree. unset(POLLY_EXPORTS) find_prefix_from_config(POLLY_CONFIG_CODE POLLY_INSTALL_PREFIX "${POLLY_INSTALL_PACKAGE_DIR}") -set(POLLY_CONFIG_LLVM_CMAKE_DIR "\${POLLY_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") -set(POLLY_CONFIG_CMAKE_DIR "\${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") -set(POLLY_CONFIG_LIBRARY_DIRS "\${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") +extend_path(POLLY_CONFIG_LLVM_CMAKE_DIR "\${POLLY_INSTALL_PREFIX}" "${LLVM_INSTALL_PACKAGE_DIR}") +extend_path(POLLY_CONFIG_CMAKE_DIR "\${POLLY_INSTALL_PREFIX}" "${POLLY_INSTALL_PACKAGE_DIR}") +extend_path(POLLY_CONFIG_LIBRARY_DIRS "\${POLLY_INSTALL_PREFIX}" "lib${LLVM_LIBDIR_SUFFIX}") +extend_path(base_includedir "\${POLLY_INSTALL_PREFIX}" "${CMAKE_INSTALL_INCLUDEDIR}") if (POLLY_BUNDLED_ISL) set(POLLY_CONFIG_INCLUDE_DIRS - "\${POLLY_INSTALL_PREFIX}/include" - "\${POLLY_INSTALL_PREFIX}/include/polly" + "${base_includedir}" + "${base_includedir}/polly" ) else() set(POLLY_CONFIG_INCLUDE_DIRS - "\${POLLY_INSTALL_PREFIX}/include" + "${base_includedir}" ${ISL_INCLUDE_DIRS} ) endif() @@ -110,12 +112,12 @@ foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) get_target_property(tgt_type ${tgt} TYPE) if (tgt_type STREQUAL "EXECUTABLE") - set(tgt_prefix "bin/") + set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/") else() - set(tgt_prefix "lib/") + set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/") endif() - set(tgt_path "\${POLLY_INSTALL_PREFIX}/${tgt_prefix}$<TARGET_FILE_NAME:${tgt}>") + extend_path(tgt_path "\${POLLY_INSTALL_PREFIX}" "${tgt_prefix}$<TARGET_FILE_NAME:${tgt}>") if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") set(POLLY_EXPORTS Index: polly/CMakeLists.txt =================================================================== --- polly/CMakeLists.txt +++ polly/CMakeLists.txt @@ -1,3 +1,5 @@ +include(GNUInstallDirs) + # Check if this is a in tree build. if (NOT DEFINED LLVM_MAIN_SRC_DIR) project(Polly) @@ -124,13 +126,13 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) install(DIRECTORY include/ - DESTINATION include + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" FILES_MATCHING PATTERN "*.h" ) install(DIRECTORY ${POLLY_BINARY_DIR}/include/ - DESTINATION include + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" FILES_MATCHING PATTERN "*.h" PATTERN "CMakeFiles" EXCLUDE Index: openmp/tools/multiplex/CMakeLists.txt =================================================================== --- openmp/tools/multiplex/CMakeLists.txt +++ openmp/tools/multiplex/CMakeLists.txt @@ -4,7 +4,7 @@ add_library(ompt-multiplex INTERFACE) target_include_directories(ompt-multiplex INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) - install(FILES ompt-multiplex.h DESTINATION include) + install(FILES ompt-multiplex.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") add_subdirectory(tests) endif() Index: openmp/runtime/src/CMakeLists.txt =================================================================== --- openmp/runtime/src/CMakeLists.txt +++ openmp/runtime/src/CMakeLists.txt @@ -346,19 +346,19 @@ # We want to install libomp in DESTDIR/CMAKE_INSTALL_PREFIX/lib # We want to install headers in DESTDIR/CMAKE_INSTALL_PREFIX/include if(${OPENMP_STANDALONE_BUILD}) - set(LIBOMP_HEADERS_INSTALL_PATH include) + set(LIBOMP_HEADERS_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}") else() string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION ${PACKAGE_VERSION}) set(LIBOMP_HEADERS_INSTALL_PATH "${OPENMP_INSTALL_LIBDIR}/clang/${CLANG_VERSION}/include") endif() if(WIN32) - install(TARGETS omp RUNTIME DESTINATION bin) + install(TARGETS omp RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") install(TARGETS ${LIBOMP_IMP_LIB_TARGET} ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}") # Create aliases (regular copies) of the library for backwards compatibility set(LIBOMP_ALIASES "libiomp5md") foreach(alias IN LISTS LIBOMP_ALIASES) install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_LIB_FILE}\" - \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/bin\")") + \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"\${CMAKE_INSTALL_BINDIR}\")") install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_IMP_LIB_FILE}\" \"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR}\")") endforeach() Index: openmp/libompd/src/CMakeLists.txt =================================================================== --- openmp/libompd/src/CMakeLists.txt +++ openmp/libompd/src/CMakeLists.txt @@ -47,4 +47,4 @@ INSTALL( TARGETS ompd LIBRARY DESTINATION ${OPENMP_INSTALL_LIBDIR} ARCHIVE DESTINATION ${OPENMP_INSTALL_LIBDIR} - RUNTIME DESTINATION bin ) + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ) Index: openmp/CMakeLists.txt =================================================================== --- openmp/CMakeLists.txt +++ openmp/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.13.4) +include(GNUInstallDirs) + # Add cmake directory to search for custom cmake functions. set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) Index: mlir/cmake/modules/AddMLIR.cmake =================================================================== --- mlir/cmake/modules/AddMLIR.cmake +++ mlir/cmake/modules/AddMLIR.cmake @@ -1,3 +1,4 @@ +include(GNUInstallDirs) include(LLVMDistributionSupport) function(mlir_tablegen ofn) @@ -371,7 +372,7 @@ ${export_to_mlirtargets} LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} - RUNTIME DESTINATION bin + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" # Note that CMake will create a directory like: # objects-${CMAKE_BUILD_TYPE}/obj.LibName # and put object files there. Index: mlir/CMakeLists.txt =================================================================== --- mlir/CMakeLists.txt +++ mlir/CMakeLists.txt @@ -1,5 +1,7 @@ # MLIR project. +include(GNUInstallDirs) + # Check if MLIR is built as a standalone project. if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) project(mlir) @@ -173,7 +175,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) install(DIRECTORY include/mlir include/mlir-c - DESTINATION include + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" COMPONENT mlir-headers FILES_MATCHING PATTERN "*.def" @@ -184,7 +186,7 @@ ) install(DIRECTORY ${MLIR_INCLUDE_DIR}/mlir ${MLIR_INCLUDE_DIR}/mlir-c - DESTINATION include + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" COMPONENT mlir-headers FILES_MATCHING PATTERN "*.def" Index: llvm/cmake/modules/LLVMInstallSymlink.cmake =================================================================== --- llvm/cmake/modules/LLVMInstallSymlink.cmake +++ llvm/cmake/modules/LLVMInstallSymlink.cmake @@ -6,7 +6,8 @@ function(install_symlink name target outdir) set(DESTDIR $ENV{DESTDIR}) - set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}") + GNUInstallDirs_get_absolute_install_dir(bindir "${outdir}" BINDIR) + set(bindir "${DESTDIR}${bindir}") message(STATUS "Creating ${name}") Index: libunwind/CMakeLists.txt =================================================================== --- libunwind/CMakeLists.txt +++ libunwind/CMakeLists.txt @@ -8,6 +8,8 @@ cmake_minimum_required(VERSION 3.13.4) +include(GNUInstallDirs) + set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake") # Add path for custom modules @@ -137,9 +139,9 @@ "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) -set(LIBUNWIND_INSTALL_INCLUDE_DIR include CACHE PATH +set(LIBUNWIND_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}" CACHE PATH "Path where built libunwind headers should be installed.") -set(LIBUNWIND_INSTALL_RUNTIME_DIR bin CACHE PATH +set(LIBUNWIND_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH "Path where built libunwind runtime libraries should be installed.") if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) Index: libcxxabi/CMakeLists.txt =================================================================== --- libcxxabi/CMakeLists.txt +++ libcxxabi/CMakeLists.txt @@ -10,6 +10,8 @@ cmake_minimum_required(VERSION 3.13.4) +include(GNUInstallDirs) + set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake") # Add path for custom modules @@ -210,7 +212,7 @@ ${CMAKE_MODULE_PATH} ) -set(LIBCXXABI_INSTALL_RUNTIME_DIR bin CACHE PATH +set(LIBCXXABI_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH "Path where built libc++abi runtime libraries should be installed.") if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) Index: libcxx/cmake/Modules/HandleLibCXXABI.cmake =================================================================== --- libcxx/cmake/Modules/HandleLibCXXABI.cmake +++ libcxx/cmake/Modules/HandleLibCXXABI.cmake @@ -1,8 +1,9 @@ - #=============================================================================== # Add an ABI library if appropriate #=============================================================================== +include(GNUInstallDirs) + # # _setup_abi: Set up the build to use an ABI library # @@ -63,7 +64,7 @@ if (LIBCXX_INSTALL_HEADERS) install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}" - DESTINATION include/c++/v1/${dstdir} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir}" COMPONENT cxx-headers PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) Index: libcxx/CMakeLists.txt =================================================================== --- libcxx/CMakeLists.txt +++ libcxx/CMakeLists.txt @@ -10,6 +10,8 @@ #=============================================================================== cmake_minimum_required(VERSION 3.13.4) +include(GNUInstallDirs) + set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake") # Add path for custom modules @@ -412,9 +414,9 @@ # TODO: Projects that depend on libc++ should use LIBCXX_GENERATED_INCLUDE_DIR # instead of hard-coding include/c++/v1. -set(LIBCXX_INSTALL_INCLUDE_DIR "include/c++/v1" CACHE PATH +set(LIBCXX_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/c++/v1" CACHE PATH "Path where target-agnostic libc++ headers should be installed.") -set(LIBCXX_INSTALL_RUNTIME_DIR bin CACHE PATH +set(LIBCXX_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH "Path where built libc++ runtime libraries should be installed.") if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) @@ -423,7 +425,7 @@ set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LLVM_BINARY_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1") set(LIBCXX_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH "Path where built libc++ libraries should be installed.") - set(LIBCXX_INSTALL_INCLUDE_TARGET_DIR "include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1" CACHE PATH + set(LIBCXX_INSTALL_INCLUDE_TARGET_DIR "${CMAKE_INSTALL_INCLUDEDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1" CACHE PATH "Path where target-specific libc++ headers should be installed.") if(LIBCXX_LIBDIR_SUBDIR) string(APPEND LIBCXX_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR}) Index: libc/CMakeLists.txt =================================================================== --- libc/CMakeLists.txt +++ libc/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.13.4) +include(GNUInstallDirs) + # Use old version of target_sources command which converts the source # file paths to full paths. cmake_policy(SET CMP0076 OLD) Index: compiler-rt/cmake/base-config-ix.cmake =================================================================== --- compiler-rt/cmake/base-config-ix.cmake +++ compiler-rt/cmake/base-config-ix.cmake @@ -108,13 +108,13 @@ set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH "Path where built compiler-rt libraries should be installed.") endif() -extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" bin) +extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_BINDIR}") set(COMPILER_RT_INSTALL_BINARY_DIR "${default_install_path}" CACHE PATH "Path where built compiler-rt executables should be installed.") -extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" include) +extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_INCLUDEDIR}") set(COMPILER_RT_INSTALL_INCLUDE_DIR "${default_install_path}" CACHE PATH "Path where compiler-rt headers should be installed.") -extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" share) +extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_DATADIR}") set(COMPILER_RT_INSTALL_DATA_DIR "${default_install_path}" CACHE PATH "Path where compiler-rt data files should be installed.") Index: clang/utils/hmaptool/CMakeLists.txt =================================================================== --- clang/utils/hmaptool/CMakeLists.txt +++ clang/utils/hmaptool/CMakeLists.txt @@ -10,7 +10,7 @@ list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HMAPTOOL}) install(PROGRAMS ${CLANG_HMAPTOOL} - DESTINATION bin + DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT hmaptool) add_custom_target(hmaptool ALL DEPENDS ${Depends}) Index: clang/tools/scan-view/CMakeLists.txt =================================================================== --- clang/tools/scan-view/CMakeLists.txt +++ clang/tools/scan-view/CMakeLists.txt @@ -20,7 +20,7 @@ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) install(PROGRAMS bin/${BinFile} - DESTINATION bin + DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT scan-view) endforeach() @@ -34,7 +34,7 @@ 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 + DESTINATION "${CMAKE_INSTALL_DATADIR}/scan-view" COMPONENT scan-view) endforeach() Index: clang/tools/scan-build/CMakeLists.txt =================================================================== --- clang/tools/scan-build/CMakeLists.txt +++ clang/tools/scan-build/CMakeLists.txt @@ -47,7 +47,7 @@ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) install(PROGRAMS bin/${BinFile} - DESTINATION bin + DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT scan-build) endforeach() @@ -61,7 +61,7 @@ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile}) list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}) install(PROGRAMS libexec/${LibexecFile} - DESTINATION libexec + DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}" COMPONENT scan-build) endforeach() @@ -89,7 +89,7 @@ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile}) list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile}) install(FILES share/scan-build/${ShareFile} - DESTINATION share/scan-build + DESTINATION "${CMAKE_INSTALL_DATADIR}/scan-build" COMPONENT scan-build) endforeach() Index: clang/tools/scan-build-py/CMakeLists.txt =================================================================== --- clang/tools/scan-build-py/CMakeLists.txt +++ clang/tools/scan-build-py/CMakeLists.txt @@ -43,7 +43,7 @@ ${CMAKE_BINARY_DIR}/bin/scan-build-py DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/scan-build) install (PROGRAMS "bin/scan-build" - DESTINATION bin + DESTINATION "${CMAKE_INSTALL_BINDIR}" RENAME scan-build-py COMPONENT scan-build-py) list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/scan-build-py) @@ -56,7 +56,7 @@ ${CMAKE_BINARY_DIR}/bin/ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) install(PROGRAMS bin/${BinFile} - DESTINATION bin + DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT scan-build-py) list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) endif() @@ -72,7 +72,7 @@ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${lib}) list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${lib}) install(PROGRAMS libexec/${lib} - DESTINATION libexec + DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}" COMPONENT scan-build-py) endforeach() Index: clang/tools/libclang/CMakeLists.txt =================================================================== --- clang/tools/libclang/CMakeLists.txt +++ clang/tools/libclang/CMakeLists.txt @@ -186,7 +186,7 @@ if(INTERNAL_INSTALL_PREFIX) set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include") else() - set(LIBCLANG_HEADERS_INSTALL_DESTINATION include) + set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") endif() install(DIRECTORY ../../include/clang-c Index: clang/tools/clang-rename/CMakeLists.txt =================================================================== --- clang/tools/clang-rename/CMakeLists.txt +++ clang/tools/clang-rename/CMakeLists.txt @@ -19,8 +19,8 @@ ) install(PROGRAMS clang-rename.py - DESTINATION share/clang + DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" COMPONENT clang-rename) install(PROGRAMS clang-rename.el - DESTINATION share/clang + DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" COMPONENT clang-rename) Index: clang/tools/clang-nvlink-wrapper/CMakeLists.txt =================================================================== --- clang/tools/clang-nvlink-wrapper/CMakeLists.txt +++ clang/tools/clang-nvlink-wrapper/CMakeLists.txt @@ -22,4 +22,4 @@ ${CLANG_NVLINK_WRAPPER_LIB_DEPS} ) -install(TARGETS clang-nvlink-wrapper RUNTIME DESTINATION bin) +install(TARGETS clang-nvlink-wrapper RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") Index: clang/tools/clang-format/CMakeLists.txt =================================================================== --- clang/tools/clang-format/CMakeLists.txt +++ clang/tools/clang-format/CMakeLists.txt @@ -21,20 +21,20 @@ endif() install(PROGRAMS clang-format-bbedit.applescript - DESTINATION share/clang + DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" COMPONENT clang-format) install(PROGRAMS clang-format-diff.py - DESTINATION share/clang + DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" COMPONENT clang-format) install(PROGRAMS clang-format-sublime.py - DESTINATION share/clang + DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" COMPONENT clang-format) install(PROGRAMS clang-format.el - DESTINATION share/clang + DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" COMPONENT clang-format) install(PROGRAMS clang-format.py - DESTINATION share/clang + DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" COMPONENT clang-format) install(PROGRAMS git-clang-format - DESTINATION bin + DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT clang-format) Index: clang/tools/c-index-test/CMakeLists.txt =================================================================== --- clang/tools/c-index-test/CMakeLists.txt +++ clang/tools/c-index-test/CMakeLists.txt @@ -49,7 +49,7 @@ set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH "@executable_path/../../lib") else() - set(INSTALL_DESTINATION bin) + set(INSTALL_DESTINATION "${CMAKE_INSTALL_BINDIR}") endif() install(TARGETS c-index-test Index: clang/cmake/modules/AddClang.cmake =================================================================== --- clang/cmake/modules/AddClang.cmake +++ clang/cmake/modules/AddClang.cmake @@ -1,3 +1,4 @@ +include(GNUInstallDirs) include(LLVMDistributionSupport) function(clang_tablegen) @@ -120,7 +121,7 @@ ${export_to_clangtargets} LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} - RUNTIME DESTINATION bin) + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") if (NOT LLVM_ENABLE_IDE) add_llvm_install_targets(install-${lib} @@ -159,7 +160,7 @@ get_target_export_arg(${name} Clang export_to_clangtargets) install(TARGETS ${name} ${export_to_clangtargets} - RUNTIME DESTINATION bin + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name}) if(NOT LLVM_ENABLE_IDE) Index: clang/CMakeLists.txt =================================================================== --- clang/CMakeLists.txt +++ clang/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.13.4) +include(GNUInstallDirs) + # If we are not building as a part of LLVM, build Clang as an # standalone project, using LLVM as an external library: if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) @@ -424,7 +426,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) install(DIRECTORY include/clang include/clang-c - DESTINATION include + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" COMPONENT clang-headers FILES_MATCHING PATTERN "*.def" @@ -433,7 +435,7 @@ ) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang - DESTINATION include + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" COMPONENT clang-headers FILES_MATCHING PATTERN "CMakeFiles" EXCLUDE @@ -453,7 +455,7 @@ add_custom_target(bash-autocomplete DEPENDS utils/bash-autocomplete.sh) install(PROGRAMS utils/bash-autocomplete.sh - DESTINATION share/clang + DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" COMPONENT bash-autocomplete) if(NOT LLVM_ENABLE_IDE) add_llvm_install_targets(install-bash-autocomplete Index: clang-tools-extra/modularize/CMakeLists.txt =================================================================== --- clang-tools-extra/modularize/CMakeLists.txt +++ clang-tools-extra/modularize/CMakeLists.txt @@ -23,5 +23,5 @@ ) install(TARGETS modularize - RUNTIME DESTINATION bin + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT clang-extras) Index: clang-tools-extra/clang-tidy/tool/CMakeLists.txt =================================================================== --- clang-tools-extra/clang-tidy/tool/CMakeLists.txt +++ clang-tools-extra/clang-tidy/tool/CMakeLists.txt @@ -52,9 +52,9 @@ install(PROGRAMS clang-tidy-diff.py - DESTINATION share/clang + DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" COMPONENT clang-tidy) install(PROGRAMS run-clang-tidy.py - DESTINATION bin + DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT clang-tidy RENAME run-clang-tidy) Index: clang-tools-extra/clang-tidy/CMakeLists.txt =================================================================== --- clang-tools-extra/clang-tidy/CMakeLists.txt +++ clang-tools-extra/clang-tidy/CMakeLists.txt @@ -113,7 +113,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) install(DIRECTORY . - DESTINATION include/clang-tidy + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/clang-tidy" COMPONENT clang-tidy-headers FILES_MATCHING PATTERN "*.h" Index: clang-tools-extra/clang-include-fixer/tool/CMakeLists.txt =================================================================== --- clang-tools-extra/clang-include-fixer/tool/CMakeLists.txt +++ clang-tools-extra/clang-include-fixer/tool/CMakeLists.txt @@ -21,8 +21,8 @@ ) install(PROGRAMS clang-include-fixer.el - DESTINATION share/clang + DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" COMPONENT clang-include-fixer) install(PROGRAMS clang-include-fixer.py - DESTINATION share/clang + DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" COMPONENT clang-include-fixer) Index: clang-tools-extra/clang-include-fixer/find-all-symbols/tool/CMakeLists.txt =================================================================== --- clang-tools-extra/clang-include-fixer/find-all-symbols/tool/CMakeLists.txt +++ clang-tools-extra/clang-include-fixer/find-all-symbols/tool/CMakeLists.txt @@ -20,5 +20,5 @@ ) install(PROGRAMS run-find-all-symbols.py - DESTINATION share/clang + DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" COMPONENT find-all-symbols) Index: clang-tools-extra/clang-doc/tool/CMakeLists.txt =================================================================== --- clang-tools-extra/clang-doc/tool/CMakeLists.txt +++ clang-tools-extra/clang-doc/tool/CMakeLists.txt @@ -19,9 +19,9 @@ ) install(FILES ../assets/clang-doc-default-stylesheet.css - DESTINATION share/clang + DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" COMPONENT clang-doc) install(FILES ../assets/index.js - DESTINATION share/clang + DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" COMPONENT clang-doc) Index: clang-tools-extra/CMakeLists.txt =================================================================== --- clang-tools-extra/CMakeLists.txt +++ clang-tools-extra/CMakeLists.txt @@ -1,4 +1,5 @@ include(CMakeDependentOption) +include(GNUInstallDirs) option(CLANG_TIDY_ENABLE_STATIC_ANALYZER "Include static analyzer checks in clang-tidy" ON)
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits