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. -- Configuring done -- Generating done -- Build files have been written to: /home/slam/slamlearn/slambook2-master/ch3/visualizeGeometry/build
时间: 2024-03-28 09:41:59 浏览: 71
这个警告是由于您使用的 CMake 版本较旧,不再支持在 `cmake_minimum_required` 命令中使用 `<min>` 参数。这不会影响您的代码构建,但是建议您更新 CMake 版本以避免潜在的不兼容问题。
您可以通过在 `cmake_minimum_required` 命令中使用 `<max>` 后缀来解决这个警告,告诉 CMake 您的项目不需要与旧版本的 CMake 兼容。例如:
```
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
```
这将告诉 CMake,您的项目需要使用版本为 3.0 或更高版本的 CMake。
如果您想更新到最新版本的 CMake,您可以从 CMake 官方网站下载最新的二进制文件或源代码,并按照官方文档进行安装和配置。
相关问题
-- 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以下的版本兼容。更新后,再次编译项目即可。
相关推荐
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)