Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -242,10 +242,21 @@ message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") endif() -set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) +set(LLVM_LIBDIR_SUFFIX "" + CACHE STRING "Define suffix of library directory name (32/64)" ) +set(CMAKE_INSTALL_BINDIR bin + CACHE STRING "Path for binary directory relative to CMAKE_INSTALL_PREFIX (defaults to 'bin')" ) +set(CMAKE_INSTALL_LIBDIR lib + CACHE STRING "Path for library directory relative to CMAKE_INSTALL_PREFIX (defaults to 'lib'" ) +set(CMAKE_INSTALL_INCLUDEDIR include + CACHE STRING "Path for include directory relative to CMAKE_INSTALL_PREFIX (defaults to 'include'" ) +set(CMAKE_INSTALL_DOCDIR share/doc + CACHE STRING "Path for documentation directory relative to CMAKE_INSTALL_PREFIX (defaults to 'share/doc')" ) +set(CMAKE_INSTALL_MANDIR share/man + CACHE STRING "Path for manpages directory relative to CMAKE_INSTALL_PREFIX (defaults to 'share/man')" ) -set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')") -mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) +set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html") +set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html") set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)") @@ -252,8 +263,8 @@ mark_as_advanced(LLVM_UTILS_INSTALL_DIR) # They are used as destination of target generators. -set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) -set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) +set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${CMAKE_INSTALL_BINDIR}) +set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) if(WIN32 OR CYGWIN) # DLL platform -- put DLLs into bin. set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) @@ -509,11 +520,6 @@ option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON) option (LLVM_ENABLE_BINDINGS "Build bindings." ON) -set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html" - CACHE STRING "Doxygen-generated HTML documentation install directory") -set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html" - CACHE STRING "OCamldoc-generated HTML documentation install directory") - option (LLVM_BUILD_EXTERNAL_COMPILER_RT "Build compiler-rt as an external project." OFF) @@ -767,9 +773,9 @@ # They are not referenced. See set_output_directory(). -set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin ) -set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} ) -set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} ) +set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/${CMAKE_INSTALL_BINDIR} ) +set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ) +set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ) if(APPLE AND DARWIN_LTO_LIBRARY) set(CMAKE_EXE_LINKER_FLAGS @@ -948,7 +954,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) install(DIRECTORY include/llvm include/llvm-c - DESTINATION include + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT llvm-headers FILES_MATCHING PATTERN "*.def" @@ -960,7 +966,7 @@ ) install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c - DESTINATION include + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT llvm-headers FILES_MATCHING PATTERN "*.def" Index: cmake/modules/AddLLVM.cmake =================================================================== --- cmake/modules/AddLLVM.cmake +++ cmake/modules/AddLLVM.cmake @@ -636,7 +636,7 @@ else() if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO" OR (LLVM_LINK_LLVM_DYLIB AND ${name} STREQUAL "LLVM")) - set(install_dir lib${LLVM_LIBDIR_SUFFIX}) + set(install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) if(ARG_SHARED OR BUILD_SHARED_LIBS) if(WIN32 OR CYGWIN OR MINGW) set(install_type RUNTIME) @@ -684,7 +684,7 @@ # DLL platform set(dlldir "bin") else() - set(dlldir "lib${LLVM_LIBDIR_SUFFIX}") + set(dlldir "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") endif() if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR @@ -696,7 +696,7 @@ install(TARGETS ${name} ${export_to_llvmexports} LIBRARY DESTINATION ${dlldir} - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) + ARCHIVE DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) endif() @@ -887,7 +887,7 @@ install(TARGETS ${name} ${export_to_llvmexports} - RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${name}) if (NOT CMAKE_CONFIGURATION_TYPES) @@ -910,7 +910,7 @@ endif() add_llvm_executable(${name} ${ARGN}) if( LLVM_BUILD_EXAMPLES ) - install(TARGETS ${name} RUNTIME DESTINATION examples) + install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) endif() set_target_properties(${name} PROPERTIES FOLDER "Examples") endmacro(add_llvm_example name) @@ -926,7 +926,7 @@ set_target_properties(${name} PROPERTIES FOLDER "Utils") if( LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS ) install (TARGETS ${name} - RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${name}) if (NOT CMAKE_CONFIGURATION_TYPES) add_llvm_install_targets(install-${name} @@ -1442,7 +1442,7 @@ set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) - set(output_dir lib${LLVM_LIBDIR_SUFFIX}) + set(output_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) if(WIN32 AND "${type}" STREQUAL "SHARED") set(output_dir bin) endif() @@ -1481,7 +1481,7 @@ set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) install(SCRIPT ${INSTALL_SYMLINK} - CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})" + CODE "install_symlink(${full_name} ${full_dest} ${CMAKE_INSTALL_BINDIR})" COMPONENT ${component}) if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE) @@ -1649,7 +1649,7 @@ set(_install_name_dir INSTALL_NAME_DIR "@rpath") set(_install_rpath "@loader_path/../lib" ${extra_libdir}) elseif(UNIX) - set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") set_property(TARGET ${name} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-z,origin ") Index: cmake/modules/AddOCaml.cmake =================================================================== --- cmake/modules/AddOCaml.cmake +++ cmake/modules/AddOCaml.cmake @@ -140,9 +140,9 @@ endforeach() if( APPLE ) - set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") + set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") elseif( UNIX ) - set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") + set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") endif() list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") Index: cmake/modules/AddSphinxTarget.cmake =================================================================== --- cmake/modules/AddSphinxTarget.cmake +++ cmake/modules/AddSphinxTarget.cmake @@ -73,7 +73,7 @@ elseif (builder STREQUAL html) string(TOUPPER "${project}" project_upper) - set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html" + set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html" CACHE STRING "HTML documentation install directory for ${project}") # '/.' indicates: copy the contents of the directory directly into Index: cmake/modules/CMakeLists.txt =================================================================== --- cmake/modules/CMakeLists.txt +++ cmake/modules/CMakeLists.txt @@ -1,4 +1,4 @@ -set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) +set(LLVM_INSTALL_PACKAGE_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')") set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") # First for users who use an installed LLVM, create the LLVMExports.cmake file. @@ -90,11 +90,11 @@ set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE} get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)") endforeach(p) -set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include") -set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}") +set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") +set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}") -set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin") +set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake") set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS}") configure_file( Index: cmake/modules/LLVMConfig.cmake.in =================================================================== --- cmake/modules/LLVMConfig.cmake.in +++ cmake/modules/LLVMConfig.cmake.in @@ -77,9 +77,15 @@ set(LLVM_CMAKE_DIR "@LLVM_CONFIG_CMAKE_DIR@") set(LLVM_BINARY_DIR "@LLVM_CONFIG_BINARY_DIR@") set(LLVM_TOOLS_BINARY_DIR "@LLVM_CONFIG_TOOLS_BINARY_DIR@") -set(LLVM_TOOLS_INSTALL_DIR "@LLVM_TOOLS_INSTALL_DIR@") +set(LLVM_TOOLS_INSTALL_DIR "@CMAKE_INSTALL_BINDIR@") set(LLVM_HAVE_OPT_VIEWER_MODULES @LLVM_HAVE_OPT_VIEWER_MODULES@) +set(CMAKE_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@") +set(CMAKE_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@") +set(CMAKE_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@") +set(CMAKE_INSTALL_DOCDIR "@CMAKE_INSTALL_DOCDIR@") +set(CMAKE_INSTALL_MANDIR "@CMAKE_INSTALL_MANDIR@") + if(NOT TARGET LLVMSupport) set(LLVM_EXPORTED_TARGETS "@LLVM_CONFIG_EXPORTS@") include("@LLVM_CONFIG_EXPORTS_FILE@") Index: cmake/modules/TableGen.cmake =================================================================== --- cmake/modules/TableGen.cmake +++ cmake/modules/TableGen.cmake @@ -177,7 +177,7 @@ install(TARGETS ${target} ${export_to_llvmexports} - RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}) + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target}) endmacro() Index: docs/CMake.rst =================================================================== --- docs/CMake.rst +++ docs/CMake.rst @@ -196,7 +196,7 @@ **LLVM_LIBDIR_SUFFIX**:STRING Extra suffix to append to the directory where libraries are to be installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` - to install libraries to ``/usr/lib64``. + to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. **CMAKE_C_FLAGS**:STRING Extra flags to use when compiling C source files. @@ -480,8 +480,8 @@ **LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING The path to install Doxygen-generated HTML documentation to. This path can - either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to - `share/doc/llvm/doxygen-html`. + either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to + `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`. **LLVM_ENABLE_SPHINX**:BOOL If specified, CMake will search for the ``sphinx-build`` executable and will make @@ -512,14 +512,34 @@ **LLVM_INSTALL_SPHINX_HTML_DIR**:STRING The path to install Sphinx-generated HTML documentation to. This path can - either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to - `share/doc/llvm/html`. + either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to + `${CMAKE_INSTALL_DOCDIR}/${project}/html`. **LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING The path to install OCamldoc-generated HTML documentation to. This path can - either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to - `share/doc/llvm/ocaml-html`. + either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to + `${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html`. +**CMAKE_INSTALL_BINDIR**:STRING + The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``. + Defaults to `bin`. + +**CMAKE_INSTALL_LIBDIR**:STRING + The path to install libraries, relative to the ``CMAKE_INSTALL_PREFIX``. + Defaults to `lib`. + +**CMAKE_INSTALL_INCLUDEDIR**:STRING + The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``. + Defaults to `include`. + +**CMAKE_INSTALL_DOCDIR**:STRING + The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``. + Defaults to `share/doc`. + +**CMAKE_INSTALL_MANDIR**:STRING + The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``. + Defaults to `share/man`. + **LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL OS X Only: If enabled CMake will generate a target named 'install-xcode-toolchain'. This target will create a directory at Index: include/llvm/CMakeLists.txt =================================================================== --- include/llvm/CMakeLists.txt +++ include/llvm/CMakeLists.txt @@ -4,5 +4,5 @@ # If we're doing an out-of-tree build, copy a module map for generated # header files into the build area. if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") - configure_file(module.modulemap.build module.modulemap COPYONLY) + configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY) endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") Index: tools/llvm-config/BuildVariables.inc.in =================================================================== --- tools/llvm-config/BuildVariables.inc.in +++ tools/llvm-config/BuildVariables.inc.in @@ -24,6 +24,9 @@ #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" +#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@" +#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" +#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" Index: tools/llvm-config/llvm-config.cpp =================================================================== --- tools/llvm-config/llvm-config.cpp +++ tools/llvm-config/llvm-config.cpp @@ -293,7 +293,7 @@ DevelopmentTreeLayout = CMakeStyle; ActiveObjRoot = LLVM_OBJ_ROOT; } else if (sys::fs::equivalent(CurrentExecPrefix, - Twine(LLVM_OBJ_ROOT) + "/bin")) { + Twine(LLVM_OBJ_ROOT) + "/" + LLVM_INSTALL_BINDIR)) { IsInDevelopmentTree = true; DevelopmentTreeLayout = CMakeBuildModeStyle; ActiveObjRoot = LLVM_OBJ_ROOT; @@ -308,7 +308,7 @@ ActiveCMakeDir; std::string ActiveIncludeOption; if (IsInDevelopmentTree) { - ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include"; + ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/" + LLVM_INSTALL_INCLUDEDIR; ActivePrefix = CurrentExecPrefix; // CMake organizes the products differently than a normal prefix style @@ -315,15 +315,15 @@ // layout. switch (DevelopmentTreeLayout) { case CMakeStyle: - ActiveBinDir = ActiveObjRoot + "/bin"; - ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX; + ActiveBinDir = ActiveObjRoot + "/" + LLVM_INSTALL_BINDIR; + ActiveLibDir = ActiveObjRoot + LLVM_INSTALL_LIBDIR + LLVM_LIBDIR_SUFFIX; ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; break; case CMakeBuildModeStyle: ActivePrefix = ActiveObjRoot; - ActiveBinDir = ActiveObjRoot + "/bin/" + build_mode; + ActiveBinDir = ActiveObjRoot + "/" + LLVM_INSTALL_BINDIR + "/" + build_mode; ActiveLibDir = - ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX + "/" + build_mode; + ActiveObjRoot + "/" + LLVM_INSTALL_LIBDIR + LLVM_LIBDIR_SUFFIX + "/" + build_mode; ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; break; } @@ -330,14 +330,14 @@ // We need to include files from both the source and object trees. ActiveIncludeOption = - ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); + ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/" + LLVM_INSTALL_INCLUDEDIR); } else { ActivePrefix = CurrentExecPrefix; - ActiveIncludeDir = ActivePrefix + "/include"; - SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); + ActiveIncludeDir = ActivePrefix + "/" + LLVM_INSTALL_INCLUDEDIR; + SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR)); sys::fs::make_absolute(ActivePrefix, path); ActiveBinDir = path.str(); - ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; + ActiveLibDir = ActivePrefix + "/" + LLVM_INSTALL_LIBDIR + LLVM_LIBDIR_SUFFIX; ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; ActiveIncludeOption = "-I" + ActiveIncludeDir; } Index: tools/llvm-shlib/CMakeLists.txt =================================================================== --- tools/llvm-shlib/CMakeLists.txt +++ tools/llvm-shlib/CMakeLists.txt @@ -89,7 +89,7 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_BINARY_DIR}/libllvm-c.exports) - set(LIB_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) + set(LIB_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) set(LIB_NAME ${LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}LLVM) set(LIB_PATH ${LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) set(LIB_EXPORTS_PATH ${LIB_NAME}.exports) Index: tools/lto/CMakeLists.txt =================================================================== --- tools/lto/CMakeLists.txt +++ tools/lto/CMakeLists.txt @@ -19,7 +19,7 @@ add_llvm_library(LTO SHARED ${SOURCES} DEPENDS intrinsics_gen) install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h - DESTINATION include/llvm-c + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c COMPONENT LTO) if (APPLE)