diff options
author | asn <asn@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2010-10-19 17:43:51 +0000 |
---|---|---|
committer | asn <asn@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2010-10-19 17:43:51 +0000 |
commit | 1755fbe4ed5aa2f11443c0415f49d8d6be32569d (patch) | |
tree | 1c57920e80144380c78d187a4ae85836e7f6b671 /pki/cmake | |
parent | 5966b33a8bf392dcaa2d4bfeacb99729a68ba2ec (diff) | |
download | pki-1755fbe4ed5aa2f11443c0415f49d8d6be32569d.tar.gz pki-1755fbe4ed5aa2f11443c0415f49d8d6be32569d.tar.xz pki-1755fbe4ed5aa2f11443c0415f49d8d6be32569d.zip |
cmake: Added a find module for mozldap.
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@1372 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/cmake')
-rw-r--r-- | pki/cmake/Modules/FindMozLDAP.cmake | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/pki/cmake/Modules/FindMozLDAP.cmake b/pki/cmake/Modules/FindMozLDAP.cmake new file mode 100644 index 000000000..4f728c36b --- /dev/null +++ b/pki/cmake/Modules/FindMozLDAP.cmake @@ -0,0 +1,103 @@ +# - Try to find MozLDAP +# Once done this will define +# +# MOZLDAP_FOUND - system has MozLDAP +# MOZLDAP_INCLUDE_DIRS - the MozLDAP include directory +# MOZLDAP_LIBRARIES - Link these to use MozLDAP +# MOZLDAP_DEFINITIONS - Compiler switches required for using MozLDAP +# +# Copyright (c) 2010 Andreas Schneider <asn@redhat.com> +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + + +if (MOZLDAP_LIBRARIES AND MOZLDAP_INCLUDE_DIRS) + # in cache already + set(MOZLDAP_FOUND TRUE) +else (MOZLDAP_LIBRARIES AND MOZLDAP_INCLUDE_DIRS) + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + pkg_check_modules(_MOZLDAP mozldap) + endif (PKG_CONFIG_FOUND) + + find_path(MOZLDAP_INCLUDE_DIR + NAMES + ldap.h + PATHS + ${_MOZLDAP_INCLUDEDIR} + /usr/include + /usr/local/include + /opt/local/include + /sw/include + PATH_SUFFIXES + mozldap + ) + + find_library(SSLDAP60_LIBRARY + NAMES + ssldap60 + PATHS + ${_MOZLDAP_LIBDIR} + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + ) + + find_library(PRLDAP60_LIBRARY + NAMES + prldap60 + PATHS + ${_MOZLDAP_LIBDIR} + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + ) + + find_library(LDAP60_LIBRARY + NAMES + ldap60 + PATHS + ${_MOZLDAP_LIBDIR} + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + ) + + set(MOZLDAP_INCLUDE_DIRS + ${MOZLDAP_INCLUDE_DIR} + ) + + if (SSLDAP60_LIBRARY) + set(MOZLDAP_LIBRARIES + ${MOZLDAP_LIBRARIES} + ${SSLDAP60_LIBRARY} + ) + endif (SSLDAP60_LIBRARY) + + if (PRLDAP60_LIBRARY) + set(MOZLDAP_LIBRARIES + ${MOZLDAP_LIBRARIES} + ${PRLDAP60_LIBRARY} + ) + endif (PRLDAP60_LIBRARY) + + if (LDAP60_LIBRARY) + set(MOZLDAP_LIBRARIES + ${MOZLDAP_LIBRARIES} + ${LDAP60_LIBRARY} + ) + endif (LDAP60_LIBRARY) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(MozLDAP DEFAULT_MSG MOZLDAP_LIBRARIES MOZLDAP_INCLUDE_DIRS) + + # show the MOZLDAP_INCLUDE_DIRS and MOZLDAP_LIBRARIES variables only in the advanced view + mark_as_advanced(MOZLDAP_INCLUDE_DIRS MOZLDAP_LIBRARIES) + +endif (MOZLDAP_LIBRARIES AND MOZLDAP_INCLUDE_DIRS) |