aboutsummaryrefslogtreecommitdiff
path: root/cmake/FindGCrypt.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/FindGCrypt.cmake')
-rw-r--r--cmake/FindGCrypt.cmake10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmake/FindGCrypt.cmake b/cmake/FindGCrypt.cmake
index 7c6b2173..250f90c9 100644
--- a/cmake/FindGCrypt.cmake
+++ b/cmake/FindGCrypt.cmake
@@ -39,10 +39,12 @@ if(GCrypt_CONFIG_EXECUTABLE)
OUTPUT_STRIP_TRAILING_WHITESPACE)
gcrypt_config_fail(${ERRCODE})
- string(REGEX REPLACE "^(.* |)-l([^ ]*gcrypt[^ ]*)( .*|)$" "\\2" GCrypt_LIBRARY "${GCrypt_LDFLAGS}")
+ string(REGEX REPLACE "^(.* |)-l([^ ]*gcrypt[^ ]*)( .*|)$" "\\2" GCrypt_LIBRARY_NAME "${GCrypt_LDFLAGS}")
string(REGEX REPLACE "^(.* |)-L([^ ]*)( .*|)$" "\\2" GCrypt_LIBRARY_DIRS "${GCrypt_LDFLAGS}")
- find_library(LIB_NAME_GCrypt ${GCrypt_LIBRARY} HINTS ${GCrypt_LIBRARY_DIRS})
- set(GCrypt_LIBRARY ${LIB_NAME_GCrypt})
+ find_library(GCrypt_LIBRARY ${GCrypt_LIBRARY_NAME} HINTS ${GCrypt_LIBRARY_DIRS})
+ mark_as_advanced(GCrypt_LIBRARY)
+ unset(GCrypt_LIBRARY_NAME)
+ unset(GCrypt_LIBRARY_DIRS)
if(NOT TARGET gcrypt)
add_library(gcrypt INTERFACE IMPORTED)
@@ -54,4 +56,4 @@ endif(GCrypt_CONFIG_EXECUTABLE)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GCrypt
REQUIRED_VARS GCrypt_LIBRARY
- VERSION_VAR GCrypt_VERSION) \ No newline at end of file
+ VERSION_VAR GCrypt_VERSION)