File: FindPFM.cmake

package info (click to toggle)
benchmark 1.9.5-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,820 kB
  • sloc: cpp: 14,339; python: 2,399; ansic: 38; sh: 28; makefile: 14
file content (28 lines) | stat: -rw-r--r-- 959 bytes parent folder | download | duplicates (21)
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
# 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)