Comments (3)
@tengai650 I think the problem is because you set the hidden attribute in the config to true, when I set this attribute to false, I don't have the problem you mentioned.
from vscode-cmake-tools.
@gcampbell-msft I am reproducing the problem stated by the user with a simple project, I think the user's problem is caused by setting the hidden attribute to true, here are my steps to reproduce it:
ENV:
VS Code: 1.90.0
CMake tools: 1.18.42
C/C++:1.20.5
- Create a folder named test and open it with vscode.
- Add the CMakeLists.txt file with the following code:
cmake_minimum_required(VERSION 3.5)
project(test)
add_executable(test main.cpp)
- Add the main.cpp file with the following code:
#include"iostream"
int main()
{
std::cout << "Hello world\n" << std::endl;
}
- Add CMakePresets.json file with the following code:
{
"version": 6,
"configurePresets": [
{
"name": "debug_x64",
"hidden":true,
"generator": "Visual Studio 17 2022",
"binaryDir": "${workspaceFolder}/build",
"description": "Default build.",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
"BOOST_ROOT": "G:/dev/boost/boost_1_85_0"
}
},
{
"name": "release_x64",
"hidden": true,
"generator": "Visual Studio 17 2022",
"binaryDir": "${workspaceFolder}/build",
"description": "Release build.",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
"BOOST_ROOT": "G:/dev/boost/boost_1_85_0"
}
}
],
"buildPresets": [
{
"name": "Release",
"description": "",
"displayName": "",
"configurePreset": "release_x64"
},
{
"name": "Debug",
"description": "",
"displayName": "",
"configurePreset": "debug_x64"
}
]
}
- Run the command:"CMake:configure"
The result of setting the hidden attribute value to true:
The result of setting the hidden attribute value to false:
from vscode-cmake-tools.
@tengai650 @v-frankwang While this is not exactly matching the behavior of cmake.exe, you should have at least one configure preset visible.
The cmake.exe does allow you to list the build presets even if they use hidden configure Presets, you are not able to build with the command-line with the build presets that use a hidden configure preset. Therefore, the current behavior makes sense.
Closing for now, since you should be using non-hidden configure presets. Thanks! Let me know if there are any other questions.
from vscode-cmake-tools.
Related Issues (20)
- CMake configure preset installDir setting is evaluated relative to the binary directory instead of the source directory HOT 6
- [Loc] Property’s tooltip info in file "CMakePresets.json" is not localized
- [Flaky]Duplicate information appeared in output when Add CMakePreset.json
- copyCompileCommands to the original path still leaves a corrupted CDB on Windows HOT 2
- "CMake: build" is repeated twice in the list
- in vscode, How to use v141 toolset in VS2022 with cmake HOT 6
- Double-clicking on one of a target's "References" does nothing HOT 4
- Project outline does not show sources of custom targets with commands HOT 5
- Failure to ask the user to select a kit due to erroneously not finding CMakeLists.txt HOT 1
- Failed to set up project in a subfolder of a git repository HOT 7
- Debugging fails on macOS HOT 7
- [FR] Support module map files HOT 1
- setting active project again after quick start causes second configure
- Include paths are wrong on macOS case sensitive filesystems HOT 7
- test issue
- VSCode CTest Google Test complains non-existing `DartConfiguration.tcl` HOT 5
- cmake.buildBeforeRun is not working as expected HOT 3
- Launch Target doesn't initialise the shell as per the user's config
- Configure on Windows generates a faulty project HOT 1
- Add toolset telemetry point for presets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-cmake-tools.