summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-04-28 21:51:54 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-04-28 21:51:54 +0000
commit74f0c66f82564a2ac145313fbdc351ef050a2026 (patch)
tree8cbb3b6bfd17c15519f06b1b24fb5e26bf76258a /cpp/src
parentb97244e49105b7adda0d8798383ea63c1986fed6 (diff)
downloadqpid-python-74f0c66f82564a2ac145313fbdc351ef050a2026.tar.gz
Fixed to allow use of cmake 2.4
Fixes to allow cmake to build all the plugin modules as before git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@769559 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/CMakeLists.txt19
-rw-r--r--cpp/src/cluster.cmake12
-rw-r--r--cpp/src/config.h.cmake3
-rw-r--r--cpp/src/rdma.cmake14
-rw-r--r--cpp/src/ssl.cmake58
5 files changed, 50 insertions, 56 deletions
diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt
index e12de6f294..9c07538a05 100644
--- a/cpp/src/CMakeLists.txt
+++ b/cpp/src/CMakeLists.txt
@@ -20,6 +20,7 @@
include(CheckFunctionExists)
include(CheckIncludeFileCXX)
include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
include(CheckLibraryExists)
include(CheckSymbolExists)
include(FindBoost)
@@ -203,13 +204,13 @@ if (QPID_HAS_XML)
message(FATAL_ERROR "XML Exchange support requested but XQilla headers not found")
endif (NOT HAVE_XQILLA_H)
- add_library (xml SHARED
+ add_library (xml MODULE
qpid/xml/XmlExchange.cpp
qpid/xml/XmlExchange.h
qpid/xml/XmlExchangePlugin.cpp)
- target_link_libraries (xml xerces-c xqilla qpidbroker)
+ target_link_libraries (xml xerces-c xqilla qpidbroker pthread)
set_target_properties (xml PROPERTIES
- VERSION ${qpidc_version}
+ PREFIX ""
LINK_FLAGS -Wl,--no-undefined)
endif (QPID_HAS_XML)
@@ -223,10 +224,10 @@ set (acl_SOURCES
qpid/acl/AclReader.cpp
qpid/acl/AclReader.h
)
- add_library (acl SHARED ${acl_SOURCES})
+ add_library (acl MODULE ${acl_SOURCES})
target_link_libraries (acl qpidbroker)
set_target_properties (acl PROPERTIES
- VERSION ${qpidc_version}
+ PREFIX ""
LINK_FLAGS -Wl,--no-undefined)
# Check for optional cluster support requirements
@@ -596,14 +597,14 @@ set_target_properties (qmfconsole PROPERTIES
# A queue event listener plugin that creates messages on a replication
# queue corresponding to enqueue and dequeue events:
-add_library (replicating_listener SHARED
+add_library (replicating_listener MODULE
qpid/replication/constants.h
qpid/replication/ReplicatingEventListener.cpp
qpid/replication/ReplicatingEventListener.h
)
target_link_libraries (replicating_listener qpidbroker)
set_target_properties (replicating_listener PROPERTIES
- VERSION ${qpidc_version})
+ PREFIX "")
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(replicating_listener PROPERTIES
LINK_FLAGS -Wl,--no-undefined)
@@ -613,14 +614,14 @@ endif (CMAKE_COMPILER_IS_GNUCXX)
# can process the messages from a replication queue (populated on the
# source system by the replicating listener plugin above) and take the
# corresponding action on the local queues
-add_library (replicating_exchange SHARED
+add_library (replicating_exchange MODULE
qpid/replication/constants.h
qpid/replication/ReplicationExchange.cpp
qpid/replication/ReplicationExchange.h
)
target_link_libraries (replicating_exchange qpidbroker)
set_target_properties (replicating_exchange PROPERTIES
- VERSION ${qpidc_version})
+ PREFIX "")
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(replicating_exchange PROPERTIES
LINK_FLAGS -Wl,--no-undefined)
diff --git a/cpp/src/cluster.cmake b/cpp/src/cluster.cmake
index 5d7c4380b6..5788ff5ea1 100644
--- a/cpp/src/cluster.cmake
+++ b/cpp/src/cluster.cmake
@@ -34,9 +34,8 @@ endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
option(BUILD_CPG "Build with CPG support for clustering" ${cluster_default})
if (BUILD_CPG)
- CHECK_LIBRARY_EXISTS (cpg cpg_local_get
- "-L/usr/lib/openais -L/usr/lib64/openais -L/usr/lib/corosync -L/usr/lib64/corosync"
- HAVE_LIBCPG)
+ find_library(LIBCPG cpg /usr/lib/openais /usr/lib64/openais /usr/lib/corosync /usr/lib64/corosync)
+ 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)
if (NOT HAVE_LIBCPG)
@@ -108,10 +107,11 @@ if (BUILD_CPG)
qpid/cluster/types.h
)
- add_library (cluster SHARED ${cluster_SOURCES})
- target_link_libraries (cluster cpg ${CMAN_LIB} qpidbroker qpidclient)
+ add_library (cluster MODULE ${cluster_SOURCES})
+ target_link_libraries (cluster ${LIBCPG} ${CMAN_LIB} qpidbroker qpidclient)
#cluster_la_LDFLAGS = $(PLUGINLDFLAGS)
- set_target_properties (cluster PROPERTIES VERSION ${qpidc_version})
+ set_target_properties (cluster PROPERTIES
+ PREFIX "")
endif (BUILD_CPG)
diff --git a/cpp/src/config.h.cmake b/cpp/src/config.h.cmake
index 69e6523c92..7a1873aafd 100644
--- a/cpp/src/config.h.cmake
+++ b/cpp/src/config.h.cmake
@@ -45,6 +45,9 @@
# define HAVE_SASL 1
#endif
+#cmakedefine HAVE_OPENAIS_CPG_H ${HAVE_OPENAIS_CPG_H}
+#cmakedefine HAVE_COROSYNC_CPG_H ${HAVE_COROSYNC_CPG_H}
+#cmakedefine HAVE_LIBCMAN_H ${HAVE_LIBCMAN_H}
#cmakedefine HAVE_LOG_AUTHPRIV
#cmakedefine HAVE_LOG_FTP
diff --git a/cpp/src/rdma.cmake b/cpp/src/rdma.cmake
index a48329a6d5..30fbe9d279 100644
--- a/cpp/src/rdma.cmake
+++ b/cpp/src/rdma.cmake
@@ -63,18 +63,22 @@ if (BUILD_RDMA)
LINK_FLAGS -Wl,--no-undefined)
endif (CMAKE_COMPILER_IS_GNUCXX)
- add_library (rdma SHARED qpid/sys/RdmaIOPlugin.cpp)
+ add_library (rdma MODULE qpid/sys/RdmaIOPlugin.cpp)
target_link_libraries (rdma qpidbroker rdmawrap)
- set_target_properties (rdma PROPERTIES VERSION ${qpidc_version})
+ set_target_properties (rdma PROPERTIES
+ PREFIX "")
+
if (CMAKE_COMPILER_IS_GNUCXX)
- set_target_properties(rdmawrap PROPERTIES
+ set_target_properties(rdma PROPERTIES
COMPILE_FLAGS -Wno-missing-field-initializers
LINK_FLAGS -Wl,--no-undefined)
endif (CMAKE_COMPILER_IS_GNUCXX)
- add_library (rdmaconnector SHARED qpid/client/RdmaConnector.cpp)
+ add_library (rdmaconnector MODULE qpid/client/RdmaConnector.cpp)
target_link_libraries (rdmaconnector qpidclient rdmawrap)
- set_target_properties (rdmaconnector PROPERTIES VERSION ${qpidc_version})
+ set_target_properties (rdmaconnector PROPERTIES
+ PREFIX "")
+
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(rdmaconnector PROPERTIES
COMPILE_FLAGS -Wno-missing-field-initializers
diff --git a/cpp/src/ssl.cmake b/cpp/src/ssl.cmake
index 765ed3fdcf..4d42e04030 100644
--- a/cpp/src/ssl.cmake
+++ b/cpp/src/ssl.cmake
@@ -32,35 +32,19 @@ endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
option(BUILD_SSL "Build with support for SSL" ${ssl_default})
if (BUILD_SSL)
- find_program (NSPR_CONFIG nspr-config)
- if (NSPR_CONFIG STREQUAL NSPR_CONFIG-NOTFOUND)
- message(FATAL_ERROR "libnspr not found, required for SSL support")
- endif (NSPR_CONFIG STREQUAL NSPR_CONFIG-NOTFOUND)
- find_program (NSS_CONFIG nss-config)
- if (NSS_CONFIG STREQUAL NSS_CONFIG-NOTFOUND)
- message(FATAL_ERROR "libnss not found, required for SSL support")
- endif (NSS_CONFIG STREQUAL NSS_CONFIG-NOTFOUND)
- # Output from nss/snpr-config ends with newline, so strip it
- # Also, sometimes there's no need for additional -I options (or -L) but
- # the -I is included anyway; in these cases, ignore it.
- execute_process (COMMAND ${NSPR_CONFIG} --cflags
- OUTPUT_VARIABLE get_flags)
- string (STRIP ${get_flags} NSPR_CFLAGS)
- if (NSPR_CFLAGS STREQUAL -I)
- set (NSPR_CFLAGS )
- endif (NSPR_CFLAGS STREQUAL -I)
- execute_process (COMMAND ${NSPR_CONFIG} --libs
- OUTPUT_VARIABLE get_flags)
- string (STRIP ${get_flags} NSPR_LIBS)
- execute_process (COMMAND ${NSS_CONFIG} --cflags
- OUTPUT_VARIABLE get_flags)
- string (STRIP ${get_flags} NSS_CFLAGS)
- if (NSS_CFLAGS STREQUAL -I)
- set (NSS_CFLAGS )
- endif (NSS_CFLAGS STREQUAL -I)
- execute_process (COMMAND ${NSS_CONFIG} --libs
- OUTPUT_VARIABLE get_flags)
- string (STRIP ${get_flags} NSS_LIBS)
+
+ # 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)
+
+ foreach(f ${NSS_CFLAGS})
+ set (NSS_COMPILE_FLAGS "${NSS_COMPILE_FLAGS} ${f}")
+ endforeach(f)
+
+ foreach(f ${NSS_LDFLAGS})
+ set (NSS_LINK_FLAGS "${NSS_LINK_FLAGS} ${f}")
+ endforeach(f)
set (sslcommon_SOURCES
qpid/sys/ssl/check.h
@@ -74,29 +58,31 @@ if (BUILD_SSL)
)
add_library (sslcommon SHARED ${sslcommon_SOURCES})
- target_link_libraries (sslcommon qpidcommon nss3 ssl3 nspr4)
+ target_link_libraries (sslcommon qpidcommon)
set_target_properties (sslcommon PROPERTIES
VERSION ${qpidc_version}
- COMPILE_FLAGS "${NSPR_CFLAGS} ${NSS_CFLAGS}")
+ COMPILE_FLAGS ${NSS_COMPILE_FLAGS}
+ LINK_FLAGS ${NSS_LINK_FLAGS})
set (ssl_SOURCES
qpid/sys/SslPlugin.cpp
qpid/sys/ssl/SslHandler.h
qpid/sys/ssl/SslHandler.cpp
)
- add_library (ssl SHARED ${ssl_SOURCES})
+ add_library (ssl MODULE ${ssl_SOURCES})
target_link_libraries (ssl qpidbroker sslcommon)
set_target_properties (ssl PROPERTIES
- VERSION ${qpidc_version}
- COMPILE_FLAGS "${NSPR_CFLAGS} ${NSS_CFLAGS}")
+ PREFIX ""
+ COMPILE_FLAGS ${NSS_COMPILE_FLAGS})
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(ssl PROPERTIES
LINK_FLAGS -Wl,--no-undefined)
endif (CMAKE_COMPILER_IS_GNUCXX)
- add_library (sslconnector SHARED qpid/client/SslConnector.cpp)
+ add_library (sslconnector MODULE qpid/client/SslConnector.cpp)
target_link_libraries (sslconnector qpidclient sslcommon)
- set_target_properties (sslconnector PROPERTIES VERSION ${qpidc_version})
+ set_target_properties (sslconnector PROPERTIES
+ PREFIX "")
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(sslconnector PROPERTIES
LINK_FLAGS -Wl,--no-undefined)