mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
Add header-only target for msgpack
This commit is contained in:
parent
4a8e46c65c
commit
ab6fd35a86
46
cmake/Findmsgpack.cmake
Normal file
46
cmake/Findmsgpack.cmake
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
################################################################################
|
||||||
|
# Copyright (C) 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" #
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
unset(_args)
|
||||||
|
|
||||||
|
if(msgpack_FIND_VERSION)
|
||||||
|
list(APPEND _args ${msgpack_FIND_VERSION})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(msgpack_FIND_EXACT)
|
||||||
|
list(APPEND _args "EXACT")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(msgpack_FIND_QUIETLY)
|
||||||
|
list(APPEND _args "QUIET")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(msgpack_FIND_REQUIRED)
|
||||||
|
list(APPEND _args "REQUIRED")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(msgpack_FIND_COMPONENTS)
|
||||||
|
list(APPEND _args "COMPONENTS" ${msgpack_FIND_COMPONENTS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(msgpack ${_args} CONFIG)
|
||||||
|
|
||||||
|
if(msgpack_FOUND AND NOT TARGET msgpack::msgpack)
|
||||||
|
# config mode find_package does not set $msgpack_ROOT, workaround by extracting
|
||||||
|
# root path from library target
|
||||||
|
unset(_msgpack_lib)
|
||||||
|
unset(_prefix)
|
||||||
|
get_target_property(_msgpack_lib msgpackc INTERFACE_LOCATION)
|
||||||
|
get_filename_component(_prefix ${_msgpack_lib} DIRECTORY)
|
||||||
|
get_filename_component(_prefix ${_prefix}/.. ABSOLUTE)
|
||||||
|
|
||||||
|
add_library(msgpack::msgpack INTERFACE IMPORTED)
|
||||||
|
set_target_properties(msgpack::msgpack PROPERTIES
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${_prefix}/include"
|
||||||
|
)
|
||||||
|
endif()
|
|
@ -214,7 +214,7 @@ target_include_directories(FairMQ
|
||||||
# link libraries #
|
# link libraries #
|
||||||
##################
|
##################
|
||||||
if(BUILD_NANOMSG_TRANSPORT)
|
if(BUILD_NANOMSG_TRANSPORT)
|
||||||
set(NANOMSG_DEPS nanomsg msgpackc)
|
set(NANOMSG_DEPS nanomsg msgpack::msgpack)
|
||||||
endif()
|
endif()
|
||||||
if(BUILD_OFI_TRANSPORT)
|
if(BUILD_OFI_TRANSPORT)
|
||||||
set(OFI_DEPS OFI::libfabric protobuf::libprotobuf $<TARGET_OBJECTS:OfiTransport>)
|
set(OFI_DEPS OFI::libfabric protobuf::libprotobuf $<TARGET_OBJECTS:OfiTransport>)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user