Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
Include building of msi_amqp_basic_publish. RITDEV-277
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulVanSchayck committed Feb 28, 2019
1 parent 8d971fd commit ef9e5e9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ set(IRODS_EXTERNALS_FULLPATH_CLANG /opt/irods-externals/clang3.8-0)
set(JANSSON_ROOT /opt/irods-externals/jansson2.7-0)

# Set compiler options
# TODO: Understand what this does and why this is needed. I just copied this from UU to make it work
add_compile_options(-std=c++14
-Os
-fPIC
Expand Down Expand Up @@ -84,6 +83,9 @@ include_directories(SYSTEM ${CURL_INCLUDE_DIRS})
find_package(Jansson REQUIRED)
include_directories(SYSTEM ${JANSSON_INCLUDE_DIRS})

find_package(Rabbitmq REQUIRED)
include_directories(SYSTEM ${RABBITMQ_INCLUDE_DIRS} )

include_directories("/usr/include/irods")


Expand All @@ -96,6 +98,7 @@ add_library(msi_json_objops SHARED msi_json_objops/libmsi_json_objops.
add_library(msi_time_ts2str SHARED msi_time_ts2str/libmsi_time_ts2str.cpp)
add_library(msi_unmount SHARED msi_unmount/unmount.cpp)
add_library(msiput_dataobj_or_coll SHARED msiput_dataobj_or_coll/libmsiput_dataobj_or_coll.cpp)
add_library(msi_amqp_basic_publish SHARED msi_amqp_basic_publish/msi_amqp_basic_publish.cpp)

# Link the generated library to dependency libraries
target_link_libraries(msi_getenv LINK_PUBLIC ${Boost_LIBRARIES})
Expand All @@ -105,6 +108,7 @@ target_link_libraries(msi_json_objops LINK_PUBLIC ${JANSSON_LIBRARIES} $
target_link_libraries(msi_time_ts2str LINK_PUBLIC ${Boost_LIBRARIES})
target_link_libraries(msi_unmount LINK_PUBLIC ${Boost_LIBRARIES})
target_link_libraries(msiput_dataobj_or_coll LINK_PUBLIC ${Boost_LIBRARIES})
target_link_libraries(msi_amqp_basic_publish LINK_PUBLIC ${Boost_LIBRARIES} ${RABBITMQ_LIBRARIES})


#Set the location for library installation
Expand Down
20 changes: 20 additions & 0 deletions CMakeModules/FindRabbitmq.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This CMake file tries to find the the RabbitMQ library
# The following variables are set:
# RABBITMQ_FOUND - System has RabbitMQ client
# RABBITMQ_LIBRARIES - The RabbitMQ client library
# RABBITMQ_INCLUDE_DIRS - The RabbitMQ client INCLUDE_DIRS

include(CheckCSourceCompiles)
find_library(RABBITMQ_LIBRARIES NAMES rabbitmq)
find_path(RABBITMQ_INCLUDE_DIRS amqp.h)

if(${RABBITMQ_LIBRARIES} MATCHES "NOTFOUND")
set(Rabbitmq_FOUND FALSE CACHE INTERNAL "")
message(STATUS "RabbitMQ library not found.")
unset(RABBITMQ_LIBRARIES)
else()
set(Rabbitmq_FOUND TRUE CACHE INTERNAL "")
message(STATUS "Found RabbitMQ library: ${RABBITMQ_LIBRARIES}")
endif()

set(CMAKE_REQUIRED_INCLUDES ${RABBITMQ_INCLUDE_DIRS})
2 changes: 1 addition & 1 deletion msi_amqp_basic_publish/msi_amqp_basic_publish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extern "C" {
amqp_rpc_reply_t reply;
amqp_bytes_t message_bytes, exchange_bytes, routing_key_bytes;
amqp_basic_properties_t props;
int status, i;
int status;

// Sanity checks
if ( !rei || !rei->rsComm ) {
Expand Down

0 comments on commit ef9e5e9

Please sign in to comment.