1 # Try to find PAPI headers and LIBRARY.
3 # Usage of this module as follows:
7 # Variables used by this module, they can change the default behavior and need
8 # to be set before calling find_package:
10 # PAPI_PREFIX Set this variable to the root installation of
11 # libpapi if the module has problems finding the
12 # proper installation path.
14 # Variables defined by this module:
16 # PAPI_FOUND System has PAPI LIBRARY and headers
17 # PAPI_LIBRARY The PAPI library
18 # PAPI_INCLUDE_DIRS The location of PAPI headers
21 set(PAPI_HINT ${papi_path} CACHE PATH "Path to search for PAPI headers and library")
29 message(STATUS "Looking for libpapi")
30 find_library(PAPI_LIBRARY
32 PATH_SUFFIXES lib64 lib
33 # HINTS gets searched before PATHS
38 message(STATUS "Looking for libpapi - found at ${PAPI_LIBRARY}")
40 message(STATUS "Looking for libpapi - not found")
43 message(STATUS "Looking for papi.h")
44 find_path(PAPI_INCLUDE_DIRS
46 # HINTS gets searched before PATHS
47 HINTS ${PAPI_PREFIX}/include
50 message(STATUS "Looking for papi.h - found at ${PAPI_INCLUDE_DIRS}")
52 message(STATUS "Looking for papi.h - not found")
59 mark_as_advanced(HAVE_PAPI)
63 message(FATAL_ERROR, "Could not find PAPI LIBRARY and/or papi.h. Make sure they are correctly installed!")
66 #include(FindPackageHandleStandardArgs)
67 #find_package_handle_standard_args(PAPI DEFAULT_MSG