aboutsummaryrefslogtreecommitdiff
path: root/cmake/FindGPGME.cmake
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-04-15 18:01:51 +0200
committerMarvin W <git@larma.de>2017-04-15 18:03:24 +0200
commita0b2a66ef0e71918b27207889519f3dc270ebb43 (patch)
tree19e00017e8ccfda89925e54caae4dec0505d1e60 /cmake/FindGPGME.cmake
parente3b69538bacd14283374f5e7619db610cafd81d6 (diff)
downloaddino-a0b2a66ef0e71918b27207889519f3dc270ebb43.tar.gz
dino-a0b2a66ef0e71918b27207889519f3dc270ebb43.zip
Replace OpenSSL with GCrypt
Diffstat (limited to 'cmake/FindGPGME.cmake')
-rw-r--r--cmake/FindGPGME.cmake27
1 files changed, 23 insertions, 4 deletions
diff --git a/cmake/FindGPGME.cmake b/cmake/FindGPGME.cmake
index 02fa7593..1bfefb95 100644
--- a/cmake/FindGPGME.cmake
+++ b/cmake/FindGPGME.cmake
@@ -2,23 +2,42 @@ set(GPGME_PKG_CONFIG_NAME gpgme)
find_program(GPGME_CONFIG_EXECUTABLE NAMES gpgme-config)
mark_as_advanced(GPGME_CONFIG_EXECUTABLE)
+find_program(GPGME_SH_EXECUTABLE NAMES sh)
+mark_as_advanced(GPGME_SH_EXECUTABLE)
+
if(GPGME_CONFIG_EXECUTABLE)
- execute_process(COMMAND ${GPGME_CONFIG_EXECUTABLE} --version
+ macro(gpgme_config_fail errcode)
+ if(${errcode})
+ message(FATAL_ERROR "Error invoking gpgme-config: ${errcode}")
+ endif(${errcode})
+ endmacro(gpgme_config_fail)
+ file(TO_NATIVE_PATH "${GPGME_CONFIG_EXECUTABLE}" GPGME_CONFIG_EXECUTABLE)
+ file(TO_NATIVE_PATH "${GPGME_SH_EXECUTABLE}" GPGME_SH_EXECUTABLE)
+
+ execute_process(COMMAND "${GPGME_SH_EXECUTABLE}" "${GPGME_CONFIG_EXECUTABLE}" --version
OUTPUT_VARIABLE GPGME_VERSION
+ RESULT_VARIABLE ERRCODE
OUTPUT_STRIP_TRAILING_WHITESPACE)
+ gpgme_config_fail(${ERRCODE})
- execute_process(COMMAND ${GPGME_CONFIG_EXECUTABLE} --api-version
+ execute_process(COMMAND "${GPGME_SH_EXECUTABLE}" "${GPGME_CONFIG_EXECUTABLE}" --api-version
OUTPUT_VARIABLE GPGME_API_VERSION
+ RESULT_VARIABLE ERRCODE
OUTPUT_STRIP_TRAILING_WHITESPACE)
+ gpgme_config_fail(${ERRCODE})
- execute_process(COMMAND ${GPGME_CONFIG_EXECUTABLE} --cflags
+ execute_process(COMMAND "${GPGME_SH_EXECUTABLE}" "${GPGME_CONFIG_EXECUTABLE}" --cflags
OUTPUT_VARIABLE GPGME_CFLAGS
+ RESULT_VARIABLE ERRCODE
OUTPUT_STRIP_TRAILING_WHITESPACE)
+ gpgme_config_fail(${ERRCODE})
- execute_process(COMMAND ${GPGME_CONFIG_EXECUTABLE} --libs
+ execute_process(COMMAND "${GPGME_SH_EXECUTABLE}" "${GPGME_CONFIG_EXECUTABLE}" --libs
OUTPUT_VARIABLE GPGME_LDFLAGS
+ RESULT_VARIABLE ERRCODE
OUTPUT_STRIP_TRAILING_WHITESPACE)
+ gpgme_config_fail(${ERRCODE})
string(REGEX REPLACE "^(.* |)-l([^ ]*gpgme[^ ]*)( .*|)$" "\\2" GPGME_LIBRARY "${GPGME_LDFLAGS}")
string(REGEX REPLACE "^(.* |)-L([^ ]*)( .*|)$" "\\2" GPGME_LIBRARY_DIRS "${GPGME_LDFLAGS}")