cmake: use a different variable for testing with and without libm CMake seems to cache the result when using the same variable, at least with some versions, so previously systems requiring libm for log2 may not have worked as expected.