summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/CMakeLists.txt24
-rw-r--r--qpid/cpp/src/QpidConfig.cmake.in30
-rw-r--r--qpid/cpp/src/QpidConfigVersion.cmake.in30
-rw-r--r--qpid/cpp/src/amqp.cmake78
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/ConnectionHandle.cpp8
-rw-r--r--qpid/cpp/src/qpid/sys/windows/FileSysDir.cpp4
6 files changed, 109 insertions, 65 deletions
diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
index d8b823fc8e..73b3e675c7 100644
--- a/qpid/cpp/src/CMakeLists.txt
+++ b/qpid/cpp/src/CMakeLists.txt
@@ -1084,7 +1084,7 @@ set (qpidmessaging_SOURCES
add_msvc_version (qpidmessaging library dll)
add_library (qpidmessaging SHARED ${qpidmessaging_SOURCES})
-target_link_libraries (qpidmessaging qpidtypes qpidclient qpidcommon "${Boost_PROGRAM_OPTIONS_LIBRARY}" ${PROTON_LIBRARIES})
+target_link_libraries (qpidmessaging qpidtypes qpidclient qpidcommon "${Boost_PROGRAM_OPTIONS_LIBRARY}" ${Proton_LIBRARIES})
set_target_properties (qpidmessaging PROPERTIES
LINK_FLAGS "${HIDE_SYMBOL_FLAGS} ${LINK_VERSION_SCRIPT_FLAG}"
COMPILE_FLAGS "${HIDE_SYMBOL_FLAGS}"
@@ -1373,7 +1373,7 @@ set (prefix ${CMAKE_INSTALL_PREFIX})
set (exec_prefix ${CMAKE_INSTALL_PREFIX})
set_absolute_install_path (libdir ${QPID_INSTALL_LIBDIR})
set_absolute_install_path (includedir ${QPID_INSTALL_INCLUDEDIR})
-set (VERSION ${QPID_VERSION})
+set (VERSION ${QPID_VERSION_FULL})
#add_custom_target(pkgconfig ALL echo DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qpid.pc)
#add_dependencies(pkgconfig ${CMAKE_CURRENT_BINARY_DIR}/qmf2.pc)
@@ -1382,3 +1382,23 @@ configure_file(qmf2.pc.in ${CMAKE_CURRENT_BINARY_DIR}/qmf2.pc @ONLY)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/qpid.pc ${CMAKE_CURRENT_BINARY_DIR}/qmf2.pc
DESTINATION ${QPID_INSTALL_LIBDIR}/pkgconfig
COMPONENT ${QPID_COMPONENT_COMMON})
+
+if (DEFINED CMAKE_IMPORT_LIBRARY_PREFIX)
+set(QPIDMSGLIB ${CMAKE_IMPORT_LIBRARY_PREFIX}qpidmessaging${CMAKE_IMPORT_LIBRARY_SUFFIX})
+set(QPIDMSGLIBDEBUG ${CMAKE_IMPORT_LIBRARY_PREFIX}qpidmessaging${CMAKE_DEBUG_POSTFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX})
+set(QPIDTYPESLIB ${CMAKE_IMPORT_LIBRARY_PREFIX}qpidtypes${CMAKE_IMPORT_LIBRARY_SUFFIX})
+set(QPIDTYPESLIBDEBUG ${CMAKE_IMPORT_LIBRARY_PREFIX}qpidtypes${CMAKE_DEBUG_POSTFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX})
+else ()
+set(QPIDMSGLIB ${CMAKE_SHARED_LIBRARY_PREFIX}qpidmessaging${CMAKE_SHARED_LIBRARY_SUFFIX})
+set(QPIDMSGLIBDEBUG ${CMAKE_SHARED_LIBRARY_PREFIX}qpidmessaging${CMAKE_DEBUG_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})
+set(QPIDTYPESLIB ${CMAKE_SHARED_LIBRARY_PREFIX}qpidtypes${CMAKE_SHARED_LIBRARY_SUFFIX})
+set(QPIDTYPESLIBDEBUG ${CMAKE_SHARED_LIBRARY_PREFIX}qpidtypes${CMAKE_DEBUG_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})
+endif ()
+
+configure_file(QpidConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/QpidConfig.cmake @ONLY)
+configure_file(QpidConfigVersion.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/QpidConfigVersion.cmake @ONLY)
+install (FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/QpidConfig.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/QpidConfigVersion.cmake
+ DESTINATION ${QPID_INSTALL_LIBDIR}/cmake/Qpid
+ COMPONENT ${QPID_COMPONENT_COMMON})
diff --git a/qpid/cpp/src/QpidConfig.cmake.in b/qpid/cpp/src/QpidConfig.cmake.in
new file mode 100644
index 0000000000..3f84e3b6b0
--- /dev/null
+++ b/qpid/cpp/src/QpidConfig.cmake.in
@@ -0,0 +1,30 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Name: Qpid
+# Description: Qpid Client C library
+# Version: @VERSION@
+# URL: http://qpid.apache.org/
+
+set (Qpid_VERSION @VERSION@)
+
+set (Qpid_INCLUDE_DIRS @includedir@)
+set (Qpid_LIBRARIES optimized @libdir@/@QPIDMSGLIB@ @libdir@/@QPIDTYPESLIB@ debug @libdir@/@QPIDMSGLIBDEBUG@ @libdir@/@QPIDTYPESLIBDEBUG@)
+
+set (Qpid_FOUND True)
diff --git a/qpid/cpp/src/QpidConfigVersion.cmake.in b/qpid/cpp/src/QpidConfigVersion.cmake.in
new file mode 100644
index 0000000000..d85924ab7e
--- /dev/null
+++ b/qpid/cpp/src/QpidConfigVersion.cmake.in
@@ -0,0 +1,30 @@
+# This is a basic version file for the Config-mode of find_package().
+# It is used by write_basic_package_version_file() as input file for configure_file()
+# to create a version-file which can be installed along a config.cmake file.
+#
+# The created file sets PACKAGE_VERSION_EXACT if the current version string and
+# the requested version string are exactly the same and it sets
+# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
+
+set(PACKAGE_VERSION "@VERSION@")
+
+if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+else()
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
+ set(PACKAGE_VERSION_EXACT TRUE)
+ endif()
+endif()
+
+# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
+if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
+ return()
+endif()
+
+# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
+if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@")
+ math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
+ set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
+ set(PACKAGE_VERSION_UNSUITABLE TRUE)
+endif()
diff --git a/qpid/cpp/src/amqp.cmake b/qpid/cpp/src/amqp.cmake
index 39f45954f3..d1ff184a64 100644
--- a/qpid/cpp/src/amqp.cmake
+++ b/qpid/cpp/src/amqp.cmake
@@ -19,61 +19,30 @@
# Optional AMQP1.0 support. Requires proton toolkit.
-include(FindPkgConfig)
-
-pkg_check_modules(PROTON libqpid-proton)
-
-if (NOT PROTON_FOUND)
- # if pkg-config is absent or fails to find proton then use
- # PROTON_ROOT command line option or environment variable to locate
- # local installed proton build.
- if (NOT PROTON_ROOT)
- set (PROTON_ROOT "$ENV{PROTON_ROOT}")
- endif()
- if (PROTON_ROOT)
- find_package(proton PATHS ${PROTON_ROOT} NO_DEFAULT_PATH)
-
- if (proton_FOUND EQUAL 1)
- set(iFile "${PROTON_ROOT}/lib/proton.cmake/libqpid-proton.cmake")
- if(EXISTS ${iFile})
- include("${iFile}")
- else()
- message(FATAL_ERROR "PROTON_ROOT defined but file ${iFile} is missing")
- endif()
- else()
- message(FATAL_ERROR "Proton package files not found in ${PROTON_ROOT}")
- endif()
- endif()
-endif()
+find_package(Proton 0.5)
set (amqp_default ${amqp_force})
-set (minimum_version 0.5)
set (maximum_version 0.6)
-if (PROTON_FOUND)
- if (PROTON_VERSION LESS ${minimum_version})
- message(STATUS "Qpid proton ${PROTON_VERSION} is too old, require ${minimum_version} - ${maximum_version}; amqp 1.0 support not enabled")
- else (PROTON_VERSION LESS ${minimum_version})
- if (PROTON_VERSION GREATER ${maximum_version})
- message(STATUS "Qpid proton ${PROTON_VERSION} is too new, require ${minimum_version} - ${maximum_version}; amqp 1.0 support not enabled")
- else (PROTON_VERSION GREATER ${maximum_version})
- message(STATUS "Qpid proton found, amqp 1.0 support enabled")
- set (amqp_default ON)
- #remove when 0.5 no longer supported
- if (NOT PROTON_VERSION EQUAL 0.5)
- set (HAVE_PROTON_TRACER 1)
- endif (NOT PROTON_VERSION EQUAL 0.5)
- endif (PROTON_VERSION GREATER ${maximum_version})
- endif (PROTON_VERSION LESS ${minimum_version})
-else (PROTON_FOUND)
+if (Proton_FOUND)
+ if (Proton_VERSION GREATER ${maximum_version})
+ message(WARNING "Qpid proton ${Proton_VERSION} is not a tested version and might not be compatible, ${maximum_version} is highest tested; build may not work")
+ endif (Proton_VERSION GREATER ${maximum_version})
+ message(STATUS "Qpid proton found, amqp 1.0 support enabled")
+ set (amqp_default ON)
+ #remove when 0.5 no longer supported
+ if (NOT Proton_VERSION EQUAL 0.5)
+ set (HAVE_PROTON_TRACER 1)
+ endif (NOT Proton_VERSION EQUAL 0.5)
+else ()
message(STATUS "Qpid proton not found, amqp 1.0 support not enabled")
-endif (PROTON_FOUND)
+endif ()
option(BUILD_AMQP "Build with support for AMQP 1.0" ${amqp_default})
if (BUILD_AMQP)
- if (NOT PROTON_FOUND)
+ if (NOT Proton_FOUND)
message(FATAL_ERROR "Qpid proton not found, required for amqp 1.0 support")
- endif (NOT PROTON_FOUND)
+ endif ()
set (amqp_SOURCES
qpid/broker/amqp/Authorise.h
@@ -129,11 +98,10 @@ if (BUILD_AMQP)
qpid/broker/amqp/Translation.cpp
)
- include_directories(${PROTON_INCLUDE_DIRS})
- link_directories(${PROTON_LIBRARY_DIRS})
+ include_directories(${Proton_INCLUDE_DIRS})
add_library (amqp MODULE ${amqp_SOURCES})
- target_link_libraries (amqp qpidtypes qpidbroker qpidcommon ${PROTON_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY})
+ target_link_libraries (amqp qpidtypes qpidbroker qpidcommon ${Proton_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY})
set_target_properties (amqp PROPERTIES
PREFIX ""
LINK_FLAGS "${CATCH_UNDEFINED}"
@@ -173,18 +141,6 @@ if (BUILD_AMQP)
if (WIN32)
list (APPEND amqp_SOURCES qpid/messaging/amqp/windows/SslTransport.cpp)
list (APPEND amqpc_SOURCES qpid/messaging/amqp/windows/SslTransport.cpp)
-
- set(proton_dll "${PROTON_LIBRARY_DIRS}/${PROTON_LIBRARIES}.dll")
- set(proton_dlld "${PROTON_LIBRARY_DIRS}/${PROTON_LIBRARIES}d.dll")
-
- install (PROGRAMS ${proton_dll}
- DESTINATION ${QPID_INSTALL_BINDIR}
- COMPONENT ${QPID_COMPONENT_COMMON}
- CONFIGURATIONS Release|MinSizeRel|RelWithDebInfo)
- install (PROGRAMS ${proton_dlld}
- DESTINATION ${QPID_INSTALL_BINDIR}
- COMPONENT ${QPID_COMPONENT_COMMON}
- CONFIGURATIONS Debug)
endif (WIN32)
else (BUILD_AMQP)
# ensure that qpid build ignores proton
diff --git a/qpid/cpp/src/qpid/messaging/amqp/ConnectionHandle.cpp b/qpid/cpp/src/qpid/messaging/amqp/ConnectionHandle.cpp
index c1ab108a61..90227fa29b 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/ConnectionHandle.cpp
+++ b/qpid/cpp/src/qpid/messaging/amqp/ConnectionHandle.cpp
@@ -31,7 +31,13 @@ namespace amqp {
namespace {
ConnectionImpl* create(const std::string& u, const qpid::types::Variant::Map& o)
{
- return new ConnectionHandle(u, o);
+ try {
+ return new ConnectionHandle(u, o);
+ } catch (const types::Exception& ) {
+ throw;
+ } catch (const qpid::Exception& e) {
+ throw messaging::ConnectionError( e.what() );
+ }
}
struct StaticInit
diff --git a/qpid/cpp/src/qpid/sys/windows/FileSysDir.cpp b/qpid/cpp/src/qpid/sys/windows/FileSysDir.cpp
index e090747715..5128f0f8d6 100644
--- a/qpid/cpp/src/qpid/sys/windows/FileSysDir.cpp
+++ b/qpid/cpp/src/qpid/sys/windows/FileSysDir.cpp
@@ -79,7 +79,9 @@ void FileSysDir::forEachFile(Callback cb) const {
// process everything that isn't a directory
do {
if (!(findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
- std::string fileName(findFileData.cFileName);
+ std::string fileName(dirPath);
+ fileName += "\\";
+ fileName += findFileData.cFileName;
cb(fileName);
}
} while (FindNextFile(hFind, &findFileData) != 0);