summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Giboudeaux <[email protected]>2017-11-13 18:36:10 +0100
committerChristophe Giboudeaux <[email protected]>2017-11-13 18:58:12 +0100
commit13cbb881d9288f3b6c60715c563cf44cb2767fba (patch)
tree73a4ecc173fd265f0a44a16f47c8118ac4e8f658
parent504b0e6846c29b700e24e6470ad80720b2781263 (diff)
Use the same FindSasl2.cmake as kldap.
-rw-r--r--cmake/COPYING-CMAKE-SCRIPTS22
-rw-r--r--cmake/FindSasl2.cmake84
2 files changed, 72 insertions, 34 deletions
diff --git a/cmake/COPYING-CMAKE-SCRIPTS b/cmake/COPYING-CMAKE-SCRIPTS
deleted file mode 100644
index 4b41776..0000000
--- a/cmake/COPYING-CMAKE-SCRIPTS
+++ /dev/null
@@ -1,22 +0,0 @@
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the copyright
- notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-3. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/cmake/FindSasl2.cmake b/cmake/FindSasl2.cmake
index ec3bb81..47b13a5 100644
--- a/cmake/FindSasl2.cmake
+++ b/cmake/FindSasl2.cmake
@@ -1,22 +1,69 @@
+#.rst:
+# FindSasl2
+# ---------
#
-# - Try to find the sasl2 directory library
-# Once done this will define
+# Try to find the SASL2 library.
#
-# Sasl2_FOUND - system has SASL2
-# Sasl2_INCLUDE_DIRS - the SASL2 include directory
-# Sasl2_LIBRARIES - The libraries needed to use SASL2
-
-# Copyright (c) 2006, 2007 Laurent Montel, <[email protected]>
+# This will define the following variables:
+#
+# ``Sasl2_FOUND``
+# System has SASL2.
+#
+# ``Sasl2_VERSION``
+# The version of SASL2.
+#
+# ``Sasl2_INCLUDE_DIRS``
+# This should be passed to target_include_directories() if
+# the target is not used for linking.
+#
+# ``Sasl2_LIBRARIES``
+# The SASL2 library.
+# This can be passed to target_link_libraries() instead of
+# the ``Sasl2::Sasl2`` target
+#
+# If ``Sasl2_FOUND`` is TRUE, the following imported target
+# will be available:
+#
+# ``Sasl2::Sasl2``
+# The SASL2 library
+#
+# Since pre-5.0.0.
+#
+# Imported target since 5.1.41
#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#=============================================================================
+# Copyright 2006, 2007 Laurent Montel <[email protected]>
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#=============================================================================
-# Note: libsasl2.pc doesn't export the include dir.
+# NOTE: libsasl2.pc doesn't export the include dir.
find_package(PkgConfig QUIET)
pkg_check_modules(PC_Sasl2 libsasl2)
-find_path(Sasl2_INCLUDE_DIRS sasl/sasl.h
-)
+find_path(Sasl2_INCLUDE_DIRS NAMES sasl/sasl.h)
# libsasl2 add for windows, because the windows package of cyrus-sasl2
# contains a libsasl2 also for msvc which is not standard conform
@@ -49,5 +96,18 @@ find_package_handle_standard_args(Sasl2
REQUIRED_VARS Sasl2_LIBRARIES Sasl2_INCLUDE_DIRS
VERSION_VAR Sasl2_VERSION
)
+if(Sasl2_FOUND AND NOT TARGET Sasl2::Sasl2)
+ add_library(Sasl2::Sasl2 UNKNOWN IMPORTED)
+ set_target_properties(Sasl2::Sasl2 PROPERTIES
+ IMPORTED_LOCATION "${Sasl2_LIBRARIES}"
+ INTERFACE_INCLUDE_DIRECTORIES "${Sasl2_INCLUDE_DIRS}")
+endif()
mark_as_advanced(Sasl2_LIBRARIES Sasl2_INCLUDE_DIRS Sasl2_VERSION)
+
+include(FeatureSummary)
+set_package_properties(Sasl2 PROPERTIES
+ URL "http://www.cyrussasl.org/"
+ DESCRIPTION "The Cyrus-sasl library."
+)
+