summaryrefslogtreecommitdiffstats
path: root/external/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-cpp/files/Packaging-fixes.patch
blob: 32c880e6d46872a899d79c764f9cc5136ba8d4ca (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
From 3db20a53f35f9d0413c312b46815f6b16fe0afa4 Mon Sep 17 00:00:00 2001
From: Scott Ware <scott.r.ware@intel.com>
Date: Fri, 8 Dec 2017 10:52:20 +0000
Subject: [PATCH 4/5] Packaging fixes

Signed-off-by: Scott Ware <scott.r.ware@intel.com>
---
 CMakeLists.txt      | 12 ++++++++----
 awsiotsdk-cpp.pc.in | 11 +++++++++++
 2 files changed, 19 insertions(+), 4 deletions(-)
 create mode 100644 awsiotsdk-cpp.pc.in

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cb0ad9d..fa98c30 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,9 @@
 cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
-project(aws-iot-sdk-cpp C CXX)
+project(aws-iot-sdk-cpp VERSION 1.3.0 LANGUAGES C CXX)
 option(BUILD_SHARED_LIBRARY "Build the library as a shared object, will build it as a static library otherwise" NO)
 
+include(GNUInstallDirs)
+
 ######################################
 # Section : Disable in-source builds #
 ######################################
@@ -51,7 +53,7 @@ add_definitions(-DSDK_VERSION_STRING="1.3.0")
 set(SDK_TARGET_NAME aws-iot-sdk-cpp)
 if (BUILD_SHARED_LIBRARY)
     add_library(${SDK_TARGET_NAME} SHARED "")
-    set_target_properties(${SDK_TARGET_NAME} PROPERTIES SUFFIX ".so")
+    set_target_properties(${SDK_TARGET_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR} VERSION ${PROJECT_VERSION})
 else()
     add_library(${SDK_TARGET_NAME} "")
 endif()
@@ -174,6 +176,8 @@ endif()
 # Section: Define Install Target #
 ##################################
 if(NOT MSVC)
-    install(TARGETS aws-iot-sdk-cpp DESTINATION lib)
-    install(DIRECTORY include/ DESTINATION include)
+    install(TARGETS aws-iot-sdk-cpp DESTINATION ${CMAKE_INSTALL_LIBDIR})
+    install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/awsiotsdk)
+    configure_file (awsiotsdk-cpp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/awsiotsdk-cpp.pc @ONLY)
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/awsiotsdk-cpp.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
 endif()
diff --git a/awsiotsdk-cpp.pc.in b/awsiotsdk-cpp.pc.in
new file mode 100644
index 0000000..0828942
--- /dev/null
+++ b/awsiotsdk-cpp.pc.in
@@ -0,0 +1,11 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@CMAKE_INSTALL_LIBDIR@
+includedir=@CMAKE_INSTALL_INCLUDEDIR@/awsiotsdk
+
+Name: awsiotsdk-cpp
+Description: SDK for connecting to AWS IoT from a device using C++
+Version: @PROJECT_VERSION@
+
+Libs: -L${libdir} -laws-iot-sdk-cpp
+Cflags: -I${includedir}
-- 
1.9.1