aboutsummaryrefslogtreecommitdiff
path: root/cmake/FindGPGME.cmake
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-03-23 17:10:45 +0100
committerMarvin W <git@larma.de>2017-03-23 17:16:08 +0100
commite6f89f8751e6e65d4a36a125cc3fe398098ba504 (patch)
tree54acce89355ee07b05db761d6d0dad8dad4e0f36 /cmake/FindGPGME.cmake
parentef0483765a0fd567f25b1f0af6df04e8973e5624 (diff)
downloaddino-e6f89f8751e6e65d4a36a125cc3fe398098ba504.tar.gz
dino-e6f89f8751e6e65d4a36a125cc3fe398098ba504.zip
New CMake
- add install and uninstall targets - compatibility for systems without pkg-config
Diffstat (limited to 'cmake/FindGPGME.cmake')
-rw-r--r--cmake/FindGPGME.cmake17
1 files changed, 14 insertions, 3 deletions
diff --git a/cmake/FindGPGME.cmake b/cmake/FindGPGME.cmake
index fd096363..90f734fe 100644
--- a/cmake/FindGPGME.cmake
+++ b/cmake/FindGPGME.cmake
@@ -1,4 +1,4 @@
-# TODO: Windows related stuff
+set(GPGME_PKG_CONFIG_NAME gpgme)
find_program(GPGME_CONFIG_EXECUTABLE NAMES gpgme-config)
mark_as_advanced(GPGME_CONFIG_EXECUTABLE)
@@ -17,11 +17,22 @@ if(GPGME_CONFIG_EXECUTABLE)
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${GPGME_CONFIG_EXECUTABLE} --libs
- OUTPUT_VARIABLE GPGME_LIBRARIES
+ OUTPUT_VARIABLE GPGME_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ string(REGEX REPLACE "^(.* |)-l([^ ]*)$( .*|)" "\\2" GPGME_LIBRARY "${GPGME_LDFLAGS}")
+ string(REGEX REPLACE "^(.* |)-L([^ ]*)$( .*|)" "\\2" GPGME_LIBRARY_DIRS "${GPGME_LDFLAGS}")
+ find_library(LIB_NAME_GPGME ${GPGME_LIBRARY} HINTS ${GPGME_LIBRARY_DIRS})
+ set(GPGME_LIBRARY ${LIB_NAME_GPGME})
+
+ if(NOT TARGET gpgme)
+ add_library(gpgme SHARED IMPORTED)
+ set_property(TARGET gpgme PROPERTY IMPORTED_LOCATION "${GPGME_LIBRARY}")
+ set_property(TARGET gpgme PROPERTY INTERFACE_COMPILE_OPTIONS "${GPGME_CFLAGS}")
+ endif(NOT TARGET gpgme)
endif(GPGME_CONFIG_EXECUTABLE)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GPGME
- REQUIRED_VARS GPGME_CONFIG_EXECUTABLE
+ REQUIRED_VARS GPGME_LIBRARY
VERSION_VAR GPGME_VERSION) \ No newline at end of file