| 1 |
# - Try to find XMLSEC |
| 2 |
# Once done, this will define |
| 3 |
# |
| 4 |
# XMLSEC_FOUND - system has XMLSEC |
| 5 |
# XMLSEC_INCLUDE_DIRS - the XMLSEC include directories |
| 6 |
# XMLSEC_LIBRARIES - link these to use XMLSEC |
| 7 |
# XMLSEC_DEFINITIONS - definitions to be added to compiler definitions |
| 8 |
|
| 9 |
include(LibFindMacros) |
| 10 |
|
| 11 |
# Use pkg-config to get hints about paths |
| 12 |
libfind_pkg_check_modules(XMLSEC_PKGCONF xmlsec1) |
| 13 |
|
| 14 |
# Include dir |
| 15 |
find_path(XMLSEC_INCLUDE_DIR |
| 16 |
NAMES xmlsec/xmlsec.h |
| 17 |
PATHS ${XMLSEC_PKGCONF_INCLUDE_DIRS} |
| 18 |
PATH_SUFFIXES xmlsec1 |
| 19 |
) |
| 20 |
|
| 21 |
# Finally the library itself |
| 22 |
find_library(XMLSEC_LIBRARY |
| 23 |
NAMES libxmlsec1.so libxmlsec1 libxmlsec xmlsec1 xmlsec |
| 24 |
PATHS ${XMLSEC_PKGCONF_LIBRARY_DIRS} |
| 25 |
) |
| 26 |
|
| 27 |
# Use pkg-config to get hints about paths |
| 28 |
libfind_pkg_check_modules(XMLSEC_OPENSSL_PKGCONF xmlsec1-openssl) |
| 29 |
|
| 30 |
# Finally the library itself |
| 31 |
find_library(XMLSEC_OPENSSL_LIBRARY |
| 32 |
NAMES libxmlsec1-openssl.so libxmlsec-openssl xmlsec1-openssl xmlsec-openssl |
| 33 |
PATHS ${XMLSEC_OPENSSL_PKGCONF_LIBRARY_DIRS} |
| 34 |
) |
| 35 |
|
| 36 |
# Set the include dir variables and the libraries and let libfind_process do the rest. |
| 37 |
# NOTE: Singular variables for this library, plural for libraries this this lib depends on. |
| 38 |
set(XMLSEC_PROCESS_INCLUDES XMLSEC_INCLUDE_DIR) |
| 39 |
set(XMLSEC_PROCESS_LIBS XMLSEC_LIBRARY XMLSEC_OPENSSL_LIBRARY) |
| 40 |
libfind_process(XMLSEC) |
| 41 |
|
| 42 |
set(XMLSEC_DEFINITIONS ${XMLSEC_OPENSSL_PKGCONF_CFLAGS_OTHER}) |