summaryrefslogtreecommitdiff
blob: 74206760f39a7219b6d0c0ab9133eb2757ea031f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 98f589636729b1e25625db6880fbd7820dcf9e40 Mon Sep 17 00:00:00 2001
From: Craig Andrews <candrews@integralblue.com>
Date: Wed, 31 Jul 2019 10:04:11 -0400
Subject: [PATCH] Install to standard locations using GNUInstallDirs

Some distributions require 64 bit libraries to be installed to lib64, for example.
Using GNUInstallDirs ensures that files are installed to the expected locations.
---
 CMakeLists.txt | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 454b830..a89af16 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,7 @@
 cmake_minimum_required(VERSION 3.2.0)
 
+include (GNUInstallDirs)
+
 # Build ROCM-Compiler-Support with ccache if the package is present.
 set(ROCM_COMPILER_SUPPORT_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build")
 if(ROCM_COMPILER_SUPPORT_CCACHE_BUILD)
@@ -146,17 +148,17 @@ configure_file("cmake/${AMD_COMGR_CONFIG_NAME}.in"
 
 install(TARGETS amd_comgr
   EXPORT amd_comgr_export
-  DESTINATION lib)
+  DESTINATION ${CMAKE_INSTALL_LIBDIR})
 
 install(FILES
   "include/amd_comgr.h"
-  DESTINATION include)
+  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
 
 install(FILES
   "README.md"
   "LICENSE.txt"
   "NOTICES.txt"
-  DESTINATION share/amd_comgr)
+  DESTINATION ${CMAKE_INSTALL_DATADIR}/amd_comgr)
 
 # Generate the install-tree package.
 set(AMD_COMGR_PREFIX_CODE "