File: Finddml.cmake

package info (click to toggle)
ceph 18.2.8%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,186,356 kB
  • sloc: cpp: 6,282,106; ansic: 3,507,390; python: 375,284; asm: 216,381; java: 133,450; sh: 125,595; xml: 39,398; ruby: 32,026; makefile: 29,004; javascript: 23,994; cs: 18,980; perl: 9,709; sql: 7,833; lisp: 5,920; pascal: 3,109; ada: 1,681; yacc: 478; awk: 188; f90: 55; php: 1
file content (58 lines) | stat: -rw-r--r-- 1,500 bytes parent folder | download | duplicates (3)
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
# - Find libdml
# Find the dml and dmlhl libraries and includes
#
# DML_INCLUDE_DIR - where to find dml.hpp etc.
# DML_LIBRARIES - List of libraries when using dml.
# DML_HL_LIBRARIES - List of libraries when using dmlhl.
# DML_FOUND - True if DML found.


find_path(DML_INCLUDE_DIR
  dml/dml.hpp
  PATHS
  /usr/include
  /usr/local/include)

find_library(DML_LIBRARIES NAMES dml libdml PATHS
  /usr/local/
  /usr/local/lib64
  /usr/lib64
  /usr/lib)

find_library(DML_HL_LIBRARIES NAMES dmlhl libdmlhl PATHS
  /usr/local/
  /usr/local/lib64
  /usr/lib64
  /usr/lib)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(dml DEFAULT_MSG
  DML_LIBRARIES
  DML_INCLUDE_DIR
  DML_HL_LIBRARIES)

mark_as_advanced(
  DML_LIBRARIES
  DML_INCLUDE_DIR
  DML_HL_LIBRARIES)

if(DML_FOUND)
  if(NOT (TARGET dml::dml))
    add_library(dml::dml UNKNOWN IMPORTED)
    set_target_properties(dml::dml PROPERTIES
      INTERFACE_INCLUDE_DIRECTORIES "${DML_INCLUDE_DIR}"
      IMPORTED_LINK_INTERFACE_LANGUAGES "C"
      IMPORTED_LOCATION "${DML_LIBRARIES}")
  endif()

  if(NOT (TARGET dml::dmlhl))
    add_library(dml::dmlhl UNKNOWN IMPORTED)
    set_target_properties(dml::dmlhl PROPERTIES
      INTERFACE_INCLUDE_DIRECTORIES "${DML_INCLUDE_DIR}"
      INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS}
      INTERFACE_COMPILE_FEATURES cxx_std_17
      INTERFACE_COMPILE_DEFINITIONS "DML_HW"
      IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
      IMPORTED_LOCATION "${DML_HL_LIBRARIES}")
  endif()
endif()