Skip to content

Commit 01213b6

Browse files
committed
cmake: Use GNUInstallDirs to install data directories
1 parent 81558a5 commit 01213b6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 2.8.12)
22
project(pahole C)
33
cmake_policy(SET CMP0005 NEW)
44

5+
include(GNUInstallDirs)
6+
57
option(LIBBPF_EMBEDDED "Use the embedded version of libbpf instead of searching it via pkg-config" ON)
68
if (NOT LIBBPF_EMBEDDED)
79
find_package(PkgConfig REQUIRED)
@@ -185,11 +187,11 @@ install(FILES dwarves.h dwarves_emit.h dwarves_reorganize.h
185187
btf_encoder.h config.h ctf.h
186188
elfcreator.h elf_symtab.h hash.h libctf.h
187189
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/dwarves/)
188-
install(FILES man-pages/pahole.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1/)
190+
install(FILES man-pages/pahole.1 DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/man/man1/")
189191
if(Python3_FOUND)
190192
install(PROGRAMS ostra/ostra-cg DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
191-
install(FILES ostra/python/ostra.py DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dwarves/runtime/python)
193+
install(FILES ostra/python/ostra.py DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dwarves/runtime/python")
192194
endif()
193195
install(PROGRAMS btfdiff fullcircle DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
194196
install(FILES lib/Makefile lib/ctracer_relay.c lib/ctracer_relay.h lib/linux.blacklist.cu
195-
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dwarves/runtime)
197+
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dwarves/runtime")

0 commit comments

Comments
 (0)