Skip to content

Commit 6fd2db0

Browse files
committed
Use GNUInstallDirs to support custom installation dirs. -- LLVM
This is a new draft of D28234. I previously did the unorthodox thing of pushing to it when I wasn't the original author, but since this version - Uses `GNUInstallDirs`, rather than mimics it, as the original author was hesitant to do but others requested. - Is much broader, effecting many more projects than LLVM itself. I figured it was time to make a new revision. I am using this patch (and many back-ports) as the basis of NixOS/nixpkgs#111487 for my distro (NixOS). It looked like people were generally on board in D28234, but I make note of this here in case extra motivation is useful. --- As pointed out in the original issue, a central tension is that LLVM already has some partial support for these sorts of things. For example `LLVM_LIBDIR_SUFFIX`, or `COMPILER_RT_INSTALL_PATH`. Because it's not quite clear yet what to do about those, we are holding off on changing libdirs and `compiler-rt`. for this initial PR. --- On the advice of @lebedev.ri, I am splitting this up a bit per subproject, starting with LLVM. To allow it to be more easily reviewed. This and the subsequent patch must be landed together, as this will not build alone. But the rest can be landed on their own. Reviewed By: compnerd Differential Revision: https://reviews.llvm.org/D100810
1 parent 76b53da commit 6fd2db0

File tree

17 files changed

+72
-44
lines changed

17 files changed

+72
-44
lines changed

clang/tools/scan-build/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,16 @@ if(CLANG_INSTALL_SCANBUILD)
6666
endforeach()
6767

6868
foreach(ManPage ${ManPages})
69-
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage}
69+
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage}"
7070
COMMAND ${CMAKE_COMMAND} -E make_directory
71-
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1
71+
"${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1"
7272
COMMAND ${CMAKE_COMMAND} -E copy
73-
${CMAKE_CURRENT_SOURCE_DIR}/man/${ManPage}
74-
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/
73+
"${CMAKE_CURRENT_SOURCE_DIR}/man/${ManPage}"
74+
"${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/"
7575
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/man/${ManPage})
76-
list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage})
76+
list(APPEND Depends "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage}")
7777
install(PROGRAMS man/${ManPage}
78-
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
78+
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
7979
COMPONENT scan-build)
8080
endforeach()
8181

libclc/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,16 @@ endif()
183183

184184
# pkg-config file
185185
configure_file( libclc.pc.in libclc.pc @ONLY )
186-
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION ${CMAKE_INSTALL_DATADIR}/pkgconfig )
187-
install( DIRECTORY generic/include/clc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
186+
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig" )
187+
install( DIRECTORY generic/include/clc DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" )
188188

189189
if( ENABLE_RUNTIME_SUBNORMAL )
190190
add_library( subnormal_use_default STATIC
191191
generic/lib/subnormal_use_default.ll )
192192
add_library( subnormal_disable STATIC
193193
generic/lib/subnormal_disable.ll )
194194
install( TARGETS subnormal_use_default subnormal_disable ARCHIVE
195-
DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
195+
DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
196196
endif()
197197

198198
find_package( Python3 REQUIRED COMPONENTS Interpreter )
@@ -343,7 +343,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
343343
add_custom_target( "prepare-${spv_suffix}" ALL
344344
DEPENDS "${spv_suffix}" )
345345
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${spv_suffix}
346-
DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
346+
DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
347347
else()
348348

349349
# Add prepare target
@@ -366,15 +366,15 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
366366
PROPERTIES ENVIRONMENT "LLVM_CONFIG=${LLVM_CONFIG}" )
367367
endif()
368368

369-
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
369+
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
370370
foreach( a ${${d}_aliases} )
371371
set( alias_suffix "${a}-${t}.bc" )
372372
add_custom_target( ${alias_suffix} ALL
373373
COMMAND ${CMAKE_COMMAND} -E
374374
create_symlink ${obj_suffix}
375375
${alias_suffix}
376376
DEPENDS "prepare-${obj_suffix}" )
377-
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
377+
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
378378
endforeach( a )
379379
endif()
380380
endforeach( d )

lldb/cmake/modules/FindLibEdit.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ else()
2525
HINTS
2626
${PC_LIBEDIT_INCLUDEDIR}
2727
${PC_LIBEDIT_INCLUDE_DIRS}
28-
${CMAKE_INSTALL_FULL_INCLUDEDIR})
28+
"${CMAKE_INSTALL_FULL_INCLUDEDIR}")
2929
find_library(LibEdit_LIBRARIES
3030
NAMES
3131
edit libedit
3232
HINTS
3333
${PC_LIBEDIT_LIBDIR}
3434
${PC_LIBEDIT_LIBRARY_DIRS}
35-
${CMAKE_INSTALL_FULL_LIBDIR})
35+
"${CMAKE_INSTALL_FULL_LIBDIR}")
3636

