-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use find_package_handle_standard_args() and remove unused bits. * rename OPENLDAP_LIBS to OPENLDAP_LIBRARIES, to be consistent with find_package() modules. Signed-off-by: Kefu Chai <[email protected]>
- Loading branch information
Showing
4 changed files
with
13 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,22 @@ | ||
# - Find OpenLDAP C Libraries | ||
# | ||
# OPENLDAP_PREFIX - where to find ldap.h and libraries | ||
# OPENLDAP_FOUND - True if found. | ||
# OPENLDAP_INCLUDE_DIR - Path to the openldap include directory | ||
# OPENLDAP_LIBRARIES - Paths to the ldap and lber libraries | ||
|
||
set(OPENLDAP_LIB_DIR "${OPENLDAP_PREFIX}/lib") | ||
|
||
find_path(OPENLDAP_INCLUDE_DIR ldap.h NO_DEFAULT_PATH PATHS | ||
find_path(OPENLDAP_INCLUDE_DIR ldap.h PATHS | ||
/usr/include | ||
/opt/local/include | ||
/usr/local/include | ||
"${OPENLDAP_PREFIX}/include" | ||
) | ||
|
||
find_library(LIBLDAP NAMES ldap) | ||
find_library(LIBLBER NAMES lber) | ||
/usr/local/include) | ||
|
||
if (OPENLDAP_INCLUDE_DIR AND LIBLDAP AND LIBLBER) | ||
set(OPENLDAP_FOUND TRUE) | ||
else (OPENLDAP_INCLUDE_DIR AND LIBLDAP AND LIBLBER) | ||
set(OPENLDAP_FOUND FALSE) | ||
endif (OPENLDAP_INCLUDE_DIR AND LIBLDAP AND LIBLBER) | ||
find_library(LDAP_LIBRARY ldap) | ||
find_library(LBER_LIBRARY lber) | ||
|
||
if (OPENLDAP_FOUND) | ||
message(STATUS "Found ldap: ${OPENLDAP_INCLUDE_DIR}") | ||
else (OPENLDAP_FOUND) | ||
if (NOT OPENLDAP_INCLUDE_DIR) | ||
message(FATAL_ERROR "Missing required ldap.h (openldap-devel)") | ||
else (NOT OPENLDAP_INCLUDE_DIR) | ||
message (FATAL_ERROR "Missing required LDAP libraries (openldap)") | ||
endif (NOT OPENLDAP_INCLUDE_DIR) | ||
endif (OPENLDAP_FOUND) | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(OpenLdap DEFAULT_MSG | ||
OPENLDAP_INCLUDE_DIR LDAP_LIBRARY LBER_LIBRARY) | ||
|
||
set(OPENLDAP_LIBS ${LIBLDAP} ${LIBLBER}) | ||
set(OPENLDAP_LIBRARIES ${LDAP_LIBRARY} ${LBER_LIBRARY}) | ||
|
||
mark_as_advanced( | ||
OPENLDAP_INCLUDE_DIR OPENLDAP_LIB_DIR OPENLDAP_LIBRARIES | ||
) | ||
OPENLDAP_INCLUDE_DIR LDAP_LIBRARY LBER_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters