|
| 1 | +# - Try to find the O2 Configuration package include dirs and libraries |
| 2 | +# Author: Barthelemy von Haller |
| 3 | +# |
| 4 | +# This script will set the following variables: |
| 5 | +# Configuration_FOUND - System has Configuration |
| 6 | +# Configuration_INCLUDE_DIRS - The Configuration include directories |
| 7 | +# Configuration_LIBRARIES - The libraries needed to use Configuration |
| 8 | +# Configuration_DEFINITIONS - Compiler switches required for using Configuration |
| 9 | +# |
| 10 | +# This script can use the following variables: |
| 11 | +# Configuration_ROOT - Installation root to tell this module where to look. (it tries LD_LIBRARY_PATH otherwise) |
| 12 | + |
| 13 | +# Init |
| 14 | +include(FindPackageHandleStandardArgs) |
| 15 | + |
| 16 | +# find includes |
| 17 | +find_path(CONFIGURATION_INCLUDE_DIR Configuration.h |
| 18 | + HINTS ${Configuration_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/Configuration" "../../include/Configuration" ) |
| 19 | +# Remove the final "Configuration" |
| 20 | +get_filename_component(CONFIGURATION_INCLUDE_DIR ${CONFIGURATION_INCLUDE_DIR} DIRECTORY) |
| 21 | +set(Configuration_INCLUDE_DIRS ${CONFIGURATION_INCLUDE_DIR}) |
| 22 | + |
| 23 | +# find library |
| 24 | +find_library(CONFIGURATION_LIBRARY NAMES Configuration HINTS ${Configuration_ROOT}/lib ENV LD_LIBRARY_PATH) |
| 25 | +set(Configuration_LIBRARIES ${CONFIGURATION_LIBRARY}) |
| 26 | + |
| 27 | +# handle the QUIETLY and REQUIRED arguments and set CONFIGURATION_FOUND to TRUE |
| 28 | +# if all listed variables are TRUE |
| 29 | +find_package_handle_standard_args(Configuration "Configuration could not be found. Install package Configuration or set Configuration_ROOT to its root installation directory." |
| 30 | + CONFIGURATION_LIBRARY CONFIGURATION_INCLUDE_DIR) |
| 31 | + |
| 32 | +if(${CONFIGURATION_FOUND}) |
| 33 | + message(STATUS "Configuration found : ${Configuration_LIBRARIES}") |
| 34 | +endif() |
| 35 | + |
| 36 | +mark_as_advanced(CONFIGURATION_INCLUDE_DIR CONFIGURATION_LIBRARY) |
0 commit comments