You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2009/04/30 19:16:07 UTC

svn commit: r770330 - in /qpid/trunk/qpid/cpp/src: CMakeLists.txt cluster.cmake rdma.cmake ssl.cmake

Author: astitcher
Date: Thu Apr 30 17:16:06 2009
New Revision: 770330

URL: http://svn.apache.org/viewvc?rev=770330&view=rev
Log:
Made cmake config more like the autotools version
- By default if it detects a dependency it will
  build the module that needs it, otherwise it won't
- It can be forced to build modules so that automated
  builds that have required outputs can fail config

Modified:
    qpid/trunk/qpid/cpp/src/CMakeLists.txt
    qpid/trunk/qpid/cpp/src/cluster.cmake
    qpid/trunk/qpid/cpp/src/rdma.cmake
    qpid/trunk/qpid/cpp/src/ssl.cmake

Modified: qpid/trunk/qpid/cpp/src/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/CMakeLists.txt?rev=770330&r1=770329&r2=770330&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/src/CMakeLists.txt Thu Apr 30 17:16:06 2009
@@ -17,6 +17,12 @@
 # under the License.
 #
 
+# Option to require building optional plugins
+foreach (r ${REQUIRE})
+  set(${r}_force ON)
+  message(STATUS "Forcing ${r} to ${${r}_force}")
+endforeach(r)
+
 include(CheckFunctionExists)
 include(CheckIncludeFileCXX)
 include(CheckIncludeFiles)
@@ -159,10 +165,16 @@
 endif (NOT CLOCK_GETTIME_IN_RT)
 
 # See if Cyrus SASL is desired and available
-option(QPID_HAS_SASL "Build with Cyrus SASL support" ON)
-if (QPID_HAS_SASL)
-  CHECK_LIBRARY_EXISTS (sasl2 sasl_checkpass "" HAVE_SASL2)
-  CHECK_INCLUDE_FILES (sasl/sasl.h HAVE_SASL_H)
+CHECK_LIBRARY_EXISTS (sasl2 sasl_checkpass "" HAVE_SASL2)
+CHECK_INCLUDE_FILES (sasl/sasl.h HAVE_SASL_H)
+
+set (sasl_default ${sasl_force})
+if (HAVE_SASL2 AND HAVE_SASL_H)
+  set (sasl_default ON)
+endif (HAVE_SASL2 AND HAVE_SASL_H)
+
+option(BUILD_SASL "Build with Cyrus SASL support" ${sasl_default})
+if (BUILD_SASL)
   if (NOT HAVE_SASL2)
     message(FATAL_ERROR "Cyrus SASL support requested but libsasl2 not found")
   endif (NOT HAVE_SASL2)
@@ -176,21 +188,25 @@
       qpid/sys/cyrus/CyrusSecurityLayer.cpp
      )
   set(qpidcommon_sasl_lib sasl2)
-
-endif (QPID_HAS_SASL)
+endif (BUILD_SASL)
 
 # See if XML Exchange is desired and prerequisites are available
+CHECK_LIBRARY_EXISTS (xerces-c _init "" HAVE_XERCES)
+CHECK_INCLUDE_FILE_CXX (xercesc/framework/MemBufInputSource.hpp HAVE_XERCES_H)
+CHECK_INCLUDE_FILE_CXX (xqilla/xqilla-simple.hpp HAVE_XQILLA_H)
+
+set (xml_default ${xml_force})
 if (CMAKE_SYSTEM_NAME STREQUAL Windows)
-  set (xml_default OFF)
 else (CMAKE_SYSTEM_NAME STREQUAL Windows)
-  set (xml_default ON)
+  if (HAVE_XERCES AND HAVE_XERCES_H)
+    if (HAVE_XQILLA_H)
+      set (xml_default ON)
+    endif (HAVE_XQILLA_H)
+  endif (HAVE_XERCES AND HAVE_XERCES_H)
 endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
 
-option(QPID_HAS_XML "Build with XML Exchange" ${xml_default})
-if (QPID_HAS_XML)
-  CHECK_LIBRARY_EXISTS (xerces-c _init "" HAVE_XERCES)
-  CHECK_INCLUDE_FILE_CXX (xercesc/framework/MemBufInputSource.hpp HAVE_XERCES_H)
-  CHECK_INCLUDE_FILE_CXX (xqilla/xqilla-simple.hpp HAVE_XQILLA_H)
+option(BUILD_XML "Build with XML Exchange" ${xml_default})
+if (BUILD_XML)
   if (NOT HAVE_XERCES)
     message(FATAL_ERROR "XML Exchange support requested but xerces-c library not found")
   endif (NOT HAVE_XERCES)
