forked from fuchsto/dyloc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPAPI.cmake
64 lines (55 loc) · 1.45 KB
/
PAPI.cmake
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
62
63
64
# Try to find PAPI headers and libraries.
#
# Usage of this module as follows:
#
# find_package(PAPI)
#
# Variables used by this module, they can change the default behaviour and
# need to be set before calling find_package:
#
# PAPI_PREFIX Set this variable to the root installation of
# libpapi if the module has problems finding the
# proper installation path.
#
# When using module, you can locate the PAPI base path via
#
# $ module show papi
#
# Variables defined by this module:
#
# PAPI_FOUND System has PAPI libraries and headers
# PAPI_LIBRARIES The PAPI library
# PAPI_INCLUDE_DIRS The location of PAPI headers
# Official PAPI source code repository:
# - git clone https://icl.cs.utk.edu/git/papi.git
find_path(
PAPI_PREFIX
NAMES include/papi.h
)
message(STATUS "Searching for PAPI in path " ${PAPI_PREFIX})
find_library(
PAPI_LIBRARIES
# Pick the static library first for easier run-time linking.
NAMES papi
HINTS ${PAPI_PREFIX}/lib
)
find_path(
PAPI_INCLUDE_DIRS
NAMES papi.h
HINTS ${PAPI_PREFIX}/include
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
PAPI DEFAULT_MSG
PAPI_LIBRARIES
PAPI_INCLUDE_DIRS
)
mark_as_advanced(
PAPI_PREFIX_DIRS
PAPI_LIBRARIES
PAPI_INCLUDE_DIRS
)
if (PAPI_FOUND)
message(STATUS "PAPI includes: " ${PAPI_INCLUDE_DIRS})
message(STATUS "PAPI libraries: " ${PAPI_LIBRARIES})
endif()