qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject [2/2] qpid-cpp git commit: QPID-7389: Fix Cyrus SASL lib detection so it works more portably
Date Thu, 11 Aug 2016 20:21:27 GMT
QPID-7389: Fix Cyrus SASL lib detection so it works more portably


Project: http://git-wip-us.apache.org/repos/asf/qpid-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-cpp/commit/69ff9551
Tree: http://git-wip-us.apache.org/repos/asf/qpid-cpp/tree/69ff9551
Diff: http://git-wip-us.apache.org/repos/asf/qpid-cpp/diff/69ff9551

Branch: refs/heads/master
Commit: 69ff9551ca5abd62a54f55ce28a8d2c833498e4c
Parents: ef7c46a
Author: Andrew Stitcher <astitcher@apache.org>
Authored: Wed Aug 10 13:58:16 2016 -0400
Committer: Andrew Stitcher <astitcher@apache.org>
Committed: Thu Aug 11 16:18:32 2016 -0400

----------------------------------------------------------------------
 src/CMakeLists.txt | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/69ff9551/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ef203e5..a38e639 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -43,14 +43,16 @@ find_program(VALGRIND_EXECUTABLE valgrind DOC "Location of the valgrind
program"
 mark_as_advanced(VALGRIND_EXECUTABLE)
 find_package_handle_standard_args(VALGRIND DEFAULT_MSG VALGRIND_EXECUTABLE)
 
-find_program(SASLPASSWD2_EXECUTABLE saslpasswd2 DOC "Location of the saslpasswd2 program")
+# See if Cyrus SASL is available
+find_library(CYRUS_SASL_LIBRARY sasl2)
+find_path(CYRUS_SASL_INCLUDE_DIR sasl/sasl.h PATH_SUFFIXES include)
+find_package_handle_standard_args(CyrusSASL DEFAULT_MSG CYRUS_SASL_LIBRARY CYRUS_SASL_INCLUDE_DIR)
+mark_as_advanced(CYRUS_SASL_LIBRARY CYRUS_SASL_INCLUDE_DIR)
+
+# Find saslpasswd2 executable to generate test config
+find_program(SASLPASSWD2_EXECUTABLE saslpasswd2 DOC "Program used to make SASL user db for
testing")
 mark_as_advanced(SASLPASSWD2_EXECUTABLE)
 
-# See if Cyrus SASL is desired and available
-CHECK_LIBRARY_EXISTS (sasl2 sasl_checkpass "" FOUND_SASL_LIB)
-CHECK_INCLUDE_FILES (sasl/sasl.h FOUND_SASL_H)
-find_package_handle_standard_args(SASL DEFAULT_MSG FOUND_SASL_LIB FOUND_SASL_H)
-
 #set (CMAKE_VERBOSE_MAKEFILE ON)  # for debugging
 
 if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows AND BUILD_TESTING)
@@ -359,17 +361,18 @@ endif (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
 
 check_size_t_distinct (QPID_SIZE_T_DISTINCT)
 
-option(BUILD_SASL "Build with Cyrus SASL support" ${SASL_FOUND})
+option(BUILD_SASL "Build with Cyrus SASL support" ${CyrusSASL_FOUND})
 if (BUILD_SASL)
-  if (NOT SASL_FOUND)
-    message(FATAL_ERROR "Cyrus SASL support requested but libsasl2 libraryor headers not
found")
-  endif (NOT SASL_FOUND)
+  if (NOT CyrusSASL_FOUND)
+    message(FATAL_ERROR "Cyrus SASL support requested but libsasl2 library or headers not
found")
+  endif (NOT CyrusSASL_FOUND)
 
   set(qpidcommon_sasl_source
       qpid/sys/cyrus/CyrusSecurityLayer.h
       qpid/sys/cyrus/CyrusSecurityLayer.cpp
      )
-  set(sasl_LIB sasl2)
+  include_directories (${CYRUS_SASL_INCLUDE_DIR})
+  set(sasl_LIB ${CYRUS_SASL_LIBRARY})
   set(HAVE_SASL 1)
 else (BUILD_SASL)
   set(HAVE_SASL 0)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message