-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
348 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
|
||
project(amqp-cpp) | ||
|
||
# ensure c++11 on all compilers | ||
include(set_cxx_norm.cmake) | ||
set_cxx_norm (${CXX_NORM_CXX11}) | ||
|
||
macro (add_sources) | ||
file (RELATIVE_PATH _relPath "${PROJECT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}") | ||
foreach (_src ${ARGN}) | ||
if (_relPath) | ||
list (APPEND SRCS "${_relPath}/${_src}") | ||
else() | ||
list (APPEND SRCS "${_src}") | ||
endif() | ||
endforeach() | ||
if (_relPath) | ||
# propagate SRCS to parent directory | ||
set (SRCS ${SRCS} PARENT_SCOPE) | ||
endif() | ||
endmacro() | ||
|
||
add_subdirectory(src) | ||
add_subdirectory(include) | ||
add_subdirectory(amqp_boost_test) | ||
|
||
include_directories(${CMAKE_SOURCE_DIR}/include) | ||
add_library(amqp-cpp STATIC ${SRCS}) | ||
target_include_directories(amqp-cpp SYSTEM PUBLIC ${PROJECT_SOURCE_DIR}) | ||
|
||
set(AMQP-CPP_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) | ||
set(AMQP-CPP_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
set(Boost_USE_STATIC_LIBS ON) | ||
set(Boost_USE_MULTITHREADED ON) | ||
set(Boost_USE_STATIC_RUNTIME OFF) | ||
find_package(Boost 1.55 REQUIRED COMPONENTS thread system) | ||
|
||
if(NOT Boost_FOUND) | ||
message( FATAL_ERROR "boost must be installed") | ||
endif() | ||
|
||
include_directories(${Boost_INCLUDE_DIRS}) | ||
|
||
set(SRC main.cpp) | ||
|
||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") | ||
set(SPECIFIC_HOST_LIBS rt pthread) | ||
else() | ||
set(SPECIFIC_HOST_LIBS) | ||
endif() | ||
|
||
set(LIBS | ||
${Boost_LIBRARIES} | ||
amqp-cpp | ||
) | ||
|
||
include_directories(SYSTEM ${CRYPTLIB_INCLUDE_PATH}) | ||
link_directories(${Boost_LIBRARY_PATH}) | ||
|
||
include_directories(SYSTEM ${AMQP-CPP_INCLUDE_PATH}) | ||
|
||
add_executable(amqp_boost_test ${SRC}) | ||
target_link_libraries(amqp_boost_test ${LIBS} ${SPECIFIC_HOST_LIBS}) | ||
|
||
install(TARGETS amqp_boost_test | ||
RUNTIME DESTINATION bin | ||
LIBRARY DESTINATION lib | ||
ARCHIVE DESTINATION lib | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <amqpcpp.h> | ||
|
||
int main(int argc, const char* argv[]) | ||
{ | ||
|
||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
add_sources( | ||
array.h | ||
booleanset.h | ||
buffer.h | ||
bytebuffer.h | ||
callbacks.h | ||
channel.h | ||
channelimpl.h | ||
classes.h | ||
compat_endian.h | ||
connection.h | ||
connectionhandler.h | ||
connectionimpl.h | ||
decimalfield.h | ||
deferred.h | ||
deferredcancel.h | ||
deferredconsumer.h | ||
deferreddelete.h | ||
deferredget.h | ||
deferredqueue.h | ||
entityimpl.h | ||
envelope.h | ||
exchangetype.h | ||
field.h | ||
fieldproxy.h | ||
flags.h | ||
login.h | ||
message.h | ||
metadata.h | ||
monitor.h | ||
numericfield.h | ||
outbuffer.h | ||
receivedframe.h | ||
stringfield.h | ||
table.h | ||
watchable.h | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef __AMQP_CPP_COMPAT_ENDIAN_H__ | ||
#define __AMQP_CPP_COMPAT_ENDIAN_H__ | ||
|
||
#if defined(__APPLE__) | ||
|
||
#include <machine/endian.h> | ||
|
||
#include <libkern/OSByteOrder.h> | ||
|
||
#define htobe16(x) OSSwapHostToBigInt16(x) | ||
#define htole16(x) OSSwapHostToLittleInt16(x) | ||
#define be16toh(x) OSSwapBigToHostInt16(x) | ||
#define le16toh(x) OSSwapLittleToHostInt16(x) | ||
|
||
#define htobe32(x) OSSwapHostToBigInt32(x) | ||
#define htole32(x) OSSwapHostToLittleInt32(x) | ||
#define be32toh(x) OSSwapBigToHostInt32(x) | ||
#define le32toh(x) OSSwapLittleToHostInt32(x) | ||
|
||
#define htobe64(x) OSSwapHostToBigInt64(x) | ||
#define htole64(x) OSSwapHostToLittleInt64(x) | ||
#define be64toh(x) OSSwapBigToHostInt64(x) | ||
#define le64toh(x) OSSwapLittleToHostInt64(x) | ||
|
||
#else | ||
|
||
#include <endian.h> | ||
|
||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,7 +90,6 @@ class ByteBuffer : public Buffer | |
{ | ||
return memcpy(buffer, _data + pos, size); | ||
} | ||
|
||
}; | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Version | ||
cmake_minimum_required(VERSION 2.6.3) | ||
|
||
set(CXX_NORM_CXX98 1) # C++98 | ||
set(CXX_NORM_CXX03 2) # C++03 | ||
set(CXX_NORM_CXX11 3) # C++11 | ||
|
||
# - Set the wanted C++ norm | ||
# Adds the good argument to the command line in function of the compiler | ||
# Currently only works with g++ and clang++ | ||
macro(set_cxx_norm NORM) | ||
|
||
# Extract c++ compiler --version output | ||
exec_program( | ||
${CMAKE_CXX_COMPILER} | ||
ARGS --version | ||
OUTPUT_VARIABLE _compiler_output | ||
) | ||
# Keep only the first line | ||
string(REGEX REPLACE | ||
"(\n.*$)" | ||
"" | ||
cxx_compiler_version "${_compiler_output}" | ||
) | ||
# Extract the version number | ||
string(REGEX REPLACE | ||
"([^0-9.])|([0-9.][^0-9.])" | ||
"" | ||
cxx_compiler_version "${cxx_compiler_version}" | ||
) | ||
|
||
if(CMAKE_COMPILER_IS_GNUCXX) | ||
|
||
if(${NORM} EQUAL ${CXX_NORM_CXX98}) | ||
add_definitions("-std=c++98") | ||
elseif(${NORM} EQUAL ${CXX_NORM_CXX03}) | ||
add_definitions("-std=c++03") | ||
elseif(${NORM} EQUAL ${CXX_NORM_CXX11}) | ||
if(${cxx_compiler_version} VERSION_LESS "4.7.0") | ||
add_definitions("-std=c++0x") | ||
else() | ||
add_definitions("-std=c++11") | ||
endif() | ||
endif() | ||
|
||
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") | ||
|
||
if(${NORM} EQUAL ${CXX_NORM_CXX11}) | ||
add_definitions("-std=c++11") | ||
endif() | ||
|
||
endif() | ||
|
||
endmacro() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
add_sources( | ||
array.cpp | ||
basicackframe.h | ||
basiccancelframe.h | ||
basiccancelokframe.h | ||
basicconsumeframe.h | ||
basicconsumeokframe.h | ||
basicdeliverframe.h | ||
basicframe.h | ||
basicgetemptyframe.h | ||
basicgetframe.h | ||
basicgetokframe.h | ||
basicheaderframe.h | ||
basicnackframe.h | ||
basicpublishframe.h | ||
basicqosframe.h | ||
basicqosokframe.h | ||
basicrecoverasyncframe.h | ||
basicrecoverframe.h | ||
basicrecoverokframe.h | ||
basicrejectframe.h | ||
basicreturnframe.h | ||
bodyframe.h | ||
channelcloseframe.h | ||
channelcloseokframe.h | ||
channelflowframe.h | ||
channelflowokframe.h | ||
channelframe.h | ||
channelimpl.cpp | ||
channelopenframe.h | ||
channelopenokframe.h | ||
connectioncloseframe.h | ||
connectioncloseokframe.h | ||
connectionframe.h | ||
connectionimpl.cpp | ||
connectionopenframe.h | ||
connectionopenokframe.h | ||
connectionsecureframe.h | ||
connectionsecureokframe.h | ||
connectionstartframe.h | ||
connectionstartokframe.h | ||
connectiontuneframe.h | ||
connectiontuneokframe.h | ||
consumedmessage.h | ||
deferredcancel.cpp | ||
deferredconsumer.cpp | ||
deferredget.cpp | ||
exception.h | ||
exchangebindframe.h | ||
exchangebindokframe.h | ||
exchangedeclareframe.h | ||
exchangedeclareokframe.h | ||
exchangedeleteframe.h | ||
exchangedeleteokframe.h | ||
exchangeframe.h | ||
exchangeunbindframe.h | ||
exchangeunbindokframe.h | ||
extframe.h | ||
field.cpp | ||
flags.cpp | ||
frame.h | ||
framecheck.h | ||
headerframe.h | ||
heartbeatframe.h | ||
includes.h | ||
messageimpl.h | ||
methodframe.h | ||
protocolexception.h | ||
protocolheaderframe.h | ||
queuebindframe.h | ||
queuebindokframe.h | ||
queuedeclareframe.h | ||
queuedeclareokframe.h | ||
queuedeleteframe.h | ||
queuedeleteokframe.h | ||
queueframe.h | ||
queuepurgeframe.h | ||
queuepurgeokframe.h | ||
queueunbindframe.h | ||
queueunbindokframe.h | ||
receivedframe.cpp | ||
returnedmessage.h | ||
table.cpp | ||
transactioncommitframe.h | ||
transactioncommitokframe.h | ||
transactionframe.h | ||
transactionrollbackframe.h | ||
transactionrollbackokframe.h | ||
transactionselectframe.h | ||
transactionselectokframe.h | ||
watchable.cpp | ||
) |
Oops, something went wrong.