3737
if(LibEdit_INCLUDE_DIRS AND EXISTS "${LibEdit_INCLUDE_DIRS}/histedit.h")
3838
file(STRINGS "${LibEdit_INCLUDE_DIRS}/histedit.h"

llvm/CMakeLists.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,12 @@ if (CMAKE_BUILD_TYPE AND
281281
message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
282282
endif()
283283

284+
include(GNUInstallDirs)
285+
284286
set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
285287

286-
set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
288+
set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING
289+
"Path for binary subdirectory (defaults to '${CMAKE_INSTALL_BINDIR}')")
287290
mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
288291

289292
set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING
@@ -592,9 +595,9 @@ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF)
592595
option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON)
593596
option (LLVM_ENABLE_BINDINGS "Build bindings." ON)
594597

595-
set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html"
598+
set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/llvm/doxygen-html"
596599
CACHE STRING "Doxygen-generated HTML documentation install directory")
597-
set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html"
600+
set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/llvm/ocaml-html"
598601
CACHE STRING "OCamldoc-generated HTML documentation install directory")
599602

600603
option (LLVM_BUILD_EXTERNAL_COMPILER_RT
@@ -1096,7 +1099,7 @@ endif()
10961099

10971100
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
10981101
install(DIRECTORY include/llvm include/llvm-c
1099-
DESTINATION include
1102+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
11001103
COMPONENT llvm-headers
11011104
FILES_MATCHING
11021105
PATTERN "*.def"
@@ -1107,7 +1110,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
11071110
)
11081111

11091112
install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c
1110-
DESTINATION include
1113+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
11111114
COMPONENT llvm-headers
11121115
FILES_MATCHING
11131116
PATTERN "*.def"
@@ -1121,13 +1124,13 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
11211124

11221125
if (LLVM_INSTALL_MODULEMAPS)
11231126
install(DIRECTORY include/llvm include/llvm-c
1124-
DESTINATION include
1127+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
11251128
COMPONENT llvm-headers
11261129
FILES_MATCHING
11271130
PATTERN "module.modulemap"
11281131
)
11291132
install(FILES include/llvm/module.install.modulemap
1130-
DESTINATION include/llvm
1133+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/llvm"
11311134
COMPONENT llvm-headers
11321135
RENAME "module.extern.modulemap"
11331136
)

llvm/cmake/modules/AddLLVM.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ macro(add_llvm_library name)
835835
${export_to_llvmexports}
836836
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
837837
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
838-
RUNTIME DESTINATION bin COMPONENT ${name})
838+
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name})
839839

