summaryrefslogtreecommitdiffstats
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
parent659a4b38496b1720b0f90872fed364ab00cb63db (diff)
downloadkube-117ed93d37fbde90f5decb7292ed0c42e5e39220.tar.gz
kube-117ed93d37fbde90f5decb7292ed0c42e5e39220.zip
One copy of the gpg helpers is enough.
-rw-r--r--cmake/modules/add_gpg_crypto_test.cmake (renamed from framework/src/domain/mime/mimetreeparser/autotests/kdepim_add_gpg_crypto_test.cmake)4
-rw-r--r--cmake/modules/generate_crypto_test_wrapper.cmake (renamed from framework/src/domain/mime/mimetreeparser/autotests/kdepim_generate_crypto_test_wrapper.cmake)0
-rw-r--r--framework/src/domain/mime/mimetreeparser/autotests/CMakeLists.txt2
-rw-r--r--framework/src/domain/mime/mimetreeparser/tests/CMakeLists.txt2
-rw-r--r--framework/src/domain/mime/mimetreeparser/tests/kdepim_add_gpg_crypto_test.cmake61
-rw-r--r--framework/src/domain/mime/mimetreeparser/tests/kdepim_generate_crypto_test_wrapper.cmake45
6 files changed, 4 insertions, 110 deletions
diff --git a/framework/src/domain/mime/mimetreeparser/autotests/kdepim_add_gpg_crypto_test.cmake b/cmake/modules/add_gpg_crypto_test.cmake
index 841cf6ff..c3df76c9 100644
--- a/framework/src/domain/mime/mimetreeparser/autotests/kdepim_add_gpg_crypto_test.cmake
+++ b/cmake/modules/add_gpg_crypto_test.cmake
@@ -33,7 +33,7 @@ macro (ADD_GPG_CRYPTO_TEST _target _testname)
33 -D_filename=${_executable}.shell -D_library_path_variable=${_library_path_variable} 33 -D_filename=${_executable}.shell -D_library_path_variable=${_library_path_variable}
34 -D_ld_library_path="${_ld_library_path}" -D_executable=$<TARGET_FILE:${_target}> 34 -D_ld_library_path="${_ld_library_path}" -D_executable=$<TARGET_FILE:${_target}>
35 -D_gnupghome="${GNUPGHOME}" 35 -D_gnupghome="${GNUPGHOME}"
36 -P ${CMAKE_SOURCE_DIR}/${MIMETREEPARSERRELPATH}/tests/kdepim_generate_crypto_test_wrapper.cmake 36 -P ${CMAKE_SOURCE_DIR}/cmake/modules/generate_crypto_test_wrapper.cmake
37 ) 37 )
38 38
39 set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${_executable}.shell" ) 39 set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${_executable}.shell" )
@@ -51,7 +51,7 @@ macro (ADD_GPG_CRYPTO_TEST _target _testname)
51 -D_filename="${_executable}.bat" 51 -D_filename="${_executable}.bat"
52 -D_ld_library_path="${_ld_library_path}" -D_executable="${_executable}" 52 -D_ld_library_path="${_ld_library_path}" -D_executable="${_executable}"
53 -D_gnupghome="${GNUPGHOME}" 53 -D_gnupghome="${GNUPGHOME}"
54 -P ${CMAKE_SOURCE_DIR}/${MIMETREEPARSERRELPATH}/tests/kdepim_generate_crypto_test_wrapper.cmake 54 -P ${CMAKE_SOURCE_DIR}/cmake/modules/generate_crypto_test_wrapper.cmake
55 ) 55 )
56 56
57 add_test(NAME ${_testname} COMMAND ${_executable}.bat) 57 add_test(NAME ${_testname} COMMAND ${_executable}.bat)
diff --git a/framework/src/domain/mime/mimetreeparser/autotests/kdepim_generate_crypto_test_wrapper.cmake b/cmake/modules/generate_crypto_test_wrapper.cmake
index e1412f37..e1412f37 100644
--- a/framework/src/domain/mime/mimetreeparser/autotests/kdepim_generate_crypto_test_wrapper.cmake
+++ b/cmake/modules/generate_crypto_test_wrapper.cmake
diff --git a/framework/src/domain/mime/mimetreeparser/autotests/CMakeLists.txt b/framework/src/domain/mime/mimetreeparser/autotests/CMakeLists.txt
index 9b26d885..f0b1f5f5 100644
--- a/framework/src/domain/mime/mimetreeparser/autotests/CMakeLists.txt
+++ b/framework/src/domain/mime/mimetreeparser/autotests/CMakeLists.txt
@@ -7,7 +7,7 @@ set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
7add_definitions( -DMAIL_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/../../testdata" ) 7add_definitions( -DMAIL_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/../../testdata" )
8 8
9include(ECMAddTests) 9include(ECMAddTests)
10include(${CMAKE_CURRENT_SOURCE_DIR}/kdepim_add_gpg_crypto_test.cmake) 10include(${CMAKE_SOURCE_DIR}/cmake/modules/add_gpg_crypto_test.cmake)
11 11
12# convenience macro to add qtest unit tests 12# convenience macro to add qtest unit tests
13macro(add_mimetreeparser_unittest _source) 13macro(add_mimetreeparser_unittest _source)
diff --git a/framework/src/domain/mime/mimetreeparser/tests/CMakeLists.txt b/framework/src/domain/mime/mimetreeparser/tests/CMakeLists.txt
index 015efc32..aa58cc71 100644
--- a/framework/src/domain/mime/mimetreeparser/tests/CMakeLists.txt
+++ b/framework/src/domain/mime/mimetreeparser/tests/CMakeLists.txt
@@ -1,6 +1,6 @@
1add_subdirectory(gnupg_home) 1add_subdirectory(gnupg_home)
2add_definitions( -DMAIL_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/../../testdata" ) 2add_definitions( -DMAIL_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/../../testdata" )
3include(${CMAKE_CURRENT_SOURCE_DIR}/kdepim_add_gpg_crypto_test.cmake) 3include(${CMAKE_SOURCE_DIR}/cmake/modules/add_gpg_crypto_test.cmake)
4include_directories( 4include_directories(
5 ${CMAKE_CURRENT_BINARY_DIR} 5 ${CMAKE_CURRENT_BINARY_DIR}
6 ${CMAKE_CURRENT_SOURCE_DIR}/.. 6 ${CMAKE_CURRENT_SOURCE_DIR}/..
diff --git a/framework/src/domain/mime/mimetreeparser/tests/kdepim_add_gpg_crypto_test.cmake b/framework/src/domain/mime/mimetreeparser/tests/kdepim_add_gpg_crypto_test.cmake
deleted file mode 100644
index 841cf6ff..00000000
--- a/framework/src/domain/mime/mimetreeparser/tests/kdepim_add_gpg_crypto_test.cmake
+++ /dev/null
@@ -1,61 +0,0 @@
1# Copyright (c) 2013 Sandro Knauß <mail@sandroknauss.de>
2#
3# Redistribution and use is allowed according to the terms of the BSD license.
4# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
5
6set( MIMETREEPARSERRELPATH framework/src/domain/mime/mimetreeparser)
7set( GNUPGHOME ${CMAKE_BINARY_DIR}/${MIMETREEPARSERRELPATH}/tests/gnupg_home )
8add_definitions( -DGNUPGHOME="${GNUPGHOME}" )
9
10macro (ADD_GPG_CRYPTO_TEST _target _testname)
11 if (UNIX)
12 if (APPLE)
13 set(_library_path_variable "DYLD_LIBRARY_PATH")
14 elseif (CYGWIN)
15 set(_library_path_variable "PATH")
16 else (APPLE)
17 set(_library_path_variable "LD_LIBRARY_PATH")
18 endif (APPLE)
19
20 if (APPLE)
21 # DYLD_LIBRARY_PATH does not work like LD_LIBRARY_PATH
22 # OSX already has the RPATH in libraries and executables, putting runtime directories in
23 # DYLD_LIBRARY_PATH actually breaks things
24 set(_ld_library_path "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/")
25 else (APPLE)
26 set(_ld_library_path "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/:${LIB_INSTALL_DIR}:${QT_LIBRARY_DIR}")
27 endif (APPLE)
28 set(_executable "$<TARGET_FILE:${_target}>")
29
30 # use add_custom_target() to have the sh-wrapper generated during build time instead of cmake time
31 add_custom_command(TARGET ${_target} POST_BUILD
32 COMMAND ${CMAKE_COMMAND}
33 -D_filename=${_executable}.shell -D_library_path_variable=${_library_path_variable}
34 -D_ld_library_path="${_ld_library_path}" -D_executable=$<TARGET_FILE:${_target}>
35 -D_gnupghome="${GNUPGHOME}"
36 -P ${CMAKE_SOURCE_DIR}/${MIMETREEPARSERRELPATH}/tests/kdepim_generate_crypto_test_wrapper.cmake
37 )
38
39 set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${_executable}.shell" )
40 add_test(NAME ${_testname} COMMAND ${_executable}.shell)
41
42 else (UNIX)
43 # under windows, set the property WRAPPER_SCRIPT just to the name of the executable
44 # maybe later this will change to a generated batch file (for setting the PATH so that the Qt libs are found)
45 set(_ld_library_path "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}\;${LIB_INSTALL_DIR}\;${QT_LIBRARY_DIR}")
46 set(_executable "$<TARGET_FILE:${_target}>")
47
48 # use add_custom_target() to have the batch-file-wrapper generated during build time instead of cmake time
49 add_custom_command(TARGET ${_target} POST_BUILD
50 COMMAND ${CMAKE_COMMAND}
51 -D_filename="${_executable}.bat"
52 -D_ld_library_path="${_ld_library_path}" -D_executable="${_executable}"
53 -D_gnupghome="${GNUPGHOME}"
54 -P ${CMAKE_SOURCE_DIR}/${MIMETREEPARSERRELPATH}/tests/kdepim_generate_crypto_test_wrapper.cmake
55 )
56
57 add_test(NAME ${_testname} COMMAND ${_executable}.bat)
58
59 endif (UNIX)
60endmacro (ADD_GPG_CRYPTO_TEST)
61
diff --git a/framework/src/domain/mime/mimetreeparser/tests/kdepim_generate_crypto_test_wrapper.cmake b/framework/src/domain/mime/mimetreeparser/tests/kdepim_generate_crypto_test_wrapper.cmake
deleted file mode 100644
index e1412f37..00000000
--- a/framework/src/domain/mime/mimetreeparser/tests/kdepim_generate_crypto_test_wrapper.cmake
+++ /dev/null
@@ -1,45 +0,0 @@
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)