2021-04-28 08:25:29 +00:00
|
|
|
# If successful, the following variables will be defined:
|
2023-07-10 16:46:34 +00:00
|
|
|
# PFM_FOUND.
|
|
|
|
# PFM_LIBRARIES
|
|
|
|
# PFM_INCLUDE_DIRS
|
|
|
|
# the following target will be defined:
|
|
|
|
# PFM::libpfm
|
2021-04-28 08:25:29 +00:00
|
|
|
|
2023-07-10 16:58:01 +00:00
|
|
|
include(FeatureSummary)
|
2023-07-10 16:46:34 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
2021-08-23 16:36:34 +00:00
|
|
|
|
2023-07-10 16:54:09 +00:00
|
|
|
set_package_properties(PFM PROPERTIES
|
|
|
|
URL http://perfmon2.sourceforge.net/
|
|
|
|
DESCRIPTION "A helper library to develop monitoring tools"
|
|
|
|
PURPOSE "Used to program specific performance monitoring events")
|
|
|
|
|
2023-07-10 16:46:34 +00:00
|
|
|
find_library(PFM_LIBRARY NAMES pfm)
|
|
|
|
find_path(PFM_INCLUDE_DIR NAMES perfmon/pfmlib.h)
|
|
|
|
|
|
|
|
find_package_handle_standard_args(PFM REQUIRED_VARS PFM_LIBRARY PFM_INCLUDE_DIR)
|
|
|
|
|
|
|
|
if (PFM_FOUND AND NOT TARGET PFM::libpfm)
|
|
|
|
add_library(PFM::libpfm UNKNOWN IMPORTED)
|
|
|
|
set_target_properties(PFM::libpfm PROPERTIES
|
|
|
|
IMPORTED_LOCATION "${PFM_LIBRARY}"
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${PFM_INCLUDE_DIR}")
|
2021-04-28 08:25:29 +00:00
|
|
|
endif()
|
2023-07-10 16:46:34 +00:00
|
|
|
|
|
|
|
mark_as_advanced(PFM_LIBRARY PFM_INCLUDE_DIR)
|