DeprecationWarning is ignored by default <sigh>
时间: 2023-03-30 15:01:38 浏览: 60
这个问题涉及编程技术,我可以回答。DeprecationWarning 是 Python 中的一个警告信息,表示某个函数或模块已经过时,不建议使用,但是在当前版本中仍然可以使用。默认情况下,Python 会忽略这个警告信息,如果需要显示这个警告信息,可以通过设置警告级别来实现。
相关问题
-- cmake version 3.22.1 CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to te
ll CMake the minimum required version for your project. For example, if you want to set the minimum required version to 3.22.1, you can modify your `CMakeLists.txt` file as follows:
```cmake
cmake_minimum_required(VERSION 3.22.1)
```
By specifying the minimum required version, you ensure that your project is compatible with that version or any higher versions of CMake. This warning is to inform you that compatibility with CMake versions older than 2.8.12 will be removed in the future.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions.
这个警告是因为你的`CMakeLists.txt`文件中设置了`cmake_minimum_required`的版本过低,建议将其更新至CMake 2.8.12或更高版本,以避免兼容性问题。你可以将`cmake_minimum_required`设置为如下所示的语句:
```
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
```
这样可以明确告诉CMake,你的项目需要的最低版本是2.8.12,如果使用低于此版本的CMake编译,则会出现错误。如果你确定你的项目不需要向下兼容旧版本的CMake,可以将`cmake_minimum_required`替换为如下所示的语句:
```
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
```
这样可以确保你的项目不会与CMake 3.0以下的版本兼容。更新后,再次编译项目即可。