summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindRabbitMQ.cmake
blob: 93aa8204b7c74e8e04e3c038177ae6de637303f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
find_path(rabbitmq_INCLUDE_DIR
  NAMES amqp.h)

find_library(rabbitmq_LIBRARY
  NAMES rabbitmq)

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(RabbitMQ DEFAULT_MSG
  rabbitmq_INCLUDE_DIR
  rabbitmq_LIBRARY)

if(RabbitMQ_FOUND AND NOT (TARGET RabbitMQ::RabbitMQ))
  add_library(RabbitMQ::RabbitMQ UNKNOWN IMPORTED)
  set_target_properties(RabbitMQ::RabbitMQ PROPERTIES
    INTERFACE_INCLUDE_DIRECTORIES "${rabbitmq_INCLUDE_DIR}"
    IMPORTED_LINK_INTERFACE_LANGUAGES "C"
    IMPORTED_LOCATION "${rabbitmq_LIBRARY}")
endif()