@@ -209,7 +225,7 @@
   set_target_properties (xml PROPERTIES
                          PREFIX ""
                          LINK_FLAGS -Wl,--no-undefined)
-endif (QPID_HAS_XML)
+endif (BUILD_XML)
 
 # Build the ACL plugin
 set (acl_SOURCES

Modified: qpid/trunk/qpid/cpp/src/cluster.cmake
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/cluster.cmake?rev=770330&r1=770329&r2=770330&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/cluster.cmake (original)
+++ qpid/trunk/qpid/cpp/src/cluster.cmake Thu Apr 30 17:16:06 2009
@@ -26,28 +26,44 @@
 include(CheckIncludeFiles)
 include(CheckLibraryExists)
 
+set(LIBCPG_PATH /usr/lib/openais /usr/lib64/openais /usr/lib/corosync /usr/lib64/corosync CACHE STRING "Default locations for libcpg (cluster library)" )
+find_library(LIBCPG cpg ${LIBCPG_PATH})
+if (LIBCPG)
+  CHECK_LIBRARY_EXISTS (${LIBCPG} cpg_local_get "" HAVE_LIBCPG)
+  CHECK_INCLUDE_FILES (openais/cpg.h HAVE_OPENAIS_CPG_H)
+  CHECK_INCLUDE_FILES (corosync/cpg.h HAVE_COROSYNC_CPG_H)
+endif (LIBCPG)
+
+set (cluster_default ${cluster_force})
 if (CMAKE_SYSTEM_NAME STREQUAL Windows)
-  set (cluster_default OFF)
 else (CMAKE_SYSTEM_NAME STREQUAL Windows)
-  set (cluster_default ON)
+  if (HAVE_LIBCPG)
+    if (HAVE_OPENAIS_CPG_H OR HAVE_COROSYNC_CPG_H)
+      set (cluster_default ON)
+    endif (HAVE_OPENAIS_CPG_H OR HAVE_COROSYNC_CPG_H)
+  endif (HAVE_LIBCPG)
 endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
 
-option(BUILD_CPG "Build with CPG support for clustering" ${cluster_default})
-if (BUILD_CPG)
-  FIND_LIBRARY(LIBCPG cpg /usr/lib/openais /usr/lib64/openais /usr/lib/corosync /usr/lib64/corosync)
-  if (LIBCPG MATCHES ".*-NOTFOUND$")
-    message(FATAL_ERROR "cpg library not found, install openais-devel or corosync-devel")
-  endif (LIBCPG MATCHES ".*-NOTFOUND$")
-  CHECK_INCLUDE_FILES (openais/cpg.h HAVE_OPENAIS_CPG_H)
-  CHECK_INCLUDE_FILES (corosync/cpg.h HAVE_COROSYNC_CPG_H)
+option(BUILD_CLUSTER "Build with CPG support for clustering" ${cluster_default})
+if (BUILD_CLUSTER)
+
+  if (NOT HAVE_LIBCPG)
+    message(FATAL_ERROR "libcpg not found, install openais-devel or corosync-devel")
+  endif (NOT HAVE_LIBCPG)
   if (NOT HAVE_OPENAIS_CPG_H AND NOT HAVE_COROSYNC_CPG_H)
     message(FATAL_ERROR "cpg.h not found, install openais-devel or corosync-devel")
   endif (NOT HAVE_OPENAIS_CPG_H AND NOT HAVE_COROSYNC_CPG_H)
 
-  option(CPG_INCLUDE_CMAN "Include libcman quorum service integration" ON)
-  if (CPG_INCLUDE_CMAN)
-    CHECK_LIBRARY_EXISTS (cman cman_is_quorate "" HAVE_LIBCMAN)
-    CHECK_INCLUDE_FILES (libcman.h HAVE_LIBCMAN_H)
+  CHECK_LIBRARY_EXISTS (cman cman_is_quorate "" HAVE_LIBCMAN)
+  CHECK_INCLUDE_FILES (libcman.h HAVE_LIBCMAN_H)
+
+  set(cluster_quorum_default ${cluster_quorum_force})
+  if (HAVE_LIBCMAN AND HAVE_LIBCMAN_H)
+    set(cluster_quorum_default ON)
+  endif (HAVE_LIBCMAN AND HAVE_LIBCMAN_H)
+
+  option(BUILD_CLUSTER_QUORUM "Include libcman quorum service integration" ${cluster_quorum_default})
+  if (BUILD_CLUSTER_QUORUM)
     if (NOT HAVE_LIBCMAN)
       message(FATAL_ERROR "libcman not found, install cman-devel or cmanlib-devel")
     endif (NOT HAVE_LIBCMAN)
@@ -57,9 +73,9 @@
 
     set (CMAN_SOURCES qpid/cluster/Quorum_cman.h qpid/cluster/Quorum_cman.cpp)
     set (CMAN_LIB cman)
-  else (CPG_INCLUDE_CMAN)
+  else (BUILD_CLUSTER_QUORUM)
     set (CMAN_SOURCES qpid/cluster/Quorum_null.h)
-  endif (CPG_INCLUDE_CMAN)
+  endif (BUILD_CLUSTER_QUORUM)
 
   set (cluster_SOURCES
        ${CMAN_SOURCES}
@@ -110,7 +126,7 @@
   set_target_properties (cluster PROPERTIES
                          PREFIX "")
 
-endif (BUILD_CPG)
+endif (BUILD_CLUSTER)
 
 # Distribute all sources.
 #EXTRA_DIST += qpid/cluster/Quorum_cman.h qpid/cluster/Quorum_cman.cpp qpid/cluster/Quorum_null.h

Modified: qpid/trunk/qpid/cpp/src/rdma.cmake
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/rdma.cmake?rev=770330&r1=770329&r2=770330&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/rdma.cmake (original)
+++ qpid/trunk/qpid/cpp/src/rdma.cmake Thu Apr 30 17:16:06 2009
@@ -25,12 +25,20 @@
 include(CheckIncludeFiles)
 include(CheckLibraryExists)
 
-option(BUILD_RDMA "Build with support for Remote DMA protocols" OFF)
+CHECK_LIBRARY_EXISTS (ibverbs ibv_create_qp "" HAVE_IBVERBS)
+CHECK_LIBRARY_EXISTS (rdmacm rdma_create_id "" HAVE_RDMACM)
+CHECK_INCLUDE_FILES (infiniband/verbs.h HAVE_IBVERBS_H)
+CHECK_INCLUDE_FILES (rdma/rdma_cma.h HAVE_RDMACM_H)
+
+set (rdma_default ${rdma_force})
+if (HAVE_IBVERBS AND HAVE_IBVERBS_H)
+  if (HAVE_RDMACM AND HAVE_RDMACM_H)
+    set (rdma_default ON)
+  endif (HAVE_RDMACM AND HAVE_RDMACM_H)
+endif (HAVE_IBVERBS AND HAVE_IBVERBS_H)
+
+option(BUILD_RDMA "Build with support for Remote DMA protocols" ${rdma_default})
 if (BUILD_RDMA)
-  CHECK_LIBRARY_EXISTS (ibverbs ibv_create_qp "" HAVE_IBVERBS)
-  CHECK_LIBRARY_EXISTS (rdmacm rdma_create_id "" HAVE_RDMACM)
-  CHECK_INCLUDE_FILES (infiniband/verbs.h HAVE_IBVERBS_H)
-  CHECK_INCLUDE_FILES (rdma/rdma_cma.h HAVE_RDMACM_H)
   if (NOT HAVE_IBVERBS)
     message(FATAL_ERROR "libibverbs not found, required for RDMA support")
   endif (NOT HAVE_IBVERBS)

Modified: qpid/trunk/qpid/cpp/src/ssl.cmake
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/ssl.cmake?rev=770330&r1=770329&r2=770330&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/ssl.cmake (original)
+++ qpid/trunk/qpid/cpp/src/ssl.cmake Thu Apr 30 17:16:06 2009
@@ -24,19 +24,25 @@
 
 include(FindPkgConfig)
 
+# According to some cmake docs this is not a reliable way to detect
+# pkg-configed libraries, but it's no worse than what we did under
+# autotools
+pkg_check_modules(NSS nss)
+
+set (ssl_default ${ssl_force})
 if (CMAKE_SYSTEM_NAME STREQUAL Windows)
-  set (ssl_default OFF)
 else (CMAKE_SYSTEM_NAME STREQUAL Windows)
-  set (ssl_default ON)
+  if (NSS_FOUND)
+    set (ssl_default ON)
+  endif (NSS_FOUND)
 endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
 
 option(BUILD_SSL "Build with support for SSL" ${ssl_default})
 if (BUILD_SSL)
 
-  # According to some cmake docs this is not a reliable way to detect
-  # pkg-configed libraries, but it's no worse than what we did under
-  # autotools
-  pkg_check_modules(NSS REQUIRED nss)
+  if (NOT NSS_FOUND)
+    message(FATAL_ERROR "nss/nspr not found, required for ssl support")
+  endif (NOT NSS_FOUND)
 
   foreach(f ${NSS_CFLAGS})
     set (NSS_COMPILE_FLAGS "${NSS_COMPILE_FLAGS} ${f}")



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org