]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | # |
2 | # This file is open source software, licensed to you under the terms | |
3 | # of the Apache License, Version 2.0 (the "License"). See the NOTICE file | |
4 | # distributed with this work for additional information regarding copyright | |
5 | # ownership. You may not use this file except in compliance with the License. | |
6 | # | |
7 | # You may obtain a copy of the License at | |
8 | # | |
9 | # http://www.apache.org/licenses/LICENSE-2.0 | |
10 | # | |
11 | # Unless required by applicable law or agreed to in writing, | |
12 | # software distributed under the License is distributed on an | |
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
14 | # KIND, either express or implied. See the License for the | |
15 | # specific language governing permissions and limitations | |
16 | # under the License. | |
17 | # | |
18 | ||
19 | # | |
20 | # Copyright (C) 2018 Scylladb, Ltd. | |
21 | # | |
22 | ||
23 | find_package (PkgConfig REQUIRED) | |
24 | ||
9f95a23c | 25 | pkg_search_module (hwloc_PC hwloc) |
11fdf7f2 TL |
26 | |
27 | find_library (hwloc_LIBRARY | |
28 | NAMES hwloc | |
29 | HINTS | |
30 | ${hwloc_PC_LIBDIR} | |
31 | ${hwloc_PC_LIBRARY_DIRS}) | |
32 | ||
33 | find_path (hwloc_INCLUDE_DIR | |
34 | NAMES hwloc.h | |
35 | HINTS | |
36 | ${hwloc_PC_INCLUDEDIR} | |
37 | ${hwloc_PC_INCLUDEDIRS}) | |
38 | ||
39 | mark_as_advanced ( | |
40 | hwloc_LIBRARY | |
41 | hwloc_INCLUDE_DIR) | |
42 | ||
43 | include (FindPackageHandleStandardArgs) | |
44 | ||
45 | find_package_handle_standard_args (hwloc | |
46 | REQUIRED_VARS | |
47 | hwloc_LIBRARY | |
48 | hwloc_INCLUDE_DIR | |
49 | VERSION_VAR hwloc_PC_VERSION) | |
50 | ||
51 | set (hwloc_LIBRARIES ${hwloc_LIBRARY}) | |
52 | set (hwloc_INCLUDE_DIRS ${hwloc_INCLUDE_DIR}) | |
53 | ||
54 | if (hwloc_FOUND AND NOT (TARGET hwloc::hwloc)) | |
55 | add_library (hwloc::hwloc UNKNOWN IMPORTED) | |
56 | ||
57 | set_target_properties (hwloc::hwloc | |
58 | PROPERTIES | |
59 | IMPORTED_LOCATION ${hwloc_LIBRARY} | |
60 | INTERFACE_INCLUDE_DIRECTORIES ${hwloc_INCLUDE_DIRS}) | |
61 | endif () |