blob: ffe0a00673ee7683c3a22b90ef2f57c1490be886 [file] [log] [blame]
Brad Bishope42b3e32020-01-15 22:08:42 -05001From 63dc2d0c9384d85482dc4cbb3c179b4b0bb18d4e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 19 Dec 2019 22:32:01 -0800
4Subject: [PATCH] cmake: Use GNUInstallDirs
5
6Helps install cmakefiles in right libdir
7
8Upstream-Status: Submitted [https://github.com/labapart/gattlib/pull/139]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 CMakeLists.txt | 5 +++--
12 dbus/CMakeLists.txt | 18 ++++++++++--------
13 2 files changed, 13 insertions(+), 10 deletions(-)
14
15diff --git a/CMakeLists.txt b/CMakeLists.txt
16index 12d8d71..ded7239 100644
17--- a/CMakeLists.txt
18+++ b/CMakeLists.txt
19@@ -152,7 +152,8 @@ endif()
20 #
21 # List of file to install
22 #
23-install(FILES include/gattlib.h DESTINATION include)
24-install(FILES ${PROJECT_BINARY_DIR}/gattlib.pc DESTINATION lib/pkgconfig)
25+include(GNUInstallDirs)
26+install(FILES include/gattlib.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
27+install(FILES ${PROJECT_BINARY_DIR}/gattlib.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
28
29 include(CPack)
30diff --git a/dbus/CMakeLists.txt b/dbus/CMakeLists.txt
31index f5096ce..cef031f 100644
32--- a/dbus/CMakeLists.txt
33+++ b/dbus/CMakeLists.txt
34@@ -19,7 +19,7 @@
35 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
36 #
37
38-cmake_minimum_required(VERSION 2.6)
39+cmake_minimum_required(VERSION 3.0)
40
41 find_package(PkgConfig REQUIRED)
42
43@@ -119,4 +119,6 @@ endif()
44 add_library(gattlib SHARED ${gattlib_SRCS})
45 target_link_libraries(gattlib ${gattlib_LIBS})
46
47-install(TARGETS gattlib LIBRARY DESTINATION lib)
48+include(GNUInstallDirs)
49+
50+install(TARGETS gattlib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
51--
522.24.1
53