Use GNUInstallDirs for LIBDIR variable
This should be supported in older versions of cmake, but haven't
explicitly tested those.
Fixes: #243
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0178c3d..7eb0b7e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,10 +9,7 @@
include(cmake/GetGitRevisionDescription.cmake)
include(cmake/version.cmake)
-get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
-if(LIB64)
- set(LIBSUFFIX 64)
-endif()
+include(GNUInstallDirs)
if(NOT PYTHON_ONLY)
find_package(BISON)
diff --git a/debian/libbcc.install b/debian/libbcc.install
index 7d20e9e..bdb1bc4 100644
--- a/debian/libbcc.install
+++ b/debian/libbcc.install
@@ -1,3 +1,3 @@
usr/include/bcc/*
-usr/lib/libbcc* /usr/lib/x86_64-linux-gnu/
+usr/lib/x86_64-linux-gnu/libbcc*
usr/share/bcc/include/*
diff --git a/src/cc/CMakeLists.txt b/src/cc/CMakeLists.txt
index 3876b8d..59bfb3e 100644
--- a/src/cc/CMakeLists.txt
+++ b/src/cc/CMakeLists.txt
@@ -51,7 +51,7 @@
target_link_libraries(bcc b_frontend clang_frontend ${clang_libs} ${llvm_libs} LLVMBPFCodeGen)
install(TARGETS bcc LIBRARY COMPONENT libbcc
- DESTINATION lib${LIBSUFFIX})
+ DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY export/ COMPONENT libbcc
DESTINATION share/bcc/include/bcc
FILES_MATCHING PATTERN "*.h")
@@ -61,6 +61,6 @@
DESTINATION include/bcc/compat/linux
FILES_MATCHING PATTERN "*.h")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libbcc.pc COMPONENT libbcc
- DESTINATION lib${LIBSUFFIX}/pkgconfig)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
add_subdirectory(frontends)