From 5e39011a5b33db129475936a43c756b372164ed6 Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Sun, 15 Apr 2018 18:04:52 +0200 Subject: [PATCH] Fix build --- CMakeLists.txt | 51 +++++++-- README.md | 23 +++- cmake/FindDDS.cmake | 74 +++++++++++++ cmake/FindFlatBuffers.cmake | 67 ++++++++++++ cmake/FindMsgpack.cmake | 39 +++++++ cmake/FindOFI.cmake | 2 +- cmake/FindZeroMQ.cmake | 112 +++++++++++++++++++ cmake/Findnanomsg.cmake | 34 ++++++ cmake/GTestHelper.cmake | 139 ++++++++++++++++++++++++ fairmq/CMakeLists.txt | 43 +++----- fairmq/FairMQLogger.h | 10 +- fairmq/FairMQTransportFactory.cxx | 12 +- fairmq/Version.h.in | 1 - fairmq/plugins/DDS/CMakeLists.txt | 26 ++--- test/CMakeLists.txt | 4 +- test/message_resize/_message_resize.cxx | 4 +- test/plugins/_plugin_manager.cxx | 2 +- test/protocols/_pair.cxx | 4 +- test/protocols/_poller.cxx | 8 +- test/protocols/_pub_sub.cxx | 4 +- test/protocols/_push_pull.cxx | 4 +- test/protocols/_push_pull_multipart.cxx | 16 +-- test/protocols/_req_rep.cxx | 4 +- test/protocols/_transfer_timeout.cxx | 4 +- 24 files changed, 590 insertions(+), 97 deletions(-) create mode 100644 cmake/FindDDS.cmake create mode 100644 cmake/FindFlatBuffers.cmake create mode 100644 cmake/FindMsgpack.cmake create mode 100644 cmake/FindZeroMQ.cmake create mode 100644 cmake/Findnanomsg.cmake create mode 100644 cmake/GTestHelper.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 526ceca0..f8a73b60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ set_fairmq_cmake_policies() get_git_version(OUTVAR_PREFIX FairMQ) project(FairMQ VERSION ${FairMQ_VERSION} LANGUAGES CXX) -message("${BWhite}${PROJECT_NAME}${CR} ${FairMQ_GIT_VERSION} from ${FairMQ_DATE}") +message(STATUS "${BWhite}${PROJECT_NAME}${CR} ${FairMQ_GIT_VERSION} from ${FairMQ_DATE}") set_fairmq_defaults() @@ -26,7 +26,9 @@ include(CTest) # Build options ################################################################ -option(BUILD_OFI_TRANSPORT "Build OFI transport." OFF) +option(BUILD_NANOMSG_TRANSPORT "Build nanomsg transport." OFF) +option(BUILD_OFI_TRANSPORT "Build experimental OFI transport." OFF) +option(BUILD_DDS_PLUGIN "Build DDS plugin." OFF) ################################################################################ @@ -34,12 +36,29 @@ option(BUILD_OFI_TRANSPORT "Build OFI transport." OFF) if(Boost_INCLUDE_DIR) # Silence output, if Boost was found already set(SILENCE_BOOST QUIET) endif() -find_package(Boost 1.64 ${SILENCE_BOOST} REQUIRED COMPONENTS system) +find_package(Boost 1.64 ${SILENCE_BOOST} REQUIRED + COMPONENTS program_options thread system filesystem regex date_time signals +) + +set(CMAKE_PREFIX_PATH ${FAIRLOGGER_ROOT} $ENV{FAIRLOGGER_ROOT} ${CMAKE_PREFIX_PATH}) +find_package(FairLogger 1.0.1 REQUIRED) + +find_package(ZeroMQ 4.2.2 REQUIRED) + +if(BUILD_NANOMSG_TRANSPORT) + find_package(nanomsg REQUIRED) + set(CMAKE_PREFIX_PATH ${MSGPACK_ROOT} $ENV{MSGPACK_ROOT} ${CMAKE_PREFIX_PATH}) + find_package(msgpack 2.1.5 REQUIRED) +endif() if(BUILD_OFI_TRANSPORT) find_package(OFI 1.6.0 REQUIRED COMPONENTS fi_sockets) endif() +if(BUILD_DDS_PLUGIN) + find_package(DDS 2.0 REQUIRED) +endif() + if(BUILD_TESTING) find_package(GTest REQUIRED) endif() @@ -67,20 +86,32 @@ install_fairmq_cmake_package() # Summary ###################################################################### -message(" ") -message(" ${Cyan}COMPONENT BUILT? INFO${CR}") -message(" ${BWhite}library${CR} ${BGreen}YES${CR} (default, always built)") -if(BUILD_OFI_TRANSPORT) +message(STATUS " ") +message(STATUS " ${Cyan}COMPONENT BUILT? INFO${CR}") +message(STATUS " ${BWhite}library${CR} ${BGreen}YES${CR} (default, always built)") +if(BUILD_TESTING) set(tests_summary "${BGreen}YES${CR} (default, disable with ${BMagenta}-DBUILD_TESTING=OFF${CR})") else() set(tests_summary "${BRed} NO${CR} (enable with ${BMagenta}-DBUILD_TESTING=ON${CR})") endif() -message(" ${BWhite}tests${CR} ${tests_summary}") +message(STATUS " ${BWhite}tests${CR} ${tests_summary}") if(BUILD_OFI_TRANSPORT) set(ofi_summary "${BGreen}YES${CR} (disable with ${BMagenta}-DBUILD_OFI_TRANSPORT=OFF${CR})") else() set(ofi_summary "${BRed} NO${CR} (default, enable with ${BMagenta}-DBUILD_OFI_TRANSPORT=ON${CR})") endif() -message(" ${BWhite}OFI transport${CR} ${ofi_summary}") -message(" ") +message(STATUS " ${BWhite}OFI transport${CR} ${ofi_summary} Experimental") +if(BUILD_NANOMSG_TRANSPORT) + set(nn_summary "${BGreen}YES${CR} (disable with ${BMagenta}-DBUILD_NANOMSG_TRANSPORT=OFF${CR})") +else() + set(nn_summary "${BRed} NO${CR} (default, enable with ${BMagenta}-DBUILD_NANOMSG_TRANSPORT=ON${CR})") +endif() +message(STATUS " ${BWhite}nanomsg transport${CR} ${nn_summary}") +if(BUILD_DDS_PLUGIN) + set(dds_summary "${BGreen}YES${CR} (disable with ${BMagenta}-DBUILD_DDS_PLUGIN=OFF${CR})") +else() + set(dds_summary "${BRed} NO${CR} (default, enable with ${BMagenta}-DBUILD_DDS_PLUGIN=ON${CR})") +endif() +message(STATUS " ${BWhite}DDS plugin${CR} ${dds_summary}") +message(STATUS " ") ################################################################################ diff --git a/README.md b/README.md index a311eb2e..1f4ac874 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,19 @@ C++ Message Queuing Library ## Dependencies -TODO + * CMake + * GTest + * Boost + * FairLogger + * dl + * pthread + * rt (Linux) + * ZeroMQ + * Msgpack (optional, nanomsg transport) + * nanomsg (optional, nanomsg transport) + * libfabric (optional, OFI transport) + * Protobuf (optional, OFI transport) + * DDS (optional, DDS plugin) ## Installation @@ -47,21 +59,26 @@ The above is useful, if you need to customize the `find_package` calls of FairMQ ## CMake options -TODO complete list - On command line: * `-DDISABLE_COLOR=ON` disables coloured console output. + * `-DBUILD_TESTING=OFF` disables building of tests. + * `-DBUILD_NANOMSG_TRANSPORT=ON` enables building of nanomsg transport. * `-DBUILD_OFI_TRANSPORT=ON` enables building of the experimental OFI transport. + * `-DBUILD_DDS_PLUGIN=ON` enables building of the DDS plugin. In front of the `find_package(FairMQ)` call: + * `set(BUILD_NANOMSG_TRANSPORT ON)` enables building of nanomsg transport. * `set(BUILD_OFI_TRANSPORT ON)` enables building of the experimental OFI transport. + * `set(BUILD_DDS_PLUGIN ON)` enables building of the DDS plugin. * `set(FairMQ_PACKAGE_DEPENDENCIES_DISABLED ON)` disables implicit discovery of all transitive package dependencies. + * ... TODO After the `find_package(FairMQ)` the following CMake variables are defined: * `${FairMQ_BOOST_COMPONENTS}` contains the list of Boost components FairMQ depends on. + * ... TODO ## Documentation diff --git a/cmake/FindDDS.cmake b/cmake/FindDDS.cmake new file mode 100644 index 00000000..899a9a0c --- /dev/null +++ b/cmake/FindDDS.cmake @@ -0,0 +1,74 @@ +################################################################################ +# Copyright (C) 2014-2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# # +# This software is distributed under the terms of the # +# GNU Lesser General Public Licence (LGPL) version 3, # +# copied verbatim in the file "LICENSE" # +################################################################################ + +find_path(DDS_INCLUDE_DIR + NAMES dds_intercom.h + HINTS ${DDS_ROOT} $ENV{DDS_ROOT} + PATH_SUFFIXES include +) + +find_path(DDS_LIBRARY_DIR + NAMES libdds_intercom_lib.dylib libdds_intercom_lib.so + HINTS ${DDS_ROOT} $ENV{DDS_ROOT} + PATH_SUFFIXES lib +) + +find_library(DDS_INTERCOM_LIBRARY_SHARED + NAMES libdds_intercom_lib.dylib libdds_intercom_lib.so + HINTS ${DDS_ROOT} $ENV{DDS_ROOT} + PATH_SUFFIXES lib + DOC "Path to libdds_intercom_lib.dylib libdds_intercom_lib.so." +) + +find_library(DDS_PROTOCOL_LIBRARY_SHARED + NAMES libdds_protocol_lib.dylib libdds_protocol_lib.so + HINTS ${DDS_ROOT} $ENV{DDS_ROOT} + PATH_SUFFIXES lib + DOC "Path to libdds_protocol_lib.dylib libdds_protocol_lib.so." +) + +find_library(DDS_USER_DEFAULTS_LIBRARY_SHARED + NAMES libdds-user-defaults.dylib libdds-user-defaults.so + HINTS ${DDS_ROOT} $ENV{DDS_ROOT} + PATH_SUFFIXES lib + DOC "Path to libdds-user-defaults.dylib libdds-user-defaults.so." +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(DDS + REQUIRED_VARS + DDS_INCLUDE_DIR + DDS_LIBRARY_DIR + DDS_INTERCOM_LIBRARY_SHARED + DDS_PROTOCOL_LIBRARY_SHARED + DDS_USER_DEFAULTS_LIBRARY_SHARED +) + +if(NOT TARGET DDS::dds_intercom_lib AND DDS_FOUND) + add_library(DDS::dds_intercom_lib SHARED IMPORTED) + set_target_properties(DDS::dds_intercom_lib PROPERTIES + IMPORTED_LOCATION ${DDS_INTERCOM_LIBRARY_SHARED} + INTERFACE_INCLUDE_DIRECTORIES ${DDS_INCLUDE_DIR} + ) +endif() + +if(NOT TARGET DDS::dds_protocol_lib AND DDS_FOUND) + add_library(DDS::dds_protocol_lib SHARED IMPORTED) + set_target_properties(DDS::dds_protocol_lib PROPERTIES + IMPORTED_LOCATION ${DDS_PROTOCOL_LIBRARY_SHARED} + INTERFACE_INCLUDE_DIRECTORIES ${DDS_INCLUDE_DIR} + ) +endif() + +if(NOT TARGET DDS::dds-user-defaults AND DDS_FOUND) + add_library(DDS::dds-user-defaults SHARED IMPORTED) + set_target_properties(DDS::dds-user-defaults PROPERTIES + IMPORTED_LOCATION ${DDS_USER_DEFAULTS_LIBRARY_SHARED} + INTERFACE_INCLUDE_DIRECTORIES ${DDS_INCLUDE_DIR} + ) +endif() diff --git a/cmake/FindFlatBuffers.cmake b/cmake/FindFlatBuffers.cmake new file mode 100644 index 00000000..e3fe1e18 --- /dev/null +++ b/cmake/FindFlatBuffers.cmake @@ -0,0 +1,67 @@ +################################################################################ +# Copyright (C) 2014-2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# # +# This software is distributed under the terms of the # +# GNU Lesser General Public Licence (LGPL) version 3, # +# copied verbatim in the file "LICENSE" # +################################################################################ + +find_path(FLATBUFFERS_INCLUDE_DIR + NAMES flatbuffers/flatbuffers.h + HINTS ${FLATBUFFERS_ROOT} $ENV{FLATBUFFERS_ROOT} + PATH_SUFFIXES include +) + +find_path(FLATBUFFERS_LIBRARY_DIR + NAMES libflatbuffers.a + HINTS ${FLATBUFFERS_ROOT} $ENV{FLATBUFFERS_ROOT} + PATH_SUFFIXES lib +) + +find_library(FLATBUFFERS_STATIC_LIBRARY + NAMES libflatbuffers.a + HINTS ${FLATBUFFERS_ROOT} $ENV{FLATBUFFERS_ROOT} + PATH_SUFFIXES lib +) + +find_path(FLATBUFFERS_BINARY_DIR + NAMES flatc + HINTS ${FLATBUFFERS_ROOT} $ENV{FLATBUFFERS_ROOT} + PATH_SUFFIXES bin +) + +find_program(FLATBUFFERS_BINARY_FLATC + NAMES flatc + HINTS ${FLATBUFFERS_ROOT} $ENV{FLATBUFFERS_ROOT} + PATH_SUFFIXES bin +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(FlatBuffers + REQUIRED_VARS + FLATBUFFERS_INCLUDE_DIR + FLATBUFFERS_LIBRARY_DIR + FLATBUFFERS_BINARY_DIR +) + +# idempotently import targets +if(NOT TARGET FlatBuffers) + if(FLATBUFFERS_FOUND) + # import target + add_library(FlatBuffers STATIC IMPORTED) + set_target_properties(FlatBuffers PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${FLATBUFFERS_INCLUDE_DIR} + IMPORTED_LOCATION ${FLATBUFFERS_STATIC_LIBRARY} + ) + endif() +endif() + +if(NOT TARGET FlatBuffers::flatc) + if(FLATBUFFERS_FOUND) + # import target + add_executable(FlatBuffers::flatc IMPORTED) + set_target_properties(FlatBuffers::flatc PROPERTIES + IMPORTED_LOCATION ${FLATBUFFERS_BINARY_FLATC} + ) + endif() +endif() diff --git a/cmake/FindMsgpack.cmake b/cmake/FindMsgpack.cmake new file mode 100644 index 00000000..27b69498 --- /dev/null +++ b/cmake/FindMsgpack.cmake @@ -0,0 +1,39 @@ +################################################################################ +# Copyright (C) 2014-2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# # +# This software is distributed under the terms of the # +# GNU Lesser General Public Licence (LGPL) version 3, # +# copied verbatim in the file "LICENSE" # +################################################################################ + +find_path(MSGPACK_INCLUDE_DIR + NAMES msgpack.hpp + HINTS ${MSGPACK_ROOT} $ENV{MSGPACK_ROOT} + PATH_SUFFIXES include +) + +find_path(MSGPACK_LIBRARY_DIR + NAMES libmsgpackc.dylib libmsgpackc.so + HINTS ${MSGPACK_ROOT} $ENV{MSGPACK_ROOT} + PATH_SUFFIXES lib +) + +find_library(MSGPACK_LIBRARY_SHARED + NAMES libmsgpackc.dylib libmsgpackc.so + HINTS ${MSGPACK_ROOT} $ENV{MSGPACK_ROOT} + PATH_SUFFIXES lib +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Msgpack + REQUIRED_VARS MSGPACK_INCLUDE_DIR MSGPACK_LIBRARY_DIR MSGPACK_LIBRARY_SHARED +) + +# idempotently import targets +if(NOT TARGET Msgpack AND Msgpack_FOUND) + add_library(Msgpack SHARED IMPORTED) + set_target_properties(Msgpack PROPERTIES + IMPORTED_LOCATION ${MSGPACK_LIBRARY_SHARED} + INTERFACE_INCLUDE_DIRECTORIES ${MSGPACK_INCLUDE_DIR} + ) +endif() diff --git a/cmake/FindOFI.cmake b/cmake/FindOFI.cmake index 652089ac..40e46e6d 100644 --- a/cmake/FindOFI.cmake +++ b/cmake/FindOFI.cmake @@ -79,7 +79,7 @@ if(PKG_CONFIG_FOUND) ) endif() -if(OFI_FOUND) +if(NOT TARGET OFI::libfabric AND OFI_FOUND) # Define an imported target add_library(OFI::libfabric SHARED IMPORTED GLOBAL) set_target_properties(OFI::libfabric PROPERTIES diff --git a/cmake/FindZeroMQ.cmake b/cmake/FindZeroMQ.cmake new file mode 100644 index 00000000..8a4798ae --- /dev/null +++ b/cmake/FindZeroMQ.cmake @@ -0,0 +1,112 @@ +################################################################################ +# Copyright (C) 2012-2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# # +# This software is distributed under the terms of the # +# GNU Lesser General Public Licence (LGPL) version 3, # +# copied verbatim in the file "LICENSE" # +################################################################################ +# +# Authors: +# +# Mohammad Al-Turany +# Dario Berzano +# Dennis Klein +# Matthias Richter +# Alexey Rybalchenko +# Florian Uhlig +# +# +# ############################# +# # Locate the ZeroMQ library # +# ############################# +# +# +# Usage: +# +# find_package(ZeroMQ [version] [QUIET] [REQUIRED]) +# +# +# Defines the following variables: +# +# ZeroMQ_FOUND - Found the ZeroMQ library +# ZeroMQ_INCLUDE_DIR (CMake cache) - Include directory +# ZeroMQ_LIBRARY_SHARED (CMake cache) - Path to shared libzmq +# ZeroMQ_LIBRARY_STATIC (CMake cache) - Path to static libzmq +# ZeroMQ_VERSION - full version string +# ZeroMQ_VERSION_MAJOR - major version component +# ZeroMQ_VERSION_MINOR - minor version component +# ZeroMQ_VERSION_PATCH - patch version component +# +# +# Accepts the following variables as hints for installation directories: +# +# ZEROMQ_ROOT (CMake var, ENV var) +# +# +# If the above variables are not defined, or if ZeroMQ could not be found there, +# it will look for it in the system directories. Custom ZeroMQ installations +# will always have priority over system ones. +# + +if(NOT ZEROMQ_ROOT) + set(ZEROMQ_ROOT $ENV{ZEROMQ_ROOT}) +endif() + +find_path(ZeroMQ_INCLUDE_DIR + NAMES zmq.h zmq_utils.h + HINTS ${ZEROMQ_ROOT} $ENV{ZEROMQ_ROOT} + PATH_SUFFIXES include + DOC "ZeroMQ include directories" +) + +find_library(ZeroMQ_LIBRARY_SHARED + NAMES libzmq.dylib libzmq.so + HINTS ${ZEROMQ_ROOT} $ENV{ZEROMQ_ROOT} + PATH_SUFFIXES lib + DOC "Path to libzmq.dylib or libzmq.so" +) + +find_library(ZeroMQ_LIBRARY_STATIC NAMES libzmq.a + HINTS ${ZEROMQ_ROOT} $ENV{ZEROMQ_ROOT} + PATH_SUFFIXES lib + DOC "Path to libzmq.a" +) + +find_file(ZeroMQ_HEADER_FILE "zmq.h" + ${ZeroMQ_INCLUDE_DIR} + NO_DEFAULT_PATH +) +if(DEFINED ZeroMQ_HEADER_FILE) + file(READ "${ZeroMQ_HEADER_FILE}" _ZeroMQ_HEADER_FILE_CONTENT) + string(REGEX MATCH "#define ZMQ_VERSION_MAJOR ([0-9])" _MATCH "${_ZeroMQ_HEADER_FILE_CONTENT}") + set(ZeroMQ_VERSION_MAJOR ${CMAKE_MATCH_1}) + string(REGEX MATCH "#define ZMQ_VERSION_MINOR ([0-9])" _MATCH "${_ZeroMQ_HEADER_FILE_CONTENT}") + set(ZeroMQ_VERSION_MINOR ${CMAKE_MATCH_1}) + string(REGEX MATCH "#define ZMQ_VERSION_PATCH ([0-9])" _MATCH "${_ZeroMQ_HEADER_FILE_CONTENT}") + set(ZeroMQ_VERSION_PATCH ${CMAKE_MATCH_1}) + set(ZeroMQ_VERSION "${ZeroMQ_VERSION_MAJOR}.${ZeroMQ_VERSION_MINOR}.${ZeroMQ_VERSION_PATCH}") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ZeroMQ + REQUIRED_VARS ZeroMQ_LIBRARY_SHARED ZeroMQ_INCLUDE_DIR ZeroMQ_LIBRARY_STATIC + VERSION_VAR ZeroMQ_VERSION +) + +if(ZeroMQ_FOUND AND NOT TARGET ZeroMQ) + add_library(ZeroMQ SHARED IMPORTED) + set_target_properties(ZeroMQ PROPERTIES + IMPORTED_LOCATION ${ZeroMQ_LIBRARY_SHARED} + INTERFACE_INCLUDE_DIRECTORIES ${ZeroMQ_INCLUDE_DIR} + ) +endif() + +mark_as_advanced( + ZeroMQ_LIBRARIES + ZeroMQ_LIBRARY_SHARED + ZeroMQ_LIBRARY_STATIC + ZeroMQ_HEADER_FILE + ZeroMQ_VERSION_MAJOR + ZeroMQ_VERSION_MINOR + ZeroMQ_VERSION_PATCH +) diff --git a/cmake/Findnanomsg.cmake b/cmake/Findnanomsg.cmake new file mode 100644 index 00000000..1762cb54 --- /dev/null +++ b/cmake/Findnanomsg.cmake @@ -0,0 +1,34 @@ +################################################################################ +# Copyright (C) 2014-2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# # +# This software is distributed under the terms of the # +# GNU Lesser General Public Licence (LGPL) version 3, # +# copied verbatim in the file "LICENSE" # +################################################################################ + +find_path(NANOMSG_INCLUDE_DIR + NAMES nanomsg/nn.h + HINTS ${NANOMSG_ROOT} $ENV{NANOMSG_ROOT} + PATH_SUFFIXES include + DOC "Path to nanomsg include header files." +) + +find_library(NANOMSG_LIBRARY_SHARED + NAMES libnanomsg.dylib libnanomsg.so + HINTS ${NANOMSG_ROOT} $ENV{NANOMSG_ROOT} + PATH_SUFFIXES lib + DOC "Path to libnanomsg.dylib libnanomsg.so." +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(nanomsg + REQUIRED_VARS NANOMSG_LIBRARY_SHARED NANOMSG_INCLUDE_DIR +) + +if(NOT TARGET nanomsg AND nanomsg_FOUND) + add_library(nanomsg SHARED IMPORTED) + set_target_properties(nanomsg PROPERTIES + IMPORTED_LOCATION ${NANOMSG_LIBRARY_SHARED} + INTERFACE_INCLUDE_DIRECTORIES ${NANOMSG_INCLUDE_DIR} + ) +endif() diff --git a/cmake/GTestHelper.cmake b/cmake/GTestHelper.cmake new file mode 100644 index 00000000..b58f7330 --- /dev/null +++ b/cmake/GTestHelper.cmake @@ -0,0 +1,139 @@ +################################################################################ +# Copyright (C) 2017-2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# # +# This software is distributed under the terms of the # +# GNU Lesser General Public Licence (LGPL) version 3, # +# copied verbatim in the file "LICENSE" # +################################################################################ + +# ########################## +# # GTest helper functions # +# ########################## +# +# The helper functions allow concise cmake files for GTest based test submodules. +# Testsuites register themselves automatically as CTest test. +# +# +# Usage: +# +# add_testsuite( SOURCES source1 [source2 ...] +# [DEPENDS dep1 [dep2 ...]] +# [LINKS linklib1 [linklib2 ...] +# [INCLUDES dir1 [dir2 ...] +# [TIMEOUT seconds] +# [RUN_SERIAL ON/OFF]) +# +# -> created target: testsuite_ +# +# add_testhelper( SOURCES source1 [source2 ...] +# [DEPENDS dep1 [dep2 ...]] +# [LINKS linklib1 [linklib2 ...] +# [INCLUDES dir1 [dir2 ...]) +# +# -> created target: testhelper_ +# +# add_testlib( SOURCES source1 [source2 ...] +# [DEPENDS dep1 [dep2 ...]] +# [LINKS linklib1 [linklib2 ...] +# [INCLUDES dir1 [dir2 ...]) +# +# -> created target: +# +# The above add_* functions add all created targets to the cmake +# variable ALL_TEST_TARGETS which can be used to create an aggregate +# target, e.g.: +# +# add_custom_target(AllTests DEPENDS ${ALL_TEST_TARGETS}) +# +# + +function(add_testsuite suitename) + cmake_parse_arguments(testsuite + "" + "TIMEOUT;RUN_SERIAL" + "SOURCES;LINKS;DEPENDS;INCLUDES" + ${ARGN} + ) + + list(INSERT testsuite_LINKS 0 GTest::Main GTest::GTest) + set(target "testsuite_${suitename}") + + add_executable(${target} ${testsuite_SOURCES}) + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + set_target_properties("${target}" PROPERTIES LINK_FLAGS "-Wl,--no-as-needed") + endif() + target_link_libraries(${target} ${testsuite_LINKS}) + if(testsuite_DEPENDS) + add_dependencies(${target} ${testsuite_DEPENDS}) + endif() + if(testsuite_INCLUDES) + target_include_directories(${target} PUBLIC ${testsuite_INCLUDES}) + endif() + + add_test(NAME "${suitename}" WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND ${target}) + if(testsuite_TIMEOUT) + set_tests_properties("${suitename}" PROPERTIES TIMEOUT ${testsuite_TIMEOUT}) + endif() + if(testsuite_RUN_SERIAL) + set_tests_properties("${suitename}" PROPERTIES RUN_SERIAL ${testsuite_RUN_SERIAL}) + endif() + + list(APPEND ALL_TEST_TARGETS ${target}) + set(ALL_TEST_TARGETS ${ALL_TEST_TARGETS} PARENT_SCOPE) +endfunction() + +function(add_testhelper helpername) + cmake_parse_arguments(testhelper + "" + "" + "SOURCES;LINKS;DEPENDS;INCLUDES" + ${ARGN} + ) + + set(target "testhelper_${helpername}") + + add_executable(${target} ${testhelper_SOURCES}) + if(testhelper_LINKS) + target_link_libraries(${target} ${testhelper_LINKS}) + endif() + if(testhelper_DEPENDS) + add_dependencies(${target} ${testhelper_DEPENDS}) + endif() + if(testhelper_INCLUDES) + target_include_directories(${target} PUBLIC ${testhelper_INCLUDES}) + endif() + + list(APPEND ALL_TEST_TARGETS ${target}) + set(ALL_TEST_TARGETS ${ALL_TEST_TARGETS} PARENT_SCOPE) +endfunction() + +function(add_testlib libname) + cmake_parse_arguments(testlib + "HIDDEN" + "VERSION" + "SOURCES;LINKS;DEPENDS;INCLUDES" + ${ARGN} + ) + + set(target "${libname}") + + add_library(${target} SHARED ${testlib_SOURCES}) + if(testlib_LINKS) + target_link_libraries(${target} ${testlib_LINKS}) + endif() + if(testlib_DEPENDS) + add_dependencies(${target} ${testlib_DEPENDS}) + endif() + if(testlib_INCLUDES) + target_include_directories(${target} PUBLIC ${testlib_INCLUDES}) + endif() + if(testlib_HIDDEN) + set_target_properties(${target} PROPERTIES CXX_VISIBILITY_PRESET hidden) + endif() + if(testlib_VERSION) + set_target_properties(${target} PROPERTIES VERSION ${testlib_VERSION}) + endif() + + list(APPEND ALL_TEST_TARGETS ${target}) + set(ALL_TEST_TARGETS ${ALL_TEST_TARGETS} PARENT_SCOPE) +endfunction() diff --git a/fairmq/CMakeLists.txt b/fairmq/CMakeLists.txt index 6e3ec152..7d65ed6f 100644 --- a/fairmq/CMakeLists.txt +++ b/fairmq/CMakeLists.txt @@ -1,5 +1,5 @@ ################################################################################ -# Copyright (C) 2012-2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# Copyright (C) 2012-2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # # # # This software is distributed under the terms of the # # GNU Lesser General Public Licence (LGPL) version 3, # @@ -9,29 +9,27 @@ #################### # external plugins # #################### -if (DDS_FOUND) - add_subdirectory(plugins/DDS) +if(BUILD_DDS_PLUGIN) + add_subdirectory(plugins/DDS) endif() ############################ # preprocessor definitions # ############################ -if(NANOMSG_FOUND) - add_definitions(-DNANOMSG_FOUND) - if(MSGPACK_FOUND) - add_definitions(-DMSGPACK_FOUND) - endif() +if(BUILD_NANOMSG_TRANSPORT) + add_definitions(-DBUILD_NANOMSG_TRANSPORT) endif() if(BUILD_OFI_TRANSPORT) - add_definitions(-DBUILD_OFI_TRANSPORT) + add_definitions(-DBUILD_OFI_TRANSPORT) endif() ################## # subdirectories # ################## -add_subdirectory(shmem/prototype) +# add_subdirectory(shmem/prototype) + ########################## # libFairMQ header files # @@ -94,7 +92,7 @@ set(FAIRMQ_HEADER_FILES zeromq/FairMQTransportFactoryZMQ.h ) -if(NANOMSG_FOUND) +if(BUILD_NANOMSG_TRANSPORT) set(FAIRMQ_HEADER_FILES ${FAIRMQ_HEADER_FILES} nanomsg/FairMQMessageNN.h nanomsg/FairMQPollerNN.h @@ -157,7 +155,7 @@ set(FAIRMQ_SOURCE_FILES zeromq/FairMQTransportFactoryZMQ.cxx ) -if(NANOMSG_FOUND) +if(BUILD_NANOMSG_TRANSPORT) set(FAIRMQ_SOURCE_FILES ${FAIRMQ_SOURCE_FILES} nanomsg/FairMQMessageNN.cxx nanomsg/FairMQPollerNN.cxx @@ -237,6 +235,9 @@ target_include_directories(FairMQ ################## # link libraries # ################## +if(BUILD_NANOMSG_TRANSPORT) + set(NANOMSG_DEPS nanomsg msgpackc) +endif() if(BUILD_OFI_TRANSPORT) set(OFI_DEPS OFI::libfabric protobuf::libprotobuf) endif() @@ -254,13 +255,12 @@ target_link_libraries(FairMQ Boost::regex Boost::date_time Boost::signals - Logger + FairLogger::FairLogger $<$:rt> PRIVATE # only libFairMQ links against private dependencies ZeroMQ - $<$:nanomsg> - $<$,$>:Msgpack> + ${NANOMSG_DEPS} ${OFI_DEPS} ) @@ -310,15 +310,9 @@ install( splitter shmmonitor - EXPORT FairMQ - - LIBRARY - DESTINATION lib - COMPONENT fairmq - - RUNTIME - DESTINATION bin - COMPONENT fairmq + EXPORT ${FairMQ_EXPORT_SET} + LIBRARY DESTINATION ${FairMQ_INSTALL_LIBDIR} + RUNTIME DESTINATION ${FairMQ_INSTALL_BINDIR} ) # preserve relative path and prepend fairmq @@ -327,6 +321,5 @@ foreach(HEADER ${FAIRMQ_HEADER_FILES}) file(TO_CMAKE_PATH include/fairmq/${_path} _destination) install(FILES ${HEADER} DESTINATION ${_destination} - COMPONENT fairmq ) endforeach() diff --git a/fairmq/FairMQLogger.h b/fairmq/FairMQLogger.h index 95775df3..090753fd 100644 --- a/fairmq/FairMQLogger.h +++ b/fairmq/FairMQLogger.h @@ -1,20 +1,14 @@ /******************************************************************************** - * Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * Copyright (C) 2017-2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ -/** - * FairMQLogger.h - * - * @since 2012-12-04 - * @author D. Klein, A. Rybalchenko - */ #ifndef FAIRMQLOGGER_H_ #define FAIRMQLOGGER_H_ -#include +#include #endif /* FAIRMQLOGGER_H_ */ diff --git a/fairmq/FairMQTransportFactory.cxx b/fairmq/FairMQTransportFactory.cxx index e61e3de2..544381d5 100644 --- a/fairmq/FairMQTransportFactory.cxx +++ b/fairmq/FairMQTransportFactory.cxx @@ -9,9 +9,9 @@ #include #include #include -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT #include -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ #ifdef BUILD_OFI_TRANSPORT #include #endif @@ -47,12 +47,12 @@ auto FairMQTransportFactory::CreateTransportFactory(const std::string& type, con { return make_shared(finalId, config); } -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT else if (type == "nanomsg") { return make_shared(finalId, config); } -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ #ifdef BUILD_OFI_TRANSPORT else if (type == "ofi") { @@ -64,9 +64,9 @@ auto FairMQTransportFactory::CreateTransportFactory(const std::string& type, con LOG(error) << "Unavailable transport requested: " << "\"" << type << "\"" << ". Available are: " << "\"zeromq\"" << "\"shmem\"" -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT << ", \"nanomsg\"" -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ #ifdef BUILD_OFI_TRANSPORT << ", and \"ofi\"" #endif /* BUILD_OFI_TRANSPORT */ diff --git a/fairmq/Version.h.in b/fairmq/Version.h.in index 7e07f861..6e493e98 100644 --- a/fairmq/Version.h.in +++ b/fairmq/Version.h.in @@ -10,7 +10,6 @@ #define FAIRMQ_VERSION "@PROJECT_VERSION@" #define FAIRMQ_VERSION_DEC (@PROJECT_VERSION_MAJOR@ * 10000) + (@PROJECT_VERSION_MINOR@ * 100) + @PROJECT_VERSION_PATCH@ -#define FAIRMQ_VERSION_HEX (@PROJECT_VERSION_MAJOR@ << 16) + (@PROJECT_VERSION_MINOR@ << 8) + @PROJECT_VERSION_PATCH@ #define FAIRMQ_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ #define FAIRMQ_VERSION_MINOR @PROJECT_VERSION_MINOR@ #define FAIRMQ_VERSION_PATCH @PROJECT_VERSION_PATCH@ diff --git a/fairmq/plugins/DDS/CMakeLists.txt b/fairmq/plugins/DDS/CMakeLists.txt index e18e5f6d..ec0bc392 100644 --- a/fairmq/plugins/DDS/CMakeLists.txt +++ b/fairmq/plugins/DDS/CMakeLists.txt @@ -7,24 +7,18 @@ ################################################################################ set(plugin FairMQPlugin_dds) - add_library(${plugin} SHARED ${CMAKE_CURRENT_SOURCE_DIR}/DDS.cxx ${CMAKE_CURRENT_SOURCE_DIR}/DDS.h) -target_link_libraries(${plugin} FairMQ ${DDS_INTERCOM_LIBRARY_SHARED} ${DDS_PROTOCOL_LIBRARY_SHARED} ${DDS_USER_DEFAULTS_LIBRARY_SHARED}) -target_include_directories(${plugin} PRIVATE ${CMAKE_CURRENT_BINARY_DIR} PUBLIC ${DDS_INCLUDE_DIR}) +target_link_libraries(${plugin} FairMQ DDS::dds_intercom_lib DDS::dds_protocol_lib DDS::dds-user-defaults) +target_include_directories(${plugin} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) set_target_properties(${plugin} PROPERTIES CXX_VISIBILITY_PRESET hidden) -add_executable(fairmq-dds-command-ui ${CMAKE_CURRENT_SOURCE_DIR}/runDDSCommandUI.cxx) -target_link_libraries(fairmq-dds-command-ui FairMQ ${DDS_INTERCOM_LIBRARY_SHARED} ${DDS_PROTOCOL_LIBRARY_SHARED} ${DDS_USER_DEFAULTS_LIBRARY_SHARED}) -target_include_directories(fairmq-dds-command-ui PRIVATE ${CMAKE_CURRENT_BINARY_DIR} PUBLIC ${DDS_INCLUDE_DIR}) +set(exe fairmq-dds-command-ui) +add_executable(${exe} ${CMAKE_CURRENT_SOURCE_DIR}/runDDSCommandUI.cxx) +target_link_libraries(${exe} FairMQ DDS::dds_intercom_lib DDS::dds_protocol_lib DDS::dds-user-defaults) +target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -install(TARGETS ${plugin} fairmq-dds-command-ui - EXPORT FairMQ - - LIBRARY - DESTINATION lib - COMPONENT fairmq - - RUNTIME - DESTINATION bin - COMPONENT fairmq +install(TARGETS ${plugin} ${exe} + EXPORT ${FairMQ_EXPORT_SET} + LIBRARY DESTINATION ${FairMQ_INSTALL_LIBDIR} + RUNTIME DESTINATION ${FairMQ_INSTALL_BINDIR} ) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 05366645..8948de54 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -31,8 +31,8 @@ add_testhelper(runTestDevice ) -set(MQ_CONFIG "${CMAKE_BINARY_DIR}/bin/testsuite_FairMQ.IOPatterns_config.json") -set(RUN_TEST_DEVICE "${CMAKE_BINARY_DIR}/bin/testhelper_runTestDevice") +set(MQ_CONFIG "${CMAKE_BINARY_DIR}/test/testsuite_FairMQ.IOPatterns_config.json") +set(RUN_TEST_DEVICE "${CMAKE_BINARY_DIR}/test/testhelper_runTestDevice") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protocols/config.json.in ${MQ_CONFIG}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protocols/runner.cxx.in ${CMAKE_CURRENT_BINARY_DIR}/protocols/runner.cxx) diff --git a/test/message_resize/_message_resize.cxx b/test/message_resize/_message_resize.cxx index eb9ef611..632cb453 100644 --- a/test/message_resize/_message_resize.cxx +++ b/test/message_resize/_message_resize.cxx @@ -63,11 +63,11 @@ TEST(MessageResize, shmem) RunPushPullWithMsgResize("shmem", "ipc://test_message_resize"); } -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT TEST(MessageResize, nanomsg) { RunPushPullWithMsgResize("nanomsg", "ipc://test_message_resize"); } -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ } // namespace diff --git a/test/plugins/_plugin_manager.cxx b/test/plugins/_plugin_manager.cxx index 32fecc62..b68721cc 100644 --- a/test/plugins/_plugin_manager.cxx +++ b/test/plugins/_plugin_manager.cxx @@ -44,7 +44,7 @@ TEST(PluginManager, LoadPluginDynamic) auto device = make_shared(); mgr.EmplacePluginServices(&config, device); - mgr.PrependSearchPath("./lib"); + mgr.PrependSearchPath("./test"); ASSERT_NO_THROW(mgr.LoadPlugin("test_dummy")); ASSERT_NO_THROW(mgr.LoadPlugin("test_dummy2")); diff --git a/test/protocols/_pair.cxx b/test/protocols/_pair.cxx index cada5cbd..099b9763 100644 --- a/test/protocols/_pair.cxx +++ b/test/protocols/_pair.cxx @@ -56,12 +56,12 @@ TEST(Pair, MP_ShMem___tcp____SingleMsg) EXPECT_EXIT(RunPair("shmem"), ::testing::ExitedWithCode(0), "PAIR test successfull"); } -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT TEST(Pair, MP_Nanomsg_tcp____SingleMsg) { EXPECT_EXIT(RunPair("nanomsg"), ::testing::ExitedWithCode(0), "PAIR test successfull"); } -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ #ifdef BUILD_OFI_TRANSPORT TEST(Pair, MP_Ofi_____tcp____SingleMsg) diff --git a/test/protocols/_poller.cxx b/test/protocols/_poller.cxx index f81d1591..e3d07940 100644 --- a/test/protocols/_poller.cxx +++ b/test/protocols/_poller.cxx @@ -55,12 +55,12 @@ TEST(Poller, ZeroMQ_subchannel) EXPECT_EXIT(RunPoller("zeromq", 0), ::testing::ExitedWithCode(0), "POLL test successfull"); } -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT TEST(Poller, Nanomsg_subchannel) { EXPECT_EXIT(RunPoller("nanomsg", 0), ::testing::ExitedWithCode(0), "POLL test successfull"); } -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ TEST(Poller, ShMem_subchannel) { @@ -72,12 +72,12 @@ TEST(Poller, ZeroMQ_channel) EXPECT_EXIT(RunPoller("zeromq", 1), ::testing::ExitedWithCode(0), "POLL test successfull"); } -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT TEST(Poller, Nanomsg_channel) { EXPECT_EXIT(RunPoller("nanomsg", 1), ::testing::ExitedWithCode(0), "POLL test successfull"); } -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ TEST(Poller, ShMem_channel) { diff --git a/test/protocols/_pub_sub.cxx b/test/protocols/_pub_sub.cxx index 4a02a938..1de3ef84 100644 --- a/test/protocols/_pub_sub.cxx +++ b/test/protocols/_pub_sub.cxx @@ -60,11 +60,11 @@ TEST(PubSub, ZeroMQ) EXPECT_EXIT(RunPubSub("zeromq"), ::testing::ExitedWithCode(0), "PUB-SUB test successfull"); } -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT TEST(PubSub, Nanomsg) { EXPECT_EXIT(RunPubSub("nanomsg"), ::testing::ExitedWithCode(0), "PUB-SUB test successfull"); } -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ } // namespace diff --git a/test/protocols/_push_pull.cxx b/test/protocols/_push_pull.cxx index 558d97c7..af309d56 100644 --- a/test/protocols/_push_pull.cxx +++ b/test/protocols/_push_pull.cxx @@ -56,11 +56,11 @@ TEST(PushPull, MP_ShMem___tcp____SingleMsg) EXPECT_EXIT(RunPushPull("shmem"), ::testing::ExitedWithCode(0), "PUSH-PULL test successfull"); } -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT TEST(PushPull, MP_Nanomsg_tcp____SingleMsg) { EXPECT_EXIT(RunPushPull("nanomsg"), ::testing::ExitedWithCode(0), "PUSH-PULL test successfull"); } -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ } // namespace diff --git a/test/protocols/_push_pull_multipart.cxx b/test/protocols/_push_pull_multipart.cxx index a4269586..6d5b0380 100644 --- a/test/protocols/_push_pull_multipart.cxx +++ b/test/protocols/_push_pull_multipart.cxx @@ -113,12 +113,12 @@ TEST(PushPull, ST_Shmem___inproc_Multipart) RunSingleThreadedMultipart("shmem", "inproc://test"); } -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT TEST(PushPull, ST_Nanomsg_inproc_Multipart) { RunSingleThreadedMultipart("nanomsg", "inproc://test"); } -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ TEST(PushPull, ST_ZeroMQ__ipc____Multipart) { @@ -130,12 +130,12 @@ TEST(PushPull, ST_Shmen___ipc____Multipart) RunSingleThreadedMultipart("shmem", "ipc://test_ST_Shmen___ipc____Multipart"); } -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT TEST(PushPull, ST_Nanomsg_ipc____Multipart) { RunSingleThreadedMultipart("nanomsg", "ipc://test_ST_Nanomsg_ipc____Multipart"); } -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ TEST(PushPull, MT_ZeroMQ__inproc_Multipart) { @@ -147,12 +147,12 @@ TEST(PushPull, MT_Shmem___inproc_Multipart) RunMultiThreadedMultipart("shmem", "inproc://test"); } -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT TEST(PushPull, MT_Nanomsg_inproc_Multipart) { RunMultiThreadedMultipart("nanomsg", "inproc://test"); } -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ TEST(PushPull, MT_ZeroMQ__ipc____Multipart) { @@ -164,11 +164,11 @@ TEST(PushPull, MT_Shmem___ipc____Multipart) RunMultiThreadedMultipart("shmem", "ipc://test_MT_Shmem___ipc____Multipart"); } -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT TEST(PushPull, MT_Nanomsg_ipc____Multipart) { RunMultiThreadedMultipart("nanomsg", "ipc://test_MT_Nanomsg_ipc____Multipart"); } -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ } // namespace diff --git a/test/protocols/_req_rep.cxx b/test/protocols/_req_rep.cxx index 46f7e7d1..07dee3bc 100644 --- a/test/protocols/_req_rep.cxx +++ b/test/protocols/_req_rep.cxx @@ -65,11 +65,11 @@ TEST(ReqRep, ShMem) EXPECT_EXIT(RunReqRep("shmem"), ::testing::ExitedWithCode(0), "REQ-REP test successfull"); } -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT TEST(ReqRep, Nanomsg) { EXPECT_EXIT(RunReqRep("nanomsg"), ::testing::ExitedWithCode(0), "REQ-REP test successfull"); } -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ } // namespace diff --git a/test/protocols/_transfer_timeout.cxx b/test/protocols/_transfer_timeout.cxx index 0ece5d60..116afce9 100644 --- a/test/protocols/_transfer_timeout.cxx +++ b/test/protocols/_transfer_timeout.cxx @@ -41,11 +41,11 @@ TEST(TransferTimeout, ShMem) EXPECT_EXIT(RunTransferTimeout("shmem"), ::testing::ExitedWithCode(0), "Transfer timeout test successfull"); } -#ifdef NANOMSG_FOUND +#ifdef BUILD_NANOMSG_TRANSPORT TEST(TransferTimeout, Nanomsg) { EXPECT_EXIT(RunTransferTimeout("nanomsg"), ::testing::ExitedWithCode(0), "Transfer timeout test successfull"); } -#endif /* NANOMSG_FOUND */ +#endif /* BUILD_NANOMSG_TRANSPORT */ } // namespace