gpt4 book ai didi

How do I open a large existing CMake project into Visual Studio Code on MacOS(如何在MacOS上将现有的大型CMake项目打开到Visual Studio代码中)

转载 作者:bug小助手 更新时间:2023-10-24 18:46:48 25 4
gpt4 key购买 nike



I want to use Visual Studio Code to edit, navigate, and debug a large CMake based C++ project, with many subdirectories and imported conan based packages.

我想使用Visual Studio代码来编辑、导航和调试一个大型的基于CMake的C++项目,该项目有许多子目录和导入的基于柯南的包。


All the docs I have found are for a trivial case of creating a new "hello world" project.

我找到的所有文档都是关于创建一个新的“Hello World”项目的琐碎案例。


Ideally I could point it to a build folder generated by the Project Root (as [ProjectRoot]/build and the [ProjectRoot]/CmakeLists.txt (build generated with -G "unix makefiles")

理想情况下,我可以将其指向由Project Root生成的构建文件夹(如[ProjectRoot]/Build和[ProjectRoot]/Cmake Lists.txt(使用-G“Unix MakeFiles”生成的构建))


And have it pull in all the proper include directories for intellisense C++, and load it in so I can navigate the project edit the code, build, and debug the app. Hopefully it can parse the Cmake tree and find all the source files and header files for navigation and symbol searching.

让它为IntelliSense C++拉入所有合适的包含目录,并加载它,这样我就可以导航项目、编辑代码、构建和调试应用程序。希望它可以解析Cmake树并找到所有的源文件和头文件,用于导航和符号搜索。


The project is large, has quite a few subdirectories. It builds fine from the command line and runs.

该项目很大,有相当多的子目录。它可以从命令行很好地构建并运行。


I see one needs to have the C++-Intellisense extestion installed, and the CMake Tools extension installed ( done )

我认为需要安装C++-IntelliSense扩展,并安装CMake工具扩展(完成)


Anyway want to open my "project" on A Macbook :)
Looking for help on this.
Thanks.

无论如何,我想在Macbook上打开我的“项目”:)在这方面寻求帮助。谢谢。


更多回答

did you set "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools", yet?

您设置“C_Cpp.default.figurationProvider”:“ms-vScott de.cmake-Tools”了吗?

If you are sure about there is nothing wrong with your project, you can simply press command shift P, input CMake: Configure, then it will start configuration for you.

如果您确定您的项目没有问题,您可以简单地按下命令Shift P,输入CMake:Configure,然后它将为您启动配置。

will try that - this is a command for the VS code application I assume ?

我假设这是VS代码应用程序的命令,会试一试吗?

@starball. nop don't know what that is. I assume there are a "bunch of steps". I have to at least specify somewhere the CMakeLists.txt file at the root of the project and the build directory it outputs to ? than deal with (command shift P) and figure out what inputting "CMake: Configure) is ( a popup dialog ? ) I am surprise there isn't a good "To Open and existing CMake based build tree" document out there that is found.

@Starball。NOP不知道那是什么。我想有“一大堆步骤”。我至少必须在项目的根目录中指定CMakeLists.txt文件及其输出到的构建目录?然后处理(命令Shift P)并弄清楚输入“CMake:Configure”是什么(弹出对话框?)我很惊讶没有找到一个好的“To Open and Existing CMake Based Build Tree”文档。

... there is. plenty. you just failed to find it. code.visualstudio.com/docs/cpp/cmake-linux, github.com/microsoft/vscode-cmake-tools#important-doc-links, stackoverflow.com/a/77079021/11107541

..。的确有。很多。你只是没能找到它。Code.VisualStudio.com/docs/cpp/cmake-linux,github.com/microsoft/vscode-cmake-tools#important-doc-links,stackoverflow.com/a/77079021/11107541

优秀答案推荐
更多回答

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com