summaryrefslogtreecommitdiff
path: root/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-cmake.patch
blob: 7fd775139b2d83efdb743c90e260363b0a439fb0 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

Pull request:
https://github.com/PeterHuewe/tpm-emulator/pull/37


From 694b7c24ac09e0ec1e54ab71eb9c82a8d4f41d33 Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Tue, 11 Sep 2018 14:08:49 +0300
Subject: [PATCH 1/3] build: use GNUInstallDirs to allow override install
 directories

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
---
 CMakeLists.txt           | 1 +
 tddl/CMakeLists.txt      | 6 +++---
 tpmd/unix/CMakeLists.txt | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f362298..d047ce3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,7 @@
 project(TPM_Emulator C)
 
 cmake_minimum_required(VERSION 2.4)
+include(GNUInstallDirs)
 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
 if(COMMAND cmake_policy)
 cmake_policy(SET CMP0003 NEW)
diff --git a/tddl/CMakeLists.txt b/tddl/CMakeLists.txt
index 0be3281..6cc63b3 100644
--- a/tddl/CMakeLists.txt
+++ b/tddl/CMakeLists.txt
@@ -15,9 +15,9 @@ elseif(WIN32)
   set_target_properties(tddl PROPERTIES PREFIX "")
 endif()
 
-install(TARGETS tddl DESTINATION lib)
-install(TARGETS tddl_static DESTINATION lib)
-install(FILES "tddl.h" DESTINATION include)
+install(TARGETS tddl DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(TARGETS tddl_static DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(FILES "tddl.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
 
 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 add_executable(test_tddl test_tddl.c)
diff --git a/tpmd/unix/CMakeLists.txt b/tpmd/unix/CMakeLists.txt
index 40c436b..c5c394a 100644
--- a/tpmd/unix/CMakeLists.txt
+++ b/tpmd/unix/CMakeLists.txt
@@ -13,5 +13,5 @@ target_link_libraries(tpmd mtm tpm tpm_crypto)
 else()
 target_link_libraries(tpmd tpm tpm_crypto)
 endif()
-install(TARGETS tpmd RUNTIME DESTINATION bin)
+install(TARGETS tpmd RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 
-- 
2.16.4

From 89bf733368dda265040cf44ff8be69a15ab66712 Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Tue, 11 Sep 2018 16:36:12 +0300
Subject: [PATCH 2/3] build: do not build mtm unless enabled

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
---
 CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d047ce3..b8b68a3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,7 +67,9 @@ include_directories(${CMAKE_BINARY_DIR})
 
 # add internal libraries
 add_subdirectory(tpm)
-add_subdirectory(mtm)
+if(MTM_EMULATOR)
+    add_subdirectory(mtm)
+endif()
 add_subdirectory(crypto)
 
 # add TDDL
-- 
2.16.4

From 24bbf683de0b0b24f0ec81d093c03e1f6a9570f2 Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Tue, 11 Sep 2018 14:20:19 +0300
Subject: [PATCH 3/3] build: support BUILD_DEV to disable device build

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
---
 CMakeLists.txt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b8b68a3..9ae6562 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -76,7 +76,12 @@ add_subdirectory(crypto)
 add_subdirectory(tddl)
 
 # add kernel modules
-add_subdirectory(tpmd_dev)
+if(NOT DEFINED BUILD_DEV)
+    set(BUILD_DEV ON)
+endif()
+if(BUILD_DEV)
+    add_subdirectory(tpmd_dev)
+endif()
 
 # add executables
 add_subdirectory(tpmd)
-- 
2.16.4