llvm.org GIT mirror llvm / eb5b5d9
[CMake] Support overriding binary install directory This patch adds a new option LLVM_TOOLS_INSTALL_DIR which allows customizing the location executables and symlinks get installed to. This adds the functionality provided by autoconf's --bindir flag. This patch is based on patches from and collaboration with Tony Kelman, and replaces http://reviews.llvm.org/D20934. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272200 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Bieneman 4 years ago
3 changed file(s) with 6 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
200200
201201 set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
202202
203 set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
204 mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
205
203206 # They are used as destination of target generators.
204207 set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
205208 set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
770770 if( LLVM_BUILD_TOOLS )
771771 install(TARGETS ${name}
772772 EXPORT LLVMExports
773 RUNTIME DESTINATION bin
773 RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}
774774 COMPONENT ${name})
775775
776776 if (NOT CMAKE_CONFIGURATION_TYPES)
12101210 set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX})
12111211
12121212 install(SCRIPT ${INSTALL_SYMLINK}
1213 CODE "install_symlink(${full_name} ${full_dest} bin)"
1213 CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})"
12141214 COMPONENT ${component})
12151215
12161216 if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE)
140140 if (${project} STREQUAL LLVM AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
141141 install(TARGETS ${target}
142142 EXPORT LLVMExports
143 RUNTIME DESTINATION bin)
143 RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR})
144144 endif()
145145 set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target})
146146 endmacro()