Files
clang-p2996/third-party/benchmark/cmake/Modules/FindPFM.cmake
Mircea Trofin a5b797172c Reapply "Update Benchmark (#83488)" (#83916)
This reverts commit aec6a04b8e.

(google/benchmark still at hash 1576991177ba97a4b2ff6c45950f1fa6e9aa678c as it was in #83488. Also reapplied same extra local diffs)

Verified locally.
2024-03-04 14:11:30 -08:00

29 lines
959 B
CMake

# If successful, the following variables will be defined:
# PFM_FOUND.
# PFM_LIBRARIES
# PFM_INCLUDE_DIRS
# the following target will be defined:
# PFM::libpfm
include(FeatureSummary)
include(FindPackageHandleStandardArgs)
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")
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}")
endif()
mark_as_advanced(PFM_LIBRARY PFM_INCLUDE_DIR)