[PATCH] D20934: Use CMAKE_INSTALL_BINDIR instead of hardcoding bin for tools install paths

Tony Kelman via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 2 15:16:51 PDT 2016


tkelman created this revision.
tkelman added a reviewer: beanz.
tkelman added a subscriber: llvm-commits.

This allows customizing the location executables and symlinks get installed to,
as with --bindir in autotools.

http://reviews.llvm.org/D20934

Files:
  cmake/modules/AddLLVM.cmake
  cmake/modules/TableGen.cmake

Index: cmake/modules/TableGen.cmake
===================================================================
--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -141,7 +141,7 @@
   if (${project} STREQUAL LLVM AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
     install(TARGETS ${target}
             EXPORT LLVMExports
-            RUNTIME DESTINATION bin)
+            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
   endif()
   set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target})
 endmacro()
Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -771,7 +771,7 @@
     if( LLVM_BUILD_TOOLS )
       install(TARGETS ${name}
               EXPORT LLVMExports
-              RUNTIME DESTINATION bin
+              RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
               COMPONENT ${name})
 
       if (NOT CMAKE_CONFIGURATION_TYPES)
@@ -1211,7 +1211,7 @@
   set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX})
 
   install(SCRIPT ${INSTALL_SYMLINK}
-          CODE "install_symlink(${full_name} ${full_dest} bin)"
+          CODE "install_symlink(${full_name} ${full_dest} ${CMAKE_INSTALL_BINDIR})"
           COMPONENT ${component})
 
   if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20934.59465.patch
Type: text/x-patch
Size: 1326 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160602/d18fb931/attachment.bin>


More information about the llvm-commits mailing list