Try to support both old and new (>= 3.0) CMake versions.