google / benchmark

A microbenchmark support library
Apache License 2.0
8.61k stars 1.57k forks source link

[BUG] PFM_ROOT is not used when ENABLE_LIBPFM=ON #1627

Open chipot opened 1 year ago

chipot commented 1 year ago

Describe the bug The usual way to point cmake to a dependency via <Name>_ROOT variable or via CMAKE_PREFIX_PATH is not working.

System Which OS, compiler, and compiler version are you using:

To reproduce Steps to reproduce the behavior:

  1. pull main branch
  2. build/install libpfm4 anywhere except in standard system path
  3. cmake -D BENCHMARK_ENABLE_LIBPFM=ON -D PFM_ROOT=/the/path/to/libpfm4/
  4. cmake configure succeeds, but did not find libpfm, and thus the support is disabled.

Expected behavior I expected to be able to inject PFM_ROOT to where I installed libpfm, but could not. Looking into it more, the custom FindPFM.cmake module is not doing the right thing.