Fix warnings when using CMake 3.1.0

fixes #7894