840840
if (NOT LLVM_ENABLE_IDE)
841841
add_llvm_install_targets(install-${name}
@@ -1268,7 +1268,7 @@ macro(add_llvm_example name)
12681268
endif()
12691269
add_llvm_executable(${name} ${ARGN})
12701270
if( LLVM_BUILD_EXAMPLES )
1271-
install(TARGETS ${name} RUNTIME DESTINATION examples)
1271+
install(TARGETS ${name} RUNTIME DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples")
12721272
endif()
12731273
set_target_properties(${name} PROPERTIES FOLDER "Examples")
12741274
endmacro(add_llvm_example name)

llvm/cmake/modules/AddSphinxTarget.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function (add_sphinx_target builder project)
7474
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
7575
if (builder STREQUAL man)
7676
if (CMAKE_INSTALL_MANDIR)
77-
set(INSTALL_MANDIR ${CMAKE_INSTALL_MANDIR}/)
77+
set(INSTALL_MANDIR "${CMAKE_INSTALL_MANDIR}")
7878
else()
7979
set(INSTALL_MANDIR share/man/)
8080
endif()
@@ -90,7 +90,7 @@ function (add_sphinx_target builder project)
9090
endif()
9191
elseif (builder STREQUAL html)
9292
string(TOUPPER "${project}" project_upper)
93-
set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html"
93+
set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/llvm/html"
9494
CACHE STRING "HTML documentation install directory for ${project}")
9595

9696
# '/.' indicates: copy the contents of the directory directly into

llvm/cmake/modules/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include(LLVMDistributionSupport)
22

3-
set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
3+
set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm CACHE STRING
4+
"Path for CMake subdirectory (defaults to 'lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm')")
45
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
56

67
# First for users who use an installed LLVM, create the LLVMExports.cmake file.
@@ -109,13 +110,13 @@ foreach(p ${_count})
109110
set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE}
110111
get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)")
111112
endforeach(p)
112-
set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include")
113+
set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
113114
set(LLVM_CONFIG_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}")
114115
set(LLVM_CONFIG_MAIN_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}")
115116
set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}")
116117
set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}")
117118
set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}")
118-
set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin")
119+
set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
119120

120121
# Generate a default location for lit
121122
if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS)

llvm/cmake/modules/LLVMInstallSymlink.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
function(install_symlink name target outdir)
66
set(DESTDIR $ENV{DESTDIR})
7-
set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/")
7+
set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}")
88

99
message(STATUS "Creating ${name}")
1010

llvm/docs/CMake.rst

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,22 @@ manual, or execute ``cmake --help-variable VARIABLE_NAME``.
252252
Sets the C++ standard to conform to when building LLVM. Possible values are
253253
14, 17, 20. LLVM Requires C++ 14 or higher. This defaults to 14.
254254

255+
**CMAKE_INSTALL_BINDIR**:STRING
256+
The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``.
257+
Defaults to ``bin``.
258+
259+
**CMAKE_INSTALL_INCLUDEDIR**:STRING
260+
The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``.
261+
Defaults to ``include``.
262+
263+
**CMAKE_INSTALL_DOCDIR**:STRING
264+
The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``.
265+
Defaults to ``share/doc``.
266+
267+
**CMAKE_INSTALL_MANDIR**:STRING
268+
The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``.
269+
Defaults to ``share/man``.
270+
255271
.. _LLVM-related variables:
256272

257273
LLVM-related variables
@@ -592,12 +608,12 @@ enabled sub-projects. Nearly all of these variable names begin with
592608
**LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING
593609
The path to install OCamldoc-generated HTML documentation to. This path can
594610
either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to
595-
`share/doc/llvm/ocaml-html`.
611+
``${CMAKE_INSTALL_DOCDIR}/llvm/ocaml-html``.
596612

597613
**LLVM_INSTALL_SPHINX_HTML_DIR**:STRING
598614
The path to install Sphinx-generated HTML documentation to. This path can
599615
either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to
600-
`share/doc/llvm/html`.
616+
``${CMAKE_INSTALL_DOCDIR}/llvm/html``.
601617

602618
**LLVM_INSTALL_UTILS**:BOOL
603619
If enabled, utility binaries like ``FileCheck`` and ``not`` will be installed
@@ -621,8 +637,8 @@ enabled sub-projects. Nearly all of these variable names begin with
621637

