diff options
| author | mharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2010-12-17 20:36:10 +0000 |
|---|---|---|
| committer | mharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2010-12-17 20:36:10 +0000 |
| commit | 26f4346b6bcbb6efdea35452db508a27664abe4c (patch) | |
| tree | e46f0102d926f76efe2b0c35a2241c184fc72a59 | |
| parent | c8b45d7727a4944c7129d12282ae5321c71f6707 (diff) | |
Bugzilla Bug #643206 - New CMake based build system for Dogtag
generated via 'generate_findpackage_file' ruby script;
added notation about this to generated file
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@1644 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
| -rw-r--r-- | pki/cmake/Modules/FindLdap.cmake | 124 |
1 files changed, 80 insertions, 44 deletions
diff --git a/pki/cmake/Modules/FindLdap.cmake b/pki/cmake/Modules/FindLdap.cmake index 93634525a..be4693bd7 100644 --- a/pki/cmake/Modules/FindLdap.cmake +++ b/pki/cmake/Modules/FindLdap.cmake @@ -1,46 +1,82 @@ -# - Try to find the LDAP client libraries +# - Try to find Ldap # Once done this will define # -# LDAP_FOUND - system has libldap -# LDAP_INCLUDE_DIR - the ldap include directory -# LDAP_LIBRARIES - libldap + liblber (if found) library -# LBER_LIBRARIES - liblber library - -if(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES) - # Already in cache, be silent - set(Ldap_FIND_QUIETLY TRUE) -endif(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES) - - -FIND_PATH(LDAP_INCLUDE_DIR ldap.h) - -if(APPLE) - FIND_LIBRARY(LDAP_LIBRARIES NAMES LDAP - PATHS - /System/Library/Frameworks - /Library/Frameworks - ) -else(APPLE) - FIND_LIBRARY(LDAP_LIBRARIES NAMES ldap) - - FIND_LIBRARY(LBER_LIBRARIES NAMES lber) -endif(APPLE) - -if(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES) - set(LDAP_FOUND TRUE) - if(LBER_LIBRARIES) - set(LDAP_LIBRARIES ${LDAP_LIBRARIES} ${LBER_LIBRARIES}) - endif(LBER_LIBRARIES) -endif(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES) - -if(LDAP_FOUND) - if(NOT Ldap_FIND_QUIETLY) - message(STATUS "Found ldap: ${LDAP_LIBRARIES}") - endif(NOT Ldap_FIND_QUIETLY) -else(LDAP_FOUND) - if (Ldap_FIND_REQUIRED) - message(FATAL_ERROR "Could NOT find ldap") - endif (Ldap_FIND_REQUIRED) -endif(LDAP_FOUND) - -MARK_AS_ADVANCED(LDAP_INCLUDE_DIR LDAP_LIBRARIES LBER_LIBRARIES) +# LDAP_FOUND - system has Ldap +# LDAP_INCLUDE_DIRS - the Ldap include directory +# LDAP_LIBRARIES - Link these to use Ldap +# LDAP_DEFINITIONS - Compiler switches required for using Ldap +# +# Copyright (c) 2010 Matthew Harmsen <mharmsen@redhat.com> +# +# NOTE: This file was generated via 'generate_findpackage_file' +# +# Copyright (c) 2006 Alexander Neundorf <neundorf@kde.org> +# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org> +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + + +if (LDAP_LIBRARIES AND LDAP_INCLUDE_DIRS) + # in cache already + set(LDAP_FOUND TRUE) +else (LDAP_LIBRARIES AND LDAP_INCLUDE_DIRS) + + find_path(LDAP_INCLUDE_DIR + NAMES + ldap.h lber.h + PATHS + /usr/include + /usr/local/include + /opt/local/include + /sw/include + ) + + find_library(LDAP_LIBRARY + NAMES + ldap + PATHS + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + ) + + find_library(LBER_LIBRARY + NAMES + lber + PATHS + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + ) + + set(LDAP_INCLUDE_DIRS + ${LDAP_INCLUDE_DIR} + ) + + if (LDAP_LIBRARY) + set(LDAP_LIBRARIES + ${LDAP_LIBRARIES} + ${LDAP_LIBRARY} + ) + endif (LDAP_LIBRARY) + + if (LBER_LIBRARY) + set(LDAP_LIBRARIES + ${LDAP_LIBRARIES} + ${LBER_LIBRARY} + ) + endif (LBER_LIBRARY) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Ldap DEFAULT_MSG LDAP_LIBRARIES LDAP_INCLUDE_DIRS) + + # show the LDAP_INCLUDE_DIRS and LDAP_LIBRARIES variables only in the advanced view + mark_as_advanced(LDAP_INCLUDE_DIRS LDAP_LIBRARIES) + +endif (LDAP_LIBRARIES AND LDAP_INCLUDE_DIRS) + |
