microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.43k stars 430 forks source link

How to set the default ``cmake_minimum_required`` version in QuickStart command #3793

Open LiuZengqiang opened 1 month ago

LiuZengqiang commented 1 month ago

Brief Issue Summary

How to set the default cmake_minimum_required version in QuickStart command?

When using "QuickStrat", there will be created a default CMakeLists.txt file, the cmake_minimum_required is 3.0.0 in this file. It will create a warning of "(cmake_minimum_required):Compatibility with CMake < 3.5 will be removed from a future version of CMake.", how to set the cmake_minimum_requied is 3.20.0 or other user defined version?

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

Yingzi1234 commented 1 month ago

@LiuZengqiang Thank you for your GitHub issue! You can fix this by manually modifying the code “cmake_minimum_required(VERSION 3.0.0)” in the CMakeLists.txt file to a version greater than (version 3.5.0).

Before modify: image

After modify: image

Please feel free if you have any questions and doubt!

LiuZengqiang commented 1 month ago

@Yingzi1234 Thanks for your reply. However, I'm too lazy to modify it manually 😂. Specifying the CMake version in the configuration file of cmake-tools once and for all might be a better solution.