Debian Codegraph @

third-party/benchmark/cmake/Modules/FindPFM.cmake

raw
1 # If successful, the following variables will be defined:
2 # PFM_FOUND.
3 # PFM_LIBRARIES
4 # PFM_INCLUDE_DIRS
5 # the following target will be defined:
6 # PFM::libpfm
7
8 include(FeatureSummary)
9 include(FindPackageHandleStandardArgs)
10
11 set_package_properties(PFM PROPERTIES
12 URL http://perfmon2.sourceforge.net/
13 DESCRIPTION "A helper library to develop monitoring tools"
14 PURPOSE "Used to program specific performance monitoring events")
15
16 find_library(PFM_LIBRARY NAMES pfm)
17 find_path(PFM_INCLUDE_DIR NAMES perfmon/pfmlib.h)
18
19 find_package_handle_standard_args(PFM REQUIRED_VARS PFM_LIBRARY PFM_INCLUDE_DIR)
20
21 if (PFM_FOUND AND NOT TARGET PFM::libpfm)
22 add_library(PFM::libpfm UNKNOWN IMPORTED)
23 set_target_properties(PFM::libpfm PROPERTIES
24 IMPORTED_LOCATION "${PFM_LIBRARY}"
25 INTERFACE_INCLUDE_DIRECTORIES "${PFM_INCLUDE_DIR}")
26 endif()
27
28 mark_as_advanced(PFM_LIBRARY PFM_INCLUDE_DIR)