How to open an existing project configured by cmake-gui ?
Brief Issue Summary
cmake-gui is the easiest way to configure the cmake with parameters.
is it possible to open the source folder by the build folder created by cmake-gui ?
the build folder may be anywhere other than "build" defaultly.
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
@xhawk18 Could you explain more what you are referring to?
What do you mean by "open the source folder by the build folder"? More information could help us understand how we should triage this item. Thanks!
The project "my_proj" has two building folders configured by cmake-gui, "build_msvc" configured under windows for msvc, and "build_wsl_gcc" configured under wsl for gcc.
"open the source folder by the build folder" may like this ---
-
If vscode-cmake-tools opens directory "build_msvc“, then vscode navigates to "my_proj" as working directory and use "build_msvc" as "Cmake: Build Directory" for vscode-cmake-tools.
-
If vscode-cmake-tools opens directory "build_wsl_gcc“ (in remote wsl), then vscode navigates to the "my_proj" as working directory , and use "build_wsl_gcc" as "Cmake: Build Directory" for vscode-cmake-tools.
@xhawk18 If I'm understanding you correctly, this sounds like you're asking for a feature from the cmake-gui to be able to open VS Code directly, which we don't have direct control over.
As for the VS Code CMake Tools extension itself, you can do this currently by opening VS Code in the root folder, and then pointing the cmake.buildDirectory setting to the build directory that you desire.
Could you confirm whether this works for you?
As for the VS Code CMake Tools extension itself, you can do this currently by opening VS Code in the root folder, and then pointing the cmake.buildDirectory setting to the build directory that you desire. Could you confirm whether this works for you?
Yes, It works partially. But there're still some reasons for this feature ---
- vscode-cmake-tools will not exactly use the existing configurations in cmake.buildDirectory/CMakeCache.txt. It may require to re-configure compiling tools even through the CMakeCache.txt is already OK there.
- For multiple build directories, manually modifying cmake.buildDirectory over and over again is very inconvenient.
- It is easier to modify cmake parameters in cmake-gui.
@xhawk18 Thanks for the explanation. We'll add this to the backlog. We typically use the amount of up-votes an issue has as a way to gauge priority and demand from the community, we'll use this to track priority of this work item!
To the community, if you want a feature like this, please upvote the initial post!