|
| 1 | +# Locate amqp-cpp |
| 2 | +# |
| 3 | +# This module defines |
| 4 | +# AMQPCPP_FOUND, if false, do not try to link to amqp-cpp |
| 5 | +# AMQPCPP_LIBRARY, where to find amqp-cpp |
| 6 | +# AMQPCPP_INCLUDE_DIR, where to find yaml.h |
| 7 | +# |
| 8 | +# By default, the dynamic libraries of amqp-cpp will be found. To find the static ones instead, |
| 9 | +# you must set the AMQPCPP_STATIC_LIBRARY variable to TRUE before calling find_package(YamlCpp ...). |
| 10 | +# |
| 11 | +# If amqp-cpp is not installed in a standard path, you can use the AMQPCPP_DIR CMake variable |
| 12 | +# to tell CMake where amqp-cpp is. |
| 13 | + |
| 14 | +# attempt to find static library first if this is set |
| 15 | +if(AMQPCPP_STATIC_LIBRARY) |
| 16 | + set(AMQPCPP_STATIC libamqpcpp.a) |
| 17 | +endif() |
| 18 | + |
| 19 | +# find the amqp-cpp include directory |
| 20 | +find_path(AMQPCPP_INCLUDE_DIR amqpcpp.h |
| 21 | + PATH_SUFFIXES include |
| 22 | + PATHS |
| 23 | + ~/Library/Frameworks/amqp-cpp/include/ |
| 24 | + /Library/Frameworks/amqp-cpp/include/ |
| 25 | + /usr/local/include/ |
| 26 | + /usr/include/ |
| 27 | + ${AMQPCPP_DIR}/include/) |
| 28 | + |
| 29 | +# find the amqp-cpp library |
| 30 | +find_library(AMQPCPP_LIBRARY |
| 31 | + NAMES ${AMQPCPP_STATIC} amqpcpp |
| 32 | + PATH_SUFFIXES lib64 lib |
| 33 | + PATHS ~/Library/Frameworks |
| 34 | + /Library/Frameworks |
| 35 | + /usr/local |
| 36 | + /usr |
| 37 | + ${AMQPCPP_DIR}/lib) |
| 38 | + |
| 39 | +# handle the QUIETLY and REQUIRED arguments and set AMQPCPP_FOUND to TRUE if all listed variables are TRUE |
| 40 | +include(FindPackageHandleStandardArgs) |
| 41 | +FIND_PACKAGE_HANDLE_STANDARD_ARGS(AMQPCPP DEFAULT_MSG AMQPCPP_INCLUDE_DIR AMQPCPP_LIBRARY) |
| 42 | +mark_as_advanced(AMQPCPP_INCLUDE_DIR AMQPCPP_LIBRARY) |
0 commit comments