如何设置VS代码的CMAKE选项

发布于 2025-02-13 11:03:56 字数 247 浏览 1 评论 0原文

如何在VSCODE上设置CMAKE的选项?有人说这是在任务中。 但是仍然有Qutestions,

设置中

  {
      //test ok 
     "cmake.configureArgs": [
         "-DCMAKE_BUILD_TYPE=Release",
         "-DENABLE_TENSORRT=on",
     ]
   }

在 。

How to set cmake's options on vscode? somebody said it is in task.json, the other said in setting.json, I test it works in setting.json
but there are still qutestions,

In setting.json, I set

  {
      //test ok 
     "cmake.configureArgs": [
         "-DCMAKE_BUILD_TYPE=Release",
         "-DENABLE_TENSORRT=on",
     ]
   }

But in the bottle of vscode on which cmake toolbar appears, it seems the program still build in Debug mode

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

万劫不复 2025-02-20 11:03:56

我亲自将其设置在root cmakelists.txt上,通过

SET( CMAKE_BUILD_TYPE Debug )

在我的cmake_minimum_required命令之后添加以下行。现在显然,这将其设置为调试,但是您可以使用其他任何(如果我没记错的话)构建类型。

我希望有帮助。

I personally set this at the root CMakeLists.txt by adding the following line

SET( CMAKE_BUILD_TYPE Debug )

after my cmake_minimum_required command. Now obviously this sets it to Debug but you can use any of the other (three if I am not mistaken) build types.

I hope that helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文