Skip to content

Commit

Permalink
Find libpfm dependency in installed CMake configs
Browse files Browse the repository at this point in the history
Currently, Google Benchmark can be built and installed with support for
libpfm, but this can cause a problem if that installation is later
called upon by another CMake project. Indeed, while the installed CMake
configuration script correctly identifies that it needs to link against
libpfm, it doesn't try to find libpfm, meaning that the target will be
unavailable. This commit fixes this potential configuration-time error
by ensuring that an installation of Google Benchmark will correctly try
to find the libpfm dependency when it is used elsewhere.
  • Loading branch information
stephenswat committed Jun 19, 2024
1 parent 4477525 commit 06247b4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmake/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ include (CMakeFindDependencyMacro)

find_dependency (Threads)

if (@BENCHMARK_ENABLE_LIBPFM@)
find_dependency (PFM)
endif()

include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")

0 comments on commit 06247b4

Please sign in to comment.