622638
**LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING
623639
The path to install Doxygen-generated HTML documentation to. This path can
624-
either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to
625-
`share/doc/llvm/doxygen-html`.
640+
either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to
641+
``${CMAKE_INSTALL_DOCDIR}/llvm/doxygen-html``.
626642

627643
**LLVM_LINK_LLVM_DYLIB**:BOOL
628644
If enabled, tools will be linked with the libLLVM shared library. Defaults

llvm/examples/Bye/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ if (NOT WIN32)
1414
BUILDTREE_ONLY
1515
)
1616

17-
install(TARGETS ${name} RUNTIME DESTINATION examples)
17+
install(TARGETS ${name} RUNTIME DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples")
1818
set_target_properties(${name} PROPERTIES FOLDER "Examples")
1919
endif()

llvm/include/llvm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ add_subdirectory(Frontend)
55
# If we're doing an out-of-tree build, copy a module map for generated
66
# header files into the build area.
77
if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
8-
configure_file(module.modulemap.build module.modulemap COPYONLY)
8+
configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY)
99
endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")

llvm/tools/llvm-config/BuildVariables.inc.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
2424
#define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
2525
#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
26+
#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@"
27+
#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
2628
#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
2729
#define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
2830
#define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@"

llvm/tools/llvm-config/llvm-config.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,16 @@ int main(int argc, char **argv) {
357357
("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
358358
} else {
359359
ActivePrefix = CurrentExecPrefix;
360-
ActiveIncludeDir = ActivePrefix + "/include";
361-
SmallString<256> path(LLVM_TOOLS_INSTALL_DIR);
362-
sys::fs::make_absolute(ActivePrefix, path);
363-
ActiveBinDir = std::string(path.str());
360+
{
361+
SmallString<256> Path(LLVM_INSTALL_INCLUDEDIR);
362+
sys::fs::make_absolute(ActivePrefix, Path);
363+
ActiveIncludeDir = std::string(Path.str());
364+
}
365+
{
366+
SmallString<256> Path(LLVM_INSTALL_BINDIR);
367+
sys::fs::make_absolute(ActivePrefix, Path);
368+
ActiveBinDir = std::string(Path.str());
369+
}
364370
ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
365371
ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
366372
ActiveIncludeOption = "-I" + ActiveIncludeDir;

llvm/tools/lto/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ add_llvm_library(${LTO_LIBRARY_NAME} ${LTO_LIBRARY_TYPE} INSTALL_WITH_TOOLCHAIN
3333
${SOURCES} DEPENDS intrinsics_gen)
3434

3535
install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
36-
DESTINATION include/llvm-c
36+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/llvm-c"
3737
COMPONENT LTO)
3838

3939
if (APPLE)

llvm/tools/opt-viewer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set (files
88

99
foreach (file ${files})
1010
install(PROGRAMS ${file}
11-
DESTINATION share/opt-viewer
11+
DESTINATION "${CMAKE_INSTALL_DATADIR}/opt-viewer"
1212
COMPONENT opt-viewer)
1313
endforeach (file)
1414

llvm/tools/remarks-shlib/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if(LLVM_ENABLE_PIC)
1919
endif()
2020

2121
install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h
22-
DESTINATION include/llvm-c
22+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/llvm-c"
2323
COMPONENT Remarks)
2424

2525
if (APPLE)

openmp/runtime/src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ if(WIN32)
323323
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_LIB_FILE}\"
324324
\"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/bin)")
325325
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_IMP_LIB_FILE}\"
326-
\"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR})")
326+
\"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR}\")")
327327
endforeach()
328328
else()
329329

@@ -335,7 +335,7 @@ else()
335335
foreach(alias IN LISTS LIBOMP_ALIASES)
336336
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
337337
\"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY
338-
\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR})")
338+
\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR}\")")
339339
endforeach()
340340
endif()
341341
endif()

0 commit comments

Comments
 (0)