summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-11-04 02:09:30 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2021-12-10 20:59:43 +0000
commit492de35df443d5f31480173d5f1274c7835cd3d8 (patch)
tree82af476ecc56fe3c92b2e0bd68ea18806a43c76f
parent8425bde82d0d96033ed74edbb94aba8e1dbee0c9 (diff)
downloadllvm-492de35df443d5f31480173d5f1274c7835cd3d8.tar.gz
Revert "Revert "Use `GNUInstallDirs` to support custom installation dirs. -- LLVM""
This reverts commit 797b50d4be873b4662983413a06806fca544c276. See the original D99484. @mib who noticed the original problem could not longer reproduce it, after I tried and also failed. We are threfore hoping it went away on its own! Reviewed By: mib Differential Revision: https://reviews.llvm.org/D115544
-rw-r--r--clang/tools/scan-build/CMakeLists.txt12
-rw-r--r--libclc/CMakeLists.txt12
-rw-r--r--lldb/cmake/modules/FindLibEdit.cmake4
-rw-r--r--llvm/CMakeLists.txt17
-rw-r--r--llvm/cmake/modules/AddLLVM.cmake4
-rw-r--r--llvm/cmake/modules/AddSphinxTarget.cmake4
-rw-r--r--llvm/cmake/modules/CMakeLists.txt7
-rw-r--r--llvm/cmake/modules/LLVMInstallSymlink.cmake2
-rw-r--r--llvm/docs/CMake.rst24
-rw-r--r--llvm/examples/Bye/CMakeLists.txt2
-rw-r--r--llvm/include/llvm/CMakeLists.txt2
-rw-r--r--llvm/tools/llvm-config/BuildVariables.inc.in2
-rw-r--r--llvm/tools/llvm-config/llvm-config.cpp14
-rw-r--r--llvm/tools/lto/CMakeLists.txt2
-rw-r--r--llvm/tools/opt-viewer/CMakeLists.txt2
-rw-r--r--llvm/tools/remarks-shlib/CMakeLists.txt2
-rw-r--r--openmp/runtime/src/CMakeLists.txt4
17 files changed, 72 insertions, 44 deletions
diff --git a/clang/tools/scan-build/CMakeLists.txt b/clang/tools/scan-build/CMakeLists.txt
index ec0702d76f18..74334e53c9b1 100644
--- a/clang/tools/scan-build/CMakeLists.txt
+++ b/clang/tools/scan-build/CMakeLists.txt
@@ -66,16 +66,16 @@ if(CLANG_INSTALL_SCANBUILD)
endforeach()
foreach(ManPage ${ManPages})
- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage}
+ add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage}"
COMMAND ${CMAKE_COMMAND} -E make_directory
- ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1
+ "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1"
COMMAND ${CMAKE_COMMAND} -E copy
- ${CMAKE_CURRENT_SOURCE_DIR}/man/${ManPage}
- ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/
+ "${CMAKE_CURRENT_SOURCE_DIR}/man/${ManPage}"
+ "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/"
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/man/${ManPage})
- list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage})
+ list(APPEND Depends "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage}")
install(PROGRAMS man/${ManPage}
- DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
+ DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
COMPONENT scan-build)
endforeach()
diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index ec39ea63f2d0..e90e0fd85201 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -183,8 +183,8 @@ endif()
# pkg-config file
configure_file( libclc.pc.in libclc.pc @ONLY )
-install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION ${CMAKE_INSTALL_DATADIR}/pkgconfig )
-install( DIRECTORY generic/include/clc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
+install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig" )
+install( DIRECTORY generic/include/clc DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" )
if( ENABLE_RUNTIME_SUBNORMAL )
add_library( subnormal_use_default STATIC
@@ -192,7 +192,7 @@ if( ENABLE_RUNTIME_SUBNORMAL )
add_library( subnormal_disable STATIC
generic/lib/subnormal_disable.ll )
install( TARGETS subnormal_use_default subnormal_disable ARCHIVE
- DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
endif()
find_package( Python3 REQUIRED COMPONENTS Interpreter )
@@ -343,7 +343,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
add_custom_target( "prepare-${spv_suffix}" ALL
DEPENDS "${spv_suffix}" )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${spv_suffix}
- DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
else()
# Add prepare target
@@ -366,7 +366,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
PROPERTIES ENVIRONMENT "LLVM_CONFIG=${LLVM_CONFIG}" )
endif()
- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
foreach( a ${${d}_aliases} )
set( alias_suffix "${a}-${t}.bc" )
add_custom_target( ${alias_suffix} ALL
@@ -374,7 +374,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
create_symlink ${obj_suffix}
${alias_suffix}
DEPENDS "prepare-${obj_suffix}" )
- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
endforeach( a )
endif()
endforeach( d )
diff --git a/lldb/cmake/modules/FindLibEdit.cmake b/lldb/cmake/modules/FindLibEdit.cmake
index b4f0cb329811..8b00d34de001 100644
--- a/lldb/cmake/modules/FindLibEdit.cmake
+++ b/lldb/cmake/modules/FindLibEdit.cmake
@@ -25,14 +25,14 @@ else()
HINTS
${PC_LIBEDIT_INCLUDEDIR}
${PC_LIBEDIT_INCLUDE_DIRS}
- ${CMAKE_INSTALL_FULL_INCLUDEDIR})
+ "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
find_library(LibEdit_LIBRARIES
NAMES
edit libedit
HINTS
${PC_LIBEDIT_LIBDIR}
${PC_LIBEDIT_LIBRARY_DIRS}
- ${CMAKE_INSTALL_FULL_LIBDIR})
+ "${CMAKE_INSTALL_FULL_LIBDIR}")
if(LibEdit_INCLUDE_DIRS AND EXISTS "${LibEdit_INCLUDE_DIRS}/histedit.h")
file(STRINGS "${LibEdit_INCLUDE_DIRS}/histedit.h"
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index d12befc1a538..f2753402f4b1 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -281,9 +281,12 @@ if (CMAKE_BUILD_TYPE AND
message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
endif()
+include(GNUInstallDirs)
+
set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
-set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING
+ "Path for binary subdirectory (defaults to '${CMAKE_INSTALL_BINDIR}')")
mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING
@@ -605,9 +608,9 @@ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF)
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"
+set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/llvm/doxygen-html"
CACHE STRING "Doxygen-generated HTML documentation install directory")
-set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html"
+set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/llvm/ocaml-html"
CACHE STRING "OCamldoc-generated HTML documentation install directory")
option (LLVM_BUILD_EXTERNAL_COMPILER_RT
@@ -1119,7 +1122,7 @@ endif()
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"
@@ -1130,7 +1133,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
)
install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c
- DESTINATION include
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
COMPONENT llvm-headers
FILES_MATCHING
PATTERN "*.def"
@@ -1144,13 +1147,13 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
if (LLVM_INSTALL_MODULEMAPS)
install(DIRECTORY include/llvm include/llvm-c
- DESTINATION include
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
COMPONENT llvm-headers
FILES_MATCHING
PATTERN "module.modulemap"
)
install(FILES include/llvm/module.install.modulemap
- DESTINATION include/llvm
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/llvm"
COMPONENT llvm-headers
RENAME "module.extern.modulemap"
)
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 1d97626d69cc..99b9d34df8a5 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -845,7 +845,7 @@ macro(add_llvm_library name)
${export_to_llvmexports}
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
- RUNTIME DESTINATION bin COMPONENT ${name})
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name})
if (NOT LLVM_ENABLE_IDE)
add_llvm_install_targets(install-${name}
@@ -1278,7 +1278,7 @@ macro(add_llvm_example name)
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)
diff --git a/llvm/cmake/modules/AddSphinxTarget.cmake b/llvm/cmake/modules/AddSphinxTarget.cmake
index e80c3b5c1cac..256c9336e1f9 100644
--- a/llvm/cmake/modules/AddSphinxTarget.cmake
+++ b/llvm/cmake/modules/AddSphinxTarget.cmake
@@ -74,7 +74,7 @@ function (add_sphinx_target builder project)
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
if (builder STREQUAL man)
if (CMAKE_INSTALL_MANDIR)
- set(INSTALL_MANDIR ${CMAKE_INSTALL_MANDIR}/)
+ set(INSTALL_MANDIR "${CMAKE_INSTALL_MANDIR}")
else()
set(INSTALL_MANDIR share/man/)
endif()
@@ -90,7 +90,7 @@ function (add_sphinx_target builder project)
endif()
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}/llvm/html"
CACHE STRING "HTML documentation install directory for ${project}")
# '/.' indicates: copy the contents of the directory directly into
diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt
index 51b6a4fdc284..b2bb370124f2 100644
--- a/llvm/cmake/modules/CMakeLists.txt
+++ b/llvm/cmake/modules/CMakeLists.txt
@@ -1,6 +1,7 @@
include(LLVMDistributionSupport)
-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
+set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm CACHE STRING
+ "Path for CMake subdirectory (defaults to 'lib${LLVM_LIBDIR_SUFFIX}/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.
@@ -109,13 +110,13 @@ foreach(p ${_count})
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_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
set(LLVM_CONFIG_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}")
set(LLVM_CONFIG_MAIN_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}")
set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${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}")
# Generate a default location for lit
if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS)
diff --git a/llvm/cmake/modules/LLVMInstallSymlink.cmake b/llvm/cmake/modules/LLVMInstallSymlink.cmake
index 3e6a2c9a2648..545883dd7dfb 100644
--- a/llvm/cmake/modules/LLVMInstallSymlink.cmake
+++ b/llvm/cmake/modules/LLVMInstallSymlink.cmake
@@ -4,7 +4,7 @@
function(install_symlink name target outdir)
set(DESTDIR $ENV{DESTDIR})
- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/")
+ set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}")
message(STATUS "Creating ${name}")
diff --git a/llvm/docs/CMake.rst b/llvm/docs/CMake.rst
index 3c7cbc85ed2e..8d8223e509bb 100644
--- a/llvm/docs/CMake.rst
+++ b/llvm/docs/CMake.rst
@@ -252,6 +252,22 @@ manual, or execute ``cmake --help-variable VARIABLE_NAME``.
Sets the C++ standard to conform to when building LLVM. Possible values are
14, 17, 20. LLVM Requires C++ 14 or higher. This defaults to 14.
+**CMAKE_INSTALL_BINDIR**:STRING
+ The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``.
+ Defaults to ``bin``.
+
+**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-related variables:
LLVM-related variables
@@ -598,12 +614,12 @@ enabled sub-projects. Nearly all of these variable names begin with
**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`.
+ ``${CMAKE_INSTALL_DOCDIR}/llvm/ocaml-html``.
**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`.
+ ``${CMAKE_INSTALL_DOCDIR}/llvm/html``.
**LLVM_INSTALL_UTILS**:BOOL
If enabled, utility binaries like ``FileCheck`` and ``not`` will be installed
@@ -627,8 +643,8 @@ enabled sub-projects. Nearly all of these variable names begin with
**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}/llvm/doxygen-html``.
**LLVM_LINK_LLVM_DYLIB**:BOOL
If enabled, tools will be linked with the libLLVM shared library. Defaults
diff --git a/llvm/examples/Bye/CMakeLists.txt b/llvm/examples/Bye/CMakeLists.txt
index bb96edb4b4bf..943c86143722 100644
--- a/llvm/examples/Bye/CMakeLists.txt
+++ b/llvm/examples/Bye/CMakeLists.txt
@@ -14,6 +14,6 @@ if (NOT WIN32)
BUILDTREE_ONLY
)
- install(TARGETS ${name} RUNTIME DESTINATION examples)
+ install(TARGETS ${name} RUNTIME DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples")
set_target_properties(${name} PROPERTIES FOLDER "Examples")
endif()
diff --git a/llvm/include/llvm/CMakeLists.txt b/llvm/include/llvm/CMakeLists.txt
index b46319f24fc8..2feabd1954e4 100644
--- a/llvm/include/llvm/CMakeLists.txt
+++ b/llvm/include/llvm/CMakeLists.txt
@@ -5,5 +5,5 @@ add_subdirectory(Frontend)
# 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}")
diff --git a/llvm/tools/llvm-config/BuildVariables.inc.in b/llvm/tools/llvm-config/BuildVariables.inc.in
index ebe5b73a5c65..e2c0fca6db9a 100644
--- a/llvm/tools/llvm-config/BuildVariables.inc.in
+++ b/llvm/tools/llvm-config/BuildVariables.inc.in
@@ -23,6 +23,8 @@
#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_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@"
diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
index 8afd3593272f..bce73aeabd81 100644
--- a/llvm/tools/llvm-config/llvm-config.cpp
+++ b/llvm/tools/llvm-config/llvm-config.cpp
@@ -357,10 +357,16 @@ int main(int argc, char **argv) {
("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
} else {
ActivePrefix = CurrentExecPrefix;
- ActiveIncludeDir = ActivePrefix + "/include";
- SmallString<256> path(LLVM_TOOLS_INSTALL_DIR);
- sys::fs::make_absolute(ActivePrefix, path);
- ActiveBinDir = std::string(path.str());
+ {
+ SmallString<256> Path(LLVM_INSTALL_INCLUDEDIR);
+ sys::fs::make_absolute(ActivePrefix, Path);
+ ActiveIncludeDir = std::string(Path.str());
+ }
+ {
+ SmallString<256> Path(LLVM_INSTALL_BINDIR);
+ sys::fs::make_absolute(ActivePrefix, Path);
+ ActiveBinDir = std::string(Path.str());
+ }
ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
ActiveIncludeOption = "-I" + ActiveIncludeDir;
diff --git a/llvm/tools/lto/CMakeLists.txt b/llvm/tools/lto/CMakeLists.txt
index 0af29ad762c5..67f6d3af40e0 100644
--- a/llvm/tools/lto/CMakeLists.txt
+++ b/llvm/tools/lto/CMakeLists.txt
@@ -33,7 +33,7 @@ add_llvm_library(${LTO_LIBRARY_NAME} ${LTO_LIBRARY_TYPE} INSTALL_WITH_TOOLCHAIN
${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)
diff --git a/llvm/tools/opt-viewer/CMakeLists.txt b/llvm/tools/opt-viewer/CMakeLists.txt
index ead73ec13a8f..c0070f8cbfac 100644
--- a/llvm/tools/opt-viewer/CMakeLists.txt
+++ b/llvm/tools/opt-viewer/CMakeLists.txt
@@ -8,7 +8,7 @@ set (files
foreach (file ${files})
install(PROGRAMS ${file}
- DESTINATION share/opt-viewer
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/opt-viewer"
COMPONENT opt-viewer)
endforeach (file)
diff --git a/llvm/tools/remarks-shlib/CMakeLists.txt b/llvm/tools/remarks-shlib/CMakeLists.txt
index 865436247270..f22cedd9ead7 100644
--- a/llvm/tools/remarks-shlib/CMakeLists.txt
+++ b/llvm/tools/remarks-shlib/CMakeLists.txt
@@ -19,7 +19,7 @@ if(LLVM_ENABLE_PIC)
endif()
install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h
- DESTINATION include/llvm-c
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/llvm-c"
COMPONENT Remarks)
if (APPLE)
diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index 60f97bd3d2ae..d13f77d33bc3 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -360,7 +360,7 @@ if(WIN32)
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_LIB_FILE}\"
\"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/bin)")
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})")
+ \"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR}\")")
endforeach()
else()
@@ -372,7 +372,7 @@ else()
foreach(alias IN LISTS LIBOMP_ALIASES)
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
\"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY
- \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR})")
+ \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR}\")")
endforeach()
endif()
endif()