Allow disabling hardware counters from cmake.
Merge pull request #1614 from skyfms/master

Allow disabling hardware counters from cmake