|
| 1 | +# - Tries to find the O2 Monitoring package (include dir and library) |
| 2 | +# Author: Barthelemy von Haller |
| 3 | +# Author: Adam Wegrzynek |
| 4 | +# |
| 5 | +# |
| 6 | +# This module will set the following non-cached variables: |
| 7 | +# Monitoring_FOUND - states whether Monitoring package has been found |
| 8 | +# Monitoring_INCLUDE_DIRS - Monitoring include directory |
| 9 | +# Monitoring_LIBRARIES - Monitoring library filepath |
| 10 | +# Monitoring_DEFINITIONS - Compiler definitions when comping code using Monitoring |
| 11 | +# |
| 12 | +# Also following cached variables, but not for general use, are defined: |
| 13 | +# MONITORING_INCLUDE_DIR |
| 14 | +# MONITORING_LIBRARY |
| 15 | +# |
| 16 | +# This module respects following variables: |
| 17 | +# Monitoring_ROOT - Installation root directory (otherwise it goes through LD_LIBRARY_PATH and ENV) |
| 18 | + |
| 19 | +# Init |
| 20 | +include(FindPackageHandleStandardArgs) |
| 21 | + |
| 22 | +# find includes |
| 23 | +find_path(MONITORING_INCLUDE_DIR Monitoring.h |
| 24 | + HINTS ${Monitoring_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/Monitoring" "../../include/Monitoring" ) |
| 25 | + |
| 26 | +# Remove the final "Monitoring" |
| 27 | +get_filename_component(MONITORING_INCLUDE_DIR ${MONITORING_INCLUDE_DIR} DIRECTORY) |
| 28 | +set(Monitoring_INCLUDE_DIRS ${MONITORING_INCLUDE_DIR}) |
| 29 | + |
| 30 | +# find library |
| 31 | +find_library(MONITORING_LIBRARY NAMES Monitoring HINTS ${Monitoring_ROOT}/lib ENV LD_LIBRARY_PATH) |
| 32 | +set(Monitoring_LIBRARIES ${MONITORING_LIBRARY}) |
| 33 | + |
| 34 | +# handle the QUIETLY and REQUIRED arguments and set Monitoring_FOUND to TRUE |
| 35 | +# if all listed variables are TRUE |
| 36 | +find_package_handle_standard_args(Monitoring "Monitoring could not be found. Set Monitoring_ROOT as root installation directory." |
| 37 | + MONITORING_LIBRARY MONITORING_INCLUDE_DIR) |
| 38 | +if(${Monitoring_FOUND}) |
| 39 | + set(Monitoring_DEFINITIONS "") |
| 40 | + message(STATUS "Monitoring found : ${Monitoring_LIBRARIES}") |
| 41 | +endif() |
| 42 | + |
| 43 | +mark_as_advanced(MONITORING_INCLUDE_DIR MONITORING_LIBRARY) |
0 commit comments