summaryrefslogtreecommitdiffstats
path: root/cmake/modules/generate_crypto_test_wrapper.cmake
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-02 21:57:34 -0600
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-02 21:57:34 -0600
commit117ed93d37fbde90f5decb7292ed0c42e5e39220 (patch)
tree204ff309386b1117e149fefa6e7fcaf432433fdf /cmake/modules/generate_crypto_test_wrapper.cmake
parent659a4b38496b1720b0f90872fed364ab00cb63db (diff)
downloadkube-117ed93d37fbde90f5decb7292ed0c42e5e39220.tar.gz
kube-117ed93d37fbde90f5decb7292ed0c42e5e39220.zip
One copy of the gpg helpers is enough.
Diffstat (limited to 'cmake/modules/generate_crypto_test_wrapper.cmake')
-rw-r--r--cmake/modules/generate_crypto_test_wrapper.cmake45
1 files changed, 45 insertions, 0 deletions
diff --git a/cmake/modules/generate_crypto_test_wrapper.cmake b/cmake/modules/generate_crypto_test_wrapper.cmake
new file mode 100644
index 00000000..e1412f37
--- /dev/null
+++ b/cmake/modules/generate_crypto_test_wrapper.cmake
@@ -0,0 +1,45 @@
1# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
2# Copyright (c) 2013, Sandro Knauß <mail@sandroknauss.de>
3#
4# Redistribution and use is allowed according to the terms of the BSD license.
5# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
6
7
8if (UNIX)
9
10file(WRITE "${_filename}"
11"#!/bin/sh
12# created by cmake, don't edit, changes will be lost
13
14# don't mess with a gpg-agent already running on the system
15unset GPG_AGENT_INFO
16
17${_library_path_variable}=${_ld_library_path}\${${_library_path_variable}:+:\$${_library_path_variable}} GNUPGHOME=${_gnupghome} gpg-agent --daemon \"${_executable}\" \"$@\"
18_result=$?
19_pid=`echo GETINFO pid | GNUPGHOME=${_gnupghome} gpg-connect-agent | grep 'D' | cut -d' ' -f2`
20if [ ! -z \"\$_pid\" ]; then
21 echo \"Waiting for gpg-agent to terminate (PID: $_pid)...\"
22 while kill -0 \"\$_pid\"; do
23 sleep 1
24 done
25fi
26exit \$_result
27")
28
29# make it executable
30# since this is only executed on UNIX, it is safe to call chmod
31exec_program(chmod ARGS ug+x \"${_filename}\" OUTPUT_VARIABLE _dummy )
32
33else (UNIX)
34
35file(TO_NATIVE_PATH "${_ld_library_path}" win_path)
36file(TO_NATIVE_PATH "${_gnupghome}" win_gnupghome)
37
38file(WRITE "${_filename}"
39"
40set PATH=${win_path};$ENV{PATH}
41set GNUPGHOME=${win_gnupghome};$ENV{GNUPGHOME}
42gpg-agent --daemon \"${_executable}\" %*
43")
44
45endif (UNIX)