aboutsummaryrefslogtreecommitdiffstats
path: root/certs/CMakeLists.txt
diff options
context:
space:
mode:
authorJose Bollo <jose.bollo@iot.bzh>2019-09-11 16:37:24 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2020-02-28 12:19:25 +0100
commitc5d922d7085c980edad3764687e2488a1b0907d0 (patch)
treeaf1e8f833e9d0c68538dab9d0974a55293d84477 /certs/CMakeLists.txt
parent7ea1070ee471141f58e9e4c03df5c95bbcef907d (diff)
Refactor of sample keys and certificates
Avoid installing any certificate or key. But if requested, install the certificates and the keys that are given as example. Bug-AGL: SPEC-2840 Change-Id: I26aebd63fad842bb9746c3a004956d9dbafc091f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'certs/CMakeLists.txt')
-rw-r--r--certs/CMakeLists.txt31
1 files changed, 22 insertions, 9 deletions
diff --git a/certs/CMakeLists.txt b/certs/CMakeLists.txt
index 7fda654..933d608 100644
--- a/certs/CMakeLists.txt
+++ b/certs/CMakeLists.txt
@@ -16,15 +16,28 @@
# limitations under the License.
###########################################################################
-cmake_minimum_required(VERSION 2.8)
+if(NOT USE_SDK)
+ install(DIRECTORY DESTINATION ${wgtpkg_trusted_certs_dir})
+endif()
-set(CERTIFICATES
- developer.cert.pem
- partner.cert.pem
- platform.cert.pem
- public.cert.pem
- root.cert.pem
-)
+if(INSTALL_SAMPLE_KEYS)
+ if(NOT USE_SDK)
+ #foreach(f root) TODO: install only root certificate
+ foreach(f root developer partner platform public)
+ install(FILES sample/${f}.cert.pem
+ DESTINATION ${wgtpkg_trusted_certs_dir}
+ RENAME sample-cert-${f}.pem
+ )
+ endforeach(f)
+ endif()
+ foreach(f developer partner platform public)
+ install(FILES sample/${f}.cert.pem
+ DESTINATION ${wgtpkg_sample_certs_dir}
+ )
+ install(FILES sample/${f}.key.pem
+ DESTINATION ${wgtpkg_sample_keys_dir}
+ )
+ endforeach(f)
+endif()
-install(FILES ${CERTIFICATES} DESTINATION ${wgtpkg_trusted_cert_dir})