qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject [3/4] qpid-proton git commit: PROTON-334: Tidied up Cyrus SASL detection in CMake - The CMake output messages now make some sense - Tidied up a few other little CMake annoyances
Date Tue, 21 Apr 2015 07:10:53 GMT
PROTON-334: Tidied up Cyrus SASL detection in CMake
- The CMake output messages now make some sense
- Tidied up a few other little CMake annoyances


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/7cf0abab
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/7cf0abab
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/7cf0abab

Branch: refs/heads/master
Commit: 7cf0ababd4e59a54a1fb7cb7b535f4a75a2fcd9c
Parents: 4a09c6a
Author: Andrew Stitcher <astitcher@apache.org>
Authored: Tue Apr 21 02:57:57 2015 -0400
Committer: Andrew Stitcher <astitcher@apache.org>
Committed: Tue Apr 21 02:59:53 2015 -0400

----------------------------------------------------------------------
 proton-c/CMakeLists.txt          | 64 ++++++++++++++++++-----------------
 proton-c/bindings/CMakeLists.txt |  1 +
 2 files changed, 34 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7cf0abab/proton-c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt
index 1b3f6d3..b97bee7 100644
--- a/proton-c/CMakeLists.txt
+++ b/proton-c/CMakeLists.txt
@@ -44,8 +44,16 @@ endif()
 
 # Set the default SSL/TLS implementation
 find_package(OpenSSL)
-
 find_package (PythonInterp REQUIRED)
+find_package(SWIG)
+# FindSwig.cmake "forgets" make its outputs advanced like a good citizen
+mark_as_advanced(SWIG_DIR SWIG_EXECUTABLE SWIG_VERSION)
+
+# 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)
 
 if(PN_WINAPI)
   set(ssl_impl schannel)
@@ -58,7 +66,14 @@ if (OPENSSL_FOUND)
   set(ssl_impl openssl)
 endif (OPENSSL_FOUND)
 set(SSL_IMPL ${ssl_impl} CACHE STRING "Library to use for SSL/TLS support. Valid values:
${ssl_providers}")
-mark_as_advanced (SSL_IMPL)
+
+set(sasl_providers cyrus none)
+if (CYRUSSASL_FOUND)
+  set (sasl_impl cyrus)
+else ()
+  set (sasl_impl none)
+endif ()
+set(SASL_IMPL ${sasl_impl} CACHE STRING "Library to use for SSL/TLS support. Valid values:
${sasl_providers}")
 
 configure_file (
   "${CMAKE_CURRENT_SOURCE_DIR}/include/proton/version.h.in"
@@ -97,19 +112,26 @@ else(PN_WINAPI)
   set (pn_selector_impl src/posix/selector.c)
 endif(PN_WINAPI)
 
+# Link in SASL if present
+if (SASL_IMPL STREQUAL cyrus)
+  set(pn_sasl_impl src/sasl/sasl.c src/sasl/cyrus_sasl.c)
+  include_directories (${CYRUS_SASL_INCLUDE_DIR})
+  set(SASL_LIB ${CYRUS_SASL_LIBRARY})
+elseif (SASL_IMPL STREQUAL none)
+  set(pn_sasl_impl src/sasl/sasl.c src/sasl/none_sasl.c)
+endif ()
+
 # Link in openssl if present
 if (SSL_IMPL STREQUAL openssl)
   set (pn_ssl_impl src/ssl/openssl.c)
-  include_directories ("${OPENSSL_INCLUDE_DIR}")
+  include_directories (${OPENSSL_INCLUDE_DIR})
   set (SSL_LIB ${OPENSSL_LIBRARIES})
-else (SSL_IMPL STREQUAL openssl)
-  if (SSL_IMPL STREQUAL schannel)
-    set (pn_ssl_impl src/windows/schannel.c)
-    set (SSL_LIB Crypt32.lib Secur32.lib)
-  else (SSL_IMPL STREQUAL schannel)
-    set (pn_ssl_impl src/ssl/ssl_stub.c)
-  endif (SSL_IMPL STREQUAL schannel)
-endif (SSL_IMPL STREQUAL openssl)
+elseif (SSL_IMPL STREQUAL schannel)
+  set (pn_ssl_impl src/windows/schannel.c)
+  set (SSL_LIB Crypt32.lib Secur32.lib)
+else ()
+  set (pn_ssl_impl src/ssl/ssl_stub.c)
+endif ()
 
 # First check whether we get clock_gettime without any special library linked
 CHECK_SYMBOL_EXISTS(clock_gettime "time.h" CLOCK_GETTIME_IN_LIBC)
@@ -130,25 +152,6 @@ else (CLOCK_GETTIME_IN_LIBC)
   endif (CLOCK_GETTIME_IN_RT)
 endif (CLOCK_GETTIME_IN_LIBC)
 
-# 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(sasl_providers cyrus none)
-if (SASL_FOUND)
-  set (sasl_impl cyrus)
-else (SASL_FOUND)
-  set (sasl_impl none)
-endif (SASL_FOUND)
-set(SASL_IMPL ${sasl_impl} CACHE STRING "Library to use for SSL/TLS support. Valid values:
${sasl_providers}")
-
-if (SASL_IMPL STREQUAL cyrus)
-  set(pn_sasl_impl src/sasl/sasl.c src/sasl/cyrus_sasl.c)
-  set(SASL_LIB "sasl2")
-elseif (SASL_IMPL STREQUAL none)
-  set(pn_sasl_impl src/sasl/sasl.c src/sasl/none_sasl.c)
-endif ()
-
 CHECK_SYMBOL_EXISTS(uuid_generate "uuid/uuid.h" UUID_GENERATE_IN_LIBC)
 if (UUID_GENERATE_IN_LIBC)
   list(APPEND PLATFORM_DEFINITIONS "USE_UUID_GENERATE")
@@ -276,7 +279,6 @@ macro (pn_absolute_install_dir NAME VALUE PREFIX)
   get_filename_component(${NAME} ${${NAME}} ABSOLUTE)
 endmacro()
 
-find_package(SWIG)
 if (SWIG_FOUND)
   add_subdirectory(bindings)
 endif (SWIG_FOUND)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7cf0abab/proton-c/bindings/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/bindings/CMakeLists.txt b/proton-c/bindings/CMakeLists.txt
index 06609e2..657e71c 100644
--- a/proton-c/bindings/CMakeLists.txt
+++ b/proton-c/bindings/CMakeLists.txt
@@ -48,6 +48,7 @@ endif (PYTHONLIBS_FOUND)
 
 # Prerequisites for Ruby:
 find_program(GEM_EXE "gem")
+mark_as_advanced(GEM_EXE)
 macro(CheckRubyGem varname gemname)
   execute_process(COMMAND ${GEM_EXE} list --local ${gemname}
     OUTPUT_VARIABLE CHECK_OUTPUT)


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


Mime
View raw message