File: cmake-gnu-install-dirs.patch

package info (click to toggle)
magma-rocm 2.9.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 83,208 kB
  • sloc: cpp: 709,115; fortran: 121,916; ansic: 32,343; python: 25,603; f90: 15,208; makefile: 942; xml: 253; csh: 232; sh: 203; perl: 104
file content (49 lines) | stat: -rw-r--r-- 1,689 bytes parent folder | download | duplicates (2)
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
45
46
47
48
49
From: Cordell Bloor <cgmb@slerp.xyz>
Date: Mon, 17 Feb 2025 16:49:22 -0700
Subject: cmake gnu install dirs

Forwarded: no
---
 CMakeLists.txt | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f7f601d..388be18 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -672,10 +672,11 @@ add_custom_target( sparse-testing DEPENDS ${sparse-testing} )
 
 # ----------------------------------------
 # what to install
+include(GNUInstallDirs)
 install( TARGETS magma magma_sparse ${blas_fix}
-         RUNTIME DESTINATION bin
-         LIBRARY DESTINATION lib
-         ARCHIVE DESTINATION lib )
+         RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+         LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+         ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
 if (MAGMA_ENABLE_CUDA)
   file( GLOB headers include/*.h sparse/include/*.h "${CMAKE_BINARY_DIR}/include/*.h" )
 else()
@@ -683,9 +684,9 @@ else()
 endif()
 if (USE_FORTRAN)
     install( FILES ${headers} ${modules}
-             DESTINATION include )
+             DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
 else()
-    install( FILES ${headers} DESTINATION include )
+    install( FILES ${headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
 endif()
 
 # ----------------------------------------
@@ -713,7 +714,7 @@ endif()
 set( MAGMA_REQUIRED "" )
 configure_file( "${pkgconfig}.in" "${pkgconfig}" @ONLY )
 install( FILES "${CMAKE_BINARY_DIR}/${pkgconfig}"
-         DESTINATION lib/pkgconfig )
+         DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig )
 
 # ----------------------------------------
 get_directory_property( compile_definitions COMPILE_DEFINITIONS )