Allow disabling hardware counters from cmake.