File: FindDAOS.cmake

package info (click to toggle)
adios2 2.10.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 33,764 kB
  • sloc: cpp: 175,964; ansic: 160,510; f90: 14,630; yacc: 12,668; python: 7,275; perl: 7,126; sh: 2,825; lisp: 1,106; xml: 1,049; makefile: 579; lex: 557
file content (61 lines) | stat: -rw-r--r-- 2,175 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#------------------------------------------------------------------------------#
# Distributed under the OSI-approved Apache License, Version 2.0.  See
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#
#
# FindDAOS
# -----------
#
# Try to find the DAOS library
#
# This module defines the following variables:
#
#   DAOS_FOUND        - System has DAOS
#   DAOS_INCLUDE_DIRS - The DAOS include directory
#   DAOS_LIBRARIES    - Link these to use DAOS
#
# and the following imported targets:
#   DAOS::DAOS - The core DAOS library
#
# You can also set the following variable to help guide the search:
#   DAOS_ROOT - The install prefix for DAOS containing the
#                     include and lib folders
#                     Note: this can be set as a CMake variable or an
#                           environment variable.  If specified as a CMake
#                           variable, it will override any setting specified
#                           as an environment variable.

if((NOT DAOS_ROOT) AND (NOT (ENV{DAOS_ROOT} STREQUAL "")))
  set(DAOS_ROOT "$ENV{DAOS_ROOT}")
endif()
if(DAOS_ROOT)
  set(DAOS_INCLUDE_OPTS HINTS ${DAOS_ROOT}/include NO_DEFAULT_PATHS)
  set(DAOS_LIBRARY_OPTS
    HINTS ${DAOS_ROOT}/lib ${DAOS_ROOT}/lib64
    NO_DEFAULT_PATHS
    )
endif()

find_path(DAOS_INCLUDE_DIR daos_api.h ${DAOS_INCLUDE_OPTS})
find_library(DAOS_LIBRARY libdaos.so ${DAOS_LIBRARY_OPTS})
find_library(DFS_LIBRARY libdfs.so ${DAOS_LIBRARY_OPTS})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DAOS
  FOUND_VAR DAOS_FOUND
  REQUIRED_VARS DAOS_LIBRARY DFS_LIBRARY DAOS_INCLUDE_DIR
)

if(DAOS_FOUND)
  set(DAOS_INCLUDE_DIRS ${DAOS_INCLUDE_DIR})
  set(DAOS_LIBRARIES ${DAOS_LIBRARY} ${DFS_LIBRARY})
  message(STATUS "DAOS Libraries \"${DAOS_LIBRARIES}\"")
  if(NOT TARGET DAOS::DAOS)
    add_library(DAOS::DAOS UNKNOWN IMPORTED)
    set_target_properties(DAOS::DAOS PROPERTIES
      IMPORTED_LOCATION             "${DAOS_LIBRARY}"
      INTERFACE_INCLUDE_DIRECTORIES "${DAOS_INCLUDE_DIR}"
      INTERFACE_LINK_LIBRARIES      "${DAOS_LIBRARIES}"
    )
  endif()
endif()